Optimal Linux Output --> Schiit DAC for music listening?
Nov 25, 2016 at 4:45 PM Thread Starter Post #1 of 14

mattlach

100+ Head-Fier
Joined
Mar 9, 2009
Posts
408
Likes
228
Hey all,
 
I'm guessing there has to be at least a handful of other Linux users on here.
 
I'm a veteran Linux user, but I've never really dug into the audio side of things until recently.
 
I am currently on Linux Mint 18, with the following setup:
 
Creative X-Fi Titanium HD ---Toslink---> Schiit Modi 2 Multibit ---> Lyr 2 ---> Headphone du jour
 
In my current setup, I just plugged everything in and started listening, and it sounds great.   Question is, is there anything I should change to make it sound even better?
 
I i have to admit, I don't have a clear picture of the audio pipeline in Linux.
 
I know I have an audio source, that somehow outputs to Pulse Audio and ALSA and then out to the DAC.
 
While it seams that each of ALSA and Pulse Audio have bit depth and output frequency settings, and will dither everything to the set frequency regardless, which is ideally to be avoided.   You want your bit depth and frequency to match your source at all times, correct?   And for typical music sources, this means 16bit 44.1khz, yes?
 
Or is there maybe a way to tell ALSA and/or Pulse Audio to autmatically switch the output to the DAC to the bit depth and frequency of the source, so if I - for instance - should isten to 48khz DVD content it outputs this natively and then switches back to 44.1khz when I go back to music?
 
Well, I started researching this further, and quickly got a little overwhelmed, and would appreciate the input and clarification from anyone who considers themselves knowledgeable in this subject.
 
I read that a the "pacmd list-sinks" command can be helpful, so I ran it and wound up with the following:
 
Apparently this forum does not use code tags, or at least not in a way that was immediately apparent to me.
 
Code:
[/font]
 [font=verdana] * index: 1
     name: <alsa_output.pci-0000_02_00.0.iec958-stereo>
     driver: <module-alsa-card.c>
     flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
     state: RUNNING
     suspend cause: 
     priority: 9058
     volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
             balance 0.00
     base volume: 65536 / 100% / 0.00 dB
     volume steps: 65537
     muted: no
     current latency: 742.74 ms
     max request: 127 KiB
     max rewind: 128 KiB
     monitor source: 1
     sample spec: s16le 2ch 44100Hz
     channel map: front-left,front-right
                  Stereo
     used by: 1
     linked by: 1
     configured latency: 743.04 ms; range is 0.50 .. 743.04 ms
     card: 1 <alsa_card.pci-0000_02_00.0>
     module: 7
     properties:
         alsa.resolution_bits = "16"
         device.api = "alsa"
         device.class = "sound"
         alsa.class = "generic"
         alsa.subclass = "generic-mix"
         alsa.name = "IEC958 Non-audio"
         alsa.id = "ctxfi"
         alsa.subdevice = "0"
         alsa.subdevice_name = "subdevice #0"
         alsa.device = "4"
         alsa.card = "0"
         alsa.card_name = "Creative X-Fi"
         alsa.long_card_name = "Creative X-Fi 20K2 SB1270"
         alsa.driver_name = "snd_ctxfi"
         device.bus_path = "pci-0000:02:00.0"
         sysfs.path = "/devices/pci0000:00/0000:00:03.0/0000:02:00.0/sound/card0"
         device.bus = "pci"
         device.vendor.id = "1102"
         device.vendor.name = "Creative Labs"
         device.product.id = "000b"
         device.product.name = "EMU20k2 [X-Fi Titanium Series]"
         device.string = "iec958:0"
         device.buffering.buffer_size = "131072"
         device.buffering.fragment_size = "65536"
         device.access_mode = "mmap+timer"
         device.profile.name = "iec958-stereo"
         device.profile.description = "Digital Stereo (IEC958)"
         device.description = "EMU20k2 [X-Fi Titanium Series] Digital Stereo (IEC958)"
         alsa.mixer_name = "20K2"
         module-udev-detect.discovered = "1"
         device.icon_name = "audio-card-pci"
     ports:
         iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
             properties:
                 
     active port: <iec958-stereo-output>[/font]
 [font=verdana]
 
 
Some thoughts after reading the above output:
 
What is the difference between s16le and s16be?   Google tells me one is "little endian" and one is "big endian".   Should I choose one over the other?
 
And latency, what is this latency?   It can't possibly be the output latency, the time from a sound being played, before it appears in my ears?   700+ms seems rather extreme, and that I would have significant problems with this kind of latency. If I play a video clip, sound seems to sync well with the video, sos I suspect thsi is measuring something else, but what it is, I have no idea.  Is something wrong here?
 
 
I'd appreciate any suggestions and / or help anyone can provide!
 
--Matt
 
Nov 26, 2016 at 12:48 AM Post #2 of 14
Have you tried plugging the Lyr 2 directly into the Titanium-HD's RCA jacks?
 
Nov 26, 2016 at 12:56 AM Post #3 of 14
Have you tried plugging the Lyr 2 directly into the Titanium-HD's RCA jacks?


That's how I used to use my first gen Asgard.

Don get me wrong, the Burr-Brown DAC's in the Titanium HD are actually respectable for a PC soundcard, but they can't touch the Modi 2 Multibit.

That, and the inside of the PC case is rather electrically noisy. When I was using the Titanium HD DAC, I could actually hear things in my headphones, like my mouse pointer moving across my screen, and ever since I built a custom water cooling loop, the pump noise was also electrically transferred to the sound.

I could have just connected the Modi 2 via USB like most people, but I figured since my PC happens to be unusually noisy, it wouldn't hurt to optically isolate it from the DAC to make absolutely certain nothing was being transferred.

Either way, whether I was using the DAC on the soundcard or the Modi, I'd still have the same issue, of how do I set up the sample rates and everything in Linux to sound the best?
 
Nov 26, 2016 at 1:07 AM Post #4 of 14
Might need to search a Linux forum for that.
 
Nov 26, 2016 at 1:10 AM Post #5 of 14
  Might need to search a Linux forum for that.

 
Chances are, you are correct, but there seem to be a few Linux users on here as well, and I'd imagine that there is a good chance some of them have gone through the same thought process of optimizing their outputs.
 
Nov 26, 2016 at 1:15 AM Post #6 of 14
Planning to use MPD bit perfect, but not there as yet. There is still more I need to understand.
 
BTW, what distribution of Linux are you using? You may want to try AP Linux, if your machine supports BIOS. AP Linux is already optimized for audio, and sounded quite good on my old laptop when connected to a USB DAC.
 
Nov 27, 2016 at 5:33 PM Post #7 of 14
If anyone else is interested, I have had a very informative (and still on going) discussion regarding this topic over on the Linux Mint forums, in this thread.
 
Nov 29, 2016 at 9:18 AM Post #8 of 14
I run Debian on my laptop rig, with a Behringer UCA202 connected via usb and use ALSA.
 
with this is my asound.rc file I get 44.1 for audio and 48khz for video automatically, as it just passes through the source without any upmix
 
audio_output {
          type       "alsa"
          name      "USB Audio Code" (obviously here, you'd put the name of your own card)
          device     "hw:1,0" (again here you'd put the card and device numbers that match your system)
}
 
Now, it is possible to get ALSA, via the .asound.rc file, to up mix the sample rate to 48khz with the dmix option set to 48000. I actually used to use that, but then I thought as my FLAC source is 44.1, why would I want to add any possible noise/degradation to the source file, by adding a conversion to it? I'm not saying upmix would do that, that's just my way of thinking. That said, I've since tried a test by listening to the same source direct and with an upmix to 48000 and didn't hear any difference. I just went with direct as peace of mind really.
 
As to what's best. I dunno. Like I say, I couldn't hear a difference. I just liked the idea of listening to my music as defined by it's source. Seeing 48khz on my amp knowing it's a 44.1 source would have me over thinking
blink.gif
bigsmile_face.gif
 
 
Nov 29, 2016 at 9:32 AM Post #9 of 14
The primary purpose for my venture into Linux is a cheaper replacement for my aging Mac laptop. However the Mac laptop is bit-perfect through the use of Audirvana. It also plays the few DSD files I have on the hard drive. But the primary focus was to get the FLAC playing at native rates. I'm running Ubuntu. Current default setup of ALSA is playing 44.1, 88.2, and 176.4 all at 44.1 through the external DAC. Similarly 48, 96, and 192 are all playing at 48. So something is obviously wrong.
 
I think I found the solution, but had to stop - get back to regular life projects. The Linux box will not be ready in time for an upcoming meet. The Mac will have to do for the now.
 
Nov 29, 2016 at 11:10 AM Post #10 of 14
  I run Debian on my laptop rig, with a Behringer UCA202 connected via usb and use ALSA.
 
with this is my asound.rc file I get 44.1 for audio and 48khz for video automatically, as it just passes through the source without any upmix
 
audio_output {
          type       "alsa"
          name      "USB Audio Code" (obviously here, you'd put the name of your own card)
          device     "hw:1,0" (again here you'd put the card and device numbers that match your system)
}
 
Now, it is possible to get ALSA, via the .asound.rc file, to up mix the sample rate to 48khz with the dmix option set to 48000. I actually used to use that, but then I thought as my FLAC source is 44.1, why would I want to add any possible noise/degradation to the source file, by adding a conversion to it? I'm not saying upmix would do that, that's just my way of thinking. That said, I've since tried a test by listening to the same source direct and with an upmix to 48000 and didn't hear any difference. I just went with direct as peace of mind really.
 
As to what's best. I dunno. Like I say, I couldn't hear a difference. I just liked the idea of listening to my music as defined by it's source. Seeing 48khz on my amp knowing it's a 44.1 source would have me other thinking
blink.gif
bigsmile_face.gif

 
 
Yeah, you really want to avoid resampling unless you absolutely have to.   If your DAC supports it you want to pass the untouched packets at the bit depth and frequency they are in directly to it whenever possible.  Resampling (especially with dmix, I understand) can have pretty bad impacts in the sound.
 
I think the only time resampling should be considered is if you need to play back a bit depth or frequency that your DAC doesn't support, and even then, if you are going to be playing those bit depths and frequencies often, it may be time to invest in a different DAC.
 
It's mostly a moot point though.   The overwhelming majority of content (99.99%) is 16bit 44.1khz, which is pretty much universally supported by all modern DAC's.
 
Nov 29, 2016 at 11:15 AM Post #11 of 14
  The primary purpose for my venture into Linux is a cheaper replacement for my aging Mac laptop. However the Mac laptop is bit-perfect through the use of Audirvana. It also plays the few DSD files I have on the hard drive. But the primary focus was to get the FLAC playing at native rates. I'm running Ubuntu. Current default setup of ALSA is playing 44.1, 88.2, and 176.4 all at 44.1 through the external DAC. Similarly 48, 96, and 192 are all playing at 48. So something is obviously wrong.
 
I think I found the solution, but had to stop - get back to regular life projects. The Linux box will not be ready in time for an upcoming meet. The Mac will have to do for the now.

 
Two things I learned from the thread on the linux mint forums I linked above:
 
1.) In modern distributions  ALSA *SHOULD* be autodetecting the bit depth and frequency and outputting it to your DAC at the same as the source.  if it isn't, there may be configuration necessary.  it is possible ALSA is not aware that your DAC can support frequencies above 48khz, and it is thus downmixing them to make them playable.  Somewhere there has to be a way to flag which frequencies are available to it to output.   I'm guessing in one of the ALSA config files.
 
I have not been able to test if this works for me or not in Linux Mint 18, because - as it turns out - my library does not contain any high res music :p   I should find a demo or test file somewhere to play back and see what happens, but I haven't gotten around to it.
 
2.) If you are using a USB DAC, there are media players that can bypass the sound system all together and output directly to the USB DAC.   This can circumvent many of these types of problems.
 
Check out the other thread linked above.   I have found it very helpful.
 
Nov 29, 2016 at 11:46 AM Post #12 of 14
   
Two things I learned from the thread on the linux mint forums I linked above:
 
1.) In modern distributions  ALSA *SHOULD* be autodetecting the bit depth and frequency and outputting it to your DAC at the same as the source.  if it isn't, there may be configuration necessary.  it is possible ALSA is not aware that your DAC can support frequencies above 48khz, and it is thus downmixing them to make them playable.  Somewhere there has to be a way to flag which frequencies are available to it to output.   I'm guessing in one of the ALSA config files.
 
I have not been able to test if this works for me or not in Linux Mint 18, because - as it turns out - my library does not contain any high res music :p   I should find a demo or test file somewhere to play back and see what happens, but I haven't gotten around to it.
 
2.) If you are using a USB DAC, there are media players that can bypass the sound system all together and output directly to the USB DAC.   This can circumvent many of these types of problems.
 
Check out the other thread linked above.   I have found it very helpful.

Definitely bookmarked your thread link - will get to it soonest!
 
The players sound quite interesting, as that is how I circumvented the OS X on my Mac. Using a player would absolutely solve my issues, as nothing I stream (YouTube, Tidal) has a resolution higher than 44.1/48. And those resolutions are working perfectly!
 
Nov 29, 2016 at 11:54 AM Post #13 of 14
couple of suggestions to explore -- raspberry pi 3 running moode audio distro.  haven't used it but lots positive feedback out there.  usb out considered weak, so many people are adding a hifiberry digi+ to get coax out.  cost for both boards less than $100.
 
Feb 28, 2017 at 11:47 AM Post #14 of 14
so just my 0.02. I'm running Ubuntu 14.04 with a Magni 2 and Modi 2 Uber without issue. I changed a couple of parameters in the pulse audio config file for when I play Tidal hi-Fi through chrome. Otherwise, I use ALSA directly through gmusicbrowse bit perfectly. No issue playing 24 bit 192 khz music.
 

Users who are viewing this thread

Back
Top