Bit Perfect Audio from Linux
Nov 29, 2012 at 8:14 PM Post #91 of 544
Yeah you used a small case l, not a capital L. The difference between small case and capital is important in Linux. They are two different things.
 
Code:
kim ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: STAC92xx Digital [STAC92xx Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
kim ~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default:CARD=Intel
    HDA Intel, STAC92xx Analog
    Default Audio Device
sysdefault:CARD=Intel
    HDA Intel, STAC92xx Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, STAC92xx Analog
    Front speakers
surround40:CARD=Intel,DEV=0
    HDA Intel, STAC92xx Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, STAC92xx Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, STAC92xx Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
    HDA Intel, STAC92xx Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, STAC92xx Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
    HDA Intel, STAC92xx Digital
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Intel,DEV=0                                                                                                                                                 
    HDA Intel, STAC92xx Analog                                                                                                                                        
    Direct sample mixing device                                                                                                                                       
dmix:CARD=Intel,DEV=1                                                                                                                                                 
    HDA Intel, STAC92xx Digital                                                                                                                                       
    Direct sample mixing device                                                                                                                                       
dsnoop:CARD=Intel,DEV=0                                                                                                                                               
    HDA Intel, STAC92xx Analog                                                                                                                                        
    Direct sample snooping device                                                                                                                                     
dsnoop:CARD=Intel,DEV=1
    HDA Intel, STAC92xx Digital
    Direct sample snooping device
hw:CARD=Intel,DEV=0
    HDA Intel, STAC92xx Analog
    Direct hardware device without any conversions
hw:CARD=Intel,DEV=1
    HDA Intel, STAC92xx Digital
    Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
    HDA Intel, STAC92xx Analog
    Hardware device with all software conversions
plughw:CARD=Intel,DEV=1
    HDA Intel, STAC92xx Digital
    Hardware device with all software conversions
 
 
Anyways. As Anda said, you should configure your music player to use Device 4, the one named IEC958. IEC958 Is the IEC standard for digital audio. This device is the SPDIF output of your audio card. The reason why you don't get any audio with the hw output is probably because you're using the analog and not the digital device. If you look at the pasted lines, you'll see I have two devices named "Direct hardware device without any conversions". One is Analog, the other is Digital. Analog is the headphone out of my laptop, the other is the SPDIF output in the mini-din connector at the back (Dell laptop). The output of "aplay -L" is the exact same thing as the drop-down menu of Deadbeef, so pasting it here will be of great help.
 
But still, it doesn't explain why the sampling gets all messed up. I really have no idea why it does that. Have you tried another music player? It's an essential step to pin point the cause of the problem.
 
Dec 1, 2012 at 11:39 AM Post #92 of 544
Hi again,
 
To Anda: it returns about 9 pages of parameters. What should I be looking for? Most parameters concern video and other stuff. The ones which I can figure are around audio are:
 
 
 
...  
udev Discs
udev Audio capture (ALSA)
...
 
  mtp MTP devices
mtp MTP devices
pulselist Audio capture (PulseAudio)
pulselist Audio capture (PulseAudio)
...
 
  wav WAV demuxer
aiff AIFF demuxer
...
 
  ps MPEG-PS demuxer
ps MPEG-PS demuxer
ogg OGG demuxer
flacsys FLAC demuxer
mjpeg M-JPEG camera demuxer
playlist Playlist
playlist ZPL playlist import
playlist WPL playlist import
playlist iTunes Music Library importer
playlist Dummy ifo demux
playlist Google Video Playlist importer
playlist QuickTime Media Link importer
playlist Kasenna MediaBase parser
playlist ASX playlist import
playlist New winamp 5.2 shoutcast import
playlist XSPF playlist import
playlist Podcast parser
playlist DVB playlist import
playlist B4S playlist import
playlist PLS playlist import
playlist RAM playlist import
playlist M3U playlist import
...
 
  flac Flac audio decoder
flac Flac audio encoder
...
 
  lpcm Linear PCM audio decoder
lpcm Linear PCM audio encoder
lpcm Linear PCM audio packetizer
...
 
  adpcm ADPCM audio decoder
mpeg_audio MPEG audio layer I/II/III decoder
mpeg_audio MPEG audio layer I/II/III packetizer
...
 
  vorbis Vorbis audio decoder
vorbis Vorbis audio encoder
vorbis Vorbis audio packetizer
...
 
  speex Speex audio decoder
speex Speex audio encoder
speex Speex audio packetizer
...
 
  pulse Pulseaudio audio output
amem Audio memory output
oss Open Sound System
aout_file File audio output
alsa ALSA audio output
adummy Dummy audio output
...
 
  compressor Dynamic range compressor
audio_format Audio filter for PCM format conversion
dolby_surround_decoder Simple decoder for Dolby Surround encoded streams
trivial_channel_mixer Audio filter for trivial channel mixing
simple_channel_mixer Audio filter for simple channel mixing
speex_resampler Speex resampler
equalizer Equalizer with 10 bands
ugly_resampler Nearest-neighbor audio resampler
samplerate Secret Rabbit Code (libsamplerate) resampler
chorus_flanger Sound Delay
a52tospdif Audio filter for A/52->S/PDIF encapsulation
mono Audio filter for stereo to mono conversion
normvol Volume normalizer
dtstospdif Audio filter for DTS->S/PDIF encapsulation
mpgatofixed32 MPEG audio decoder
audiobargraph_a Audio part of the BarGraph function
converter_fixed Fixed point audio format conversions
converter_fixed Fixed point audio format conversions
spatializer Audio Spatializer
scaletempo Audio tempo scaler synched with rate
karaoke Simple Karaoke filter
headphone_channel_mixer Headphone virtual spatialization effect
param_eq Parametric Equalizer
dtstofloat32 DTS Coherent Acoustics audio decoder
a52tofloat32 ATSC A/52 (AC-3) audio decoder
taglib taglib
taglib taglib
folder Folder meta data
v4l2 Video4Linux2 input
v4l2 Video4Linux2 Compressed A/V
access_mtp MTP input
cdda Audio CD input
...
 
  access_alsa ALSA audio capture input
 
 
 
Any idea from all that?
:wink:
Thanks
 
 
 
 
 
 
 
 
 
Dec 1, 2012 at 11:53 AM Post #93 of 544
To Kim,
Yes, I can see a similar list with aplay -L (thanks by the way to point to the case sensitive behaviour), or even in the Preference/sound/Output device box directly in DeadBeeF. The thing is that i doesn't exit any sound except when I put the option mentioning explicitly S/PDIF (in bold in the list below). I therefore can't use the "without any conversion" option.
I started to think my hardware in defect, but I tried with another PC (a Latitude D800 this time), same behaviour. So I'm completely lost!!
No bit perfect with my PC :frowning2:
Shame, my DAC is just waiting for more bits to crunch!
Thanks anyway for all your efforts!!
 
 
jerome@jerome-Inspiron-8600:~$ aplay -L
default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=I82801DBICH4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Default Audio Device
front:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Front speakers
surround40:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    4.0 Surround output to Front and Rear speakers
surround41:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
iec958:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Direct sample mixing device
dmix:CARD=I82801DBICH4,DEV=4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    Direct sample mixing device
dsnoop:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Direct sample snooping device
dsnoop:CARD=I82801DBICH4,DEV=4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    Direct sample snooping device
hw:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Direct hardware device without any conversions
hw:CARD=I82801DBICH4,DEV=4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    Direct hardware device without any conversions
plughw:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Hardware device with all software conversions
plughw:CARD=I82801DBICH4,DEV=4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    Hardware device with all software conversions
 
Dec 1, 2012 at 2:34 PM Post #94 of 544
Quote:
To Kim,
Yes, I can see a similar list with aplay -L (thanks by the way to point to the case sensitive behaviour), or even in the Preference/sound/Output device box directly in DeadBeeF. The thing is that i doesn't exit any sound except when I put the option mentioning explicitly S/PDIF (in bold in the list below). I therefore can't use the "without any conversion" option.
I started to think my hardware in defect, but I tried with another PC (a Latitude D800 this time), same behaviour. So I'm completely lost!!
No bit perfect with my PC :frowning2:
Shame, my DAC is just waiting for more bits to crunch!
Thanks anyway for all your efforts!!
 
 
jerome@jerome-Inspiron-8600:~$ aplay -L
default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=I82801DBICH4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Default Audio Device
front:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Front speakers
surround40:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    4.0 Surround output to Front and Rear speakers
surround41:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
iec958:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Direct sample mixing device
dmix:CARD=I82801DBICH4,DEV=4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    Direct sample mixing device
dsnoop:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Direct sample snooping device
dsnoop:CARD=I82801DBICH4,DEV=4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    Direct sample snooping device
hw:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Direct hardware device without any conversions
hw:CARD=I82801DBICH4,DEV=4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    Direct hardware device without any conversions
plughw:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Hardware device with all software conversions
plughw:CARD=I82801DBICH4,DEV=4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    Hardware device with all software conversions

 
It's there, lower in the list. I highlighted the correct output device. As I said, IEC958 = SPDIF. Using the device I made italic will output directly to your SPDIF output without any software conversion.
 
In DeadBeef, the device should be named like so:
 
 
Intel 82801DB-ICH4, Intel 82801DB-ICH4 -IEC958
Direct hardware device without any conversions
 
And it should be the 3rd from bottom in the drop-down menu. Give this a try and report back.
 
If it still doesn't output any audio, do the following:
 
  • Select the device I made italic.
  • Play a file.
  • While playing, take a screenshot of DeadBeef and post it here.
  • While playing, paste here the output of "cat /proc/asound/card*/pcm*p/sub*/hw_params"
 
I'm starting to think it may be a "device busy" problem. It may be that Alsa or another mixer is keeping a connection to the DAC, so no other software can send a stream to it. This is why we use Dmix. You can only send a single stream directly to the DAC. Dmix mixes all the streams together (e.g. Youtube, Skype and system sounds all playing together) and then sends a single stream to the DAC. I've had similar problems with Amarok. I have both DeadBeef and Amarok configured to use direct hardware. If I launch Amarok while DeadBeef is playing, Amarok will close Deadbeef's stream and open it's own stream to the DAC.
 
Dec 1, 2012 at 8:14 PM Post #95 of 544
Quote:
To Anda: it returns about 9 pages of parameters. What should I be looking for? Most parameters concern video and other stuff. The ones which I can figure are around audio are:

 
It should run VLC as a daemon. Try playing some music to see if VLC can output sound to the SPDIF output.
 
Dec 2, 2012 at 6:28 AM Post #96 of 544
Good morning,
 
Trying to play with VLC works on the default output option (trough pulse audio), but when I try to use the option IEC958 - without any conversion, I get an error message:
 
Audio output failed:
The audio device "hw:CARD=I82801DBICH4,DEV=4" could not be used:
Device or resource busy.
 
To kim, as I said before, when I select the output device you mentioned:
 
hw:CARD=I82801DBICH4,DEV=4
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    Direct hardware device without any conversions
I get no signal, this is why I started to believe I have a hw problem (either the sound card, or may be the DAC doesn't lock on 96kHz for some reason - although it is supposed to according to specs).
 
The funny thing is that I get a signal when I select the option directly above:
 
hw:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4
    Direct hardware device without any conversions
and the signal coming from the S/PDIF output!!!
 
With this option selected, I get for hw_params:
1. with the help of the secret rabbit:
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 1024
buffer_size: 8192
(remember the original file is at 96kHz!!!)
and the music is played at the right speed (a 2:50 tracks plays in 2:50)
 
2. without the elusive bunny:
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 1024
buffer_size: 8192
(and the music is played half speed)
 
When I select for output device


iec958:CARD=I82801DBICH4,DEV=0
    Intel 82801DB-ICH4, Intel 82801DB-ICH4 - IEC958
    IEC958 (S/PDIF) Digital Audio Output
1. with bunny (music played ok):
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 1024
buffer_size: 8192
 
2.without (music played half speed):
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 1024
buffer_size: 8192
 
 
In short, I'm in the complete blue (and rather dark :wink:
 
 


 
 
Dec 2, 2012 at 4:31 PM Post #97 of 544
Ah, you have Pulse Audio installed? This may be the source of the problem. The first thing I do after a fresh install is purge everything related to Pulse Audio. Pulse is just dirty...
 
The VLC error message confirms what I doubted. Pulse Audio is keeping a stream open to your sound card, and will not permit any other software to talk directly to the audio hardware.
 
It's probably Pulse Audio that's so dumb, it cuts the samples in half without doubling the speed, causing the audio to play at half speed.
 
You could try to temporarily shut down pulse, and see if it fixes your problem. It's a pain though, as pulse will restart itself it you simply kill it. You have to outsmart it. This may work, to disable pulse only for this program:
 
Code:
 pasuspender -- /opt/deadbeef/bin/deadbeef
 
But since I don't have pulse installed, I can't test it.
 
Dec 3, 2012 at 7:45 AM Post #98 of 544
Bouhouhou!!!
 
(doesn't work!)
 
I managed to kill pulse audio, though. Good start. And when I play "vlc --alsa-audio-device=hw:0,4 -I qt4 -d" as Anda suggested, I do not get the "device or resource busy" as before ...
... and apparently there is a signal (at 48kHz though, see below) because my DAC locks on something ...
... but no sounds (as if the signal was only 0s)
... and it still works on the non-IEC598 "without connversion" output ... but at 48kHz
 
(and yes, the amp is on :wink:
 
I'm thinking of giving up. 
Can I install iTunes on Ubuntu? (just kidding)
 
 
 
hw_params:
 
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 2048
buffer_size: 16384
 
Dec 3, 2012 at 7:53 AM Post #99 of 544
In terminal try running "alsamixer" and check if SPDIF/IEC958 is unmuted. Are you still trying to playback a 96KHz file?
 
This is how my alsamixer looks:

 
Dec 3, 2012 at 9:54 AM Post #100 of 544
Quote:
In terminal try running "alsamixer" and check if SPDIF/IEC958 is unmuted. Are you still trying to playback a 96KHz file?
 
This is how my alsamixer looks:

 
 
 
Good pick!
I have two S/PDIF bargraphs:
- one "S/PDIF" stuck to 00 no matter what
- one "S/PDIF Playback AC97-SPSA" which can take 4 values: 00, 33, 67 and 100. It was on 67. But there a signal only at 100. Don't know why.
 
Now I have an output on "...-IEC598 without any conversion" which produces sound on my speakers
...
BUT
...
96kHz still played at half pace (and 44.1 kHz 8% too fast)!!!
....
ARGHHH
...
 
 
Must be a prob from the DAC (but I am trying on 2 of them, same thing).
Called Musical Fidelity as well, they are unaware of such malfunction on this model. So either I'm unlucky and the DAC is broken (but works with CDs), or the setting is still not correct.
 
 
Thanks anyway, Anda and Kim, for so much help!
 
Dec 3, 2012 at 1:42 PM Post #101 of 544
Quote:
96kHz still played at half pace (and 44.1 kHz 8% too fast)!!!

 
Is this with Deadbeef? What's the name of the Chip in alsamixer?
 
Dec 3, 2012 at 2:05 PM Post #103 of 544
Dec 3, 2012 at 2:54 PM Post #105 of 544
"Supported audio sample rates include 48 kHz, 44.1 kHz..."
 
....
Still don't understand why it does not convert 44.1 properly then
...
 
but I guess it isn't worth trying to work that out ... 
... let's use the usb instead
 

Users who are viewing this thread

Back
Top