Bug in OSS4 or in ossplay?

OSS specific Linux discussion (x86/amd64)

Moderators: cesium, dev, kodachi, hannu

Bug in OSS4 or in ossplay?

Postby igorzwx » Sat Aug 20, 2011 11:44 am

EDIT: If it is a special feature of OSS4, it should be explained in OSS4 Wiki.

Johnny User writes...
Hi. I'm trying to use ellipticaljerk-0.3.2, but my speakers make a farting sound when I click the jerk button. Then it crashes. Is this a bug?
http://linuxhaters.blogspot.com/2008/08 ... m-all.html


It seems that OSS4 resamplers are broken. They produce a terrible noise when playing (downsampling) HiRes waves, such as Stereo WAV 24BIT/96kHz and Stereo WAV DXD 24BIT/352.8kHz (Notice that OSS4 resamplers are based on the Stupid Theorem http://en.wikipedia.org/wiki/Nyquist%E2 ... ng_theorem ).
Code: Select all
$ ossinfo
Version info: OSS 4.2 (b 2004/201108041420) (0x00040100) GPL
Platform: Linux/i686 3.0-ARCH #1 SMP PREEMPT Tue Aug 16 07:25:56 UTC 2011 

_________________________________________________________________________________________________
EDIT: That terrible noise seems to be produced by "ossplay" rather than by OSS4 resamplers.
Mplayer plays those HiRes waves without noise.
DeadBeef (with the standard OSS plugin) plays HiRes waves without noise.

For some strange reason, "ossplay" is playing 24bit waves to 32bit device (which does not exist on this computer):
Code: Select all
$ ossplay -vvvv 4*
FORM len = 124854404
4 - Haydn - String Quartet in D, Op. 76, No. 5 - Finale - Presto Stereo WAV 24BIT 96kHz 2L53SACD_04_stereo_96k.wav: Reading chunk fmt , size 16, pos 0, next 12
FMT chunk: len = 16, fmt = 0
4 - Haydn - String Quartet in D, Op. 76, No. 5 - Finale - Presto Stereo WAV 24BIT 96kHz 2L53SACD_04_stereo_96k.wav: Reading chunk data, size 124854360, pos 0, next 36
DATA chunk. Offs = 44, len = 124854360
Playing WAVE file 4 - Haydn - String Quartet in D, Op. 76, No. 5 - Finale - Presto Stereo WAV 24BIT 96kHz 2L53SACD_04_stereo_96k.wav, 24 bits/stereo/96000 Hz
Setup device S32_LE/2/96000
Time: 00:17.60 of 03:36.76 VU ---   

Code: Select all
$ ossplay -vvvv 5*
FORM len = 432702226
5 - Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav: Reading chunk JUNK, size 28, pos 0, next 12
5 - Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav: Reading chunk fmt , size 18, pos 0, next 48
FMT chunk: len = 18, fmt = 0
5 - Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav: Reading chunk data, size 432702144, pos 0, next 74
DATA chunk. Offs = 82, len = 432702144
Playing WAVE file 5 - Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav, 24 bits/stereo/352800 Hz
Setup device S32_LE/2/352800
Time: 00:10.60 of 03:24.41 VU ---   

It seems that ossplay is playing 24bit waves as 32bit waves, and this produces noise.
Those HiRes waves have pcm_s24le format.
Code: Select all
$ ffmpeg -i 5*
Input #0, wav, from '5 - Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav':
  Duration: 00:03:24.41, bitrate: 16934 kb/s
    Stream #0.0: Audio: pcm_s24le, 352800 Hz, 2 channels, s32, 16934 kb/s
At least one output file must be specified

However, if you tells "ossplay" that it should play 24bit, it plays 16bit to 24bit device, and the result is a kind of "white noise", very strong noise and nothing more.
Code: Select all
$ ossplay -vvvv -fS24_LE 5*
FORM len = 432702226
5 - Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav: Reading chunk JUNK, size 28, pos 0, next 12
5 - Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav: Reading chunk fmt , size 18, pos 0, next 48
FMT chunk: len = 18, fmt = 0
5 - Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav: Reading chunk data, size 432702144, pos 0, next 74
DATA chunk. Offs = 82, len = 432702144
Playing WAVE file 5 - Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav, 16 bits/stereo/352800 Hz
Setup device S24_LE/2/352800
Time: 00:02.20 of 02:33.31 VU -------++

Code: Select all
$ ossplay -vvvv -fS24_LE 4*
FORM len = 124854404
4 - Haydn - String Quartet in D, Op. 76, No. 5 - Finale - Presto Stereo WAV 24BIT 96kHz 2L53SACD_04_stereo_96k.wav: Reading chunk fmt , size 16, pos 0, next 12
FMT chunk: len = 16, fmt = 0
4 - Haydn - String Quartet in D, Op. 76, No. 5 - Finale - Presto Stereo WAV 24BIT 96kHz 2L53SACD_04_stereo_96k.wav: Reading chunk data, size 124854360, pos 0, next 36
DATA chunk. Offs = 44, len = 124854360
Playing WAVE file 4 - Haydn - String Quartet in D, Op. 76, No. 5 - Finale - Presto Stereo WAV 24BIT 96kHz 2L53SACD_04_stereo_96k.wav, 16 bits/stereo/96000 Hz
Setup device S24_LE/2/96000
Time: 00:01.80 of 02:42.57 VU -------++

We all know that OSS4 is well documented, much better than ALSA.
Code: Select all
$ man ossplay
DESCRIPTION
       ossplay  plays raw PCM, Microsoft RIFF (.wav), Sun ULaw (.au), Mac AIFF (.aif) and other
       types of audio files. By default the application will try to determine the audio  file’s
       format  and  play  audio  based  on the stored inforation about sample format, number of
       channels and sampling rate.

_________________________________________________________________________________________________

By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz → 48000hz). There is an article about this issue in "Stereophile" which was discussed on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. https://wiki.archlinux.org/index.php/OS ... ample_Rate

A half-truth is a deceptive statement that includes some element of truth. The statement might be partly true, the statement may be totally true but only part of the whole truth, or it may utilize some deceptive element, such as improper punctuation, or double meaning, especially if the intent is to deceive, evade, blame or misrepresent the truth. http://en.wikipedia.org/wiki/Half-truth

It is not simply "a loss in audio quality", it is a terrible noise produced by OSS4 resamplers during downsampling. This problem has not been fixed simply because the OSS4 developers do not know what to do with the problem. The OSS4 resamplers might be impossible to fix, because they are fundamentally wrong by design. You see, on the one hand, you have the Stupid Theorem which is believed to represent the absolute truth. On the other hand, you have an unpleasant fact that OSS4 resamplers produce a terrible noise during downsampling.

The problem is how to pull the facts into conformity with the Stupid Theory. This is, of course, the most fundamental problem of Cargo Cult Science http://www.lhup.edu/~DSIMANEK/cargocul.htm It is a persistent challenge, which is impossible to answer. That half-truth (or, perhaps, more exactly, half-falsehood) about OSS4 and "downsampling" (published in the OSS4 manual of Arch Linux Wiki), was just a desperate attempt to respond to the persistent challenge of Cargo Cult Science.

Needless to say that a simple exercise in elementary math may make it clear that the Stupid Theorem is fundamentally wrong. If you have already forgot the elementary math, you may ask the kids. Although, of course, it might be obvious from the standpoint of ordinary common sense, because the Stupid Theorem actually states that a kind of "exact scientific interpolation" can produce a reliable information from the absence of information http://en.wikipedia.org/wiki/Nyquist%E2 ... ng_theorem

The unpleasant fact No 1: The OSS4 resamplers produce a terrible noise during downsampling high quality audio files which can be downloaded from the 2L (Lindberd Lyd) website http://www.2l.no/hires/index.html

The unpleasant fact No 2: Morten Lindberg seems to use a kind of "closed source" resampler for downsampling, which does not produce a terrible noise
http://www.lindberg.no/english/editing.htm Although that "closed source" resampler might also have been derived from the Stupid Theorem, it does not produce a strong noise. It might have been removed with special filters. That is why deterioration in quality: "the obvious degeneration is from 96kHz down to 48kHz" http://morten.lindberg.no/19537/

The unpleasant fact No 3: Morten Lindberg's HiRes audio files sound very nice (much better than audio CDs) when downsampled to 48kHz with the Russian "exact scientific resampler" viewtopic.php?f=3&t=4402

To summarize:
1. The challenge of "the unpleasant fact No 1" was "answered" with the OSS4 manual in Arch Linux Wiki.
2. The challenge of "the unpleasant fact No 2" might be answered by blaming Micro$oft and "closed source".
3. The challenge of "the unpleasant fact No 3" might be "answered" with theological discussions about resamplers, "information theory" and the absolute truth.
4. The OSS4 users may try to convince themselves that they do not need to play HiRes audio files, such as 24BIT/352.8kHz DXD waves, because the Stupid Theorem states that the Nyquist sample rate 44.1 kHz should be sufficient for the purpose. This does not contradict, of course, the interests of the producers of Audio CDs.

Those, who do not believe in the truth of the Stupid Theorem, may reset vmix to the default settings (that is, 48kHz sample rate) and try to play 24BIT/96kHz stereo waves (from http://www.2l.no/hires/index.html ) with ossplay:

Code: Select all
$ ossplay -v 2L*
Playing WAVE file 2L53SACD_04_stereo_96k.wav, 24 bits/stereo/96000 Hz
Time: 00:05.40 of 03:36.76 VU ----

Code: Select all
$ ossplay -v 1*
Playing WAVE file 1. Vivaldi - Che giova il sospirar, povero core - Aria - Cupido, tu vedi Stereo WAV DXD 24BIT 352.8kHz 2L-056_04.wav, 24 bits/stereo/352800 Hz
Time: 00:06.20 of 03:24.41 VU ----   

You may try different resamplers of OSS4:
Code: Select all
$ ossmix | grep vmix0-
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-channels <Stereo|Multich> (currently Stereo)
vmix0-src <Fast|High|High+|Production|OFF> (currently Production)

Code: Select all
$ ossmix | grep vmix0-
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-channels <Stereo|Multich> (currently Stereo)
vmix0-src <Fast|High|High+|Production|OFF> (currently High+)

Code: Select all
$ ossmix | grep vmix0-
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-channels <Stereo|Multich> (currently Stereo)
vmix0-src <Fast|High|High+|Production|OFF> (currently High)

Code: Select all
$ ossmix | grep vmix0-
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-channels <Stereo|Multich> (currently Stereo)
vmix0-src <Fast|High|High+|Production|OFF> (currently Fast)

To ensure that resamplers have been changed, OSS might be reloaded with soundoff/soundon

To enable the "Production quality" resampler of OSS4, you may try this: viewtopic.php?f=3&t=3543&start=30#p15711
This "Production quality" resampler, of course, produces a terrible noise of "Production quality", when downsampling high quality audio files.

You may try different HiRes audio files from from http://www.2l.no/hires/index.html , for example:

J. Haydn: String Quartet in D, Op. 76, No. 5 - Finale - Presto
Performer: Engegårdkvartetten
From the album: STRING QUARTETS: Haydn/Solberg/Grieg (2L53SACD)
119MB Stereo WAV 24BIT/96kHz http://www.lindberg.no/hires/test/2L53S ... eo_96k.wav

A. Vivaldi: Che giova il sospirar, povero core - Aria: Cupido, tu vedi 3:24
Performers: Tone Wik & Barokkanerne
From the album: Bellezza Crudel - VIVALDI (2L56SACD)
432MB Stereo WAV DXD 24BIT/352.8kHz http://www.lindberg.no/hires/test/2L-056_04.wav

These HiRes audio files sound very nice (much better than Audio CDs), if you downsample them to 48kHz with the Russian "exact scientific resampler" viewtopic.php?f=3&t=4402
Code: Select all
$ deadbeef
starting deadbeef devel
oss: exclusive mode is activated!
Converter: fftrate (ver. 0.5)
Input  : 96000 Hz, 2 ch, 24i bits
Output : 48000 Hz, 2 ch, 16i bits
Params.: delay = 43 ms, sync: ON, transform: 'DCT' - 'Vorbis'

Code: Select all
$ deadbeef
starting deadbeef devel
oss: exclusive mode is activated!
Converter: fftrate (ver. 0.5)
Input  : 352800 Hz, 2 ch, 24i bits
Output : 48000 Hz, 2 ch, 16i bits
Params.: delay = 53 ms, sync: ON, transform: 'DCT' - 'Vorbis'


As it was already mentioned, the Russian "scientific plugin" for DeadBeef (free, but "closed source") is somehow distributed among the Russian "secret esoteric society of audiophiles". To get the magic plugin, you may need to prove, in some way, that you are not "stupid and deaf". The Russian "exact scientific resampler" (a very old version) can be downloaded here: viewtopic.php?f=3&t=3543&start=45#p15974

As it was already explained, HiRes waves can be downoladed from the 2L [Lindberg Lyd] website: http://www.2l.no/hires/index.html
They are free:
HiRes Download - test bench
http://www.2l.no/hires/index.html
To download audio please provide the username HD and the password 2L

We invite you to join us in this evaluation of future consumer delivery formats. FLAC is a lossless encoding of WAV-files derived directly from our production original used for the SACD and Pure Audio Blu-ray. All resolutions and encodings are derived from the same original DXD source files. Please send us an e-mail and share your experience on your practical experience with these file formats. Enjoy the music!

Digital eXtreme Definition is a professional audio format that brings "analogue" qualities in 32 bit floating point at 352.8 kHz. DXD preserves 11.2896 Mbit/s (4 times the data of DSD). http://www.2l.no/hires/index.html


See also: http://www.2l.no/epost/news2008grammy51st.html
http://www.2l.no/old-2L/2L.htm
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Return to Linux

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron