Bit Perfect Audio from Linux
Apr 12, 2014 at 2:41 AM Post #256 of 544
^ I'm trying it out now. Looks like it can't play 96/24?
 
Apr 12, 2014 at 4:33 AM Post #257 of 544
May 2, 2014 at 6:47 PM Post #259 of 544
Hi,
 
Lengthy topic and it seems like most of the chat here is trying to get Bit Perfect via USB
 
If I'm trying to set up my Benchmark DAC1 to receive digital out via S/PDIF would it be simply using deadbeef to use output plugin as ALSA and output device as HDA Intel PCH, ALC892 Digital for SPDIF out? Would that be bit perfect?
 
Haven't tinkered with this in a while. Thanks!
 
May 2, 2014 at 7:13 PM Post #260 of 544
Hey Mofonyx, depending on your alsa settings it sure would! Just make sure your alsa file doesn't have a sample rate or bitdepth default defined for the output device you plan on using (unless you have files outside your dac's reach bit or rate wise).

For more information just post back or look at the alsa wiki!
 
May 2, 2014 at 7:14 PM Post #261 of 544
  If I'm trying to set up my Benchmark DAC1 to receive digital out via S/PDIF would it be simply using deadbeef to use output plugin as ALSA and output device as HDA Intel PCH, ALC892 Digital for SPDIF out? Would that be bit perfect?
 

 
as long as your spdif output can handle the sampling frequencies and bit depths your music is stored in - yes.
 
May 3, 2014 at 5:30 AM Post #262 of 544
Hey Mofonyx, depending on your alsa settings it sure would! Just make sure your alsa file doesn't have a sample rate or bitdepth default defined for the output device you plan on using (unless you have files outside your dac's reach bit or rate wise).

For more information just post back or look at the alsa wiki!

Thanks
 

I haven't tinkered with the alsa config file (/usr/share/alsa/alsa.conf) but can't find anything within it that would suggest this. All the defaults just appear as a list without any further strings below it. I assume that this means that bitdepth default hasn't been defined - therefore I should be OK.
 
How do I check that this is accurate during music playback?
 
May 3, 2014 at 5:59 AM Post #263 of 544
While playing a 48kHz file through a Benchmark DAC 1 USB here, executing

$ cat /proc/asound/card1/stream0

produces:

Texas Instruments Benchmark 1.0 at usb-0000:0e:00.0-2.1, full speed : USB Audio

Playback:
Status: Running
Interface = 1
Altset = 1
Packet Size = 365
Momentary freq = 48000 Hz (0x30.0000)
Interface 1
Altset 1
Format: S24_3LE
Channels: 2
Endpoint: 1 OUT (ADAPTIVE)
Rates: 44100, 48000, 88200, 96000

Note the "Momentary freq = 48000 Hz" line.

Depending on your device, you may need to replace card1 with cardN for some other N.
 
May 3, 2014 at 8:31 AM Post #265 of 544
@mofonyx sorry i should have clarified, by alsa config people (around here) generally mean one of the audio configuration files.
 
Here is an extract from my guide to audio linux found here. I put it in a spoiler so it doesn't ruin the look of the thread.
 
 

Setting up Alsa:
Firstly make sure alsa and alsa-utils are both installed and up to date.
for debian/ ubuntu:
 

  Detecting your proper sound card:
For the uses of this guide i will assume you are using a USB DAC.
Running the below in a terminal will list your devices detected by alsa as valid output devices:
 
 aplay -l



 
The output on my machine is:
 
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: DAC [UAC1 DAC], device 0: USB Audio [USB Audio]
 Subdevices: 0/1
 Subdevice #0: subdevice #0

 
Here you can easily see that card 1, device 0 is my usb sound card. If i was to use HDMI output i would set it to card 0 device 3 or card 0 device 7.
 
Note: Sometimes if you get two HDMI outputs one is actually your DVI output, its a cheap trick hardware OEMs use to add ports. You will have to try both to find out which one is actually your HDMI device.
  Testing a device is as simple as using:
  aplay -D hw:0,0 test.wav
 
Where hw:0,0 refers to your hardware detected above with aplay -l.

 
For Alsa playback applications we provide hardware addresses in the form:
 
 hw:card#,device#

 

So in my case it is:
 

 
Setting defaults is the final step. Run the following in a terminal:
 
sudo nano /etc/asound.conf

 
I suggest cleaning out this entire file so it is blank then putting the below contents in.
 
 
pcm.!default {
    type hw
    card 0
device 0
}

ctl.!default {
    type hw           
    card 0
device 0
}
 

 
Simply replace the card and device numbers with the ones you found above.
 
For instance my config reads:
 
 
pcm.!default {
    type hw
    card 1
device 0
}

ctl.!default {
    type hw           
    card 1
device 0
}

 
 
You are done with alsa!
 
 
May 3, 2014 at 10:46 AM Post #267 of 544
  @mofonyx sorry i should have clarified, by alsa config people (around here) generally mean one of the audio configuration files.
 
Here is an extract from my guide to audio linux found here. I put it in a spoiler so it doesn't ruin the look of the thread.
 

Thanks
All done and ALSA configured accordingly playing through my DAC.
 
However, I am still able to control the volume of my playback on Deadbeef by tinkering with the volume bar. I don't think that is supposed to happen if I am streaming bit perfect via SPDIF
 
May 3, 2014 at 11:43 AM Post #268 of 544
Quote:

 
Gives me
 
  **** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

 
and my asound.conf reads
  pcm.!default {
    type hw
    card 1
device 1
}
 
ctl.!default {
    type hw
    card 1
device 1
}
 

 
Still able to alter volume on deadbeef and clementine. :frowning2:
 
May 3, 2014 at 6:31 PM Post #269 of 544
  My top 3 audio players for bit perfect audio in Linux are:
 
- Clementune
- Audacious
- Guayadeque
 
And also VLC (considered as a music player as well)

 
I had been using Audacious...till now. The SQ in Guayadeque is really amazing. I was running both in ALSA and still in disbelief after switching back forth for hours :p

This thread has been a giant help to a neophyte, big thanks to all the contributors
 
May 3, 2014 at 7:12 PM Post #270 of 544
I had been using Audacious...till now. The SQ in Guayadeque is really amazing. I was running both in ALSA and still in disbelief after switching back forth for hours :p


This thread has been a giant help to a neophyte, big thanks to all the contributors


This idea that one audio player sounds much different from another is not correct. On a GNU/Linux OS any and all audio players will use the same sound systems and so will sound the same. If they don't sound the same then either you configured them badly or they are essentially broken. Unless there is something seriously broken with an audio player then you can configure it (and/or the sound system such as alsa or pulse) to simply use the available hardware without bit depth changes or sample rate conversions, hence it will be bit perfect. If it can't do gapless with native gapless formats such as ogg vorbis, flac, wav (or any lossless format in fact), opus etc. then that player is broken and you ought to use something else.

If you have a sane setup of alsa/pulse/jack/whatever_it_is_you_use then mplayer, mplayer2, totem, gmusicbrowser, mpd, audacious, moc etc will all sound absolutely identical. If they don't then you did something wrong, or the people who set the default config of your OS did.

Bit perfect audio is really easy in Linux so long as your hardware supports it (i.e. it doesn't silently resample everything - see ancient Creative cards and current budget USB audio cards). If you really want bit perfect audio then you just set alsa to pass the audio stream to the hardware device. It isn't difficult or complicated. If your hardware device is not capable then there is no work around. If you insist on software mixing or resampling for convenience then there are no guarantees. But if you want bit perfect audio out then it's hard to imagine a simpler (or more verifiable) method than just dumping the audio>suitable hardware audio device>amplification>speakers/headphones. Any decent audio tool for GNU/Linux lets you choose the output device, and that device can be defined by you. So long as the hardware does what you think it does then you can have bit perfect audio.

If you have just one audio device and use alsa (not pulse) then it's as simple as defining ~/.asoundrc like so:

Code:
pcm.!default {
 type plug
 slave.pcm "hw:0,0";
}

That is it. There is no more to it. You just make sure any audio app outputs to the default device without filters or conversions and you are there. So if you can copy and paste four lines of text and don't run some OS where they broke everything in the name of user friendliness then you can have bit perfect audio as easily as that. But you might not like it. If you want any of software sound mixing, software volume control, sample rate conversion, a pulseaudio style sound server or abstraction layer then you have to think again about bit perfect.
 

Users who are viewing this thread

Back
Top