Bit Perfect Audio from Linux
Jun 21, 2014 at 9:09 AM Post #286 of 543
Finally had some time off today and got around to looking at the "new" kde defaults, I will be updating my newb guide accordingly.
The basics are it no longer ships with a gstreamer alsa plugin and has become more disable friendly, ironically.
 
Ubuntu (or at least kubuntu 14.04) now has a weird PA setup (as it should have been all along, pulse is set to be a user daemon). Check out where your individual user PA config should be and you will see what I mean.
 
All i had to do was install the alsa-gstreamer plugin then disable global autospawn and pulseaudio is now under my control.
In /etc/pulse/client.conf set autospawn to no.
install the package:
gstreamer0.10-alsa or gstreamer1.0-alsa depending on the gstreamer version you are using.
 
Use the same tests as always to make sure you are getting bitperfect, and remember, if you want to multitask all you have to do is manually spawn pulseaudio then kill it when you are done.
 
 
 
Edit: If anyone wants to check out WHY pulseaudio is now easy to disable read the init file for it.
 
Jun 21, 2014 at 4:26 PM Post #287 of 543
  Finally had some time off today and got around to looking at the "new" kde defaults, I will be updating my newb guide accordingly.
The basics are it no longer ships with a gstreamer alsa plugin and has become more disable friendly, ironically.
 
Ubuntu (or at least kubuntu 14.04) now has a weird PA setup (as it should have been all along, pulse is set to be a user daemon). Check out where your individual user PA config should be and you will see what I mean.
 
All i had to do was install the alsa-gstreamer plugin then disable global autospawn and pulseaudio is now under my control.
In /etc/pulse/client.conf set autospawn to no.
install the package:
gstreamer0.10-alsa or gstreamer1.0-alsa depending on the gstreamer version you are using.
 
Use the same tests as always to make sure you are getting bitperfect, and remember, if you want to multitask all you have to do is manually spawn pulseaudio then kill it when you are done.
 
 
 
Edit: If anyone wants to check out WHY pulseaudio is now easy to disable read the init file for it.

 
There is no packages relating to both gstreamer and alsa on fedora. You sure you're not talking about the phonon gstreamer backend? How is your phonon configured?
 
Jun 21, 2014 at 7:35 PM Post #288 of 543
As with all desktops and OS's, you want to skip as much of the audio sub system as is possible to both keep things simple and bit perfect.
 
My phonon is set to output to my dac, it never actually does this unless its own backend pulseaudio is started. This way there is no mixing or signal converting going on anywhere.
 
Do music players you have installed see alsa as a audio-sink? If so then you already have the required library. If not then.... well, i can't for the life of see what they have done in their packaging system to not include something very important.
 
Jun 22, 2014 at 6:13 PM Post #289 of 543

 
Here's the mess of affairs on my system. Deadbeef works fine, listing all ALSA outputs. KMix now lists my ALSA outputs. Phonon does not list the ALSA outputs. The only option available to me in Phonon is to change the "hardware profile" in the "Audio Hardware Setup" tab, which toggles the activation of either the analog out OR the digital out on the first tab. (making the first tab totally irrelevant)
 
On my last install, desabling pulseaudio made phonon list and activate the same things deadbeef lists right now. This allowed me to set "default audio device" as my "audio playback" setting, which allowed for mixing of all signals trough dmix, while setting the "Music" to the SPDIF output, which made Amarok stream bit perfect to my external DAC.
 
Jun 26, 2014 at 2:43 PM Post #291 of 543
Interesting. I thought I disabled Pulse, but it turns out it was still running. In Fedora 20, pulse is called directly by KDE at startup, so a bit more work is needed to disable it.
 
Disabling Pulse fixed the problem I had with mutes in KMix, and changed the available settings in Phonon.
 
Here's what my phonon looks like now.
 

It makes more sense now, but my digital out is not listed, nor are the direct hardware devices...
 
Jul 28, 2014 at 11:49 AM Post #292 of 543
Hello guys, 
 
I have bought the AudioEngine D3 and I'm running in Linux (Ubuntu 14.04). It works very nice, after read all the thread I was able to make it work through PulseAudio using this settings on .asoundrc
 
Code:
 pcm.D3 { type hw card "D3" } # Bind a default ctl to the underlying hw driver # for the "AB12". # ctl.!default { type hw card "D3" } # Create a default pcm, use the "plug" wrapper # to wrap the named PCM we created above. # # Plug will adjust sample format as needed; we can # force it to never change the sample rate! Nice. # pcm.!default { type plug slave { pcm "D3" rate "unchanged" } }
 
However, the volume through PulseAudio seems to be screwed up and jumps from 0 to 100%. Is there anyway to tell pulseaudio to use the right steps on this device? Through Alsamixer it works like a charm.
 
Thanks,
 Andrés
 
Jul 28, 2014 at 10:41 PM Post #293 of 543
Most of this thread is dedicated to NOT using pulseaudio. To use pulseaudio on a default Ubuntu install you simply choose the output device from the output picker in the top right sound settings menu. That's the only step there is.

What you described was setting an alsa alias for your device, which if using pulseaudio won't change your experience.
 
Aug 17, 2014 at 1:34 AM Post #294 of 543
First, sorry for my English.
 
I read many things interesting here, but I don't get this "bit perfect" obsession. I mean what is the real benefit ? Apparently it's quite annoying.
 
My sound configuration :
- Amp : Sony UDA-1 (USB)
- Headphone : AKG K612 pro
 
Not the best configuration, but a good one.
 
I do some tests to find out what is about "bit perfect".
I use mpv (a young but great fork of mplayer/mplayer2 => http://mpv.io/ ).
I have lot of riped CD (44.1kHz/16bits), some 44.1kHz/24bits files, and  "Norah Johns - The Fall" in 88.2kHz/24bits.
I will use the last one.
 
"Bit perfect" listening :
$ soxi <some files>.flac
...
Sample Rate    : 88200
Precision      : 24-bit
...
 

$ mpv --softvol=no --msg-level=af=v:ao=v --ao=alsa=device=[front:CARD=Amplifier,DEV=0] <some files>.flac
...
AO: [alsa] 88200Hz stereo 2ch s32
...
[af] Audio filter chain:
[af]   [in] 88200Hz stereo 2ch s32
[af]   [out] 88200Hz stereo 2ch s32
[af]   [ao] 88200Hz stereo 2ch s32
 

Result : perfect
 
 
Now I'm no longer "bit perfect". Worse, I'm downsampling from 88.2kHz/24bits to 44.1kHz/16bits
$ mpv --audio-samplerate=44100 --audio-format=s16le --msg-level=af=v:ao=v --ao=alsa=device=[front:CARD=Amplifier,DEV=0] <some files>.flac
...
AO: [alsa] 44100Hz stereo 2ch s16
...
[af] Audio filter chain:
[af]   [in] 88200Hz stereo 2ch s32
[af]   [lavrresample] 44100Hz stereo 2ch s16
[af]   [out] 44100Hz stereo 2ch s16
[af]   [ao] 44100Hz stereo 2ch s16
 

Result : perfect
 
 
For my ears and with this disc of Norah Jones, there is no difference.
 
Usually I use pulseaudio configured for 88.2kHz/24bits. It's enough for my music files. But here I use 192kHz.
 
$ mpv --msg-level=af=v:ao=v <some files>.flac
...
AO: [pulse] 88200Hz stereo 2ch s32 [af] Audio filter chain:
[af]   [in] 88200Hz stereo 2ch s32
[af]   [out] 88200Hz stereo 2ch s32
[af]   [ao] 88200Hz stereo 2ch s32
 
$ cat /proc/asound/card1/pcm0p/sub0/hw_params
format: S24_3LE
rate: 192000 (192000/1)
...
 

Result : perfect (obviously)
 
 
Perfect and I can still listen some (poor quality) youtube vidéos, watch the TV, have an audio alarm, etc.
 
Before going to the "annoying" bit perfect path, it could be interesting to do some test.
 
If downsampling to 44100/16bits don't show difference, why should I fear upsampling ?
 
On the "16 vs 24bits" front, I find some differences with some recent dvd movies (dts) that have a huge dynamic.
 
My USB-DAC can't accept format below 44.1kHz/16bits. But pulseaudio can.
Another test :
$ mpv --audio-samplerate=32000 --audio-format=s16le <some files>.flac

Not bad, but not as good as previously.
 
 
 
 
Should I have a computer only dedicated to listen music ?
I think some tests can be helpful.
$ mpv --volume=0 --softvol=yes <some file>

This ensure that we are pushing data (0) to the sound card. Just a precaution. Set the volume to the maximum with alsamixer (or with pavucontrol if you use pulseaudio) and on your DAC if it has a knob. Stress your computer and if everything is fine, you should not hear anything. I have a very quiet computer (fanless), and with the Sony UDA-1 it's a great silence. I have an inboard sound card, with it it's another story (lot of noise ; not a well grounded sound card).
Overall, it's a pita if a modern computer can only be used to listen music.
 
 
Another point, are you sure your sound card is "bit perfect" compliant ?
I think most of DAC upsample to its max frequency before going to the digital to analog conversion. Otherwise its must have several low-pass filter frequency.
 
Aug 22, 2014 at 7:49 AM Post #295 of 543
The fact that system load alters the output signal of a (digital) audio interface connected to that system is as unfortunate as inevitable. Bit-perfectness should be about minimizing that effect. First by bypassing plug-and-play stacks which alter the sound on purpose (for example by resampling or volume control) and secondly by minimizing system load to eliminate *potential* (eg unwanted) alteration of the output signal. The same principles apply to the rest of the audio playback chain (in my case anyway), which makes this discussion somewhat trivial?
 
The fact that you can't hear the difference between the Norah Jones 88.2kHz/24bit source file played back in 44.1kHz/16bit mode, probably just means it's a great source to begin with and has nothing to do with my statement above. Converting from 88.2 to 44.1kHz sample rate just means to leave out every other sample which is easy for any playback system and should cause no visible (or audible) load to the system. At the same time the sound quality is presevered as predicted by the digital audio theorum (see on xiph.org). In a good system and using a good 16bit source file, one has a theoretical dynamic range of 96dB. The extra 48dB 24bit provides just dies silently below the noise floors of your playback system and ears. What higher than 16bit resolutions do provide (during music production) is less slope filtering of the sample frequency which results in less artifacts (especially phase shifts) in the upper end of the audio domain, eg. towards the fs/2 frequency.
 
Many high resolution files on the market are exactly the opposite; with an audio analyzer one can see such a file actually was a 44.1kHz/16bit source which was simpy upsampled (and processed/smoothed) to "something higher". In that process the musical information could have been altered by the upsampling while possibly adding artifacts as a result of that process. While a bit perfect playback system should reproduce everything that is in the published source file, it actually differs from the real (16bit/44.1kHz) source. Most of the times this is clearly audible and a proper rip of the CD from the same masters sounds better than such a "high resolution" version. 
 
As far as I can see, apart from the SACD (DSD source) only a 44.1kHz/24bit version is released of this Norah Jones album, so maybe your source file is suffering from the effect I decribed above?
 
Aug 24, 2014 at 11:54 AM Post #296 of 543
  The fact that system load alters the output signal of a (digital) audio interface connected to that system is as unfortunate as inevitable. Bit-perfectness should be about minimizing that effect. First by bypassing plug-and-play stacks which alter the sound on purpose (for example by resampling or volume control) and secondly by minimizing system load to eliminate *potential* (eg unwanted) alteration of the output signal.

 
I think you are talking about badly, or far from perfectly, grounded sound cards.
For me, if a sound card (or something else) has an issue, then try to fix the sound card in the first place. I don't want to buy another computer and spend time to configure it and so on because one element is weak.
As far I'm concerned and with my configuration, I don't have such issues as stated earlier.
I understand what you say, you are right. But...
 
 
The same principles apply to the rest of the audio playback chain (in my case anyway), which makes this discussion somewhat trivial?  
The fact that you can't hear the difference between the Norah Jones 88.2kHz/24bit source file played back in 44.1kHz/16bit mode, probably just means it's a great source to begin with and has nothing to do with my statement above. Converting from 88.2 to 44.1kHz sample rate just means to leave out every other sample which is easy for any playback system and should cause no visible (or audible) load to the system. At the same time the sound quality is presevered as predicted by the digital audio theorum (see on xiph.org). In a good system and using a good 16bit source file, one has a theoretical dynamic range of 96dB. The extra 48dB 24bit provides just dies silently below the noise floors of your playback system and ears. What higher than 16bit resolutions do provide (during music production) is less slope filtering of the sample frequency which results in less artifacts (especially phase shifts) in the upper end of the audio domain, eg. towards the fs/2 frequency.
 
Many high resolution files on the market are exactly the opposite; with an audio analyzer one can see such a file actually was a 44.1kHz/16bit source which was simpy upsampled (and processed/smoothed) to "something higher". In that process the musical information could have been altered by the upsampling while possibly adding artifacts as a result of that process. While a bit perfect playback system should reproduce everything that is in the published source file, it actually differs from the real (16bit/44.1kHz) source. Most of the times this is clearly audible and a proper rip of the CD from the same masters sounds better than such a "high resolution" version. 
 
As far as I can see, apart from the SACD (DSD source) only a 44.1kHz/24bit version is released of this Norah Jones album, so maybe your source file is suffering from the effect I decribed above?

 
Forget what I said about the record of Norah Jones.
Thue 24 bits record or not doesn't matter in my case. I read some measurements of my DAC and they show that my dac is not capable of fully showing the difference between 16 and 24 bits. In practical, it's more a 18 bits DAC, or worse, than a 24 bits DAC. Bad news.
I am really new in the "audiophile world". 3 ou 4 months ago I buy some decent and not expensive equipments just to check if I can really enjoy "good sound" (with good music obviously). I enjoy and it's  exciting. Perhaps it's time for an upgrade. I'm thinking about Yulong DA8 -> Yulong A28 -> Hifiman HE-560. It's lot of money for me, and ... it's off topic here.
 
Aug 24, 2014 at 12:42 PM Post #297 of 543
   
I think you are talking about badly, or far than perfectly, grounded sound cards.

Unfortunately I'm not. The audible effects I wrote about in my previous post are there even using the best external USB Audio Class (UAC) 2 asynchronous DACs with proper USB-receiver isolation and dedicated highest quality linear power supplies.
 
The theory behind this is that all the switching which occurs in all the components of the PC has an effect on the computer generated SPDIF stream, which in case of UAC is packed in USB URBs, which in themselves are transported to the DAC perfectly (in a proper setup). Minimizing the switching (load on the processor(s), RAM, storage media, busses and interfaces) is currently the only way to minimize the negative impact. For the record, I'm not talking about buzzing or humming, I'm talking about more subtle audible effects like harshness and colouration.
 
The extent to which this effect is present on modern dedicated proprietary i2s connections is unclear to me, but such discrete signal transport could (theoretically) be better. On the other hand I don't think such proprietary protocols/transports/interfaces are sustainable. I do hope the next computer-audio interface standard (be it UAC or something else) will address this issue.
 
Good luck on your path to audio nirvana!
 
Aug 24, 2014 at 3:18 PM Post #298 of 543
  Unfortunately I'm not. The audible effects I wrote about in my previous post are there even using the best external USB Audio Class (UAC) 2 asynchronous DACs with proper USB-receiver isolation and dedicated highest quality linear power supplies.
 
The theory behind this is that all the switching which occurs in all the components of the PC has an effect on the computer generated SPDIF stream, which in case of UAC is packed in USB URBs, which in themselves are transported to the DAC perfectly (in a proper setup). Minimizing the switching (load on the processor(s), RAM, storage media, busses and interfaces) is currently the only way to minimize the negative impact. For the record, I'm not talking about buzzing or humming, I'm talking about more subtle audible effects like harshness and colouration.
 
The extent to which this effect is present on modern dedicated proprietary i2s connections is unclear to me, but such discrete signal transport could (theoretically) be better. On the other hand I don't think such proprietary protocols/transports/interfaces are sustainable. I do hope the next computer-audio interface standard (be it UAC or something else) will address this issue.
 
Good luck on your path to audio nirvana!

 
Obviously, the problem is bigger with a badly grounded sound card. Any way, with a well grounded sound card, you are always right. I'm not arguing this point.
You think one of the solution is to use a computer only for music (less load system). That is to say, in my case, I have to buy a new computer. I'll not go through this path. For me, for my perception of the "usb jitter" problem, this doesn't deserve such drastic solution.
Perhaps I'm wrong, but don't think I'm not serious about music, at least a little. I build my day-to-day computer by also really taking care about music. It's low consumption computer, have an excellent alimentation (80 plus platinum) with very low (electronic) noise and fanless. I don't have an electrical hungry graphic card. The graphic card is the one provided by the Intel CPU. I use a low consumption CPU, less than 60w (with the graphic card !). I use 2.5 harddrive (less consumption, less noise) + anti-vibration. The case of the computer is a Cool Master Silencio (one of the best). Since it's a low consumption computer, the case is fanless as the CPU (thanks to the fanless Zalman radiator). No fan at all. It's a very very quiet computer and I use it for "everything". Write some paper (In French, as you can see my English is not good) watch DVDs, browse the web, keep my finanial-accounting up to date, do some SQL stuff, ... Compared with a typical computer (as the ones we can see here : http://www.head-fi.org/forum/newestpost/397869 ), it's a HUGE improvement and I am sure we can hear the difference even when enjoying some musics.
From my point of view, and perhaps I am wrong, if the "usb jitter" rise to be a concern, I think it's more interresting to use the optical entry of the DAC than building a not very usefull computer because we should keep the load system low.

Btw, I wasn't saying that a sound server has no drawback at all. I think if used with a little caution (avoid downsampling, avoid software volume) it's very convenient with nearly no drawbacks. Of course, if the purpose of a computer is only to listen music, you can just remove it out of the system.
 
Aug 26, 2014 at 11:03 AM Post #299 of 543
   
I build my day-to-day computer by also really taking care about music. It's low consumption computer, have an excellent alimentation (80 plus platinum) with very low (electronic) noise and fanless. I don't have an electrical hungry graphic card. The graphic card is the one provided by the Intel CPU. I use a low consumption CPU, less than 60w (with the graphic card !). I use 2.5 harddrive (less consumption, less noise) + anti-vibration. The case of the computer is a Cool Master Silencio (one of the best). Since it's a low consumption computer, the case is fanless as the CPU (thanks to the fanless Zalman radiator). No fan at all. It's a very very quiet computer and I use it for "everything". 

Great PC, I build exactly the same a few years ago, based on the "Leise Vorschlag" of the excellent German CT-magazine. 
 
From my point of view, and perhaps I am wrong, if the "usb jitter" rise to be a concern, I think it's more interresting to use the optical entry of the DAC than building a not very usefull computer because we should keep the load system low.

I don't agree; any SPDIF computer output, be it electrical (coax or USB), or optical, suffers from the symptoms described. Of course the sound quality depends on the implementation of both the computer generating the signal and the (quality of the particular interface of the) DAC. 
 
Aug 27, 2014 at 1:57 AM Post #300 of 543
...Any SPDIF computer output, be it electrical (coax or USB), or optical, suffers from the symptoms described. Of course the sound quality depends on the implementation of both the computer generating the signal and the (quality of the particular interface of the) DAC. 

I presume that an IEEE 1394 interface, or a PCI or PCI-Express audio card (such as the Creative Laboratories® Professional™ EM8986 or equivalent), that supports AES/EBU, would have fewer problems with jitter than the Sony/Philips interface common to consumer devices, provided that the balance of the rig can keep the signal at top speed?
 

Users who are viewing this thread

Back
Top