cladisch wrote:If OSS appends to each sample eight zero bits which are then ignored by the hardware, why would this have any effect on bitperfectness?
What is odd is that through Xonar ST digital coax out,
24-bit files are being truncated to 16-bit e.g. 24/(any samplerate) is being played back and displayed on an external DAC as 16/(any samplerate). I would have assumed that padded 24/(any samplerate) files would be played back through S32_LE and displayed as either 24/(any samplerate), or 32/(any samplerate).
igorzwx wrote:If everything is buggy, it might be difficult to believe that audio files are played correctly. Right?
Yes, something buggy is going on...
Verify that the file to be tested is indeed 24/192...- Code: Select all
$ soxi -V4 Hotel.wav
soxi INFO formats: detected file format type `wav'
...
soxi DBUG wav: Reading Wave file: Microsoft PCM format, 2 channels, 192000 samp/sec
...
Input File : 'Hotel.wav'
Channels : 2
Sample Rate : 192000
Precision : 24-bit
Duration : 00:06:30.92 = 75057280 samples ~ 29319.2 CDDA sectors
File Size : 450M
Bit Rate : 9.22M
Sample Encoding: 24-bit Signed Integer PCM
The result is serious distortion, nearly pure white noise...- Code: Select all
$ ossplay -Rvvvv Hotel.wav
...
Playing WAVE file Hotel.wav, 24 bits/stereo/192000 Hz
Setup device S32_LE/2/192000
...
The result is serious distortion, nearly pure white noise...- Code: Select all
$ ossplay -Rvvvv -fS16_LE Hotel.wav
...
Playing WAVE file Hotel.wav, 16 bits/stereo/192000 Hz
Setup device S16_LE/2/192000
...
Let's take a look at ALSA under 3.2.6 stable...
'alsa-lib' and 'alsa-utils' are versioned 1.0.25...
Attention will be focused on S/PDIF output...
Discover ALSA defined playback PCMs...- Code: Select all
$ aplay -L
...
iec958:CARD=ST,DEV=0
Xonar ST, Multichannel
IEC958 (S/PDIF) Digital Audio Output
Attempt to play back through S/PDIF PCM... - Code: Select all
$ aplay -D iec958:CARD=ST,DEV=0 -vvv Hotel.wav
Playing WAVE 'Hotel.wav' : Signed 24 bit Little Endian in 3bytes, Rate 192000 Hz, Stereo
aplay: set_params:1081: Sample format non available
Available formats:
- S16_LE
- S32_LE
Attempt to play back through default device...
As expected, conversion through linear-interpolation is occurring...
The following is output as 16/48 to the external DAC...- Code: Select all
$ aplay -v Hotel.wav
Playing WAVE 'Hotel.wav' : Signed 24 bit Little Endian in 3bytes, Rate 192000 Hz, Stereo
Plug PCM: Rate conversion PCM (48000, sformat=S32_LE)
Converter: linear-interpolation
Protocol version: 10002
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S24_3LE
subformat : STD
channels : 2
rate : 192000
exact rate : 192000 (192000/1)
msbits : 24
buffer_size : 65536
period_size : 4096
period_time : 21333
tstamp_mode : NONE
period_step : 1
avail_min : 4096
period_event : 0
start_threshold : 65536
stop_threshold : 65536
silence_threshold: 0
silence_size : 0
boundary : 4611686018427387904
Slave: Direct Stream Mixing PCM
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S32_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 24
buffer_size : 16384
period_size : 1024
period_time : 21333
tstamp_mode : NONE
period_step : 1
avail_min : 1024
period_event : 0
start_threshold : 16384
stop_threshold : 16384
silence_threshold: 0
silence_size : 0
boundary : 4611686018427387904
Hardware PCM card 0 'Xonar ST' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S32_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 24
buffer_size : 16384
period_size : 1024
period_time : 21333
tstamp_mode : ENABLE
period_step : 1
avail_min : 1024
period_event : 0
start_threshold : 1
stop_threshold : 4611686018427387904
silence_threshold: 0
silence_size : 4611686018427387904
boundary : 4611686018427387904
appl_ptr : 0
hw_ptr : 0
Determine S/PDIF playback device...- Code: Select all
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
...
card 0: ST [Xonar ST], device 1: Digital [Digital]
Subdevices: 1/1
...
Create $HOME/.asoundrc with the following parameters...- Code: Select all
pcm.!default {
type hw
card 0 # ST [Xonar ST]
device 1 # Digital [Digital]
}
Attempt to play back through default device...
As expected, software mixing has been successfully disabled...- Code: Select all
$ aplay -v Hotel.wav
Playing WAVE 'Hotel.wav' : Signed 24 bit Little Endian in 3bytes, Rate 192000 Hz, Stereo
aplay: set_params:1081: Sample format non available
Available formats:
- S16_LE
- S32_LE
Convert WAV to FLAC for DeaDBeeF...- Code: Select all
$ flac Hotel.wav
flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.
Hotel.wav: WARNING: legacy WAVE file has format type 1 but bits-per-sample=24
Hotel.wav: wrote 259952727 bytes, ratio=0.577
Playback through DeaDBeeF using the ALSA output plugin...
ALSA appears to properly play back through S32_LE w/o conversion...
The following is output as 24/192 to the external DAC...- Code: Select all
$ deadbeef Hotel.flac
starting deadbeef devel
...
selected output plugin: ALSA output plugin
...
palsa_setformat 24bit int 2ch 192000Hz channelmask=3
alsa_soundcard: iec958:CARD=ST,DEV=0
cannot set sample format (Invalid argument), trying all supported formats
cannot set sample format (Invalid argument), trying all supported formats
...
chosen samplerate: 192000 Hz
minchan: 2, maxchan: 2
setting chan=2
alsa channels: 2
trying buffer size: 8192 frames
trying period size: 1024 frames
alsa buffer size: 8192 frames
alsa period size: 1024 frames
chosen bps: 32 (int)
new format 32bit int 2ch 192000Hz channelmask=3
What about OSS4? So long as bitrate >= 16-bits,
playback through DeaDBeeF using the OSS output plugin will always output as 16/(original samplerate) to the external DAC...This is regardless of whether vmix is enabled/disabled and regardless of whether the samplerate workaround is enabled/disabled in for the DeaDBeeF OSS plugin option...So why are bits being truncated by OSS4?