# Bit Perfect Audio from Linux



## TheKisho

I've never got a very clear answer or understanding if it's posible to configure ALSA to output a bit perfect copy of a playing music file (as the only sound playing), no resampling or mixing for supported output sample rates and bit rates.  I wouldn't mind it to work like WASAPI in shared mode on Windows Vista and 7 (bit perfect until another application needs to play audio).  Would JACK help configure ALSA to do what I'm looking for?  What settings do I need to play with to get it do what I want?  How well does it resample (downsampling for sample rates and bit rates not supported by hardware) and/or how well does it mix down surround sound to stereo; and how well is the quality of the mixer compared to Windows, Mac, and other Linux (OSS,....) audio sub-systems mixers'?  I don't think a computer forum would understand bit perfect output or the point in bothering to set it up and configure it.  I think this is the best place for this question, I just hope there is some linux audiophiles in the house. (Even if what I want is shared/mixed mode depending if audio needs to be mixed together [Bit perfect the majority of the time]).  Thanks in the advance.
   
   
  P.S.  I'm not worried about audio delay/lag, long as the audio memory buffer doesn't have issues (aka keeping 0.25s-1s sound clips and playing back at random intervals randomly.  I've had that happened time to time on some slower linux machines when using audactiy. [only when the is no audio being outputed]).


----------



## Roseval

Quote: 





> I wouldn't mind it to work like WASAPI in shared mode on Windows Vista and 7 (bit perfect until another application needs to play audio).


 
Sorry but this not bit perfect by design.
In shared mode all audio is routed to the Win mixer and dithered.


----------



## Rizlaw

thekisho said:


> I've never got a very clear answer or understanding if it's posible to configure ALSA to output a bit perfect copy of a playing music file (as the only sound playing), no resampling or mixing for supported output sample rates and bit rates.  I wouldn't mind it to work like WASAPI in shared mode on Windows Vista and 7 (bit perfect until another application needs to play audio).  Would JACK help configure ALSA to do what I'm looking for?  What settings do I need to play with to get it do what I want?  How well does it resample (downsampling for sample rates and bit rates not supported by hardware) and/or how well does it mix down surround sound to stereo; and how well is the quality of the mixer compared to Windows, Mac, and other Linux (OSS,....) audio sub-systems mixers'?  I don't think a computer forum would understand bit perfect output or the point in bothering to set it up and configure it.  I think this is the best place for this question, I just hope there is some linux audiophiles in the house. (Even if what I want is shared/mixed mode depending if audio needs to be mixed together [Bit perfect the majority of the time]).  Thanks in the advance.
> 
> 
> P.S.  I'm not worried about audio delay/lag, long as the audio memory buffer doesn't have issues (aka keeping 0.25s-1s sound clips and playing back at random intervals randomly.  I've had that happened time to time on some slower linux machines when using audactiy. [only when the is no audio being outputed]).


 

 You can get bit-perfect audio from Linux without too much difficulty using ALSA. Most popular distributions of Linux (Ubuntu, Mint, Fedora, OpenSuse) to name but a few, use the Pulse Audio Sound Server which, by default, will mix all audio down to 16/44.1 or 48 for movies. Not good for 24/96 or higher. Those who want bit perfect audio in Linux need to bypass this "feature" 
	

	
	
		
		

		
			





.
  
 While I am no Linux guru, here are a few ways to do it using Ubuntu Linux, without removing Pulse Audio or hopefully resorting to the terminal/command line. All will yield excellent results:
  
 1. You need to install a music player that allows you to select certain ALSA settings. Each of my recommendations has pluses and minuses. IMO, the closest to perfection is "gmusicbrowser".  My 4 recommendations for top notch music players are:
  
      *DeaDBeef            *http://deadbeef.sourceforge.net/
      *Gmusicbrowser  *https://launchpad.net/~shimmerproject/+archive/ppa
*     Guayadeque        *http://sourceforge.net/projects/guayadeque/
*     Quod Libet*          https://code.google.com/p/quodlibet/
*    *
 2.  To get bit-perfect output from each of the above:
  
     *DeaDBeef*:  (a) Click on the *Edit* menu, then *Preferences*.
                        (b) In the Preferences window under "*Sound*" tab > "*Output plugin*" = "_*ALSA*_"
                                                                                                           "*Output device*" = "_*HDA Intel ALC889,*_
_*                                                                                                                                      IEC958, S/PDIF*_" 
  
                             NOTE: the "Output device" choice will depend on the type of sound card in your computer. It may be labeled differently from the one I have.                           
  
                        (c) In the same *Preferences* window select > *Plugins*
                             In the left column select "*Alsa Output Plugin*" and then click the "*Configure*" button
                             In the configuration window make sure that *ALSA resampling* is unchecked and that you place a *check* in box to "_*Release device when stopped*_".
  
 You are now done setting up DeaDBeeF for bit perfect playback.
  
     *Quod Libet*:  (a) click on the *Music *menu > *Preferences* > *Player *tab
                           (b) for the "*Output pipeline*" type "_*alsasink device=hw:0,1*_"  (omit quotes)
  
     *Gmusicbrowser:* see post 5 in this thread: http://www.head-fi.org/t/561961/bit-perfect-audio-from-linux#post_7596563
  
  
     *Guayadeque*:  (a) click on *Library* menu > *Preferences *and select "*Playback*" from left column
                             (b) for *Output device* = *ALSA* and in the white box to the right type "_*hw:0,1*_"  or "*plughw:0,1*" (omit quotes)
  
*PLEASE NOTE WELL:* in each case above, you will see that ALSA hardware device setting for the sound card is "hw:0,1". This is *usually* the case if you have one and only one sound card in your system. If you have more than one sound card, you should, if possible, remove or disable all sound cards but one you intend to use for audio output. Motherboard sound chips are usually disabled in the BIOS. If the above "hw:0,1" doesn't work for you, sorry, but you will have to open a terminal and type:
  
 Code: 





> aplay -l


 
  
 for a single sound card setup, this command (aplay -l) will display a result like:
  
 Code: 





> **** List of PLAYBACK Hardware Devices ****
> card 0: Intel [HDA Intel], device 0: ALC889 Analog [ALC889 Analog]
> Subdevices: 1/1
> Subdevice #0: subdevice #0
> ...


 
  
 The above output shows that my primary sound card is, card "0",  device "1" (written as:  "hw:0,1") for my digital S/PDIF output.
  
*Please read post 5, Notes 1 & 2 below for additional helpful info on using "aplay -l" for ALSA output.** http://www.head-fi.org/t/561961/bit-perfect-audio-from-linux#post_7596563*
  
 Also be aware that when using exclusive ALSA mode, *Gmusicbrowser, Guayadeque and DeaDBeeF* have one significant advantage over other players. When you stop playback with the "stop" button, you immediately have access to sound for other programs, like answering a Skype call. With other players (like Quod Libet), they take exclusive control of the audio (like Windows WASAP mode) and no other applications can use audio.
  
 This can also be done using the Linux *MPD* (Media Player Daemon) but it requires more work and file editing.


----------



## TheKisho

Quote: 





roseval said:


> Sorry but this not bit perfect by design.
> In shared mode all audio is routed to the Win mixer and dithered.


 
   
 Only when there is more than one program using the audio.  When one program like WinAmp (with plugins) or other program is using WASAPI in shared mode it's bit perfect until knocked into mixing another programs audio into the output (like a browser or VLC or something else), but will return to bit perfect once it's the only program using it.  In exclusive mode it disables all other audio steams but program which took exclusive control.  There has been verification.  That's why I use it in shared mode, but make sure there is no interruptions from other applications.  Well maybe I'm talking about non-exclusive mode of WASAPI and Shared mode is the name of when more than one audio stream is trying to access the audio output.  So I was lead to believe.  The person also use a DTS or AC/3 audio stream to prove that when it has to share with another applications active audio stream the decoder drops out during the two mixed audio streams.
   
   
  And thanks *Rizlaw*.  I'll check that out when I have time.  Is there anymore applications that you know of that can be configured in one way or another to do the above?  I probably should of mention that my favorite distro is Fedora (Gnome, .rpm), but that shouldn't change anything you discribed.  (Just application support at most).


----------



## Rizlaw

Yes. _*Gmusicbrowser*_ (also excellent). http://gmusicbrowser.org/
 Currently, my preferred music player in Linux.
  
 Once downloaded and installed, to set up _*Gmusicbrowser*_ for bit perfect playback:
  
 Click the *Main menu > Settings > Audio tab*
  
 In the *Audio tab* box make sure you have *ALSA *selected
  
 Click on the topmost *Advanced Settings* tab to the right, this will pop up a small window. In this window, if you like gapless playback you can check it off. Most importantly, in the *Alsa device* box make certain to add *hw:0,1*
  
 Do not enable enable any other features in this window. Close window.
  
*NOTE 1*: as I mentioned in post #3 above, if this setting is to work properly for you, you must check to see that your sound card actually is at *hw:1,0* . If you are not sure, use the command *aplay -l* in a terminal window to determine the correct setting for your sound card. Sometimes, when you have multiple sound devices in your computer (e.g. a video card with HDMI out; a plug in sound card and the sound chip on the Motherboard) a reboot of the OS will change the order of the device drivers for these devices. So, if the sound card you use was initially listed as *hw:1,0*, a reboot of the OS might change it to *hw:3,0*. When you try to play something you won't hear any sound or it will be coming from the wrong sound device. This happened to me frequently. To prevent your setting from changing: instead of using, for example, *hw:1,0* for the ALSA device, use the *name* of the device to permanently identify it to the OS, for example,  *hw:STX,0* (where "STX" is your Audigy STX sound card). The "name" does not change.
  
*Note 2*  below explains how this is done:
  
*NOTE 2*:
 Quote: powerhouse64   http://www.head-fi.org/t/561961/bit-perfect-audio-from-linux/360#post_12136621
   





> 1. Open a terminal and enter the following (copy & paste):
> 
> *aplay -l | awk -F \: '/,/{print $2}' | awk '{print $1}' | uniq*
> 
> ...


 
  
 Recently *Gmusicbrowser* added a nice "nowplaying" widget that you can place on your desktop which will show: transport control buttons, track title, artist, Album and Album art of the currently playing song. It's one of the nicest I've seen in Linux. It is enabled by doing the following:
  
*Main Menu > Settings > Plugins tab >*
 Put a check in the *"Desktop Widgets*" selection, then in the* Layout* window select "*Buttons, Song & Cover*" and click the *Add* button. This will pop up a control panel that will allow you to move the widget around on your desktop for placement.
  
 NOTE: if you are using Ubuntu 11.10 or higher, you will need to have the latest version of gmusicbrowser (1.1.9 deb) obtained here http://gmusicbrowser.org/devel.html
 and read this post: http://forum.gmusicbrowser.org/index.php?topic=469.msg2191 and https://github.com/squentin/gmusicbrowser/commit/3d75f91e33
  
  
 Recently, I started a thread on the Gmusicbrowser forum about enhancing this widget which you can read here: http://forum.gmusicbrowser.org/index.php?topic=536.0
  
 If you read and follow the post, you will obtain a "nowplaying" desktop widget that looks like the one below. It will only show the transport buttons (back, stop, play/pause, forward)  below the cover art, when you mouse over the cover art):


----------



## eimis

Quote: 





rizlaw said:


> You can get bit-perfect audio from Linux without too much difficulty using ALSA. Most popular distributions of Linux (Ubuntu, Mint, Fedora, OpenSuse) to name but a few, use the Pulse Audio Sound Server which, by default, will mix all audio down to 16/44.1 or 48 for movies. Not good for 24/96 or higher. Those who want bit perfect audio in Linux need to bypass this "feature"
> 
> 
> 
> ...


 

 I love you dude.


----------



## d1554573r

Linux audio is a mess, I mean there are many options to get perfect audio, but theres no out-of-the box setup 
  Another thing that increases confusion in this matter are people who fight in the sound system wars  the entire whats best pulse audio or alsa or even OSS4 subject - but most of those ppl are not even close to beeing an audiophile and hq - good sound definition to them includes good looking mixers and adding post-processing effects to audio like 3d sound so dont even bother reading those topics on ubuntu/debian/arch forums.
   
  I've fought with pulse audio, alsa and even OSS4 to get best sound possible. 
  Each of those sound systems has its pros and cons, but quality wise the best one out of the box is OSS4. 
  That said, OSS4 will make some applications freak out when set to default in system...
   
  But hopefully theres an option to achive even higher sound quality with alsa and jack. Jack in general is the linux alternative to ASIO (fto achive low latency it bypasses kernel mixing just like ASIO on windows) and its has nice server app. After installing JACK You just need to start sound server, set it like this:
   

   
  (I've highlighted with red important ones)
   
  This setup should output bit-perfect SD audio. (I cant do a null-test with my setup to check if it's 100% bit perfect but my ears feel fine with the reproduction quality )
   
  I recomend Audacious with JACK output plugin or using system wide sound capture to jack and then You can use whatever You like.
   
  You can use JACK with ALSA system wide by creating .asoundrc in Your home directory containing:
   
   
  # use this as default
  pcm.!default {
  type plug
  slave { pcm "jack" }
  }
   
  ctl.mixer0 {
  type hw
  card 1
  }
   
  # pcm type jack
  pcm.jack {
  type jack
  playback_ports {
  0 systemlayback_1
  1 systemlayback_2
  }
  capture_ports {
  0 system:capture_1
  1 system:capture_2
  }
  }


----------



## sulcata_geo

Another option is Voyage MPD.
   
  It is Debrin based MPD.
  The sound is very detailed and clear.
  Voyage MPD dosen't require machine power nor more strage size.
   
  cheeers


----------



## adamlau

OSS4 w/ vmix disabled is as close as you will get to BP audio out of a Linux box. Don't even consider ALSA/PulseAudio.


----------



## Henry Flower

Quote: 





adamlau said:


> Don't even consider ALSA/PulseAudio.


 


  Do.  ALSA's fine.  Pulse, with the settings you choose, is fine.  Just because you only know how to do it one way, that doesn't mean no-one should do it other ways.


----------



## storrgie

Quote: 





adamlau said:


> OSS4 w/ vmix disabled is as close as you will get to BP audio out of a Linux box. Don't even consider ALSA/PulseAudio.


 


  Can you provide some sort of substantiation to this claim? I find comments like this misleading and destructive.


----------



## storrgie

Quote: 





henry flower said:


> Do.  ALSA's fine.  Pulse, with the settings you choose, is fine.  Just because you only know how to do it one way, that doesn't mean no-one should do it other ways.


 


  I agree.


----------



## d1554573r

Since this post has preety high position @ google maybe You guys could describe Your ways just as I did this could be an intresting lecture for other people.


----------



## storrgie

The major reason I've not written how I set up MPD is because the documentation is actually quite good. Secondarily if you can learn how to use IRC, their channel usually has a couple people in it that know what they're talking about. 
   
  Instead of replicate that knowledge out here, we should push the knowledge back into their documentation.
   
  I would emplore people to try out MPD as their player of choice, more and more hifi manufactures are bundling this capability within their playback devices.


----------



## adamlau

I know how to do it both ways as any Linux user who is interested in improving/comparing means of audio fidelity should.   

  
  Quote: 





henry flower said:


> Do.  ALSA's fine.  Pulse, with the settings you choose, is fine.  Just because you only know how to do it one way, that doesn't mean no-one should do it other ways.


 


  Nothing outside of what I have tested and heard on my own systems. This is with and without mixer compiled out of alsa-lib. Compare the two audio subsystems for yourself and report back with your own results. If need be, you could also compare OSS4 vs. ALSA sonograms off the same audio file(s). Though perhaps I was a bit brash with my statement as the feature set of ALSA is quite complete thanks to active development ( @cladisch: Thanks for the Xonar contributions  )


  Quote: 





storrgie said:


> Can you provide some sort of substantiation to this claim? I find comments like this misleading and destructive.


----------



## cycler2

Thanks to all who have posted here; very informative.  I've tried Linux before (Mint 10, which was pretty friendly to this newb, and Ubuntu before that.  I abandoned Linux, because I couldn't find a way to get bit perfect playback.  This thread has rekindled my interest in trying Linux again.
   
  With Mint 10, I used it on a partition of my main drive and dual booted with Windows.  Worked pretty well, except when I removed the Mint partition I had to rebuild the MBR for Windows.  This time I'd like to just put my toe in the water and install Linux on a thumb drive and access my music library on either my internal drive or an external USB drive.  Has anyone here tried this?  If not, any thoughts on whether this will work?
   
  Thanks in advance for your advice.
   
  Rich


----------



## chickpea

Sorry if I'm resurrecting an old thread here, but I have a question:  Why can't you simply change the default sample rate in PulseAudio to 48000 Hz?
   
  It's a fairly trivial process:  just change the /home/$USER/.pulse/daemon.conf file.
   
  Easy to follow instructions can be found here http://www.ubuntugeek.com/howto-change-pulseaudio-sample-rate.html
   
  Please note, it's likely better to leave /etc/pulse/daemon.conf alone.  pulseaudio first looks in the /home/$USER/.pulse/daemon.conf for settings, then if none are found defaults to what is set in /etc/pulse/daemon.conf.
   
  This may cause some extra CPU load for resampling other (non 48 kHz) audio streams.  With a modern system, however, this should be trivial and not affect system performance.
   
  I realize that Pulse works on top of ALSA, so perhaps the answer is that ALSA does something to the audio stream itself?  A little more edumacation would be greatly appreciated.


----------



## our martin

i am about to build a gaming pc just waiting for the new ivy bridge and amd 7990 graphics card to come out..i thought about going down the linux route for my new build but they are not plug in and play and are really for recording music to a adat machine so i am opting for the beyerdynamic headzone game instead with a asus phoebus dolby home theatre 4 as the sound card.. i am a professional dj and when i am recording music i use a korg mr1000 which is one bit one touch recording records in the highest 24 bit setting and i use access virus keyboards and a reactable and 2 pioneer cdj2000s and nexus 900 midi with clear audio concept turntables and a macbook pro with record box adl dac through two krell s-150 monoblocks with bowers and wilkins pm1 speakers which sounds like it was done at abbey road studios it sounds that good!


----------



## PhoebeFairchild

I added the DeadBeef PPA to my Ubuntu 11.10 64 bit and I installed it. I configured it according to the directions and I am getting bit perfect playback. My .FLAC files sound just like the original CDs now that I have bit perfect audio playback. Thank you for the help. I was looking for something like this guide for a while.


----------



## andrix

Hi guys, 
   
  First of all I want to say a big THANK for the guidelines here about good player for linux. Then, as a linux user and as a very beginner audiophile I want to improve my sound quality including an USB Dac to my laptop. I don't want to spent a lot of money, just less than 100 USD, which adapter you recommend that works OK on linux & can give me a decent sound quality? My actual soundcard is an Intel, this one:
   card 0: PCH [HDA Intel PCH], device 0: STAC92xx Analog [STAC92xx Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
   
  Which recommendation can you give me? (I've seen than Fiio E7 and Asus Xonar are recommended a lot)
   
  Andres


----------



## PhoebeFairchild

I get good results with my HeadRoom Total BitHead, but it costs $150.00 USD. It's portable so you can take it anywhere with you. I can confirm that it works with Ubuntu 11.10 64 bit. Is this for a desktop or laptop PC? Which GNU/Linux distribution are you using?


----------



## soundlikes

My Audioengine D1 works flawlessly through USB on both my Lenovo E420 and old Compaq desktop with DeadBeaf. Oh yeah and I am using the Ubuntu Studio 64bit.


----------



## andrix

Hi, 
   
  I'm using Ubuntu 11.10 64bit on a HP dm4.
   
  Andres


----------



## PhoebeFairchild

Andrix:
   
  Then, you are looking for an external USB 2 DAC. You can usually find a used HeadRoom Total BitHead for about $105 - $115 USD. It produces good sound quality and you can use it with an Apple iPod Classic which can sync using Banshee or Clementine with .MP3 or AAC files. I recommend this solution for you to consider.


----------



## andrix

PhoebeFairchild:

 Cool, thanks! I'll take a look to those ones, the problem I'm in Uruguay and here is difficult to get hardware cheap.. . 
   
  Andrés


----------



## chickpea

Using Sabayon Linux x64 and e7 on a Sony Vaio VPCSB.  Works flawlessly, no configuration required, sounds great.


----------



## storrgie

Ibasso D7 sitting on my desk right now. best cheap XMOS based dac for the price that I have found. I'm very happy with it.
   
  Does 24-bit/192Khz via USB on ALSA


----------



## leomix88

You made my day!


----------



## skamp

storrgie said:


> Does 24-bit/192Khz via USB on ALSA




I'm surprised. Even the Benchmark DAC1 USB only supports up to 96kHz. Try listening to some 24/192 material, and run the following command in a terminal:


```
cat /proc/asound/card*/stream0
```

When I'm listening to CD audio, it looks like this (look at the "Momentary freq" line):


```
Burr-Brown from TI USB Audio DAC at usb-0000:00:1d.0-1.3, full speed : USB Audio

Playback:
 Status: Running
 Interface = 1
 Altset = 1
 URBs = 3 [ 8 8 8 ]
 Packet Size = 192
 Momentary freq = 44100 Hz (0x2c.199a)
 Interface 1
 Altset 1
 Format: S16_LE
 Channels: 2
 Endpoint: 2 OUT (ADAPTIVE)
 Rates: 32000, 44100, 48000
 Interface 1
 Altset 2
 Format: S16_LE
 Channels: 1
 Endpoint: 2 OUT (ADAPTIVE)
 Rates: 32000, 44100, 48000
```


----------



## corehun

hi,
   
  I tried, 
   
deadbeff with alsa output and disabled resampling for 24 bit 96 khz flac file
   
  when I type,
   
cat /proc/asound/card*/stream0 
   
I get
   
Momentary freq = 48000 Hz
   
then I tried qmusicbrowser with gstreamer alsa output for 24 bit 96 khz flac file
   
   
  when I type,
   
cat /proc/asound/card*/stream0 
   
I get
   
Playback: Status: Stopped and no Momentary freq
   
  so I understand deadbeef with alsa output is not bitperfect, right?
   
  and what is the reason that I cound't check qmusicbrowser, any suggestions?
   
  thanks.


----------



## skamp

corehun said:


> Momentary freq = 48000 Hz




What's your DAC? Post the entire output of "cat /proc/asound/card*/stream0" *while playing some music*. Pay attention to the "Rates:" line, it lists the supported sampling rates of your DAC.



corehun said:


> so I understand deadbeef with alsa output is not bitperfect, right?




You can have bitperfect output with deadbeef, deadbeef just isn't responsible for it. It depends on your system setup.


----------



## KimLaroux

Actually, you have to configure Deadbeef to output directly to the DAC without resampling.
   
  In deadbeef, go to Edit > Preferences. Under the Sound tab, select Alsa output plugin. Then select the right output, either Digital for SPDIF or "front speaker" of the correct DAC if USB. Then go to the DSP tab. Select the Resampler, then hit Remove. Restart Deadbeef and retest
   
  Note that if you're using SPDIF, you might not have the stream file. You can check using
   
  cat /proc/asound/card*/pcm*p/sub0/hw_params


----------



## corehun

my dac is hegel hd11 and supports 32, 44.1,48,96 khz (shown in rates line)
   
  "You can have bitperfect output with deadbeef, deadbeef just isn't responsible for it. It depends on your system setup."
   
how is it possible?


----------



## corehun

Quote: 





kimlaroux said:


> Actually, you have to configure Deadbeef to output directly to the DAC without resampling.
> 
> In deadbeef, go to Edit > Preferences. Under the Sound tab, select Alsa output plugin. Then select the right output, either Digital for SPDIF or "front speaker" of the correct DAC if USB. Then go to the DSP tab. Select the Resampler, then hit Remove. Restart Deadbeef and retest
> 
> ...


 
  thanks for the reply,
   
  I am using the usb connection and select default usb audio. so I need to change it to usb front speakers, right? doesnt matter if I set the resampler to 96 or dac default I still get Momentary freq = 48000 Hz. next time I' ll remove it and retest.


----------



## skamp

You're probably using a software mixer that resamples everything to 48 kHz, like ALSA's default "dmixer", or PulseAudio, or jackd or whatever. You have to set deadbeef to use the sound device directly. Try KimLaroux's suggestion.

Before software mixers, people were complaining they couldn't have two different applications playing sound at the same time. Now people complain that they can't get bit-perfect output!

I use a barebones setup without any software mixer, and control everything through /etc/asound.conf, so I'm afraid I won't be of much help.

See also Bit Perfect Audio from Linux.


----------



## KimLaroux

When you select "default" devices, the audio is routed trough Dmix. Dmix resamples everything to 48kHz. This is needed to mix different sound sources together. As Skamp said, Dmix was created so that all sounds are mixed together and sent to your audio device. Without it, only one application can send a stream to your DAC. So in order to by-pass Dmix, you have to find the right hardware output that sends the audio directly to your dac. Trial and error rarely fails me.
   
  This is Linux, you need to have a sense of adventure to really enjoy it. Gotta try things out, if not just to see what they do.


----------



## soundlikes

I agree on the "adventure" aspect of Linux usage 
	

	
	
		
		

		
		
	


	




 It can be very rewarding or make you want to throw your pc out the window !!! LOL


----------



## corehun

Thank you very much guys, it works fine with the front speaker selection 
   
  any idea for gmusicbrowser?


----------



## corehun

when gmusicbrowser playing (alsa output)
   
  I type "cat /proc/asound/card*/stream1" instead of "cat /proc/asound/card*/stream0" and I get Momentary freq = 48000 Hz so my guess is dmixer still works. So how can I disable the mixer?


----------



## joe_cool

If you want "everything" to work bit-perfect with Linux ALSA you can re-define the default device in ".asoundrc" (note this is a hidden ALSA control file in your home directory).
   
  For Via Envy24 and other cards that require S32_LE data:
   
  pcm.!default {
     type plug
     slave.pcm "hw:0,0"    # or whatever is needed, SPDIF is sometimes "hw:0,1"
 }
  
  For some other cards that support S24_LE (24-bit packed) data:
   
  pcm.!default {
     type hw
     card 0    # built-in device is usually "card0", add-in or USB may be "card1"
     device 0
 }
   
  ALSA control is complicated and may require some research on the part of the user.


----------



## d1554573r

Hi again guys!
   
  After nearly a year playing around with a different setups, it came out that the best sounding setup is one of the easiest ones. The only con is that it requires USB DAC accepting SPDIF signal (aka SPDIF over USB) works with most players (XBMC, Deadbeef).
  All You need is to remove any replaygain in those apps, plus select SPDIF output with software postprocesing off. (Select "SPDIF hw:{number of device}" as an output device)
  NOTE: use OSS4 or ALSA only. Remove pulse audio if You got it on Your system.
   
  I'll make a more detailed tutorial describing setup for XBMC and Deadbeef,
   
  This setup actually sounds so good that it made me certain that ASIO output in Foobar isn't bitperfect!
   
  EDIT: This thing has little harder about a year ago sine device decriptions appeared just recently, and not all distributions have it now, so if You dont have description with "direct hardware device without any software mixing" You need to choose it by device name, in order to do so open Terminal and type alsamixer, then hit F2 enter devices there, it will list available devices and there numbers. In order to select proper device choose correct number of device from the list with prefix iec958:CARD={device name},DEV={device number here}, also if u got mixer selection choose hw:{device number here}
   
IEC958 is anlternative name of SPDIF more common in linux.
   
  Additionaly most ppl claim that playing audio files buffored entirely into RAM without cashing to hard disk improves sound quality, It's hard to say for me becouse I dont use swap partition in linux at all (for real theres no purpose for using swap if You got more then 2 GB of ram on nix platforms, my ram usage is like 5% all the time and cashing to disk is horrible for performance in general)
   
  Another aspect in using PC as an audio source is the problem of power supply unit and mother board, now before someone will throw a stone in my direction --- none of those have an actual impact on bit steam send over to sound device, it impacts the jitter level produced in DAC! Best way to avoid this is to use separate power source for DAC, I use battery powered PSU myself, but if I had to choose betwen cheap PSU and power over USB I would go for USB power (I tried all those options and even though im audiophile mythos sceptic in most cases [biggest BS -- quality of digital cabels having impact on audio quality XD] I cant argue, that PSU thing works).


----------



## KimLaroux

Yeah I've been using SPDIF direct hardware device without any software mixing for a few months now. It's the most practical setup, if anything else.
   
  Though both Amarok and VLC are killing me these days. The gstreamer phonon backend I'm using with Amarok has a few major problems. First is, the random option is broken. It used to randomly play all tracks in a playlist, never repeating one, and stopping when they all have been played once. Now it forgets which were played, and repeats them. Even worse, in about one track in five, it get stuck in a "replay track" loop. Then there's the last.fm scrobbling. Many tracks are scrobbled twice, and there seems to be nothing that explains why some are scrobbled once and others twice. They even broke the notification service. Both system notifications and OSDs have the same problem: The current playing song is displayed twice, at the beginning and at the end of each track. This results in a flood of notifications, and just confuses the user... How did they manage to break such basic functions that worked flawlessly before?
   
  My guess is all of these problems are related, and are a side effect of their implementation of gapless playback. I'm really happy they finally brought gapless playback to Amarok, but in doing so they ruined the perfect random function, the scrobbler and the notifications. Switching to the VLC backend fixes all these issues, but you lose gapless playback.


----------



## d1554573r

I wonder what do You mean by gapless playback? If it's a crossfade effect, thats something that most of us diehards here try to avoid  after all its an additonal postprocessing 
   
  Anyway I would like to recommend You few alternatives to Your current media players (for real dont use VLC ), my pesonal favorites are in order: Deadbeef, Audacious (a perfect winamp clone) and XBMC.
   
  Btw do You also hear diffrence between SPDIF direct hardware device without any software mixing   and direct hardware device without any software mixing without SPDIF? 
Is it just me or SPDIF has more spacious sound plus better hights?


----------



## KimLaroux

I can't tell the difference between the filters and oversampling settings of my NFB-12, so no I can't see any difference between USB and SPDIF.
   
  I also have Aqualung installed, and have been using it for a while before gapless playback was brought to Amarok. I also tried Deadbeef and loved it, but there is no repositories for Ubuntu that feature the latest Deadbeef. I tried to compile it from source but gave up after fooling with dependencies for a few hours. I never tried Audacious, but I hate winamp, so I won't even try it.
   
  By gapless playback, I mean that there is no muted gap in between songs. Many albums have tracks that flow from one to the other, without silences in between tracks. Take for example Pink Floyd's "The Wall" album, which is basically just a single song that never ends. If you play the CD in a CD player, or the vinyl on a record player, you would have one continuous music experience that never stops. You can't even tell when you passed from one track to the other. Prior to 2.5.0, Amarok was unable to play the next track exactly when the current one ended. When a track ended, there was a pause with no music while Amarok fetched the next track from the hard drive and loaded it. This is a serious problem that ruins the experience of albums like The Wall.
   
  In 2.5.0, they finally brought gapless playback to Amarok. To do this, the player has to fetch the next track and load it _before_ the current track ends. You can see this happening in the logs:
   

```
About to finish Got next source. Waiting for end of current. New source: QUrl( "file:///home/kim/Music/FLAC/Pink Floyd/1979. The Wall/Disc 1/05 - Pink Floyd - Another Brick In The Wall (Part II).flac" ) Finally got a source Duration message Stream changed to file:///home/kim/Music/FLAC/Pink%20Floyd/1979.%20The%20Wall/Disc%201/05%20-%20Pink%20Floyd%20-%20Another%20Brick%20In%20The%20Wall%20%28Part%20II%29.flac HTTP POST: QUrl( "http://post2.audioscrobbler.com:80/protocol_1.2" ) "[...]" HTTP POST: QUrl( "http://post.audioscrobbler.com:80/np_1.2" ) "[...]" "OK" Stream changed to file:///home/kim/Music/FLAC/Pink%20Floyd/1979.%20The%20Wall/Disc%201/05%20-%20Pink%20Floyd%20-%20Another%20Brick%20In%20The%20Wall%20%28Part%20II%29.flac "OK" About to finish Got next source. Waiting for end of current. New source: QUrl( "file:///home/kim/Music/FLAC/Pink Floyd/1979. The Wall/Disc 1/06 - Pink Floyd - Mother.flac" ) Finally got a source Duration message Stream changed to file:///home/kim/Music/FLAC/Pink%20Floyd/1979.%20The%20Wall/Disc%201/06%20-%20Pink%20Floyd%20-%20Mother.flac HTTP POST: QUrl( "http://post2.audioscrobbler.com:80/protocol_1.2" ) "[...]" HTTP POST: QUrl( "http://post.audioscrobbler.com:80/np_1.2" ) "[...]" Stream changed to file:///home/kim/Music/FLAC/Pink%20Floyd/1979.%20The%20Wall/Disc%201/06%20-%20Pink%20Floyd%20-%20Mother.flac "OK" "OK"
```
   
  This is just one way to do it. One problem is lossy formats like MP3 usually introduce "padding" at the beginning and end of each track, which are samples of silence. This is why iTunes has to scan the library to read each tracks, building a database of the padding to know how many samples to cut in order to have gapless playbak. I don't know if Amarok has a way to handle padding, but so far I have heard no gap even on MP3s. Most of my library is FLAC, which has no padding problem. MP3s encoded with LAME, which is the encoder I use, have information in their headers telling exactly where the music starts. If Amarok reads this information, it could explain why I have no issues with my MP3s. I'll have to try it to make sure and report back.
   
  So no, real gapless playback is not crossfade. I was not talking about "Fade on Stop".


----------



## d1554573r

Heh, I guess You made it clear enough now  I had no such problem with deadbeef, nor with xbmc.
   
  About Deadbeef, the major con for me right now is the lack of support for plugins in 64 bit version, I mean we can compile them on our own but I've runed into the same problems You did.
  PPA builds arnt bad though.
   
  https://launchpad.net/~alexey-smirnov/+archive/deadbeef
   
  If You really want the latest ones install deb packages from their repository 
   
  http://sourceforge.net/projects/deadbeef/files/debian/0.5.5/
   
  Don't worry about the fact that this package was made for debian, Ubuntu is just a fork of debian after all, Ubuntu made debs will most likely not run on debian system but it works other way around nicely 
   
  Additionaly I've found an extremely detailed tutorial about bitperfect audio, even though it was made for windows and describes configuration for a lot of media players it also describes most common problems related to PC audio and propeses few sollutions, such as loading files to RAm for playback, droping buffer to lowest possible value etc.
   
  Unfrortunatly for most of ppl here its written in Polish.
   
  http://audiomagic.pl/pdf/PC_ART1.pdf
   
  Another tutorial this time in English was made by cambride audio, focuses on windows but gives some insight into DAC's in general:
   
  http://www.cambridgeaudio.com/assets/documents/Audiophiles_guide_to_bit_perfect_USB_Audio_October_2011.pdf


----------



## KimLaroux

I just visited DeaDBeeF's website and noticed they now have .deb for ubuntu, even for 64 bit. They didn't have those last time I visited. I downloaded it and it installed itself without a scratch. Everything works out of the box. I'm running Kubuntu 12.04 amd_64.
   
  Even better, they now have stand alone binaries with all the dependencies and plugins built in! I didn't try it as using the .deb is cleaner, but still. It's a good thing they officially maintain those builds, as it lets anyone just download the player and run it on any Linux distribution without the headache of compiling it.
   
  I tried to install the Debian .deb last time, but it didn't work. It was simply not compatible with Ubuntu.
   
  Those files seems nice, but not very useful. I'd love one in English and written for Linux audio. I'd really like to know what the size of the buffer and the period does, and if it changes anything to the music stream.


----------



## d1554573r

About Audacious, the winamp interface isn't it's default UI, normaly it looks like deadbeef or gmusicbrowser with its GTK ui  
  Take it for a spin  it's much more advanced than deadbeef.


----------



## ronalde

_UPDATE 2013-11-05_: made commands more robust and applicable to S24_3LE as well as S32_LE formats. Updated the link to the newer and simpler article. 
  
 Quote:


skamp said:


> What's your DAC? Post the entire output of "cat /proc/asound/card*/stream0" *while playing some music*. Pay attention to the "Rates:" line, it lists the supported sampling rates of your DAC.
> You can have bitperfect output with deadbeef, deadbeef just isn't responsible for it. It depends on your system setup.


 
  
 An easy way to determine which alsa stream to watch is by grepping the desired format recursively in /proc/asound while playing a 24bit file, like this:
  

```
egrep -R 'S(24|32)' /proc/asound/card[0-9]
```
  
 In my case it returns ...
  

```
/proc/asound/card0/stream0:    Format: S32_LE /proc/asound/card0/pcm0p/sub0/hw_params:format: S32_LE
```
  
 ... point to the same alsa device (a Pink Faun 2 USB DAC).
  
 If you have just one alsa card (capable of playing the specified format) you could combine this in one command:
  

```
hdcard=$(egrep -m 1 -R 'S(24|32)' /proc/asound/card[0-9] | awk '{ print $1}' | sed 's/://') watch -n 1 "cat $hdcard"
```
  
 In the article "How to turn Music Player Daemon (mpd) into an audiophile music player" I wrote this year I have some additional pointers about analyzing your cards capabilities and your alsa configuration.
  
 Enjoy!


----------



## ronalde

UPDATE: 2011-11-05: Updated link to Pulseaudio bug, which page doesn't exist anymore.
  
 Quote:


chickpea said:


> Sorry if I'm resurrecting an old thread here, but I have a question:  Why can't you simply change the default sample rate in PulseAudio to 48000 Hz?
> .... I realize that Pulse works on top of ALSA, so perhaps the answer is that ALSA does something to the audio stream itself?  A little more edumacation would be greatly appreciated.


 
  
 Default _pulseaudio_ with _alsa_ configurations perform on the fly _bit depth_ and _sample rate conversion_ for ensuring a pop and crackle free “plug-n-play” experience (see pulseaudio ticket #930: Media players report 96khz, proc reports 44khz)
  
 When you force Pulseaudio to a certain (fixed) bitrate, pulseaudio actually tells alsa to do cheap and dirty sample rate conversion. Technically speaking, pulseaudio uses the software interface to alsa (`hwplug:x,y`) instead of the bare hardware interface (`hw:x,y`).
  
 The only way to get bit perfect audio is to disable pulseaudio and configure your music player to use the alsa hardware interface (`hw:x,y`). Of course only the first application to use this interface has exclusive access to it.
  
 Cheers,
 Ronald


----------



## KimLaroux

The first thing I do when I install a fresh Linux OS is purge PulseAudio. I then configure my music players to use the direct hardware devices. I add a line in .asoundrc to tell Alsa to use the best sample rate converter when conversion is needed. I leave the "default" audio device to my sound card. The nice thing about this setup, is that you can have music playing trough your external DAC, but other audio will still play trough your sound card. So I can use my speakers to play music while watching a Youtube video and having the Youtube audio going out my laptop's speakers.
   
  I was quite impressed when I learned that Alsa could handle two different audio streams without mixing them together.
   
  How do you know if the bit depth (and overall format) is kept the same from the audio file to the DAC? I never figured how to even tell which format a .flac or .mp3 is formatted as.


----------



## ronalde

UPDATE 2013-11-05: replaced `file' command with `soxi' command
  
 Quote:


kimlaroux said:


> The first thing I do when I install a fresh Linux OS is purge PulseAudio.


 

 Purging Pulseaudio on a modern Linux system can cause all kinds of troubles; my advice is to disable it using the config files.
  


> I then configure my music players to use the direct hardware devices. I add a line in .asoundrc to tell Alsa to use the best sample rate converter when conversion is needed. I leave the "default" audio device to my sound card. The nice thing about this setup, is that you can have music playing trough your external DAC ...


 
  
 My goal was to bypass any conversion done in software. You could achieve that by specifying a `hw:x,y` interface for your (music playing) external USB DAC and point your music playing software to that hardware interface.
  
 Then configure a `hwplug:x,y` interface for a second sound card, for example the one embedded on your motherboard. Stack pulseaudio on this second alsa interface and point your desktop managers sound configuration to that.
  
 This way you combine a dedicated high quality hardware interface for your beloved music and a 'normal' plug-n-play experience for all other sound.
  
  


> How do you know if the bit depth (and overall format) is kept the same from the audio file to the DAC?


 
  
 See   my previous reply in this thread on how to watch `/proc/asound`; it tells you what alsa sends to your sound card (USB DAC).
  
  


> I never figured how to even tell which format a .flac or .mp3 is formatted as.


 
  
 The easiest way is to use the `soxi' command in a terminal (part of the `sox' package), like this:
  

```
$ soxi Wayne\ Shorter\ -\ Speak\ No\ Evil/01\ Witch\ Hunt.flac Input File     : 'Wayne Shorter - Speak No Evil/01 Witch Hunt.flac' Channels       : 2 Sample Rate    : 96000 Precision      : 24-bit Duration       : 00:08:09.68 = 47009525 samples ~ 36726.2 CDDA sectors File Size      : 189M Bit Rate       : 3.09M Sample Encoding: 24-bit FLAC Comments ...
```
  
  
 Another obvious way is to use your file manager. In Ubuntu Precise when you right click on a music file and choose 'Properties' nautilus displays a 'Audio' tab with the details of the music file.
  
 Cheers,
 Ronald


----------



## Misconstruction

thanks for a nice guide:
   
  When i add the hw:0,1 to gmusicplayer, i get an error when trying to play files. (line 135)
   
  Any ideas why?
   
  i'm using a USB dac


----------



## Rizlaw

Quote: 





misconstruction said:


> thanks for a nice guide:
> 
> When i add the hw:0,1 to gmusicplayer, i get an error when trying to play files. (line 135)
> 
> ...


 
  First, have you made sure, using the command: aplay -l     that hw:0,1 is the correct setting for the sound device you are trying to use? If you can't playing anything, then I'm guessing you have the wrong setting. If it plays some tracks and then randomly stops then read on.
   
  I have 3 sound devices on my system: onboard sound (BIOS disabled); Xonar STX (hw:0,1) and a USB to Spdif Audiophilleo 2 (hw:2,0). My primary sound device, the Audiophilleo 2, gives me the same occasional error (the error message is a little more verbose than just "135", but right now I can't recall the exact wording). I believe this is a bug in gmusicbrowser.  Usually, for me, just clicking through the error message starts the next track playing. I posted this bug on the gmusicbrowser forum quite some time ago. As I recall, the author of gmusicbrowser (a very nice and helpful individual) had no idea why it happens and felt it was a gstreamer error. I tend to disagree, since no other player I use exhibits a similar problem (Quod Libet or Deadbeef). It also seems that the error only happens when you enable gmusicbrowser's gstreamer "Advanced settings" > ALSA device = hw:x,x.
   
  If you are using a recent version of Ubuntu or Mint, the error should not prevent you from using gmusicbrowser, provided you are not trying to play another audio stream at the same time. For example, trying to play a YouTube audio/video file while gmusicbrowser is in "Play" or "Pause" mode. "Stop" would be OK, as this mode temporarilly releases the exclusive ALSA hardware connection between gmusicbrowser and ALSA freeing you to temporarilly play another stream in your browser. I do this occasionally when surfing the web. However, I've found that it can also lead to the error you encountered when resuming gmusicbrowser audio playback (pressing "play" after a "stop").
   
  If the error is causing you too much grief, I suggest removing the ALSA direct hardware setting (hw:x,x) and using gmusicbrowser via PulseAudio. Or, you can switch to Quod Libet for similar functionality and not get the error. Same for Deadbeef.


----------



## Misconstruction

Thank you for your swift response!
   
  First of all, here's the full error message:
   
  Playing error : Configured audiosink alsa is not working. at /usr/bin/../share/gmusicbrowser/gmusicbrowser_gstreamer-0.10.pm line 135.
   
  adding the hw:0,1, does change the configuration shown in aplay -l (as you described it should):
   
   
  **** List of PLAYBACK Hardware Devices ****
  card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  card 1: Audio [NAD USB Audio], device 0: USB Audio [USB Audio]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
   
   
  It's the same problem for every single track and persists with or without youtube or any other programs open.
   
  The NAD DAC should be capable of up to 24/96.


----------



## Anda

If you want to use "NAD USB Audio", you have to use hw:1,0 which is card 1, device 0.


----------



## Misconstruction

Quote: 





anda said:


> If you want to use "NAD USB Audio", you have to use hw:1,0 which is card 1, device 0.


 
   
  Doing that gives,
   
   
  **** List of PLAYBACK Hardware Devices ****
  card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  card 1: Audio [NAD USB Audio], device 0: USB Audio [USB Audio]
    Subdevices: 0/1
    Subdevice #0: subdevice #0
   
  Is it correctly configured? Sound is coming out the speakers!


----------



## Rizlaw

You haven't mentioned what Linux distro you are using, so I am assuming it's Ubuntu or a derivative.
  You have confirmed your USB sound device is hw:1,0 and NOT hw:0,1 as you originally thought and that, now, you do get sound out of the speakers. From you last post it's not clear (at least to me) whether the sound is (a) music playing from gmusicbrowser and (b) whether the error message persists. If the answers to a and b are yes, then:
   
  1. Have you tried what I suggested before: setting up the _*Quod Libet*_ player with "alsasink device=hw:1,0"?  I outline how to do it in the 3rd post in this thread. It should work without any errors and confirm that you can get bit perfect audio output to your USB dac.
   
  2. Have you tried downloading and installing the latest development version of gmusicbrowser (1.1.9 deb for debian/ubuntu): http://gmusicbrowser.org/devel.html
   
  Version 1.1.9 fixes several issues which may be contributing to your problem. If you're not using a Debian distro, then download one of the other packages on the page applicable to your distro.
   
  3. You should also double check that any unneeded motherboard audio chip is disabled in your BIOS.


----------



## Migou67

For me now the easy way in my Kubuntu 12.04 is to use Clementine and select Audio sink (ALSA) and use in my case hw:2,0 for the output device.
  Unselect Cross Fade when changing tracks manually to avoid errors and reduce the buffer duration to 1200 ms.
   
  This is the result with my iBasso D7 :
*cat /proc/asound/card2/stream0*
 XMOS XMOS USB Audio 2.0 at usb-0000:00:0b.1-2.3, high speed : USB Audio
 Playback:
   Status: Running
     Interface = 1
     Altset = 1
     URBs = 2 [ 46 46 ]
     Packet Size = 1024
     Momentary freq = 192011 Hz (0x18.0058)
     Feedback Format = 16.16
   Interface 1
     Altset 1
     Format: S32_LE
     Channels: 2
     Endpoint: 1 OUT (ASYNC)
     Rates: 44100, 48000, 88200, 96000, 176400, 192000
     Data packet interval: 125 us
   
  To find the hardware audio card, if you have more than one device, use alsa mixer in a terminal :


----------



## gustmahler

Quote: 





> In deadbeef, go to Edit > Preferences. Under the Sound tab, select Alsa output plugin. Then select the right output, either Digital for SPDIF or "front speaker" of the correct DAC if USB. Then go to the DSP tab. Select the Resampler, then hit Remove. Restart Deadbeef and retest


 
   
   
  I was using Deadbeef for while now and thought I did it to Bit Perfect settings. Using Alsa / USB CODEC USB AUDIO IEC956 S/PDIF output to my DAC. I also set the Alsa plugin to not use ALSA resampling. I never worried about the DSP tab. Now after reading the post from Kim Laroux quoted above, I removed the Resampler (Secret Rabbit Code) and restarted. Unfortunately all my HD 24kbit 88200Hz music files play now half velocity. So this means what got out before was not Bit Perfect, because it had to go through the Resampler. Well, I am confused. Can anyone help?


----------



## Rizlaw

Quote: 





gustmahler said:


> I was using Deadbeef for while now and thought I did it to Bit Perfect settings. Using Alsa / USB CODEC USB AUDIO IEC956 S/PDIF output to my DAC. I also set the Alsa plugin to not use ALSA resampling. I never worried about the DSP tab. Now after reading the post from Kim Laroux quoted above, I removed the Resampler (Secret Rabbit Code) and restarted. Unfortunately all my HD 24kbit 88200Hz music files play now half velocity. So this means what got out before was not Bit Perfect, because it had to go through the Resampler. Well, I am confused. Can anyone help?


 
  I just ran a test. By default deadbeef includes "SuperEQ" and the "Secret Rabbit Code Resampler" in the DSP list, but if you don't use them, I don't believe they have any effect on the output. They certainly didn't for me. When I removed them (for the test) from the DSP list, and played 16/44.1 and 24/96 files back to back, my W4S DAC-2 automatically switched from 44.1 to 96 without missing a beat. I'm wondering, did you activate Resampling or EQ before you deleted them as per the post you referred to above from Kim Laroux? If you did, perhaps a setting in some deadbeef config file was changed which is causing the problem, now that you have removed Resampling and EQ. Also, I'm not sure what you mean by writing that your files now play back at "half velocity". I suspect you mean that the sampling rate is no longer 88.2k but 44.1k on playback?
   
  Your specific USB device should be listed in the list of output devices seen by deadbeef. For example, my Audiophileo 2 has several possible choices. The one highlighted in blue is my active selection. You may have to experiment to find the right selection. Perhaps that's your only problem. Unfortunately, deadbeef is a little light on helpful documentation.


----------



## MrSlim

Since reading these threads, I thought I would look into my own config a bit more.  I decided to give Lubuntu a try since it leaves Pulse audio out of the base distro. I was able to get it set up and playing without resampling with DeadBeef (44.1K file in, 44.1K  output shown in   /proc/asound /card1/pcm0p/sub0/hw_params).  Now, not content to leave well enough alone, I've re-installed Lubuntu 64bit, and I can't get back to that point. Here's my config:
   
   
  @linux-dt:~$ aplay -l
  **** List of PLAYBACK Hardware Devices ****
  card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  card 1: USB [E-MU 0204 | USB], device 0: USB Audio [USB Audio]
    Subdevices: 0/1
    Subdevice #0: subdevice #0
   
   @linux-dt:~$ cat /etc/asound.conf 
  defaults.ctl.card 1
  defaults.pcm.card 1
  defaults.timer.card 1
   (to use the E-MU 0204 as default)
   
  Using the DeadBeef config as an example (gmusicbrowser gives the same result), 
  (with ALSA resampling turned off, and the resampler deleted from DSP), the sound is ok if I select  "E-MU 0204 Default Audio Device" as the output dev, but I see that it is being resampled :
   
   @linux-dt:~$ cat /proc/asound/card1/pcm0p/sub0/hw_params 
  access: MMAP_INTERLEAVED
  format: S24_3LE
  subformat: STD
  channels: 2
  rate: 48000 (48000/1)
  period_size: 1024
  buffer_size: 16384
   

  If I select "Front Speakers" or "Direct Hardware without any conversions" I can see that it is not being re-sampled: (BUT)....
   
   @linux-dt:~$ cat /proc/asound/card1/pcm0p/sub0/hw_params 
  access: RW_INTERLEAVED
  format: S24_3LE
  subformat: STD
  channels: 2
  rate: 44100 (44100/1)
  period_size: 1024
  buffer_size: 8192
   
  The but is that the sound is distorted/static/slow...  like something is being intermodulated with it?  
  I did notice this as I was sorting it out originally(on 32bit), but didn't take a note of what I did, and I thought adding the /etc/asound.conf config was what solved it the first time..
   
  Any Ideas would be appreciated.. 

   

  JD


----------



## KimLaroux

What if you don't use /etc/asound.conf this time around? I've been using Kubuntu 64 bits for a few years now and never had to use it. I actually didn't even know this file existed. I always use ~.asoundrc to configure alsa.
   
  Do you get the same weird sound with another program, or just DeadBeef?
   
  Maybe I'll get a USB cable and try your setting, see if I can replicate. If it's a bug with the EMU, there might be documentation about it on the ALSA wiki.


----------



## gustmahler

Quote: 





rizlaw said:


> I'm not sure what you mean by writing that your files now play back at "half velocity". I suspect you mean that the sampling rate is no longer 88.2k but 44.1k on playback?


 
   
  Hello Rizlaw
   
  This is meant literally: When I delete Resampling from the DSP list, music plays half velocity (everything plays lower and slower).


----------



## gustmahler

Quote: 





rizlaw said:


> I'm wondering, did you activate Resampling or EQ before you deleted them as per the post you referred to above from Kim Laroux? If you did, perhaps a setting in some deadbeef config file was changed which is causing the problem, now that you have removed Resampling and EQ.


 
   
  Rizlaw,
  No, I did not change them. I did not even know that they are there, never looked into DSP before.


----------



## TwinQY

I can confirm that the half velocity speed thing happens with some DACs on my deadbeef setup, namely portable stuff. I just set the card back to default settings with_ _alsactl init card*. It shouldn't happen if you have either the Resampling DSP or ALSA resampling enabled. Both must be disabled to reproduce this. It seems to happen whenever I repeatedly switch from a 96K or a 192K back to something lower, and back again. Strangely, my DAC1 has never had this happen.


----------



## Rizlaw

Quote: 





gustmahler said:


> Rizlaw,
> No, I did not change them. I did not even know that they are there, never looked into DSP before.


 
   
  OK, I understand. TwinQY in post # 65 above confirms the problem occurs with some portable DACs:
   
  Quote: 





> I can confirm that the half velocity speed thing happens with some DACs on my deadbeef setup, namely portable stuff. . . . Strangely, my DAC1 has never had this happen.


 
   
  Perhaps your Creative E-Mu is the issue?  As I noted before, whether I had "Resampler" in the deadbeef DSP section or not, I did not experience your problem. This suggests, to me, that the issue may lie with your DAC and how it is handling the bits received. One way to determine if it's your DAC, is to try a different external DAC.
   
  To the best of my knowledge, direct hardware ALSA playback (i.e., hw:x,x) bypasses all mixers. Therefore, another suggestion for troubleshooting your issue: install the latest version of _*Quodlibet*_: https://code.google.com/p/quodlibet/
   
   


> *Quod Libet*:   (a) click on the *Music* menu > *Preferences* > *Player* tab
> (b) for the "*Output pipeline*" type "_*alsasink device=hw:x,x*_"
> (omit quotes and substitute your sound device's numbers for "x,x". If needed, use command "aplay -l" from a terminal to find your sound device's "x,x" settings)


 
  I've found that if you haven't altered your distro's basic installed sound system (i.e., removed Pulse Audio, modified ALSA config files, etc.), and your sound card is properly recognized by Linux, quodlibet, set to ALSA hardware direct output works to provide "bit perfect output".
   
  Quote:http://thewelltemperedcomputer.com/KB/BitPerfect.htm 





> Most of the time bit perfect playback refers to the absence of any type of DSP (Digital Signal Processing) like volume control, sample rate conversion, dither, etc.
> 
> True bit perfect playback is sending the audio file unaltered to the audio device.
> Bit depth, sample rate, number of channels and the format should remain unaltered.
> ...


----------



## MrSlim

Quote: 





kimlaroux said:


> What if you don't use /etc/asound.conf this time around? I've been using Kubuntu 64 bits for a few years now and never had to use it. I actually didn't even know this file existed. I always use ~.asoundrc to configure alsa.
> 
> Do you get the same weird sound with another program, or just DeadBeef?
> 
> Maybe I'll get a USB cable and try your setting, see if I can replicate. If it's a bug with the EMU, there might be documentation about it on the ALSA wiki.


 
   
  Gmusicbrowser was doing the same thing...

 Well, that seems to have solved the problem, but it didn't work right away which was weird..  I renamed asound.conf and then rebooted, just to make sure. After the reboot I tried DeadBeef and it was doing the same thing, so I tried gmusicbrowser, and it worked, using hw:1,0, and I could see that the sample rate was correct on the output..  Then I tried DeadBeef and it worked too..  so problem solved, not sure why the lingering problem.. but Thanks!


----------



## Rizlaw

Quote: 





mrslim said:


> Gmusicbrowser was doing the same thing...
> 
> Well, that seems to have solved the problem, but it didn't work right away which was weird..  I renamed asound.conf and then rebooted, just to make sure. After the reboot I tried DeadBeef and it was doing the same thing, so I tried gmusicbrowser, and it worked, using hw:1,0, and I could see that the sample rate was correct on the output..  Then I tried DeadBeef and it worked too..  so problem solved, not sure why the lingering problem.. but Thanks!


 
  Contrary to what many think, quickly rebooting a computer does not completely wipe DRAM memory of what your OS was running. DRAM does retain information for some time after a power down and certainly after a reboot which normally does not involve a power down. I recall a few years back some security researchers demonstrated how sensitive data could be recovered from computers that were shut down, if one could quickly freeze the memory and run some security tools to recover data most would have thought gone after a power down. Here's an article about it: http://www.zdnet.com/blog/security/cryogenically-frozen-ram-bypasses-all-disk-encryption-methods/900
   
  I've found, in situations like yours where I've change a setting in the OS, then performed a quick reboot that the change, although present, didn't always work right away. But, a shutdown for several minutes fully cleared memory and a restart correctly picked up the change and everything was back to normal. This is also why Cable Modem Techs will always recommend completely removing AC power from a cable modem to clear a problem.  IMO, I think you experienced the same thing. Good to hear everything is working again.


----------



## gustmahler

Rizlaw: Thank you very much. 
   
  I am using a Beresford Caiman DAC, connected by USB. I had to look up the number from Terminal, it found three outputs, from all the the numbers provided, I suppose x,x means "card no.","device no.", which for USB is 2,0
   
  So I installed Quod Libet and set 
*Output pipeline*" type "_*alsasink device=hw:2,0*_"
   
  This worked. I got the audio on my equipment. Quod Libet is a very nice player. Thank you for the tip. The only thing I miss is, it to tell me what hz/bit it is actually playing. Is there no option for that?
   
  Now I still do not know what went wrong in Deadbeef, as it seems it is not the DAC's fault, if Quod Libet really is playing 88200/24.
   
  Thanks


----------



## Rizlaw

Quote: 





gustmahler said:


> Rizlaw: Thank you very much.
> 
> I am using a Beresford Caiman DAC, connected by USB. I had to look up the number from Terminal, it found three outputs, from all the the numbers provided, I suppose x,x means "card no.","device no.", which for USB is 2,0
> 
> ...


 
   
  I'm glad to hear you got *Quodlibet* to work.
   
   
  Quote: 





> Originally Posted by *gustmahler*
> 
> 
> 
> ...




   
  If you're unwilling to believe the read out of you DAC and really concerned about double checking *quodlibet* for bit perfect playback, you can try this:
   
  Quote:http://thewelltemperedcomputer.com/KB/BitPerfect.htm 





> Testing bit perfect playback  Either you believe you have your configured your system right or you proof it.
> This can be done by playing a file.
> Record the digital out of your sound device.
> Load both the original and the recorded file in an audio editor.
> ...


 
   
   
   
  Quote: 





> Originally Posted by *gustmahler*
> 
> 
> 
> The only thing I miss is, it to tell me what hz/bit it is actually playing. Is there no option for that?


 
   
   
  Unfortunately, each Linux music player seems to be missing one or two features that are found in the other players. Each development/design team seems to have different ideas of what a player should have in terms of features. In *Quodlibet's* case, there is no plug-in, for displaying real time file info like bitrate and sampling frequency (_a la_* deadbeef*). It's also missing a spectrum analyzer (_a la_ *Guayadeque* - another excellent player) and it has no super terrific "now playing" feature _a la_ *gmusicbrowser*. Although the last item can be made up for by using* Conky*.
   
  As for your continuing deadbeef issue, have you tried removing the deadbeef config files?
  Open Nautilus, simultaneously press the "Ctl" and "H" keys to reveal hidden "dot" files/folders and navigate to:



> /home/.config/deadbeef


 
  You should see two folders and three files (config, dspconfig and socket) in the /deadbeef folder. Try temporarilly moving the 3 files to your trash bin, shut down your computer for about 1 minute to fully clear DRAM. Restart your computer and open deadbeef, it should re-create the 3 missing files with default settings. Select your DAC as before and see if it works. You should NOT have to touch anything in the DSP folder. If it doesn't work, restore the 3 files from the trash bin or perform a complete uninstall of deadbeef with Synaptic Package Manager. Note that a complete uninstall, like Windows, doesn't always uninstall the config files, so you should double check that the uninstall also removed the deadbeef folder from the above indicated location in your /home folder. You can then opt to reinstall deadbeef or stay with Quodlibet or some other player that appeals to you.


----------



## gustmahler

Thank you Rizlaw. I will try Deadbeef after removing the config file.
   
  The problem is, the Beresford DAC has no display. As far as a read out by ear is possible, yes I believe I have a more intense listening experience now. A better way to tell may be that HD files are playing much louder now - I suppose that should be the case with 24bit audio.
   
  Telling by sound quality is often difficult. Because a 24/88,2 HD audio file does not tell you how good the recording equipment and setting was. It is often surprising how good a standard audio CD can sound, if a well playing orchestra is recorded properly. Most CD's lack the one or the other or even both and of course this does not sound better with whatever high bit and sampling rate


----------



## Rizlaw

Quote: 





gustmahler said:


> . . . . A better way to tell may be that HD files are playing much louder now - I suppose that should be the case with 24bit audio. . . .


 
  In my own experience, I haven't found 16 bit and 24 bit audio files of the exact same recording to have noticeably different recording levels. I'm sure different masterings of the same recording can and do make a difference. I have noticed, in some cases, that 24 bit files of pieces tend to be quieter and more resolved than their identical 16 bit counterparts. However, most of the time, I'm simply not that impressed by most "hi-rez"  music I buy from places like_ HDTracks_ and _Classics On Line_.  However, given the way you originally described your problem, I can understand why it would now seem "louder".


----------



## Jonas Kienitz

You really helped me  Thanks a lot!!!


----------



## Hark3n

Howdy people,
   
  Just a quick rundown of my experience with Linux audio.
   
  Short version: A ******** mess.
   
  Long version:
   
  I've been running Linux for a good couple of years now. Mainly Kubuntu, but have dabbled in some other flavours. Anyway, recently I started to get the audiophile itch again, and this time simply decided to scratch. Bought myself a pair of HD439's and a FiiO E10. Yes, tight budget.
   
  So, seeing that I use Linux, I started to peruse a couple of sites to find out how I can decent sound from Linux. Obviously this thread has been super helpful.
   
  So, I finally have bit-perfect audio caressing my ears. I'm now balder than when I started this exercise, but it work.
   
  OK, what I did.
   
  First off, PulseAudio is nice, on the surface, but between last night and this morning it just simply decided that my E10 is not a valid device anymore. Tried everything, but only silence eminated from my headphones.
   
  ALSA seems to be the best option for decent audio on Linux. I uninstalled PulseAudio and reverted to pure ALSA. It worked. Only problem is that it now lists about 25 audio devices in my device tree. Simple matter of testing each one and seeing what works and what don't.
   
  After that it was over to finding the best player. For years I have been a staunch devotee to Amarok. Brilliant player with exceptional media library functions. Only problem is that it passes everything through its own mixer and highest output, according to the cat command, is only 16/48. That is while playing 24/192 audio. Also, for some reason the SQ is really bad. Allot of distortion. Enough so that I can hear it over my cheap desktop speakers. And it is not a volume problem. Even turning it down still result in serious distortion.
   
  So with that I said goodbye to Amarok as my player of choice, although I still use it for music management, and setting off to find a new player.
   
  First I tried VLC. Brilliant little program that. Plays anything you throw at it, and does it all in bit-perfect goodness. Only problem is that media management with it sucks, big time. Big deal breaker for me. It will still be my default video player, but for music, nope.
   
  Then I came upon this thread and saw someone mention DeaDbeef. Tried it, love it, will continue using it until foobar2000 comes to Linux. Bit-perfect output, decent playlist display, brilliant sq and eq.
   
  So, to sum up. Use clean ALSA for sound. It's a bit more hands on with settings, but that is alright concidering what mess PulseAudio is. It is like a woman during pms. Freaking unstable. Smallest little change in your setup and it gets a fanny-wobble of epic proportions.
   
  For playback DeaDbeef is pretty much the closest thing to fb2k in Linux at the moment. I tried Audacious, but it is ugly. DeaDbeef also handles fb2k eq settings, so that has to count for something.
   
  Thanks to all on this thread whose advice and guidance has helped me in getting decent sound out of my setup.


----------



## TwinQY

+1 for Deadbeef! I own a similar setup to yours (FiiO E10, bass-modded HD428), and it sounds pretty damn good, well, as good as the HD428s have ever sounded. Sometimes with the E10 on ALSA though, playback speed gets doubled at arbitrarily random occasions. I just reset the device back to default, but some might view it as annoying. Thankfully, I've never messed with pulseaudio at this point 
	

	
	
		
		

		
			





. Probably a better solution exists, but I don't use the FiiO enough to warrant finding out why.


----------



## Hark3n

Quote: 





twinqy said:


> Sometimes with the E10 on ALSA though, playback speed gets doubled at arbitrarily random occasions. I just reset the device back to default, but some might view it as annoying.


 
   
   
  Never had that happen with me. Must be software related.
   


> Thankfully, I've never messed with pulseaudio at this point
> 
> 
> 
> ...


 
   
  Spare yourself the headache and just leave it if it works. Apparently OSS4 is a very good audio system, but I'll only try it in about a months time when I do the bi-annual clean install.


----------



## KimLaroux

Quote: 





> Originally Posted by *Hark3n* /img/forum/go_quote.gif
> ...
> 
> After that it was over to finding the best player. For years I have been a staunch devotee to Amarok. Brilliant player with exceptional media library functions. Only problem is that it passes everything through its own mixer and highest output, according to the cat command, is only 16/48. That is while playing 24/192 audio. Also, for some reason the SQ is really bad. Allot of distortion. Enough so that I can hear it over my cheap desktop speakers. And it is not a volume problem. Even turning it down still result in serious distortion.
> ...


 
   
  I've been using exclusively Amarok for the past months, and it's as bit-perfect as any Linux system can get. I use Gstreamer backend, configured to output directly to the hardware without any conversion. It plays any sample rate just fine, and the hw_params are the same as with deadbeef. I think your Amarok system simply is not configured properly.
   
  I'm currently using Kubuntu 12.04 with Amarok 2.5. This Amarok version has a few annoying bugs that I hope were fixed in 2.6, which comes with Kubuntu 12.10. I downloaded the dvd for a clean install, but college has kept me too busy to reinstall everything. I'll report back when I finally get a chance to try the latest releases.


----------



## Hark3n

Quote: 





> Originally Posted by *KimLaroux* /img/forum/go_quote.gif
> 
> I think your Amarok system simply is not configured properly.


 
   
  Not at all impossible. Like I said, I only do a fresh install every couple of years and there is one just around the corner for me, so there might be serious improvements that I haven't gotten yet.


----------



## TwinQY

Quote: 





hark3n said:


> Never had that happen with me. Must be software related.
> 
> Spare yourself the headache and just leave it if it works. Apparently OSS4 is a very good audio system, but I'll only try it in about a months time when I do the bi-annual clean install.


 
  Probably not. A few posts into the thread, and I see that many have experienced similar problems with some portable dacs. Most likely something with the internal dac at high sampling rates. Just don't go over 24/96, and you'll be fine. 
   
  Assuming that you're using Ubuntu (bi-annual install was the hint), I was curious on why you would have 25 devices listed by ALSA though.


----------



## Hark3n

Quote: 





twinqy said:


> Assuming that you're using Ubuntu (bi-annual install was the hint), I was curious on why you would have 25 devices listed by ALSA though.


 
   
  Not Ubuntu, but Kubuntu. I usually only upgrade with every new LTS release, but this year I'm waiting for December. Have a couple of new HDD's to buy and then redo everything.
   
  Anyway, onto the 25 devices thing. Command line lists only shows 3 devices. DigiHug (the E10), Nvidia Analog (onboard sound) and Nvidia HDMI stub (graphics card). Phonon is the bugger that lists absolutely everything, some even twice. Here's a couple of screenshots to show my list.
   
   
 
   
  As you can see, quite a list. Doesn't bother me anymore, now that I know which devices to use.


----------



## TwinQY

Quote: 





hark3n said:


> Not Ubuntu, but Kubuntu. I usually only upgrade with every new LTS release, but this year I'm waiting for December. Have a couple of new HDD's to buy and then redo everything.
> 
> Anyway, onto the 25 devices thing. Command line lists only shows 3 devices. DigiHug (the E10), Nvidia Analog (onboard sound) and Nvidia HDMI stub (graphics card). Phonon is the bugger that lists absolutely everything, some even twice. Here's a couple of screenshots to show my list.
> 
> ...


 
  Into 12.10? Any specific reason? Nothing major has been really fixed or update this release, but performance has degraded quite a bit (even on Kubuntu), partly due to the social integration stuff. It's been the only edition where not only my usual VBox machine for Ubuntu testing had froze from the sluggishness, many of my friend's machines had completely refused to work without freezing (and these are Core Duos). The general consensus from many users is that performance has gone down as well. Makes me glad I stick to Arch on my home rig. I'd stick with 12.04 (Just wait till 12.04.2 in January if you have to reinstall for several machines without having to go through the usual 1 year's worth of updates)
   
  Rant aside, I just found that I have the exact same 25 things that you have listed when on a KDE virtual machine (devices attached), so makes sense. Just got used to alsamixer's output, I guess.


----------



## Hark3n

Quote: 





twinqy said:


> Into 12.10? Any specific reason?


 
   
  Ah, I missed a section of my previous post. I meant to say that I will be trying Mint in December as well. Friend of mine is a huge Mint fan, and dev as well on some libs, and he is raving about it to no end. Thought that I will try my hand at it this December. If I don't like it I'll move back to Kubuntu.


----------



## TwinQY

Quote: 





hark3n said:


> Ah, I missed a section of my previous post. I meant to say that I will be trying Mint in December as well. Friend of mine is a huge Mint fan, and dev as well on some libs, and he is raving about it to no end. Thought that I will try my hand at it this December. If I don't like it I'll move back to Kubuntu.


 
  Ahh, Mint, now there's a solid distro. Although I would hope there be something akin to a LTS version, or to stick to the Debian edition, as I think the performance regressions on 12.10 go more than skin deep. Hopefully they fix them before December


----------



## nicko7i

This happened to me too.  It's because your DSP (like mine) does not natively support 88.2KHz.
   
  You can confirm this (as I learned from another poster on this thread) by running 
    % cat /proc/asound/card0/stream0
   
  Here's an example from mine (an Audio-GD DAC 19DSP)


> GFEC ASSP DigiHug USB Audio at usb-0000:00:13.0-1, full speed : USB Audio
> 
> Playback:
> Status: Running
> ...


 
   
  There's no "88200" value in the "Rates:" line.
   
  When I play an 88.2K album, I manually enable the "Secret Rabbit Code" resampler.  This does exactly what I want: downsample to 44.1 but preserving the 24-bit depth:


> Status: Running
> Interface = 3
> Altset = 2
> URBs = 3 [ 8 8 8 ]
> ...


 
   
   
  Quote:


gustmahler said:


> I was using Deadbeef for while now and thought I did it to Bit Perfect settings. Using Alsa / USB CODEC USB AUDIO IEC956 S/PDIF output to my DAC. I also set the Alsa plugin to not use ALSA resampling. I never worried about the DSP tab. Now after reading the post from Kim Laroux quoted above, I removed the Resampler (Secret Rabbit Code) and restarted. Unfortunately all my HD 24kbit 88200Hz music files play now half velocity. So this means what got out before was not Bit Perfect, because it had to go through the Resampler. Well, I am confused. Can anyone help?


----------



## qayws

Hi guys,
   
  Thanks for all the tips, I have done great progress... but I still have the same trouble than Gustmahler in reply 59: if I disable DSP, my 96kHz files are played at 48kHz speed, i.e. twice slower and twice deeper (using DeadBeef and Ubuntu 12.04 on a (very) old DELL Inspiron 8600, output directly to SPDIF, not USB). 
   
  Is it a pb with my DAC? It is however supposed to accept anything from 32 to 96kHz according to the manufacturer (it's a Musical Fidelity kW DM25).
   
  Thanks for your answers,


----------



## KimLaroux

I just tried to replicate the bug, but it works just fine here.
   
  Ubuntu 12.04.1
  DeadBeef 0.5.5
   
  No DSP, No plugins.
  Output plugin; Alsa.
  Output device; Digital (SPDIF) Direct hardware device without any conversion.
  File FLAC 96Khz 24bit.
   
  My DAC is an Audio-gd NFB-12.
   
  The audio plays at the right speed.
   

   
   
  Maybe the Alsa wiki has information regarding this. I'm not sure though where to look as the bug could be the sound card, the DAC itself not being supported, or simply a configuration corruption.


----------



## qayws

Hi Kim,
   
  Well, actually, I cannot use the option "Direct Hardware without any convertion", because in that case the output is not directed to the spdif (no sound). I use instead "IEC958 (s/pdif) Digital Audio Output".
   
  The interesting thing is that in the file hw_params, I see rate 48000 (see printscreen below), and on my DAC display I also read 48000 as well, but on the status bar of DeadBeef I read 96000 (the actual definition of the file). So a 96k file is read at 48k/sec. Also interesting is that the time on the status bar shows 13:15/8:30. It continues reading until 17:00 (in this case), confirming a half rate reading.
   
  The funny thing (so to speak) is that 44,1kHz is also read at 48kHz, making the tracks a bit shorter this time.
   
  Couldn't see anything in the alsa wiki.
   
  What do you mean by "configuration corruption". How do you address that?
   
  Many thanks,


----------



## KimLaroux

Yeah I think the problem is software. By default ALSA resamples everything to 48khz so it can mix different sources together. The only way to bypass this is to use "direct hardware device without any conversion". Since you're not using direct hardware, everything gets sampled to 48khz. I find it amusing though that it cannot properly downsample to 48khz. It seems as though a programmer somewhere had an "oops" moment.
   
  Wait, you're saying even 44.1khz isn't resampled properly? Wow that's weird. I think your ALSA is broken. Maybe the driver it uses is not the right one for your audio device. Does this happen only using Deadbeef? Are other music players playing at normal speeds?
   
  There's actually a couple of "direct hardware device without any conversion". There's Analog and Digital. Analog uses the DAC of your sound card while Digital uses the SPDIF out. Are you sure you're using the Digital out?
   
  If you're unsure which to use, can you paste the output of "aplay -L"? Note the capital L. This is where the "Output device" drop-down menu of Deadbeef comes from.


----------



## qayws

Well, I can downsample to 48kHz but only with the resampler Secret Rabbit Code installed in the DSP tab of the Preferences pannel. If I remove it, as you suggested earlier, it doesn't work properly. The same wiht 44.1: it only works with a rabbit nearby, which completely defeat the "bit perfect" concept. Do you have an idea on why "direct hw..." doesn't work with the spdif output? Would it work better with usb?
   
  aplay -l outputs:
  card 0: I82801DBICH4 [Intel I82801DB-ICH4], device 0: Intel ICH [Intel I82801DB-ICH4]
     Subdevices: 1/1
     Subdevice #0: subdevice #0
   
  card 0: I82801DBICH4 [Intel I82801DB-ICH4], device 4: Intel ICH - IEC958 [Intel I82801DB-ICH4 - IEC958]
     Subdevices: 1/1
     Subdevice #0: subdevice #0
   
  Thanks a lot


----------



## Anda

Just for testing, could you try running "vlc --alsa-audio-device=hw:0,4 -I qt4 -d" in terminal. This runs VLC using card 0 device 4.


----------



## KimLaroux

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.
   

```

```
  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.


----------



## qayws

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?

  Thanks


----------



## qayws

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 
  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


----------



## KimLaroux

Quote: 





qayws said:


> 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
> ...


 
   
  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.


----------



## Anda

Quote: 





qayws said:


> 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.


----------



## qayws

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


----------



## KimLaroux

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:
   

```
pasuspender -- /opt/deadbeef/bin/deadbeef
```
   
  But since I don't have pulse installed, I can't test it.


----------



## qayws

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 
   
  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


----------



## Anda

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:


----------



## qayws

Quote: 





anda said:


> 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!


----------



## Anda

Quote: 





qayws said:


> 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?


----------



## qayws

Deadbeef, yes.
  Chip in AlsaMixer v1.0.25 is SigmaTel STAC9750,51  and the card is Intel 82801DB-ICH4


----------



## Anda

Quote: 





qayws said:


> Deadbeef, yes.
> Chip in AlsaMixer v1.0.25 is SigmaTel STAC9750,51  and the card is Intel 82801DB-ICH4


 
   
http://alsa-project.org/~james/datasheets/sigmatel/stac9750-pb.pdf
   
  "Supported audio sample rates include 48 kHz, 44.1 kHz, 32 kHz, 22.05 kHz, 16 kHz, 11.025 kHz, and 8 kHz"


----------



## qayws

Quote: 





anda said:


> http://alsa-project.org/~james/datasheets/sigmatel/stac9750-pb.pdf
> 
> "Supported audio sample rates include 48 kHz, 44.1 kHz, 32 kHz, 22.05 kHz, 16 kHz, 11.025 kHz, and 8 kHz"


 
   
  Right.
  Make sense.
  So two options left: a newer PC, or a USB2SPDIF device, I guess.
   
  Thanks and congratulation for working this out!
   
  Jerome


----------



## qayws

"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


----------



## Anda

Quote: 





qayws said:


> So two options left: a newer PC, or a USB2SPDIF device, I guess.


 
   
  Are you located in the US? Go get the V-link192 while the price is still $199:
http://www.amazon.com/Musical-Fidelity-V-LINK192-SPDIF-Converter/dp/B00718X2TU
http://www.audioadvisor.com/prodinfo.asp?number=MFVL192
   
  I have the Hiface Two and the XMOS chip works great in Linux. In addition V-link192 has galvanically isolated USB input.


----------



## qayws

Well, no, in  Switzerland. Here the Vlink 192 cost almost double!! But anyway I need the Vlink-II since the DAC won't accept more than 96kHz anyway, and this one is cheaper (I will then have a trouble playing 192k files then! More headaches to come! ) ... or the M2Tech, that's an option too.
   
  Thanks again for everything!


----------



## Anda

Quote: 





qayws said:


> Well, no, in  Switzerland. Here the Vlink 192 cost almost double!! But anyway I need the Vlink-II since the DAC won't accept more than 96kHz anyway, and this one is cheaper (I will then have a trouble playing 192k files then! More headaches to come! ) ... or the M2Tech, that's an option too.
> 
> Thanks again for everything!


 
   
  Yes, I know. I live in Denmark. You should consider something with XMOS as this is maybe the best USB chip at the moment. I have a DAC with the TE8802 which should also be USB audio class 2, but it has annoying glitches so I use the Hiface2 instead (I use redbook material and sometimes up to max. 96KHz). Here's a comprehensive list of USB audio class 2 devices:
http://www.forum-audiophile.fr/musique-demat/les-dac-transport-usb-audio-class-2-t16248.html
   
  Have fun!


----------



## analogue 3

Can anyone recommend a linux music player with bit perfect audio AND folder browsing?
   
  I've been using mediamonkey with asio/wasapi for sometime and really enjoy the option of browsing by folder when making custom playlists etc. Something with a similar GUI would be nice too.
   
  I would try mediamonkey over wine however I guess I'm more likely to get bit perfect with something native to linux...


----------



## Anda

Music Player Daemon (backend). As frontend I am using ncmpcpp and Sonata (see pics below). Takes a bit of work to set up, but works beautifully.
http://mpd.wikia.com
https://wiki.archlinux.org/index.php/MPD


----------



## Puranti

After having tested many players (deadbeef, quodlibet, sonata, gmusicbrowser, rythmbox, amarok, etc).
  I've discovered recently QMMP, and it's the closest player to winamp you can find.
  It has bit perfect playback, great plugins (bs2b, ladspa, etc).
  And its UI is very tweakable. I'll settle with this one.
  My audinirvana is near


----------



## Migou67

QMMP look very nice, I will give it a try this evening, using Clementine for the moment, Thanks.


----------



## Zodac

Hi there,
   
  I'm new into Unix bit perfect sound. I'm using ubuntu server (no GUI) on my HP N40L and my Asus Xonar Essence One via USB with mpd and alsa.
   
  I have a strange problem with this setup. Playing files works, but if I change from a "normal" mp3 file with 44.1 khz to a file with 48 khz and vice versa the sound plays too fast / too slow. I have to stop and play the file again and then it's fixed.
   
  The first mp3 file after a reboot sounds very corrupted and the Essence One shows 192 khz playback. Stopping and starting fixes this problem too. Any one with an idea to fix this?
   
  My Config:
   
  ALSA asound.conf
   
  pcm.!default {
         type hw
         card One
 #       device 0
 }

 ctl.!default {
         type hw
         card One
 }
   
  MPD mpd.conf
   
  audio_output {
         type            "alsa"
         name            "One"
         device          "hw:0,0" 
         auto_resample   "no"
 }
  
   
  aplay -l
 **** List of PLAYBACK Hardware Devices ****
 card 0: One [ASUS Xonar Essence One], device 0: USB Audio [USB Audio]
   Subdevices: 0/1
   Subdevice #0: subdevice #0
  
   
   aplay -L
 null
     Discard all samples (playback) or generate zero samples (capture)
 sysdefault:CARD=One
     ASUS Xonar Essence One, USB Audio
     Default Audio Device
 front:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     Front speakers
 surround40:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     4.0 Surround output to Front and Rear speakers
 surround41:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     4.1 Surround output to Front, Rear and Subwoofer speakers
 surround50:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     5.0 Surround output to Front, Center and Rear speakers
 surround51:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     5.1 Surround output to Front, Center, Rear and Subwoofer speakers
 surround71:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
 iec958:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     IEC958 (S/PDIF) Digital Audio Output
 dmix:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     Direct sample mixing device
 dsnoop:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     Direct sample snooping device
 hw:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     Direct hardware device without any conversions
 plughw:CARD=One,DEV=0
     ASUS Xonar Essence One, USB Audio
     Hardware device with all software conversions
  
  on a correct playing file:
   
   cat /proc/asound/card0/stream0
 ASUS ASUS Xonar Essence One at usb-0000:00:13.2-1, high speed : USB Audio

 Playback:
   Status: Running
     Interface = 1
     Altset = 1
     URBs = 8 [ 8 8 8 8 8 8 8 8 ]
     Packet Size = 104
     Momentary freq = 44109 Hz (0x5.8380)
     Feedback Format = 16.16
   Interface 1
     Altset 1
     Format: S16_LE
     Channels: 2
     Endpoint: 6 OUT (ASYNC)
     Rates: 44100, 48000, 88200, 96000, 176400, 192000
     Data packet interval: 125 us
   Interface 1
     Altset 2
     Format: S32_LE
     Channels: 2
     Endpoint: 6 OUT (ASYNC)
     Rates: 44100, 48000, 88200, 96000, 176400, 192000
     Data packet interval: 125 us
  
   
  on a corrupt sounding flac 192 khz file:
   
   cat /proc/asound/card0/stream0
 ASUS ASUS Xonar Essence One at usb-0000:00:13.2-1, high speed : USB Audio

 Playback:
   Status: Running
     Interface = 1
     Altset = 2
     URBs = 8 [ 8 8 8 8 8 8 8 8 ]
     Packet Size = 208
     Momentary freq = 176438 Hz (0x16.0e00)
     Feedback Format = 18.14
   Interface 1
     Altset 1
     Format: S16_LE
     Channels: 2
     Endpoint: 6 OUT (ASYNC)
     Rates: 44100, 48000, 88200, 96000, 176400, 192000
     Data packet interval: 125 us
   Interface 1
     Altset 2
     Format: S32_LE
     Channels: 2
     Endpoint: 6 OUT (ASYNC)
     Rates: 44100, 48000, 88200, 96000, 176400, 192000
     Data packet interval: 125 us


----------



## KimLaroux

Weird, you're not the first in this thread reporting this issue. Have you looked for bug reports?
   
  Others had the same problems using different DACs and different music players. I'm guessing it's a problem with ALSA. It's as if ALSA forgets to change the output sample rate to match the input sample rate.
   
  Does your server has a sound card? What happens if you unplug the One and replace it with the on-board sound card in all the configuration files?


----------



## Zodac

I haven't checked bug reports, but I did a google search and didn't came up with anything regarding this issue. I guess I'll try out the One on my windows system via USB (it's connected through coax actually) and check if it's an issue with the One (updated the firmware last week).
   
  My HP N40L doesn't have onboard sound so I can't try that.


----------



## TommyNavara

HI guys!!!!!
  I'm a ubuntu user.
  I use DeadBeef with a FiiO e07k usb dac and it works selecting both IEC...spdif and Direct to hardware without modification.
  The sound is very clear and detailed.
  I have two question:
  is there a way to verify that the audio is really bit-perfect?
  Ia possible to use the bit perfect stream playing for example spotify or mog through the flash player (I've tried Jack but selecting the usb dac is not able to start)


----------



## KimLaroux

Quote: 





zodac said:


> I haven't checked bug reports, but I did a google search and didn't came up with anything regarding this issue. I guess I'll try out the One on my windows system via USB (it's connected through coax actually) and check if it's an issue with the One (updated the firmware last week).
> 
> My HP N40L doesn't have onboard sound so I can't try that.


 
   
  First, the problem is clearly in Linux, so testing in in Windows isn't gonna tell you much. It's gonna work.
   
  Second, testing it trough COAX would not be a representative test. When you connect a DAC trough SPDIF, be it coaxial or optical, to a computer, you're not using the DAC as an audio device. You're using the computer's sound card as an audio device. The whole signal path is so different, it would be almost impossible that you have the same problem with both. It would have to be a problem with the DAC's DAC chip itself, or in userland apps.
   
  Have you tried using a different app? A simple test would be to create a folder containing tracks you know when played one after the other will replicate the bug. Then play the folder using aplay or something similar.


----------



## bcschmerker4

Thanks for a Thread for tracking issues with ALSA™ 1.0.2x w/r/t bit-perfect transmission and reception.  I am currently considering several PCI 2.x audio cards as part of planning for a LinUX-box rebuild, including, among others, the Asus® XONAR® Essence™ ST (C-Media® CMI-8788; snd-virtuoso) and E-MU®/Creative® EM3961 1010m (Creative® CA0102; snd-emu10k1-fpga).  (I found my current Creative Laboratories® SB0350 Sound Blaster® Audigy2™ ZS™ to pick up excessive noise from the balance of the 'puter.)  So far, which card has had the least latency from the ALSA™ drivers? the best sound on stock op amps (through beyerdynamic® DT880 600Ω Pro's)?  These will be factors in deciding on an SB0350 replacement.
   
  (The Advanced LinUX Sound Architecture Project™ has been unable to develop a fully-functional snd-ctxfi for the Creative Laboratories® CA20K2 DSP, required for the SB0880 Sound Blaster® X-Fi® Titanium™, SB0885 Sound Blaster® X-Fi® Titanium™ FATAL1TY® Professional™, SB0886 Sound Blaster® X-Fi® Titanium™ FATAL1TY® Championship™, and SB1270 Sound Blaster® X-Fi® Titanium™ HD™.  Furthermore, the ALSA™ Project has yet to receive one of the brand-new Sound Blaster® RECON3D® PCI-Express audio cards for checking development work.)


----------



## Zodac

Hi,
   
  I found this http://www.spinics.net/linux/fedora/alsa-user/msg10475.html. This guy has exactly the same problem.
   
  I tried:
   
  cat /dev/urandom | aplay -D hw:2,0 -f S16_LE -c2 -r192000
  cat /dev/urandom | aplay -D hw:2,0 -f S16_LE -c2 -r44100
  cat /dev/urandom | aplay -D hw:2,0 -f S16_LE -c2 -r48000
   
  and each time it changed from (a multiple of) 44100 or 48000 the sound was played wrong so its clearly a problem with alsa. I'm running on Version 1.0.24.


----------



## Anda

Does anyone have experience with using SoX resampler in MusicPlayerDaemon? Can you give an example configuration, e.g. if I wanted to upsample everything to 24/96?


----------



## kchapdaily

anyone know if clementine can produce bit perfect playback? i really like the layout, but know very little about whats going on behind the hood with the audio.


----------



## TwinQY

Quote: 





kchapdaily said:


> anyone know if clementine can produce bit perfect playback? i really like the layout, but know very little about whats going on behind the hood with the audio.


 
  Downloaded Clementine just for ya.
  Screenies - 
   

  Just specify your sound device in the output device box like this (ex hw:0,1 - don't forget to adjust for your device) for exclusive ALSA playback.


----------



## ruzzaford

Hey guys,
   
  I've been following head-fi for quite some time now, but never actually bothered to create an account. But since I see there are a lot of informed fellow *Nix'ers here, I'd like to pop a question that I never could clarify.
  If my single goal was to listen to some quality music, would low-latency or even a real time kernel effect my listening experience in any way?
  I couldn't quite figure out if low-latency was only relevant to music production or audio in general.
  In theory, I wouldn't mind delay if the quality stayed the same.
  But then again, you never know...
  I'd appreciate any comments, thanks.


----------



## KimLaroux

Quote: 





ruzzaford said:


> Hey guys,
> 
> I've been following head-fi for quite some time now, but never actually bothered to create an account. But since I see there are a lot of informed fellow *Nix'ers here, I'd like to pop a question that I never could clarify.
> If my single goal was to listen to some quality music, would low-latency or even a real time kernel effect my listening experience in any way?
> ...


 
   
  Real time kernels are only necessary when the computer is in the middle of the audio chain. In other words, it's only necessary if the audio signal comes into the computer trough a sound device, gets mixed, and sent back out trough an audio device. For example, it's necessary if you use a computer as mixer or effect generator during a live event. In this case, the sound from the live instruments goes trough the computer before getting at the speakers - you need the lowest latency possible.
   
  If you're using the computer as a source of music, then you really don't need real time kernel. The latency is bellow 50 ms even with a normal kernel, which is acceptable even if the audio is synchronized with a video, which is the only time when timing will be relevant in any way. Timing is irrelevant if you're simply listening to music and will have no influence on sound quality.


----------



## ruzzaford

Wow. That was the perfect answer for me. I searched a lot of forums for this, but never could find a solution because I didn't really know what to Google for. Thanks, Kim!


----------



## kchapdaily

Quote: 





twinqy said:


> Downloaded Clementine just for ya.
> Screenies -
> 
> 
> Just specify your sound device in the output device box like this (ex hw:0,1 - don't forget to adjust for your device) for exclusive ALSA playback.


 
  awesome thanks. ill have to double check tomorrow (later today technically), but i was having trouble with some parts of the settings being grayed out.


----------



## anoxy

Quote: 





twinqy said:


> Downloaded Clementine just for ya.
> Screenies -
> 
> 
> Just specify your sound device in the output device box like this (ex hw:0,1 - don't forget to adjust for your device) for exclusive ALSA playback.


 
  Linux noob here. How do I specify my output device? Like what would I type in the box?


----------



## TwinQY

Quote: 





anoxy said:


> Linux noob here. How do I specify my output device? Like what would I type in the box?


 
  aplay -l lists devices available. Syntax is as such - X;Y (where X = the card, and Y = the device).


----------



## TrollDragon

What distro's are you all running? Is there support for the E17 in any or all?

Thanks!

Sent from my HTC Desire HD A9191 using Tapatalk 2


----------



## TwinQY

Quote: 





trolldragon said:


> What distro's are you all running? Is there support for the E17 in any or all?
> 
> Thanks!
> 
> Sent from my HTC Desire HD A9191 using Tapatalk 2


 
  It's the Linux kernel. i.e. in the kernel. For most parts "sound device drivers" are distro-agnostic. Just need to have USB drivers enabled, for example. Again, if you're not compiling your own kernel it matters little.
   
  tl;dr - don't worry about incompatibility.


----------



## KimLaroux

If the E17 is USB audio class compliant, then it doesn't even need a driver. At least that's on normal OS that care about standards... That you need driver to use class compliant devices on Windows just goes to prove how ridiculous Microsoft's logic is.
   
  If it's not class compliant, then you're kinda left on your own. It's a hit-and-miss thing where you are never guaranteed of a fully working device. In this case, the distro may have an impact on the solution.


----------



## draiiinage

Hi, all.  I'm new to the audiophile world and to this website.  Sorry if this has been discussed - I can't find it by searching (maybe am using the wrong terminology).  Has anyone had any luck playing 88k/24bit files through a DAC that only supports 96k/24bit (I have the Fiio E17)?  I have tried Gmusicbrowser and Guayadeque - both of which will play the files at 96/24 but they are sped up or at a significantly higher pitch than they should be.  I can't find any way to adjust the pitch in these players (not even sure that would compensate adequately, or if it would degrade the signal).  Any suggestions?


----------



## eimis

You may use deadbeef. It can output 88khz at 96khz. Go to preferences, DSP tab, add, and select Resampler. Then click configure. Enter 96000 as target freq. Aso select best quality/alg.

https://launchpad.net/~starws-box/+archive/deadbeef-player


----------



## julian67

draiiinage said:


> ....playing 88k/24bit files through a DAC that only supports 96k/24bit.....  Any suggestions?




You'll need to convert the sample rate. For a really high quality sample rate conversion you can use sox.

Example command to convert to 88/24:


```
sox --no-clobber -G  -b 24  rate -v 88200 dither -s
```

the --no-clobber prevents accidentally overwriting
-G (automatic clip prevention) and dither will together give you the result with the widest possible dynamic range and no clipping.


----------



## julian67

eimis said:


> ... deadbeef. It can output 88khz at 96khz. Go to preferences.....Aso select best quality/alg.




Very useful info, thanks.

I haven't compared or tested but it seems that Sox resampler is now considered better than SRC, as used in DeadBeef and many other apps and ALSA add-ons. Anyone have any experience or testing of this?


----------



## draiiinage

Thanks, guys. That was very helpful. I went the sox route, because I can't get DeaDBeef to install - tried both using the repository (Ubuntu raring) and compiling it but no matter what, when I enter deadbeef on the command line it says "Starting DeaDBeef 0.5.6" and then it quits immediately. Anyone have this issue? Also, I'm converting 88k to 96k. When I do this with sox I get "sox WARN dither: no `shibata' filter is available for rate 96000; using sloped TPDF". I'm guessing this is ok - I have all the original files, of course, in case I need to do something else. The songs sound great now so I guess it worked either way. Thanks again!


----------



## julian67

I think "shibata" is the default noise shaping filter and that if it doesn't work at the sample rate requested then sox will choose another. I am not 100% sure which but if you make a spectrogram of your converted file you will see it that dither has been applied.


----------



## wolfson

While new to this forum, I have been a LONG time avscience member/poster, and am active in the Linux HTPC area there.
   
  I have been building media/HTPC/music PC's since the 90's.
   
  A thread search shows no one has mentioned foobnix
http://www.foobnix.com/welcome?lang=en
   
  Anyone try this for bit perfect Linux music playback?
   
  Other features/music mgmt issues?
   
  It was created as a FOSS/linux functional/look-alike alternative to Foobar2K from Windows.
   
  Just wondering if there's room for another "audiophile approved" Linux music player app besides the "big four"  
   
 *DeaDBeef           * http://deadbeef.sourceforge.net/
 *Gmusicbrowser * https://launchpad.net/~shimmerproject/+archive/ppa
 *Guayadeque       * http://sourceforge.net/projects/guayadeque/
 *Quod Libet*          https://code.google.com/p/quodlibet/
 *   *


----------



## julian67

wolfson said:


> It was created as a FOSS/linux functional/look-alike alternative to Foobar2K from Windows.
> 
> Just wondering if there's room for another "audiophile approved" Linux music player app besides the "big four"




I don't think it's much like foobar2000 at all and doesn't even begin to approach its capabilities. I also don't think it has much to offer compared to other playback apps which don't attempt to mimic something else. Foobnix is no more than a completely unremarkable python+gstreamer playback UI. It doesn't even allow the user to specify which audio output to use. It seems that a huge number of people who learn python or perl or whatever like to test their skills on yet another media player, so there are an awful lot of naive or abandoned projects of this kind.

Of the GUI music apps you mention I think DeadBeef is the best thought out as it does do all the basics properly: it allows the user to specify audio output, to customise the way metadata is displayed, it plays gapless gaplessly and so on.

I would not consider the four applications you mention to constitute a "big four". If you don't include mpd then you missed out what is probably the most widely used and long established quality music player in the UNIX-like world. These days you can also include mplayer2 because it now has a -gapless-audio option which works with flac.


----------



## wolfson

Thanks for the input- I hadn't done a deep dive on foobnix re: functionality like gapless playback (important to me) or what backend it used.  Not being able to direct sound playback to specific hardware devices like the ALSA methods in this thread is a dealbreaker.
   
  Nice to see how trivial it is to achieve bit perfect playback on Linux with common FOSS apps described here.  I was chasing bit-perfect SPDIF output with  fellow HTPC'rs since the later 90's- now get off my lawn!


----------



## KimLaroux

Heck even Amarok has gapless bit-perfect playback now. And I bet VLC could do it too. The list is endless. It all comes down to your preferences. Personally I use Amarok as a library organizer and Deadbeef as a stand-alone ligthweight player. I seem to be using both just as much.


----------



## wolfson

Don't know how good you guys got it now- the state of bit-perfect output with common sound cards and stock drivers/media players back on Windows 9x/XP in the late 90's/early 2000's was abysmal- undefeatable hardware 48khz resampling on SoundBlaster Live's, anyone?


----------



## wolfson

Does this forum support sticky threads?
   
  This thread looks like a good candidate.  Perhaps a thread that keeps current with the top recommended audiophile grade music players on Linux would be a good reference for noobs.


----------



## julian67

kimlaroux said:


> Heck even Amarok has gapless bit-perfect playback now. And I bet VLC could do it too...




VLC can't do gapless, neither playing back files nor playing gapless physical CDs.

You can see this recently confirmed by a VLC developer: http://forum.videolan.org/viewtopic.php?f=13&t=92466&p=370404&hilit=gapless#wrap



> VLC never played gapless in its 14 years existence. Ever.


----------



## wolfson

Apparently, "bit perfect" output from a Mac to a USB DAC "sounds better" than bit perfect output of the same file/data from Windows or a Linux PC to the same DAC-
   
http://www.head-fi.org/t/553416/bitperfect-was-audirvana-alternatives/690
   
http://bitperfectsound.blogspot.com/p/what-is-bitperfect.html
   

   
  No, I don't believe this, just another example of green-penmanship 
   
  This is the kind of thing that gives the audiophile hobby a bad name


----------



## julian67

There is no mention at all of Linux in the linked pages so it's not clear how those pages relate to this thread which is Linux specific.

Are you confusing a product called BitPerfect with the descriptive term "bit perfect"? The authors of the app certainly are.

Anyway it's a subject for a different thread.


----------



## wolfson

I was just trying (unsuccessfully) to be facetious 
   
  Besides "linux", this thread's subject is "Bit perfect" output.
   
  My understanding is that "bit perfect" audio output means that there ought to be no difference in the data/bits being presented to a DAC, regardless of OS/app (other than jitter magnitude).  It appeared that the maker of the "Bit Perfect" Mac app was trying to claim otherwise.  I may have been mistaken.


----------



## HPiper

Thanks a ton for this very informative thread. I installed Gmusicbrowser and now FINALLY have bit-perfect playback of my music. Only problem I have is I can't get sound from my speakers, but it works with my dac and headphones. I'll play with it a bit more later, but thanks again.


----------



## fihidelity

Quote: 





wolfson said:


> Apparently, "bit perfect" output from a Mac to a USB DAC "sounds better" than bit perfect output of the same file/data from Windows or a Linux PC to the same DAC-
> 
> http://www.head-fi.org/t/553416/bitperfect-was-audirvana-alternatives/690
> 
> ...


 
  If the digital signal could be compared to the source at the DAC end wouldn't it be identical regardless of OS so longs as the settings were identical?


----------



## wolfson

Quote: 





fihidelity said:


> If the digital signal could be compared to the source at the DAC end wouldn't it be identical regardless of OS so longs as the settings were identical?


 
   
  I was just trying (unsuccessfully) to be facetious 
   
  My understanding is that "bit perfect" audio output means that there ought to be no difference in the data/bits being presented to a DAC, regardless of OS/app (other than jitter magnitude). Once the claim is made that "bit perfect" is achieved at the output of a device (CD player, computer, etc), the output should be identical between the devices.
   
  It appeared that the maker of the "Bit Perfect" Mac app was trying to claim otherwise.  I may have been mistaken.
   
  I was mocking what I believed to be an example of audiophile-market-snake-oilsmanship


----------



## wolfson

What are the favoite mpd front ends used around here?
   
  http://mpd.wikia.com/wiki/Clients#GTK.2B
   
  If one was to use mplayer2 for bitperfect gapless playback, what are the recommended GUI's/frontends for mplayer2?


----------



## fihidelity

Quote: 





wolfson said:


> I was just trying (unsuccessfully) to be facetious
> 
> My understanding is that "bit perfect" audio output means that there ought to be no difference in the data/bits being presented to a DAC, regardless of OS/app (other than jitter magnitude). Once the claim is made that "bit perfect" is achieved at the output of a device (CD player, computer, etc), the output should be identical between the devices.
> 
> ...


 
  Ah right, it took me a while to get my head around it! Unfortunately there's no paucity of snake-oil in this hobby!
   
   
   


wolfson said:


> What are the favoite mpd front ends used around here?
> 
> http://mpd.wikia.com/wiki/Clients#GTK.2B
> 
> If one was to use mplayer2 for bitperfect gapless playback, what are the recommended GUI's/frontends for mplayer2?


 
  If I understood the question then I use Sonata from my laptop or MPDroid from my phone to control the daemon which is on my RPi. One of the downfalls of MPDroid for me is that there's no option to view all tracks but Sonata is good for making playlists so I just whack it all in one 'All Tracks' playlist.
   
  I think options for gapless/bit depth/sample rate are in the MPDaemon/Alsa config files.


----------



## julian67

wolfson said:


> What are the favoite mpd front ends used around here?
> 
> http://mpd.wikia.com/wiki/Clients#GTK.2B
> 
> If one was to use mplayer2 for bitperfect gapless playback, what are the recommended GUI's/frontends for mplayer2?




For a graphical front end I like gmpc a lot because it can display all the metadata that mpd is capable of using. This means I can use comment and composer tags as well as the more usual artist, album etc. There are very few graphical mpd clients which take full advantage of mpd's facilities.

For a console front end I love ncmpcpp. It allows full use of metadata, appearance is easily customised and it's easy to use.

gmpc

ncmpcpp


Front end for mplayer2? You could use smplayer2 if you want a GUI. I usually use mplayer2 via scripts, aliases and file manager context menus. The keyboard and mouse controls are good (and can be customised) and I don't find a GUI necessary. I can't claim it's much fun reading the manual and getting it exactly as wanted but once that's done it's done.


----------



## KimLaroux

Quote: 





hpiper said:


> Thanks a ton for this very informative thread. I installed Gmusicbrowser and now FINALLY have bit-perfect playback of my music. Only problem I have is I can't get sound from my speakers, but it works with my dac and headphones. I'll play with it a bit more later, but thanks again.


 
   
  If your speakers are internal or connected to a sound card, then it's expected behavior. In order to set your music player as bit-perfect, you have to set it to output directly to a specific device. This means the audio stream will only go to this device, and not the others.
   
  The idea of a software mixer is to fix this problem. A software mixer mixes all incoming streams and sends a copy to every connected device. To get bit perfect, we bypass this mixer, losing this capability. Funny thing is you can still send a different stream to each device. So you can have music out of your DAC while watching a youtube video trough your speakers. I do this all the time.


----------



## HPiper

Quote: 





kimlaroux said:


> If your speakers are internal or connected to a sound card, then it's expected behavior. In order to set your music player as bit-perfect, you have to set it to output directly to a specific device. This means the audio stream will only go to this device, and not the others.
> 
> The idea of a software mixer is to fix this problem. A software mixer mixes all incoming streams and sends a copy to every connected device. To get bit perfect, we bypass this mixer, losing this capability. Funny thing is you can still send a different stream to each device. So you can have music out of your DAC while watching a youtube video trough your speakers. I do this all the time.


 

  It is not big problem, I got it working. I had the wrong numbers in the advanced options I had 2 choices after running the aplay -l command and I just picked the wrong one. It was very clear, after running that command, which my dac was but I wasn't sure about my speakers. Still wondering what that 3rd option is for, I am thinking it is the coax or toslink output from my soundcard. Anyway everything is working perfectly now.
   If I can ever get Linux to do all the stuff I need it to do I fully intend to ditch Windows. This is one large step in that direction.


----------



## wolfson

In theory, it should be possible to hear the same bitstream on two devices simultaneously, one bit perfect via a USB DAC and duplicated on your PC internal soundcard to its analog output.
   
  This would be functionally similar to how any low cost set top CD/DVD player sends bit perfect PCM from a CD out its coax/optical SPDIF jack, plus the same audio out its analog RCA outputs.
   
  Using Jack would probably be required to achieve this, perhaps pulseaudio.
   
http://jackaudio.org/
   
http://en.wikipedia.org/wiki/PulseAudio
   
  From an abstract point of view, all that is needed is for the bitstream to be duplicated in memory after read/decoded from the source file, then routed to each sound device, a trivial task for a CPU/memory/software, but may be tricky to set up from a practical point of view.
   
  You would set multiple sinks (outputs) from the same source (application/audio daemon/bitstream) without mixing/resampling.
   
  I have never tried this- just thinking out loud.


----------



## wolfson

To refute the "linux audio is a mess" complainers, often mockingly depicted-
   
http://1.bp.blogspot.com/-jLXOZF_0txQ/T6K3HZ_3JII/AAAAAAAABrw/y-4zbxrWw-E/s1600/linux_audio.png
   
http://harmful.cat-v.org/software/operating-systems/linux/audio-mess.png
   
http://www.indygo.de/misc/linux_audio.png
   
  These diagrams look understandable and "Clean" to me-
   
http://en.wikipedia.org/wiki/Fileulseaudio-diagram.svg
   
http://tuxradar.com/content/how-it-works-linux-audio-explained


----------



## fihidelity

I just removed the resampling line in the output part of mpd.conf and for some reason there's loads of clicking when I send music to my DAC from the Pi. Can anyone tell me why this is and how to solve it?


----------



## KimLaroux

Quote: 





wolfson said:


> In theory, it should be possible to hear the same bitstream on two devices simultaneously, one bit perfect via a USB DAC and duplicated on your PC internal soundcard to its analog output.
> 
> This would be functionally similar to how any low cost set top CD/DVD player sends bit perfect PCM from a CD out its coax/optical SPDIF jack, plus the same audio out its analog RCA outputs.
> 
> ...


 
   
  I believe that the moment you use Jack or Pulse, you lose all bit-perfect output. These things are nothing more than software mixer that plays with the audio stream
   
  Quote: 





fihidelity said:


> I just removed the resampling line in the output part of mpd.conf and for some reason there's loads of clicking when I send music to my DAC from the Pi. Can anyone tell me why this is and how to solve it?


 
   
  It's a known bug on the Pi. I'm blaming a flaky USB implementation and the lack of processing power. There is no fix yet as far as I know.


----------



## fihidelity

Actually not to worry I've just found a fix, it's coming in the next Raspian update. Have a look here.


----------



## XVampireX

Linux is lacking a bit on the software side of the audiophile world, but makes up for it when you do eventually get a good setup the audio drivers are really awesome. Two of the best words in Linux Audio world is ALSA and Jack, very configurable stuff.
   
  I was a linux user for a while, especially when I was stuck with lower end hardware, it's good to play with, still waiting for the day I can truly start using it with all of the games I play.
   
  Out of the software itself I'd recommend Amarok, MPD, heck even Rhythmbox is pretty cool and then there's some of the Amarok wannabe's too like Clementine.
   
  But I don't understand the bit perfect stuff yet
   
  P.S: Linux doesn't seem to be able to do even dsd2pcm which is a shame  I call DSD superior, in any form, be it native or converted to PCM. To compare with even 24/192 well.. vinyl rips at least, I can clearly hear the instrument separation and at least to me it seems like there's plenty more clarity, and maybe even somewhat of a warmth effect.


----------



## xnor

Quote: 





xvampirex said:


> I call DSD superior, in any form, be it native or converted to PCM. To compare with even 24/192 well.. vinyl rips at least, I can clearly hear the instrument separation and at least to me it seems like there's plenty more clarity, and maybe even somewhat of a warmth effect.


 
  Well, but DSD could be considered inferior to even 24/96. The aggressive noise shaping adds a lot of HF noise and there's the problem with editing..
  There's a thread in sound science about this, about 2 weeks old or so.


----------



## Anda

What's the best way to get USB sound to work with Spotify?


----------



## wolfson

Quote: 





xvampirex said:


> P.S: Linux doesn't seem to be able to do even dsd2pcm which is a shame  I call DSD superior, in any form, be it native or converted to PCM. To compare with even 24/192 well.. vinyl rips at least, I can clearly hear the instrument separation and at least to me it seems like there's _*plenty *_*more clarity*, and maybe even somewhat of a *warmth effect*.


 
   
  I think the guys at http://www.hydrogenaudio.org/forums/ might take issue with such "precise" technical jargon 
   
  Given known electrical engineering, acoustics and digital audio science, I'm personally convinced that anything more than 20bit/48Khz PCM is unneeded for playback and cannot be distinguished by most people on most audio equipment, maybe no one in a controlled ABX test.
   
  AFAIK, no one has successfully picked out a difference between 16/44.1 and 24/96 in a _*proper* *_ABX test.
   
  Similarly, I am not aware of any proper ABX test results showing someone can pick out DSD vs PCM
   
  Feel free to provide links/data to back up a claim to prove otherwise.
   
  *start with a 24 bit 96Khz audio file (FILE1) of your choosing, downsample to 16bit 44.1Khz (file2) then upsample file2 to 24bit 96khz (file3) with accepted best practice resampling software methods (see hydrogenaudio forums), then ABX file1 and file3 on a 24/96 DAC of your choosing.  Foobar with ABX plugin is recommended.


----------



## julian67

wolfson said:


> AFAIK, no one has successfully picked out a difference between 16/44.1 and 24/96 in a _*proper* *_ABX test.




http://www.hydrogenaudio.org/forums/index.php?showtopic=81467&st=0 

seems to show more than one successful abx of 16/44.1 vs 24/96.

I find statements along the lines of "nobody has ever abx'd x y or z" can be as unreliable as claims of "I can hear the difference but it's so obvious I didn't measure it and I'm too busy to demonstrate it" because I've seen enough claims here and elsewhere that it's supposedly impossible to abx codec Z vs lossless, player A vs player B and so on, and those claims can persist even after being debunked with abx logs and similar. I also saw that one of the most famous "no result" conclusions regarding hi res vs red book derives from a study where some of the "hi res" files were in fact upsampled red book, see item 13 at http://www.head-fi.org/t/486598/testing-audiophile-claims-and-myths so I think it pays to be skeptical of claims of scientifically proven non-difference as well as of the touchy feely impressions. Where people have a stake they also have a motive or, more kindly, anyone can unknowingly make a series of fundamental mistakes that purely coincidentally lead people to where they hoped they would go in the first place. 

Can I abx 16/44.1 vs 24/96? I don't have the kind of quiet environment or speakers that would make it worthwhile for me to perform abx of 16/44.1 vs 24/96 where the red book file is a very high quality derivative so I don't buy hi res or worry about it but I can't rule out other people being able to perform an abx that shows a difference.


----------



## KimLaroux

Guys please, don't derail this thread on yet another sound science war. This is a technical thread on how to setup audio on Linux, not a debate on which setup is best.


----------



## Snoozles101

Hey, hopefully this is the right place to ask this... does anyone know of a way to get finer control over a system-wide EQ, such as the PulseAudio Multiband EQ?
   
  It *only* has 15 bands by default, but ideally I'd prefer much finer control to tweak specific frequencies to my liking. Is there anything for linux that has this capability on the OS level?


----------



## TwinQY

Jack has jamin, which allows for parametric EQ, 30-band, everything. Most (worthwhile) players will output to jack. I remember back when I used moc, it could do jack as well. I've slowly transitioned most of my music servers to jack and love the customization. 
   
  If you want to stick with just ALSA, fil-plugins and a lot of LADSPA plugins running off of ALSA, but I never got it fully working. Not anywhere near what you can do with jack though.15-band? Forget about it....
  Although, keep in mind, I've not bothered setting jack up on a daily-usage machine like my work laptop. There's no need for that hassle.


----------



## mindbomb

thekisho said:


> I wouldn't mind it to work like WASAPI in shared mode on Windows Vista and 7 (bit perfect until another application needs to play audio).


 
  
 wasapi shared mode is not bitperfect, it will convert the audio from integer to floating point. you need to use wasapi exclusive mode.


----------



## zhunter

What is wasapi exclusive mode? Are they push and event mode?


----------



## gevorg

zhunter said:


> What is wasapi exclusive mode? Are they push and event mode?




WASAPI is Microsoft’s own ASIO, it talks straight to the soundcard if set to exclusive mode. For more info see this and this.

Now back to audiophile playback on Linux.


----------



## yay101

Alsa output with no mixer will be bit exact unless you break something to with bit depth or resampling.


----------



## emueyes

I'll read all 12 pages of this eventually, but just to jump to the exciting bit, are any of these players able to be controlled via DLNA ? I realise using the words 'control' and 'DLNA' in the same sentence is hilariously oxymoronic but it's worth a try. Use case: Linux box full of songs needing to feed a receiver via optical, coax or HDMI, and be controlled by a tablet.


----------



## TwinQY

XBMC can do server/client. So can MediaTomb. I'm not too sure about your usage case though - probably can't help you out. More details?


----------



## emueyes

I'm using XBMC on an i3 based machine ATM, and feeding my new Denon receiver audio via HDMI, The XBMC server is very nicely controlled with Yatse, running on an Android tablet. Yatse does beautiful cover art, remote control, has never crashed. All in all, I don't think I can better this. It sounds excellent. The one area is replacement of the i3 machine. It's a few years old, runs Windows 7, and behaves perfectly. But I have a Snapdragon 4 based board, and there are plenty of other ARM boards out there -  CubieBoard, BeagleBone, Odroid, that run on, say, 6W, compared to 60W from the i3 machine. They'll run Linux of course, or Android, which I'm desperately trying to avoid. (Android, that is, not Linux). My sardonic remark about DLNA being unable to control itself was a bit unjust, Yatse / XBMC work great together.. XBMC could be coerced to run on one of these SBCs, running Linux, and that'd suit me just fine, but I'm wondering if there are better alternatives that will fit into the small ARM computer running Linux scenario. 
  
 The SBC computer probably won't output sound over HDMI either I realise, so I'm looking at USB to S/PDIF converters in my spare time


----------



## TwinQY

If only Alpine could port to ARM I'd be doing so many things right now instead of being unproductive on a forum...sigh...
  
 ReadyMedia (MiniDNLA) is very barebones and might be suited to the task - my previous experience with it left me thinking that it was perhaps a bit _too_ barebones for things I had wanted to do. You'd have to stick with a web client all the way as well.


----------



## emueyes

Thanks TwinQY, I had a look at miniDLNA too, I kinda like it because of that simplicity; the alternative being the labyrinth of XML files in XBMC that I think were written by the same person who wrote Rogue, on a bad day, with a toothache and dentists visit coming up. It's probably got my keystrokes now and is just waiting for me to watch a movie.
  
 The OS is the weak point of these boards. To have that beautiful Snapdragon just sitting there because nothing will run on it is sad. I hope you get Alpine, and that someone tells you that you are very friendly and helpful.


----------



## stv014

gevorg said:


> WASAPI is Microsoft’s own ASIO, it talks straight to the soundcard if set to exclusive mode. For more info see this and this.
> 
> Now back to audiophile playback on Linux.


 
  
 WASAPI actually has some relevance on Linux, because it can be used in WINE to bypass the (not bit perfect) DirectSound emulation, for example in foobar2000.


----------



## Deac0n

Here is a site I came across while I was looking for more info, on this thread.

W w w dot ap-linux dot com

Linux distro with just a music shell. Based on mint . Trying it out, shortly on Virtualbox . 

I hope this helps


----------



## julian67

It's hocus pocus.

Question: if you already have bit perfect audio then how do the bits get more perfect?

Apparently the "answer" is 





> The unnecessary services and daemons, included in standard Linux distributions, have been removed and their negative influence on audio playback made impossible. Printing and some other network services running in background of the standard Linux distributions, use the CPU and memory and are completely useless for audio reproduction.




This is kind of idiotic superstition. It's also not really what they are doing because the distribution runs a full graphical desktop with X and the Xfce desktop environment. I'd love to know how a network printer (for example) might have a mysterious (and unquantified) "negative influence" on audio decoding or on the signal passing through a toslink cable and if these are indeed "a bad thing" then how is it that a full X server/client running is conveniently benign? The authors also seem to believe that a real time kernel is need for simple audio playback. It's a lot of bs. Or to put it another way, it's as credible as the measurements they offer to support their claims.


----------



## Deac0n

What I think they where trying yo do is give you a bare bones install with only what is needed to run the audio system and usb interface . So if you have a old ass computer around you could just make it do audio where if some of the other stuff was running you might get hiccups while trying to decode or output the 24/96 stream. Linux is modular like this so that you can install specifically what you need. I would not be surprised if you used this install on an old ass machine it would work good. In reality on high end hardware it is overkill


----------



## gevorg

julian67 said:


> Question: if you already have bit perfect audio then how do the bits get more perfect?




Some think that there is more to it than just bit-perfect:

http://www.audioasylum.com/forums/pcaudio/messages/12/126159.html


----------



## Deac0n

From my understanding, 1011111000001110101001 is all digital is. Now from what they where talking about I could agree that the timing of the packet going from host to slave if there was not enough buffer Hiccup in stream cpu cycle on some ither process might affect the decoding and introduce something that should not be there. These are my humble observation.


----------



## julian67

If a computer has an audio chip that supports 24/96 then it isn't likely to struggle converting audio. Decoding audio files and passing off to a DAC is not exactly going to put any load even on very modest hardware. No special "audiophile" distro required. If someone somehow has a very modest system that includes a decent sound card then the obvious thing to do would be to run it headless with no X server or graphical environment. It's very easy to set up mpd and then control it from a client i.e. another PC, a tablet , a phone and so on. By the reasoning of the ap-linux crew this would be even more "audiophile" than their offering  

The audioasylum article is about ground noise. I'd love to know how a board with ground noise problems has its problems solved by the choice of a real time kernel or by disabling a daemon or by choosing a particular window manager or desktop environment. You could waste some time trying out the magic software and the mysterious process or you could send the audio elsewhere via spdif and stop worrying about it.

btw Deac0n you mentioned you will be trying this in a VM. This is pointless if you're trying to discover some change in sound quality. You would need to actually install it to hard disk and run it on real hardware, otherwise your "audiophile" OS just inherits all the alleged deficiencies of your current environment.


----------



## Deac0n

I was only using virtual box to look at it. And check out the install. Which 10 years ago would have needed a lot of expert friend help. This if you like to tinker is great. Another way to move people from windows.


----------



## undersys

Did anyone ever do any testing between oss4 alsa and jack?

I hear talk that each one of them is better 
Has there been any real tests with figures graphs etc ? Or is it all hear say


----------



## julian67

undersys said:


> Did anyone ever do any testing between oss4 alsa and jack?
> 
> I hear talk that each one of them is better
> Has there been any real tests with figures graphs etc ? Or is it all hear say




These are not all interchangeable and directly comparable so "testing between" them would be in large part futile.

JACK is a sound server daemon which can use OSS or ALSA (or several others) as a backend.

ALSA is a sound framework that includes kernel drivers and an API.

OSS is similar to ALSA in conception and implementation being a set of kernel drivers and an API.

You could make a fresh comparison of OSS and ALSA, or you could join in a pre-existing religious war and enjoy the same happy experience and reactions.

If you want to compare JACK to something that would probably be Pulse Audio. Again, have fun but that mud slinging contest started a long time ago.

Anyway this thread is "Bit Perfect Audio from Linux" and in that context it doesn't matter if you use ALSA or OSS as long as your sound card has a working driver. If the hardware is capable but the driver doesn't allow you to enjoy bit perfect audio then you have to consider it isn't yet a working driver.


----------



## undersys

Ok sure, thanks for the reply.
 I use jack now on my desktop for audio recording.
  
 I am aware of what alsa/oss is, but from what your saying as long as the driver can interface directly; IE no mixer or crap in between in theory it should not matter as both will be bit perfect. (the real goal)
  
 I agree, but has any one tested it ?
 I am likely to go with ALSA for my new setup with MPD but was interested in testing checking etc... a bit more scientific rather then holy-wars  
 If they are exactly bit perfect then there should no measurable difference between OSS and ALSA.


----------



## julian67

undersys said:


> I agree, but has any one tested it ?




You can easily check for yourself on your own hardware by outputting via spdif to external dac or digital recorder and checking the result is the same in turn with alsa and oss.


----------



## undersys

julian67 said:


> You can easily check for yourself on your own hardware by outputting via spdif to external dac or digital recorder and checking the result is the same in turn with alsa and oss.


 
  
 That was my plan 
 I don't have the H/W yet for the new audio setup.
 Hence they question.


----------



## julian67

I would use mplayer (command line, not GUI front end). Then it's easy to send decoded audio direct to hardware, specifying driver, bypassing system mixer and sound daemons, and taking exclusive control of the hardware. Run it in verbose mode to see exactly what it's doing.


----------



## undersys

thanks for that. I love the CLI anyway  (Gentoo user)
 I'll worry about that when the kit gets hear, thanks for you reply.


----------



## emueyes

Has anyone had experience with the Cubieboards? They would seem to offer everything that's needed: S/PDIF, a SATA port, and Fedora or Ubuntu. The version 3 board has Toslink, the previous version coax with some TTL level changing from its IO headers.


----------



## yay101

No experience except a lot of reading and having used the pi as a bit perfect music player.

But from what I can tell the cuboxi is by far the superior product with none of the issues the pi had (many USB sync issues and dropouts) and make a fantastic little media device. All of alsa is present and accounted for in packages for the kernels being prepared, the very latest kernel actually.

Ive ordered one for my girlfriend for xbmc duties and one for me for programming duties. If you need more hardware don't forget to check out the utilite.


----------



## emueyes

Could I ask, which model Cubie did you decide on getting? Their models' features / pricing are a bit confusing, with the CubieTruck seeming to be less expensive than the preceding models ?
  
 Sounds like you haven't taken delivery yet, but I would really like to know what build of XBMC you find works the best, or also for that matter what OS you decide to run on it. Linux and XBMC are my current choice for the use I want to put the board to, a remotely controllable jukebox of as high quality as I can reasonably achieve.
  
 I have in mind also one of these http://www.ebay.com/itm/Hi-Fi-24bit-192K-USB-DAC-Amp-CM6631A-CS4398-Coaxial-RCA-Out-Headphone-Amplifier-/190850934929?pt=LH_DefaultDomain_0&hash=item2c6f9a2891
  
 as an audio output. Even if it doesn't get used for the main system, I figure I get a headphone amp. It should in theory be great though, and I can use my receiver as DAC, music collection on local SATA drive and Android tablet running Yatse to control it.
  
  
  
 I agree btw, regarding you comments on the RasPi. It's been a wonderful step, no doubt introduced thousands of people to small computers, to programming and to hardware at a fairly low level, Truly a great product, but, as you say, their are factors that limit its use in 'mission critical, cannot tolerate error' situations like audio playback. The USB situation, given my plan of using a USB -> S/PDIF converter, is very important.


----------



## ssrock64

Hello, everyone. My apologies for unceremoniously resurrecting this thread once again.
  
 It's been so long since I used my computer-based home setup that I've gone through an OS change (to Bodhi Linux) and bought a brand-new ODAC since I last fired up Gmusicbrowser. Unfortunately, despite configuring everything the way I've always done, I'm getting *a lot* of hiss through the Gmusicbrowser/ODAC/SX780 chain. I've isolated it to the USB audio side of the equation, since there's nowhere near that much noise in my CDP chain.
  
 What could I have done wrong that's letting my ODAC act like the computer's hissy headphone out would?


----------



## TwinQY

I'm using an ODAC with no problems (mpd). I've just installed gmusicbrowser to simulate your experience, have set it all up, doesn't seem to be a problem on my end.
  
 Perhaps go into more detail about the hiss, playback machine, how you've set it up, USB input stream, strace, pretty much any debug logs/info we could go on?


----------



## ssrock64

I should've clarified in my initial post: it's definitely not the player software that's the problem. The hiss begins as soon as the loading screen for the OS shows if I have the DAC plugged in on startup, or whenever I plug it in afterward. I don't have to be using Gmusicbrowser for it to be hissing.
  
 It's definitely computer noise, since little upticks in pitch and intensity correspond to login actions, opening programs, and editing files. Like I said earlier, it's as if I've plugged in very sensitive headphones directly to the headphone out of the computer. Everything on my sound controls for any output is muted, and Gmusicbrowser is set up with the Alsa pipieline hw:1,0 or hw:2,0 depending on where the device mounts each time I plug it in.
  
 Are there any commands I could run that might illuminate the issue?


----------



## bcschmerker4

ssrock64 said:


> I should've clarified in my initial post: it's definitely not the player software that's the problem. The hiss begins as soon as the loading screen for the OS shows if I have the DAC plugged in on startup, or whenever I plug it in afterward. I don't have to be using Gmusicbrowser for it to be hissing.
> 
> It's definitely computer noise, since little upticks in pitch and intensity correspond to login actions, opening programs, and editing files. Like I said earlier, it's as if I've plugged in very sensitive headphones directly to the headphone out of the computer. Everything on my sound controls for any output is muted, and Gmusicbrowser is set up with the Alsa pipieline hw:1,0 or hw:2,0 depending on where the device mounts each time I plug it in.
> 
> Are there any commands I could run that might illuminate the issue?


 

 What additional hardware is in your system?  I noticed a lesser version of your computer-noise problem on my own custom "Hot Rod gPC™" LinUX box, as its installed Creative Laboratories® SB0350 (which is nowhere near as well-shielded as the Asus® XONAR® Essence™ STX™ installed in my upgraded Asus® CM1630-06) picks up internal noise at the rear Mic In, especially with the +20dB mic boost active.  (On the same system, the SB0250 I/O Drive's Line2/Mic2 input is unusable due to a suspected circuit-board problem, as it performs erratically even when it does have an input signal.)


----------



## ssrock64

I did a lot of wire rearrangement behind my stereo equipment so that nothing was crossing paths, and unplugged my CD player. For now, it seems to have resolved the problem. Is it possible that the radio antenna of my SX780 could be picking up computer noise and transferring it to the DAC or something crazy like that?


----------



## yay101

http://www.daphile.com/
  
 Genuinely fantastic little system.


----------



## ssrock64

yay101 said:


> http://www.daphile.com/
> 
> Genuinely fantastic little system.


 
 If this works as well as it claims to, this could solve my most prominent issue with Linux.
  
 Every time I change any of my audio settings in Bodhi, I end up having to go back into alsamixer to make it work with my ODAC or DAC1 again.
  
 EDIT: I'm installing it now; I'll report back on how well it works!


----------



## yay101

Its no desktop os, but it's a brilliantly simple standalone.


----------



## ssrock64

I've spent about half an hour with it so far, and all I can say is *WOW*. This is brilliant; this is going to be my default system from now on. Thanks so much!
  
 I'll try to post some details later on tonight or tomorrow so more people know what makes it so great.


----------



## yay101

There's a post on here about the distro and one over on hydrogen audio where I have posted several feature requests and have gotten fast replys from the developer.

Enjoy!


----------



## ssrock64

Here's a couple of screenshots from the distance interface of the Daphile server, which I'm viewing across the room from the host computer on a MacBook. If I had a cord long enough, I could wander the entire house with my headphones if I wished while controlling my TOTL bedroom setup from any room. It recognizes my ODAC and DAC1 natively, and configures them for bitperfect playback without any effort from me. The same goes for my external hard drive, which it recognized as soon as I did a scan of devices. All the songs were automatically added to my library. I've been loving the shuffle mode, which works very cleanly and gives you a preview queue to edit if you wish (something you can't do easily with gmusicbrowser and friends). And you can't deny that the UI is really good-looking, too.
  

  

  
 As far as Linux-based audiophile playback goes, this is a game-changer in my mind.
  
 EDIT: I should mention, since one of the screenshots above shows me rocking out to the Abbey Road medley set, that gapless works flawlessly as well.


----------



## shaya

Hi,
  
 I read through most of this long and very helpful thread, but in gmusicbrowser, when I set the "Alsa Device" to use the Xonar STX to "hw:3,0" (I use headphones) it does not work and gives the Error message: "Playing error: Configured audiosink alsa is not working. at /usr/bin/../share/gmusicbrowser/gmusicbrowser_gstream-0.10.pm line 135"
  
 Here is "aplay -l":
  
 card 0: MID [HDA Intel MID], device 0: ALC888 Analog [ALC888 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 0: MID [HDA Intel MID], device 1: ALC888 Digital [ALC888 Digital]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 1: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 2: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 3: STX [Xonar STX], device 0: Multichannel [Multichannel]
   Subdevices: 0/1
   Subdevice #0: subdevice #0
 card 3: STX [Xonar STX], device 1: Digital [Digital]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
  
 Many thanks in advance for any advice with this!


----------



## ssrock64

shaya said:


> Hi,
> 
> I read through most of this long and very helpful thread, but in gmusicbrowser, when I set the "Alsa Device" to use the Xonar STX to "hw:3,0" (I use headphones) it does not work and gives the Error message: "Playing error: Configured audiosink alsa is not working. at /usr/bin/../share/gmusicbrowser/gmusicbrowser_gstream-0.10.pm line 135"


 
 Did you try 3,1?


----------



## shaya

yes, I tried 3,1. Same Error!?


----------



## ssrock64

shaya said:


> yes, I tried 3,1. Same Error!?


 
 Sometimes I have to fiddle with what order I plug things in to get my DAC to be fully recognized, but that's not something you can do with a built-in DAC. Are you sure that everything is properly hooked up?


----------



## shaya

I think everything is hooked up properly. When I leave the field "output device" empty I can listen through the STX's headphone jack.


----------



## ssrock64

shaya said:


> I think everything is hooked up properly. When I leave the field "output device" empty I can listen through the STX's headphone jack.


 
 You're likely not getting bitperfect output if you do that, but I'm no expert.


----------



## shaya

I guess you're right... hmmm


----------



## yay101

Do you use the other outputs for other puposes? for instance force music through you STX but watch tv through your hdmi or anything?
  
 It may be easier to force your headphones as default output and set other programs to play through pulse/ selected pulse output.
  

```
pcm.!default { type hw card 3 } ctl.!default { type hw card 3 }
```
  
 That sets your default controller and mixer devices to your STX card. A simple reboot would give you bit perfect from any one application at a time.
  
 The above goes in your:

```
/etc/asound.conf
```
  
 or
  

```
/home/xxx/.asoundrc
```


----------



## shaya

Thank you for that advice! It worked!
  
 I do exclusively use the STX outputs (the headphone-out and the front-out with an amp and speakers).
  
 ALso I just discovered Audiophile _Linux  _http://www.ap-linux.com/


----------



## crashley

I have a Dell XPS 13 laptop that has 2 USB ports and an HDMI port. The aplay -l output is;
  
 **** List of PLAYBACK Hardware Devices ****
 card 0: PCH [HDA Intel PCH], device 0: ALC275 Analog [ALC275 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
  
 So, it looks like the USB ports don't show up. I'm thinking about getting a USB DAC/Amp and it might be the case that without actually connecting a USB device up, it's normal that they don't show. OTOH I'm not sure about it and I don't want to buy something if it won't work.
  
 Can anyone tell me if the USB ports don't show up unless you have a device hooked up to it?


----------



## undersys

USB ports won't show up under aplay with out a audio device plugged into them.

 Thats expected


----------



## yay101

Edit* what he said ^ 

Also make sure the DAC you buy doesn't need special drivers to work 99% of them are fine as they either support generic drivers or have then provided.


----------



## crashley

Thanks.
  
 I read all 15 pages in this thread and didn't get the answer I needed. 5 minutes after posting, I did. Incidentally, I have my eye on that WA7 Fireflies. I doubt that it would need a special driver but ya never know.


----------



## yay101

That DAC uses the cmedia 6631 usb interface which has native support under Linux and macos. So unless woo audio saw fit to modify the interface somehow it should be fine right out of the gate. If you see someone with one perhaps ask them to test it with a Linux live cd.


----------



## yay101

shaya said:


> Thank you for that advice! It worked!
> 
> I do exclusively use the STX outputs (the headphone-out and the front-out with an amp and speakers).
> 
> ALso I just discovered Audiophile _Linux  _http://www.ap-linux.com/


 
 I found audiophile linux to not be all it's cracked up to be, and found daphile to be the far better standalone player running off a netbook with my dac and amp hooked up.

 Your mileage may of course vary, and it may be improved since i used it a couple of months ago. All the best with your journey!


----------



## bcschmerker4

yay101 said:


> ...I found audiophile linux to not be all it's cracked up to be, and found daphile to be the far better standalone player running off a netbook with my dac and amp hooked up.
> 
> Your mileage may of course vary, and it may be improved since i used it a couple of months ago. All the best with your journey!


 
 Speaking of Audiophile LinUX™, any idea which Kernel version?  I've had nothing but problems with the RT kernel (specifically Kernel 2.6.11-15-rt) last supported by Canonical in Ubuntu® Studio™ 10.04.4-LTS Lucid Lynx™ - apparently the RT patches were engineered for Intel® hardware at the time, and the Advanced Micro Devices® Athlon 64® X2 5600+ kept going into Kernel panics and other crashes.  I need to find out whether any sub-release(s) of Kernel 3.x will work consistently on AMD® hardware such as I currently use with 12.04.4-LTS Precise Pangolin™ and anticipate re-using with 14.01b1 (as of the new year) Trusty Tahr™ when released to market (presumably as 14.04.1-LTS).


----------



## yay101

You shouldn't have any issues as is currently. I have a phenom Ii rig that works fine with the generic rt kernel provided in the repositories of 13.04+


----------



## undersys

Have you measured and tested that a RT kernel is in fact benefiting your application ?


----------



## yay101

All of jackds internal measurements all showed improvement. Always remember to avoid producing load on a music machine as io load will destroy any benefits.


----------



## undersys

Jack is not bit perfect from my understanding ?
 I could get why jack would benefit, especially for recording instruments.


----------



## yay101

Jack is.... Complicated. It can be bit perfect or not depending on your application chain. But yes rt kernels don't really help an already asynchronous USB connection.


----------



## ssrock64

Complicated is definitely the right word for Jack. It's always been way too much of a pain for me to try to implement properly on any chain I've had. I'm perfectly happy with Daphile as a server and a gmusicbroswer ALSA chain for listening when I need to multitask on the computer.


----------



## kebbgolive

Well maybe I'm talking about non-exclusive mode of WASAPI and Shared mode is the name of when more than one audio stream is trying to access the audio output.  So I was lead to believe.  The person also use a DTS or AC/3 audio stream to prove that when it has to share with another applications active audio stream the decoder drops out during the two mixed audio streams.


----------



## yay101

What is that in reply to?


----------



## ssedlmayr

First, I would like to thank everyone on here, and Head-Fi.  Your information is terrific, as is your dedication to excellence in audio.  
 [size=xx-small]​I used [/size]to[size=xx-small] have a very high end system.  It was a Linn system with 9 different speaker boxes, each box having either 3, 5 or 7 speakers in each box.  Every speaker had its own amp, and each amp had a dynamic filter in it for each dedicated freq range.  Every wire also was tuned for a certain freq range.  So the 7 speaker towers up front had 7 dual wires going to it, driven by 7 amps with 7 dynamic filters built into the amps, with selected wires for those freqs.  Also had the Linn player for the cds, which played the SACD and DVDA formats, and it had a DAC built in for the 24/192k sound.  So it was pretty awesome.  Linn even flew over 2 engineers to look at it and study it.  They then built an identical system for the Queen back home.  [/size]
  
 [size=xx-small]But I lost everything in the crash in 2008, including house, cars, everything.  Left with clothes on my back.  So I miss having good audio.[/size]
  
 [size=xx-small]​Since then I have acquired a good Linux computer and I am running Ubuntu 12.10 with a Sound Blaster SB400 and Grado SR325 headphones.  Using your info I think I have achieved 24/192 output.  I am using DeadBeef for the program.  I chose the output to be set at SB Audigy 2 Value (400), ADC Capture/Standard PCM device Playback Direct Hardware without any conversions.  Also set the secret Rabbit Code to automatic samplerate and a target sample rate of 192,200, and quality algorithm to since_best_quality.  For the ADplug I set it to prefer Ken emu over Satoh, and then set the ALSA output plugin to no ALSA resampling and release device while stopped.  Preferred buffer size is 20000 and preferred period size is 1024.[/size]
  
 [size=xx-small]I do not know what some of these do, but the 24/192 recordings I do have on my hard disk do sound pretty good.  [/size]
  
 [size=xx-small]Can you comment on what I have done and if there is an improvement, or have I done it correctly?  Your kind advice is appreciated, and I have the people on here so knowledgable that I take your advice to heart. [/size]
  
 [size=xx-small]​Also, would your recommend another program, or is DeadBeef good enough to do this.  I have noticed that some others like Gmusicbrowser.  Would this be a better program, or is the GUI better in people's estimation.[/size]
  
 [size=xx-small]One more question.  I am thinking about getting an Emotiva DAC XDA-2 (wish I could afford the Stealth DC-1)  that uses USB input for my headphone driver.  Do devices like this need special drivers, or is that handled by the Linux OS?  Will the bits be passed directly to the USB bus and then to the external DAC for conversion, or is there some processing done before they are passed?  It seems like the programs will pass directly to the USB bus if the preferences are right.  I have emailed Emotiva with these questions but have not received an answer back yet. If Linux recognizes one USB device, will it recognize all the others that are also DACS?  That is, is one DAC the same as all the other DACs to Linux?[/size]
  
 [size=xx-small]And the last question, if I do the above, would it benefit me to use the output of the DAC to go into a tube headphone amplifier?  Would I gain anything?  [/size]
  
 [size=xx-small]Thanks again for any help that you throw my way.[/size]
  
 [size=xx-small]Best Regards to everyone.[/size]


----------



## ssedlmayr

Here is the reply I received from Emotiva.  Any comments to help me?
  
 The XDA-2 uses UAC2 (USB Audio Class 2), which is supported by some Linux dists and not others.

 Check out the attached PDF, and the following link.....

http://www.computeraudiophile.com/f10-music-servers/linux-distro-netbook-w-uac2-0-a-11222/

 The DC-1 uses the C-Media CM6631A USB interface chip.
 Our implementation is UAC2 ONLY.
 Other well known devices that use the same chip are the Asus Xonar Essence “high end external sound 
 card” and many of the DACs made by Schiit Audio.

 I have one comment that Linux Mint is “fully UAC2 compatible”. 

 Especially read the attached “unofficial” help
 (Note: we didn’t try it here)
 The XDA-2 (which he used) has the CM6631 chip, while the DC-1 has the CM6631A, 
 but they are basically the same and use the same drivers, so it should work similarly for both


 Unfortunately, I'm not especially well-versed in Linux itself, so I can't offer you much support beyond that...
  
 Thanks


----------



## Chs177

ssedlmayr said:


> Here is the reply I received from Emotiva.  Any comments to help me?


 
 As I seen on alsa site there is issues with linux and this chip - http://comments.gmane.org/gmane.linux.alsa.user/36935.
 May be you will be lucky to solve it..


----------



## yay101

Hey ssedlmayr, UAC2 support only depends on 4 things:
  
 1. USB 2.0 hardware.
  
 2. Kernel with support for it or the correct modules (all modern distro's)
  
 3. Modern Alsa install.
  
 4. The manufacturer to stick to known standards.

 Number 4 is where companies fall down, luckily its not super hard to program a way around it in alsa if the hardware is well documented.
  
http://www.head-fi.org/t/700447/guide-newb-guide-to-bit-perfect-linux-audio#post_10171335

 Here is a starters guide I wrote to getting bit perfect audio on Linux. You seem to know a bit, but this will help you with the software setup side.


----------



## LowLatency

Awesome thread, just one question though.
 Isn't bitperfect output supposed to render volume controls in the player useless?
  
 I've disabled dmix via deadbeef using the settings: "M Audio Audiophile 24/96, ICE1712 multi Front Speakers" also disabled ALSA resampling, enabled Release device when stoped.
 44.1 tracks play as 44.1 also 96 tracks play as 96Hz etc.
  
 MMAP_INTERLEAVED
 format: S32_LE
 subformat: STD
 channels: 10
 rate: 44100 (44100/1)
 period_size: 1024
 buffer_size: 6553
  
 SuperEQ and Resampling were also removed via the DSP section but SuperEQ keeps reappearing, although EQ isn't enabled.
  
 But the volume controls in deadbeef still function.. Is it possible to disable them?


----------



## yay101

This is exactly true LowLatency.
  
 You cannot have digital volume control AND bitperfect playback (well you can, but it gets SUPER complicated and needs special hardware). You can usually stand to lose a few bits before you will hear an audible difference that isn't placebo, but it does happen. Most people say they can hear a "normalisation" like effect at about 88% or lower, this is from the sound science forum if you would like to have a read.
  
 May i ask why you have dmix if you don't intend on using it? A simpler system is, well, a simpler system. Always set a music player to the direct name of your device, not to a soft name a mixer gives it if you want to use bitperfect playback. If you want to get dmix working as a sole volume control on your system i can help you set that up if you would like. Otherwise just chuck it and set deadbeef to your hardware address.


----------



## LowLatency

Thanks yay101, thats what I figured..
  
 Do you have a link to that info on the sound science forum? Seems like an intresting read.
  
 Regarding dmix I thought that it was enabled as default for soundcards which do not support hardware mixing for later revisions?
  
 I also have it generally disabled under .asoundrc via:
  
 pcm.!default{
  type hw
  card 0
 }
  
 Although that has no effect on the volume controls in deadbeef. 
 Without the settings in .asoundrc I can get playback without volume controls in cmus, although setting it to "hw:0,0" to bypass dmix and have the correct Hz disables any audio.
  
 I've tried the other options for output in deadbeef and M2496 front speakers is the only one that outputs sound at the correct Hz.
 I'd just like to remove dmix completely from the chain and have deadbeef without any soft volume control or dsp.


----------



## yay101

There is a much longer read on the subject I will try to find for you, as it was more in depth as far as usage scenarios go.
  
http://www.head-fi.org/t/689942/digital-vs-analog-volume-control
  
 This is the one i was thinking of: http://www.head-fi.org/t/671220/effective-number-of-bits-or-why-you-have-to-keep-software-at-full-volume-is-nonsense

 I am honestly not entirely sure what is default when you don't have hardware mixing as i haven't had a machine without it for many years, perhaps someone else can answer that question although i will be looking into it for my own personal interests. It sounds like you have a deeper issue going on however, by the lack of audio when you try to access the hardware directly. What version and system are you running?

 Have you tried simply uninstalling dmix?


----------



## Makiah S

How well do linux Distros handle USB Dacs?


----------



## eimis

You just plug them in and they work. Not sure if that's well enough for you.


----------



## Chs177

mshenay said:


> How well do linux Distros handle USB Dacs?


 

 It depends on USB chip in the DAC: some DACs recognized on fly, some with problems, some wth workarounds.


----------



## Makiah S

eimis said:


> You just plug them in and they work. Not sure if that's well enough for you.


 
 sounds good to me


----------



## ssrock64

Does anybody else have issues with Gmusicbrowser intermittently crashing? Mine tends to shut down with a Gstreamer error on occasion, especially after ending an album on sequential play mode.


----------



## yay101

Whats the error?


----------



## ssrock64

yay101 said:


> Whats the error?


 

 I can't remember the exact phrase at the moment; I'll try to screenshot it when it happens next.


----------



## yay101

If possible, start gmusicbrowser from a terminal and copy the terminal output for me as well.


----------



## TwinQY

Gmusicbrowser also has verbose and debug flags, if you just force it to crash the regular output is less than useful.

 I installed it and tried to replicate the bug but to no avail.
 There are no commonly reported bugs or tickets on anything like this issue so strace would be useful as well in case it's something wrong with your system.
 Distro? Version? Gstreamer version? If you replicate the activity on a different player will a similar behaviour occur?


----------



## HPiper

It isn't quite plug and play, my HiFiMan EF2a dac works fine on Linux but my Modi dac not only doesn't work but slows Ubuntu down to a crawl until I unplug it.


----------



## ssrock64

It's probably facing some issues being on a Distro that doesn't fully support it, or perhaps an older version of Gstreamer. I'm running the latest version of Bodhi Linux, and my most common problems are the aforementioned crash issue and a glitched display of time passed and time remaining in a song when I pause it. If I pause halfway through a 4-minute song, it might display 122 hours of play in the song, and two minutes left, with the time slider all the way to the right.


----------



## ronalde

undersys said:


> Jack is not bit perfect from my understanding ?
> I could get why jack would benefit, especially for recording instruments.


 
 You're right, jack isn't bit perfect and isn't supposed to be. Jack its "middle ware" connecting the input and output of "user applications" to those of "backend" libraries and drivers, like alsa, oss and portaudio.
  
 Jacks reason for being is (low-latency) recording and playback and (sample rate and format) synchronization between the in and output streams applications and the backend software (like hardware drivers) produce or consume.
  
 jackd (the master daemon process) glues all those different streams together to a fixed sample rate and bit depth. The combined output channels are just one of those streams, which jacks  synchronizes and reformats.


----------



## ronalde

ssedlmayr said:


> [size=xx-small]​Since then I have acquired a good Linux computer and I am running Ubuntu 12.10 with a Sound Blaster SB400 and Grado SR325 headphones.  Using your info I think I have achieved 24/192 output.  I am using DeadBeef for the program.  I chose the output to be set at SB Audigy 2 Value (400), ADC Capture/Standard PCM device Playback Direct Hardware without any conversions.  Also set the secret Rabbit Code to automatic samplerate and a target sample rate of 192,200, and quality algorithm to since_best_quality.  For the ADplug I set it to prefer Ken emu over Satoh, and then set the ALSA output plugin to no ALSA resampling and release device while stopped.  Preferred buffer size is 20000 and preferred period size is 1024.[/size]
> 
> [size=xx-small]I do not know what some of these do, but the 24/192 recordings I do have on my hard disk do sound pretty good.  [/size]
> 
> ...


 
  
 Dear ssedlmayr,
  
 It's sad to read about your unfortunate crash. Nice though that you're endeavors led to the queen having a proper sound system, I guess it's rather hard to fill up her not too modest surroundings with majestic sound. 
  
 Maybe this sheds some light on your questions. 
  
 Your software configuration is not geared towards "bit perfect" audio playback. Bit perfect is about getting rid of any influence of the computers operating system and user applications on (the playback of) digital source files. The source files are supposed to have arrived at your music playback computer in a (bit) perfect manner. This could easily be assessed by comparing the bits that make up the files, both at the sender and your computer, if the sender is willing to provide such information. In the computer world this normally is done using checksums, for example using the popular md5sum program. No confusion on the "perfectness" is possible. 
  
 The part of getting the (pristine) source music files from your computer (or network device) to a playback system like your SB Audagy in a (bit) perfect manner is a little more complex. That is because all consumer operating systems (like Linux, Mac and Windows) are default configured towards usability and convenience, and not audio playback. That explains the existence of threads like this one. According to the description of your configuration, in which deadbeef sends it's output to pulseaudio, which re-samples and re-formats the incoming audio, before handing it over to alsa's libraries and hardware driver for the SB Audagy, it is not bit perfect. It alters the digital audio before handing it over the DA converter. Many audio enthusiasts therefore prefer "bit perfect" output of their music playback software. 
   BTW, a DA converter can't be bit perfect, as such a device has both a digital and an analog end (no "bits" there) and the D-to-A conversion involves filters that influence the analog audio in the audible domain. 
  
 With your current hardware and Ubuntu, it's perfectly possible to get this kind of transparent transfer of digital audio. On Ubuntu, it's all about bypassing pulseaudio or other audio altering software and using alsa's hardware interfaces instead (using "hw:x,y"). Just read about it in this thread, yay101's Newbie Guide on bit perfect playback or the articles on my website (which are geared towards using Music Player Daemon / mpd).
  
 You could then really concentrate on getting good sounding source files and comparing different audio components, like a separate DA converter and/or a high quality headphone amplifier, without having to worry about the applications or the operating system influencing the sound quality. 
  
 Regards,
 Ronald


----------



## HPiper

I was wondering if anyone is using the Bifrost dac under Ubuntu 12.4 (or any version really) and if it was difficult to get working or if it was pretty much plug and play?


----------



## Chs177

hpiper said:


> I was wondering if anyone is using the Bifrost dac under Ubuntu 12.4 (or any version really) and if it was difficult to get working or if it was pretty much plug and play?


 

 Bifrosf have USB C-Media CM6631A chip. It also in Modi.
 I found out this link:
http://www.amazon.com/automatically-distros-Ubuntu-specialised-Audiophile/forum/Fx10CKODN7N4HQE/Tx2T6SJ1IWXQX9F/1/ref=cm_cd_ql_tlc_al?_encoding=UTF8&asin=B00CICPN0K
 May be it will help.


----------



## yay101

The BiFrost SHOULD be plug and play, the chip it  uses for usb is supported on linux in usb1.0 mode. Usb 2.0 mode will be supported as soon as CMedia get around to it.
  
 FURTHER READING:
 Always be on the watch for devices that have supported hardware but then use a joint usb mode for connections such as using other chips on input to lower or remove jitter, these often have adverse affects without the specific driver from the manufacturer.


----------



## LowLatency

Managed to get CMUS bitperfect as far as I understand via ALSA (no dmix, no software volume control unlike deadbeef, no DSP, no funny business), as CMUS is ncurses based you can also run outside of X, which is nice.
  
 Open CMUS, then press 7, scroll down to "output_plugin" make sure it's "alsa".
 Scroll up to "dsp.alsa.device" make sure it's "plughw:0", 0 worked for me, could be 0,0 or 1,0 etc. If plughw doesn't work try "hw:0" or 0,0 etc.
 Scroll down to change "mixer.alsa.channel" delete "Master" so the setting is empty, also empty "mixer.alsa.device".
 Lastly make sure "softvol" is "false".
  
 Changing volume via "[ & ]" in CMUS produces: "Error: can't change volume: mixer is not open".
  
 "cat /proc/asound/card0/pcm0p/sub0/hw_params" output from a 44.1Hz FLAC file is: 
  
 access: MMAP_INTERLEAVED
 format: S32_LE
 subformat: STD
 channels: 10
 rate: 44100 (44100/1)
 period_size: 221
 buffer_size: 6553


----------



## eimis

^ I'm trying it out now. Looks like it can't play 96/24?


----------



## Chs177

eimis said:


> ^ I'm trying it out now. Looks like it can't play 96/24?


 
 cat /proc/asound/card*/stream*
 ?


----------



## LowLatency

eimis said:


> ^ I'm trying it out now. Looks like it can't play 96/24?


 
  
 Strange, 24/96 works here..
  
  cat /proc/asound/card0/pcm0p/sub0/hw_params
 access: MMAP_INTERLEAVED
 format: S32_LE
 subformat: STD
 channels: 10
 rate: 96000 (96000/1)
 period_size: 481
 buffer_size: 6553


----------



## mofonyx

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!


----------



## yay101

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!


----------



## ampair

mofonyx said:


> 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.


----------



## mofonyx

yay101 said:


> 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?


----------



## Berdine

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.


----------



## komhst

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)


----------



## yay101

@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.
  
   



Spoiler: Warning: Spoiler!



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


> sudo apt-get update && sudo apt-get install -y alsa alsa-utils


 
   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
> ...


 
  
 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:
  


> hw:1,0


 
  
 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
> ...


 
  
 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
> ...


 
  
  
 You are done with alsa!


----------



## yay101

I love Clementine! It is my favourite "Foobar for linux". For dedicated listening i started using daphile and haven't looked back!


----------



## mofonyx

yay101 said:


> @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


----------



## mofonyx

Quote:


> aplay -l


 
  
 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
> ...


 
  
 and my asound.conf reads


> pcm.!default {
> type hw
> card 1
> device 1
> ...


 
  
 Still able to alter volume on deadbeef and clementine.


----------



## Zoo Animal

komhst said:


> My top 3 audio players for bit perfect audio in Linux are:
> 
> - Clementune
> - Audacious
> ...


 
  
 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 

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


----------



## julian67

zoo animal said:


> 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
> 
> 
> 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:


```
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.


----------



## yay101

Deadbeef is probably using a included mixer, most music players offer a way to turn off volume control in settings, if they ever don't just remember to leave then at 100%. The best way to test that deadbeef has exclusivity is just to try to play a file in something else / YouTube. Only music should be audible.


----------



## mofonyx

Tried playing something else whilst listening to audio.
  
 There is just one audio device that is built into the mobo, so card 0 outputs to HDMI and card 1 outputs to PCH, which contains the SPDIF out. When I play something on soundcloud while listening to music on deadbeef, it plays via HDMI but nothing goes through the SPDIF. So I guess that's fine.
  
 Me being paranoid here but if the file is being passed through a software mixer before being output digitally through SPDIF - could this potentially be flawed and not 'bit perfect' ?
  
 Tried it with clementine also and when set up to output with ALSA, I am able to use the built in equaliser and mess around with the L/R balance.
  
 :/


----------



## ampair

mofonyx said:


> Thanks, that seems to be the case.
> 
> Me being paranoid here but if the file is *being passed through a software mixer before being output digitally through SPDIF* - could this potentially be flawed and not 'bit perfect' ?
> 
> ...


 
  
 "bit perfect" = the bit stream from the music file is passed as-is and excusively to the spdif output, without *any* kind of processing.
 means: no volume/balance adjustment, no eq/bass boost/treble boost, no mixing with other bit streams, no resampling, no crossfading, no anything else.
  
 so yes, you are correct. as soon as there's any kind of software mixer in between it's technically not bit perfect.


----------



## mofonyx

how do I fix this?
  
 I tried Audacious and it seems that it allows you to 'set' a bit-depth and not let the bit-depth be determined by the audio file. The good thing about Audacious is that it allows you to disable all software volume control, so essentially the output is perfect as far as I am concerned
  


> cat /proc/asound/card1/pcm1p/sub0/hw_params


 
  
 shows me that the bit depth does change when I try to tinker with preferences in Audacious to set a bit depth.
  
 Using DeadbeeF or Clementine PUSHES all tracks to a bit-depth of 32 and I don't know the significance of that on bit perfectness.
  
 Please advise!


----------



## ampair

> Originally Posted by *mofonyx* /img/forum/go_quote.gif
> 
> Using DeadbeeF or Clementine PUSHES all tracks to a bit-depth of 32 and I don't know the significance of that on bit perfectness.


 
  
 don't worry. the "increase" in bit depth does nothing but stuff zeros to the lesser significant bits, where the additional info would supposed to be.


----------



## mofonyx

Oh, right. Great.
  
 I found that MPD with GMPC works best (and adjusts bit-depth according to files - although you've mentioned that this bears little significance). Audacious comes close with working very well too. These two programs disable software control altogether.
  
 DeadbeeF and Clementine seem to allow software volume control, which is a slight annoyance.


----------



## KimLaroux

Oh lord... I updated to fedora 20 with KDE 4.12.5 a few days ago, and it's killing me.
  
 They broke EVERYTHING!
  
 3 days of messing around and I still cant get Amarok to output bit perfect trough my SPDIF like it was on fedora 18. Ugh. 
  
 They totally broke Phonon in the name of "improved user experience". There is no way to select specific ALSA channels in the "Device Preference" tab, and they created a new tab which uses "profiles" to setup your channels. And just to help things, there's no profile that uses both my laptop's speakers while allowing some apps to use direct devices.
  
 Worst is the new "PulseAudio Integration" of Kmix. It took me a while to figure out how to turn it off, but now the mute button on my laptop is broken. Hitting it once mutes both the Master and Speaker channels, but hitting it again only unmutes one of those channel, the one you selected as master channel. Re Ugh.
  
 Anyone faced these new problems and came out with a solution? Any help would be welcome at this point...
  
 edit: More technical details here http://fedoraproject.org/wiki/Features/KDE_PulseAudio_Integration


----------



## yay101

I am literally half an hour from installing kubuntu or debian with KDE. I guess i will see if they broke the world too.


----------



## eimis

you should give manjaro a try. i used to be a debian/*buntu/mint fan but finally got sick of using ppas to get the latest stuff. i've been using arch (manjaro's based on it) for more than a year and it's absolutely great.
  
 i see debian's use in servers, not desktop though
  
  
 ooh and KaOS is a new hype, looks good


----------



## Chs177

*KimLaroux,*
  
 try deadbeef, it's pretty good player.


----------



## TwinQY

Although it seems that KDE is still working on their Phonon, Qt5 marks the point where QtMultimedia replaces it instead. I'm not holding out on any hope of it getting much attention in the future. 
	

	
	
		
		

		
			




  
 To fix the problem with the mute you might have to think about disabling Pulse entirely, sticking with dmix for your day-to-day since KMix should work well enough for that, and using JACK for specific-apps-to-devices. A quick KDE install on an Arch box that was transplanted over a ALSA/JACK setup (make sure they both play nicely though), and moc plays through the FiiO while I have a youtube video playing on my speakers just fine. It's not as simple to use, but at least it works.


----------



## KimLaroux

chs177 said:


> *KimLaroux,*
> 
> try deadbeef, it's pretty good player.


 
  
 I do use deadbeef too, and it works flawlessly. But I still need Amarok to take care of my music library.
  
  


twinqy said:


> Although it seems that KDE is still working on their Phonon, Qt5 marks the point where QtMultimedia replaces it instead. I'm not holding out on any hope of it getting much attention in the future.
> 
> 
> 
> ...


 
  
 I have disabled pulse, but as you can see from the link I pasted, KDE modified both Phonon and KMix to work even closer to Pulse, so removing pulse is now far from enough.
  
 The goal here is too remove layers so the audio stream is modified as little as possible. On fedora 18, phonon was able to output directly to a device, bypassing Dmix even. This meant Amarok streamed bit-perfect to my DAC. My goal for now is to gain this feature back. I'll go with jack as a last resort. I'm still hoping they didn't completely break things and I can still find the setup I used to have.


----------



## bonesnv

I always used MPD and Sonata (or ncmpcpp) as the GUI front-end for it, running on Xubuntu or Arch Linux.  Whenever I did a cat of the hw_params or streams I was always in bit perfect play back through USB to my DAC.
  
 I changed over recently because I got rid of that system and for my purposes, Jriver or similar was needed and the Linux version just ain't quite there yet.
  
 Get rid of anything to do with Pulseaudio if at all possible, use ALSA with a basic configuration and everything from DeadBeef, Clementine, Sonata, ncmpcpp and others will run without an issue.  I never cared much for Amarok and others, as they seemed to clunky for my taste, unfortunately Jriver like in a way but it is what it is.


----------



## powerhouse64

Thanks to Rizlaw for the excellent instructions on getting bit perfect audio under Linux. I installed ALSA and totally removed pulseaudio.
  
 My hardware is an Asus Xonar Essence STX and everything works fine, including the impedance selection and speaker/headphones switch. The onboard sound is disabled.
  
 The OS is Linux Mint 16, running Gmusicbrowser as music player.
  
 Just to make sure that the output is bit perfect, I connected my external DAC via coax to the Xonar and the sampling frequency corresponds with the source material.
  
 Again thanks - this is a very helpful thread.


----------



## stuzzyapple

will Being doing this no doubt when Steam OS is released.


----------



## yay101

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.


----------



## KimLaroux

yay101 said:


> 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.
> ...


 
  
 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?


----------



## yay101

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.


----------



## KimLaroux

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.


----------



## yay101

Sounds like there is a phonon-alsa library missing. I'll try to replicate tonight.


----------



## KimLaroux

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...


----------



## andrix

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
  

```
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


----------



## yay101

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.


----------



## web123

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
> ...


 
 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
> ...
> ...


 
 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
> ...


 
 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.


----------



## ronalde

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?


----------



## web123

ronalde said:


> 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.
> ...


 
  
 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.


----------



## ronalde

web123 said:


> 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!


----------



## web123

ronalde said:


> 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.
> 
> ...


 
  
 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.


----------



## ronalde

web123 said:


> 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.


----------



## bcschmerker4

ronalde said:


> ...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?


----------



## ronalde

Hi bcschmerker4®,
  
 Whether the interface is balanced (IEC 60958 Type I using XLR) or not (IEC 60958 Type II using RCA/coax) is of no importance to the symptoms. Both interfaces carry computer generated SPDIF-signals with all problems related to it. Those subtle problems in sound quality are inherent to the SPDIF-signal, and exist even when there is proper signal transfer without coarse issues like grounding loops, signal decay and/or dropped packets. 
  
 The latter problems could benefit from dedicated sound hardware inside the PC coupled to balanced connections. On the other hand, if you experience those issues at your home setup, something else is wrong. They are intended for professional use where long distances between devices are required and the prevention of electrical problems (in the rest of the delivery chain) is more important than sound quality. That's also the reason that currently not a single professional audio device exists which aims at bit-perfectness in the whole chain.
  
 Regards,
 Ronald


----------



## bcschmerker4

Thanks, @ronalde, for the additional details on the problem.  As of August 2014, the Creative Laboratories® SB0350 PCI 2.2 card and SB0250 I/O Drive are still functional in my custom LinUX box; I'm still debating a potential re-build around an Intel® Core Processor™ i5-3500 Series APU (FCLGA 1155), ASRock® Z68 Pro-3M, and up to four new Western Digital® Caviar Red® hard drives, as JACK™ doesn't want to fly at all speeds on the current Advanced Micro Devices® Athlon 64® X2 5600+ (running at 2.9 GHz) and 780G/SB700 chipset.


----------



## ronalde

bcschmerker4 said:


> Thanks, @ronalde, for the additional details on the problem.  As of August 2014, the Creative Laboratories® SB0350 PCI 2.2 card and SB0250 I/O Drive are still functional in my custom LinUX box; I'm still debating a potential re-build around an Intel® Core Processor™ i5-3500 Series APU (FCLGA 1155), ASRock® Z68 Pro-3M, and up to four new Western Digital® Caviar Red® hard drives, as JACK™ doesn't want to fly at all speeds on the current Advanced Micro Devices® Athlon 64® X2 5600+ (running at 2.9 GHz) and 780G/SB700 chipset.


 
 Jack is middleware aimed at (semi-)professional usage and aims for troublefree and "realtime" routing of multiple audio streams, like pulseaudio is middleware targeted towards desktop users providing them a seamless plug-n-play experience.
  
 Those layers settle for one single fixed sample rate and bit depth for all streams by providing automagic resampling, bit depth conversion and/or leveling. In other words bit-imperfectness is their raison-d'être.
  
 Regards,
 Ronald


----------



## watchpocket

As one new to the attempt to achieve bit-perfect, I found Rizlaw's post #3 and yay101's post #265 the two single most informative items in this entire thread. * Thank you* to both of you! 
  
*My goal right now is simply to be able to play DSD files -- .dsf and .dff files -- preferably in DeaDBeef and/or Clementine. *
  
 But so far no matter what player I'm in, when I open a .dsf file, nothing happens.  I'm on a 64-bit Ubuntu 12.04 desktop workstation using Gnome Basic (I don't want to know about Unity, thank you).
  
 My USB DAC is the Light Harmonic / LH Labs Geek Out 1000 (the "1000" refers to the DAC's power in milliwatts), which definitely handles DSD (via DoP) and all sampling rates.

_*Should players like DeaDBeef and Clementine be able to play .dsf and .dff files out-of-the-box?*_  I suspect not. * But what combination of players, plug-ins, codecs and voodoo might be needed?*  I've installed every Gstreamer plugin I could find for Rythmbox, I've tried to use the Signalyst hqplayer trial (way complicated), as well as Amorak, Audacious, VLC, SMplayer/mplayer and a few others, to play a .dsf file. 
  
 I see that JRiver Media Center, MPD, and Kodi (formerly XBMC) all advertise that they play DSD files, but I'd like (for now at least) to avoid large client-server-type programs such as these, particularly JRiver which is not free and open-source. I may use one of them if necessary, but first I'd like to see if I can get a more lightweight, audio-only player to play DSD files. 
  
 I can get the bit-perfect -- there's plenty of explanation here to do that.  But I haven't yet been able to play DSD files in Ubuntu, as I have with foobar2000 on windows (at my work location) with the same DAC.   I can provide output to the standard commands if needed, but wondered, before I do that, if there might be a more fundamental answer. 
  
 Thanks for any guidance or pointers.


----------



## bcschmerker4

watchpocket said:


> As one new to the attempt to achieve bit-perfect, I found Rizlaw's post #3 and yay101's post #265 the two single most informative items in this entire thread. * Thank you* to both of you!
> 
> *My goal right now is simply to be able to play DSD files -- .dsf and .dff files -- preferably in DeaDBeef and/or Clementine. *
> 
> ...


 

 After looking up some possible programs at FileInfo.com, I found that Direct Stream Digital DFFs are handled by foobar2000, which is ported across all major OS's.  OtOH, Delusion Music Files (DMFs) and Delusion Sample Files (DSFs) were developed by Olivier Lapicque for applications originally developed for Microsoft® Windows® 6-up; don't know whether Lapicque has the source code available for download.


----------



## watchpocket

Thanks for your response.  foobar2000, however, is not available on the Ubuntu Linux platform.
  
 The .*dsf* file extension I'm referring to is this:_* (DSD) Storage Facility files (DSF), a digital audio file format and file extension (.dsf)*_.
  
 The* .dff *extension is the_* DSD Interchange File Format (DSDIFF) (.dff).*_
  
 They're the only two_* DSD audio-file extensions*_ that I'm aware of.
  
 From DSD-Guide.com:
  
*DSD or Direct Stream Digital is a one bit recording format.  DSF and DFF are 'kinds' of audio files that are delivered as downloads or read by software for playback. *
*DSF has the ability to hold metadata and DFF doesn't, however, some players only read DFF files.

 In PCM recording, DSF and DFF would be similar to having .wav and .aiff files which are both PCM*
*More complex answers to the above question exists, but for those new to DSD, this is a simple explanation.*
  
 I don't know from "Delusion Music Files" but I'm pretty sure they don't have anything to do with DSD audio, I could be wrong.


----------



## stv014

watchpocket said:


> Thanks for your response.  foobar2000, however, is not available on the Ubuntu Linux platform.


 
  
 It can be run without any major problems using Wine. If you use the WASAPI plugin in "push" mode, and select the correct audio output device for Wine (that is, one that uses ALSA directly), then software processing issues should be avoided. On the other hand, the last time I checked, the default DirectSound output was not bit perfect.


----------



## watchpocket

Thank you for the tip.  I'm going to hold off on Wine/foobar though until I'm sure no native Ubuntu app does what I'm looking for.


----------



## yay101

At work, can't really reply. But just a heads up at this stage look at mpd for DSD/ DSF.


----------



## watchpocket

Thanks, yay101.  My thinking has already been moving in the direction that mpd might be the most useful item for me right now.


----------



## yay101

MPD is excellent as a daily player, the default limits on playlists can be annoying though. If I had a DSD capable DAC I would write a guide for setting it up, but sadly I do not.


----------



## ronalde

> Originally Posted by *watchpocket* /img/forum/go_quote.gif
> 
> I've installed every Gstreamer plugin I could find ...
> 
> I can get the bit-perfect -- there's plenty of explanation here to do that.


 
 Hi watchpocket,
  
 gstreamer is never bit-perfect. Stick with alsa with mpd in bit-perfect mode, eg, using hw:x,y alsa output device names in mpd.conf.
  
 No voodoo required .. a little prayer around christmas never hurts though.
  
 Regards,
 Ronald


----------



## userser

rizlaw said:


> *DeaDBeef*:  (a) Click on the *Edit* menu, then *Preferences*.
> (b) In the Preferences window under "*Sound*" tab > "*Output plugin*" = "_*ALSA*_"
> "*Output device*" = "_*HDA Intel ALC889,*_
> _*                                                                                                                                      IEC958, S/PDIF*_"
> ...


 
  
  
  
 I just signed up to tell you guys that this setup still rocks on Ubuntu 14.04.1 LTS; DeadBeef 0.6.2. I found nothing as simple as this.
  
  
  


> GYROCOM C&C Co., LTD Audiotrak ProDigy CUBE at usb-0000:00:1d.0-1, full speed : USB Audio
> Playback:
> Status: Running
> Interface = 3
> ...


 
  
  
  
 Peace&Love


----------



## bixby

I hope someone can help with a dropout problem I am having with Deadbeef.  
  
 Running HP Laptop with Lubuntu installed and Deadbeef.  Machine has core 2 Duo and 2GB of ram.  Files are located on NAS and 16/44khz Aiff files streamed via wireless to the Linux machine.  Throughput is 100 Mbps to 350 Mbps on wireless.  Deadbeef is feeding USB dac via Alsa plugin with no resampling and buffers currently set at 8290 adn 1024 for the period size.
  
 I get very short dropouts about every 5-10 minutes of playback.  Any idea what can be adjusted to remedy?
  
 thanks for your ideas


----------



## yay101

5-10 minutes sounds network related to me, I'd set deadbeef to buffer the full file then see if it still happens.


----------



## bixby

thanks for the idea, not sure what you mean by "the full file" as it streams continuously I thought but perhaps not.  I will try pushing the size to 16384 and cut the period to 512 to see what happens.
  
 I cannot believe it is the network since the throughput is very high, no?


----------



## yay101

If the buffer is small a network dropout of 1 second can be an issue, as within that one second it has already played all the samples it had stored. Raising the buffer allows for it to not need a connection for several seconds or even minutes at a time, eliminating network as a issue if it still occurs.


----------



## bixby

The buffer is now set to 16384 and period is still 1024.  First drop was at about 45 minutes, so it seems it is helping.  thx.  I'll keep my fingers crossed to see if it can maintain or better.  I may also try cutting the period down as well as the size to keep the drive pinged more frequently.


----------



## Anda

I think the buffer settings in Deadbeef are a bit strange. I use Mopidy and the default GStreamer backend settings are 200ms for buffer and 10ms for period.
 This means that the buffer and period are sample rate dependent.
  
 For a 16/44.1 file the buffer size is 8820 (44100*200/1000) and period size is 441 (44100*10/1000). For a 24/96 buffer size is 19200 and period size is 960.
 If you set the buffer size in GStreamer to 1 second (1000ms) you will get a buffer size of 44100 for 44.1KHz and 96000 for 96KHz.
  
 This is not the case for Deadbeef where the settings are fixed no matter what the sample rate is. That said the default 8192 and 1024 should be sufficient.
 I hope you'll find a way to fix the problem.


----------



## yay101

Yeah something is definitely not working quite right.


----------



## ampair

bixby said:


> The buffer is now set to 16384 and period is still 1024.  First drop was at about 45 minutes, so it seems it is helping.  thx.  I'll keep my fingers crossed to see if it can maintain or better.  I may also try cutting the period down as well as the size to keep the drive pinged more frequently.


 
  
 keeping the drive busy might be the key. i also have dropouts from a usb hard drive (and i know why).
 my external case puts the drive to sleep after 5min idle time, so after almost every song that's longer than 5min there's a dropout. maybe your NAS behaves in a similar way.


----------



## bixby

Some network adjustments may have helped as well with drops now seemingly only occurring with some higher rez tracks.  Another head-fier noted that he had some drops and attributed them to usb bus interrupt conflicts.  I may try moving the USB dac around to some other ports to see if that has an impact.


----------



## yay101

It could also he the way the program handles the buffer. On my machine (4790, 32gb ram) I had dropouts regularly with Clementine and a few others. But with other applications I had no such issues. To be noted however with Clementine even the largest buffer would act as if I hadn't changed a setting. Using network over power doesn't help.


----------



## bixby

Inquiring minds want to know what programs behaved best.


----------



## yay101

MPD, goggles, foobar in wine all performed flawlessly with default settings, of course your mileage may vary. I usually keep another machine around to be a dedicated playback machine (volumio or daphile) these days though, so apart from keeping my bitperfect guide up to date and in working order i don't dabble in the desktop side much. Unless of course there is an issue that could use a look at that is probably reproduceable (like this one).


----------



## Nova40

I'm trying to get 192/24bit to my Cambridge Audio DacMagic100.  Using Deadbeef I've been able to achieve 96/24bit, but as I understand it, usb can't achieve anything greater than this without a driver.  Unfortunately Cambridge Audio doesn't have a Linux driver.  So is there some way to get around having a driver (I don't have any experience in compiling my own kernel) or would optical, spdif, or usb 3.0 be able to achieve this? 
  
 Thanks guys!


----------



## undersys

Ahh 


nova40 said:


> I'm trying to get 192/24bit to my Cambridge Audio DacMagic100.  Using Deadbeef I've been able to achieve 96/24bit, but as I understand it, usb can't achieve anything greater than this without a driver.  Unfortunately Cambridge Audio doesn't have a Linux driver.  So is there some way to get around having a driver (I don't have any experience in compiling my own kernel) or would optical, spdif, or usb 3.0 be able to achieve this?
> 
> Thanks guys!


 
 I don't feel that is correct :
  
 From ta device "Bus 002 Device 007: ID 040d:3410 VIA Technologies, Inc"


> Playback:
> Status: Stop
> Interface 1
> Altset 1
> ...


 
 All the way up to  : 384/32


----------



## Anda

nova40 said:


> I'm trying to get 192/24bit to my Cambridge Audio DacMagic100.


 
  
 The XMOS chip does not require drivers in Linux. Can you get sound through the IEC958 in the device list?


----------



## Nova40

> The XMOS chip does not require drivers in Linux. Can you get sound through the IEC958 in the device list?


 
 ^ is that the chip the DacMagic 100 uses?  I've been using Alsa (with USB 1, Front speaker), but I get the same result using IEC958.  DeadBeaf says that it's outputting 192/24bit and the dac says that it's only getting 96.  I don't know if it helps but the output device says: Cambridge Audio DAC100 USB 1, USB Audio IEC958 (S/PDIF) Digital Audio Output.


----------



## Anda

nova40 said:


> ^ is that the chip the DacMagic 100 uses?  I've been using Alsa (with USB 1, Front speaker), but I get the same result using IEC958.  DeadBeaf says that it's outputting 192/24bit and the dac says that it's only getting 96.  I don't know if it helps but the output device says: Cambridge Audio DAC100 USB 1, USB Audio IEC958 (S/PDIF) Digital Audio Output.


 
  
 Sorry, I thought it used the same chip as the DacMagic Plus but just found this on their website:
  


> 24-bit/96kHz driverless USB Audio 1.0 input


----------



## Nova40

Yup... it's a bummer.  So should I start looking for a new DAC, or can I achieve 192/24bit with SPDIF or something?


----------



## Anda

I you like the sound you can get a Gustard U12. Are you located in the UK (based on your Cambridge and B&W gear)?
  
 It's available here:
http://www.ebay.co.uk/itm/GUSTARD-U12-Native-32bit-384kHz-XMOS-DAC-0-1ppm-U10-upgrade-Black-Silver-/261596415436


----------



## Nova40

Actually I'm in the United States, but that's a good price and looks pretty nice.  Can this be used at 384/32bit under linux without a driver?  Also, I'm considering going for a balanced dac design, but I don't think it'll fit my current budget...


----------



## Anda

Ok, I think you can get it slightly cheaper from Asia. Honestly don't know about 32/384. My spdif input is limited to 24/96, so I am not able to test it properly.


----------



## Nova40

Yeah, my goal is just to be able to play 24/192 because I have quite a number of flac files that are 24/192.  But so far I've heard that you need a driver to do that.  How certain are you that the XMOS chip in the DacMagic Plus can play 24/192 under linux?


----------



## undersys

nova40 said:


> Yeah, my goal is just to be able to play 24/192 because I have quite a number of flac files that are 24/192.  But so far I've heard that you need a driver to do that.  How certain are you that the XMOS chip in the DacMagic Plus can play 24/192 under linux?


 
  
 Like I said a few a posts back you can use the Linux in kernel USB2 support for that resolution.
 You do not need a "driver" for USB2 audio compliant devices.
 My Audio-GD just works at 24/192+ resolutions.


----------



## Anda

Just to confirm it, this is the output when playing a 24/192 flac file on my U10:


Spoiler: Warning: Spoiler!



$ cat /proc/asound/card1/stream0 
 XMOS XMOS USB Audio 2.0 at usb-0000:00:1d.7-2, high speed : USB Audio
  
 Playback:
   Status: Running
     Interface = 1
     Altset = 1
     Packet Size = 247
     Momentary freq = 192000 Hz (0x18.0000)
     Feedback Format = 16.16
   Interface 1
     Altset 1
     Format: S32_LE
     Channels: 2
     Endpoint: 1 OUT (ASYNC)
     Rates: 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000
     Data packet interval: 125 us
  
 Capture:
   Status: Stop
   Interface 2
     Altset 1
     Format: S32_LE
     Channels: 2
     Endpoint: 2 IN (ASYNC)
     Rates: 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000
     Data packet interval: 125 us


----------



## Nova40

What do I have to change to get kernel USB2 support working?


----------



## undersys

nova40 said:


> What do I have to change to get kernel USB2 support working?


 
  
 Kernel option for USB audio is "CONFIG_SND_USB_AUDIO" (USB1 and 2)
 I assume your kernel already has USB2 support.
 I would also assume that "CONFIG_SND_USB_AUDIO" is already part of your kernel. 
 Since your getting audio playback via USB 1.0.
  
  
 It seems the DacMagic is operating in USB 1.0 audio mode, hence the limit on playback.
 See this page for details on the limits :
 http://www.thewelltemperedcomputer.com/KB/USB.html
  
  
 Maybe a newer kernel is required to support the DacMagic 100 ? 
 Have you asked Cambridge ?


----------



## watchpocket

So I have four different mpd clients: Cantata, GMPC, Glurp and mpc. 
  
*All of them except Cantata will play .dsf (DSD) files.*  I've looked through the settings of each of these clients to see how they might differ from one another, and I cannot figure out what might be different about Cantata such that it refuses to play .dsf and/or .dff files. 
  
 My DAC is the Geek Out 1000.
  
 I've played .dsf files successfully in any one of the three clients that can do that, then closed that client, unplugged and re-plugged the Geek Out (makiing sure it was selected in sound-settings), killed mpd and re-started it, and then opened Cantata to see if it would play .dsf.  I've changed the order in which I made these steps several times.  I'm using ALSA, Pulseaudio is turned off. ReplayGain is turned off.
  
 All I get with Cantata are sample rates of either 44100 or 48000.
  
 My OS is Ubuntu-MATE 14.04 LTS on a System76 Wild Dog desktop unit.
  
_*Anyone have a clue why all the other clients work fine but Cantata?*_  Do I need a special plugin to play .dsf / .dff files in Cantata?


----------



## julian67

watchpocket said:


> So I have four different mpd clients: Cantata, GMPC, Glurp and mpc.
> 
> *All of them [COLOR=0000FF]except[/COLOR] Cantata will play .dsf (DSD) files.*  I've looked through the settings of each of these clients to see how they might differ from one another, and I cannot figure out what might be different about Cantata such that it refuses to play .dsf and/or .dff files.
> 
> ...




Maybe you should attach your ~/.asoundrc and your working mpdconf and any cantata config files so people have a chance to help.

In any case gmpc is the _only_ GUI MPD client which supports all of MPD's features so I'd suggest that anyone needing anything more than basic features and simple metadata support should just stick with gmpc (or a console client such as ncmpc/ncmpcpp/mpc). I've been using MPD for quite a few years and I think I must have tried every GUI client at least once. Sooner or later, even with more ambitious or extended clients like Cantata, you find that a feature is missing and only gmpc can do what you want. And on a GTK desktop like Mate gmpc surely makes more sense than a QT client?


----------



## yay101

Basically it comes down to how mpd works, Cantata probably hasn't been updated to allow adding dsd to playlists, realistically one of the very few things mpd actually listens to the frontend for.


----------



## kazcou

For those who want directly use there SACDISO with mpd, there is a branch (http://git.musicpd.org/cgit/manisiutkin/mpd.git)
 who support it and also DVDAISO. But you have to compile it.


----------



## watchpocket

julian67 said:


> Maybe you should attach your ~/.asoundrc and your working mpdconf and any cantata config files so people have a chance to help.


 
  
 Why certainly. I didn't attach them originally since the other clients work fine, didn't think the problem would be with the configs but you never know, the problem can always be with the configs and any perverse portmanteau-like constructions they may contain.
  
_> And on a GTK desktop like Mate gmpc surely makes more sense than a QT client?_
  
 I do heart and I do use gmpc but what problems is using a QT client actually expected to pose on Ubuntu?  Cantata is a stellar program but for this one issue and I don't know for sure yet, but I'll bet the Cantata developers simply haven't made accommodations for delivering or facilitating DSD.  If not, I'll be fiing a bug report with those lo-rez luddites.
  
_*asoundrc:*_
  

```
[size=8px]pcm.!default { type plug slave.pcm "hw:1,0"; # slave.pcm "plughw:G1V5,0; }[/size]
```
  
_*.mpd/mpd.conf:*_
  

```
[size=8px]### Config file for mpd (Music Player Daemon) v. 0.19.9 ### I'm using mpd with GMPC (Gnome Music Player Client) v. 11.8.16 on Ubuntu-MATE 14.04 LTS ### Last update: Friday  2015-03-27 10:35:53 PM  EDT ### This is version 0.3 of this file as I have more to learn about mpd ### This setup is for using mpd as a "user service," not as a "system service." ### See <https://help.ubuntu.com/community/MPD> ### See <https://bbs.archlinux.org/viewtopic.php?pid=1017873#p1017873> (post number 5) ### See <http://lacocina.nl/detect-alsa-output-capabilities> ### See mpd example config file: /etc/mpd.conf music_directory "/home/rj/Music" # Don't use ~/ playlist_directory "/home/rj/.mpd/playlists" # db_file "/home/rj/.mpd/mpd.db" database { plugin "simple" path "/home/rj/.mpd/mpd.db" } log_file "/home/rj/.mpd/mpd.log" pid_file "/home/rj/.mpd/mpd.pid" state_file "/home/rj/.mpd/mpdstate" # Where settings are maintained across re-boots & crashes. sticker_file "/home/rj/.mpd/mpd.sticker.db" # A database that manages dynamic information attached to songs. auto_update "yes" # Enables automatic update of MPD's database when files in music_directory are changed. zeroconf_enabled "no" # Don't publish 'service information.' max_playlist_length "90000" max_output_buffer_size "16384" bind_to_address "127.0.0.1" # Sets the address for the daemon to listen on. Careful attention should be paid if this is assigned # to anything other than the default. This setting can deny access to control of the daemon. port "6600" log_level "verbose" # For now. # Available settings are "default", "secure" or "verbose". The "verbose" setting is recommended # for troubleshooting, though can quickly stretch available resources on limited hardware storage. save_absolute_paths_in_playlists "yes" # Enables MPD to create playlists in a format usable by other music players. metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc,comment" # Defines a list of tag types that will be extracted during the audio # file discovery process. # Input: input { plugin "curl" } # Decoder plugins: decoder { plugin "dsf" # Decodes DSF files containing DSDIFF data (e.g. SACD rips). [/size] [size=8px] enabled "yes" } decoder { plugin "dsdiff" # Decodes DFF files containing DSDIFF data (e.g. SACD rips). enabled "yes" lsbitfirst "no" # Decode the least significant bit first. Default is 'no'. } decoder { plugin "wildmidi" config_file "/etc/timidity/freepats.cfg" } # Audio ouput block for ALSA output: audio_output { type "alsa" name "Geek Out HD Audio 1V5, USB Audio" device "plughw:G1V5,0" format "*:*:*" dsd_usb "yes" # ESSENTIAL. Without this setting, I get -NO- DSD playback on the Geek Out. # <http://comments.gmane.org/gmane.comp.audio.musicpd.devel/2248> mixer_type "none" auto_resample "no" auto_channels "no" auto_format "no" replay_gain_handler "none" } # Audio output block for http: # audio_output { # type "httpd" # (Do this part later.) # } # Character Encoding: filesystem_charset "UTF-8" # If file or directory names don't display correctly for your locale, you may need to modify this setting. id3v1_encoding "UTF-8" # This setting controls the encoding that ID3v1 tags should be converted from. ### end of file ### [/size]
```
  
_*.config/cantata/cantata.conf:*_
  

```
[size=8px][General] storeCoversInMpdDir=true storeLyricsInMpdDir=true currentConnection=- stopOnExit=true version=1.5.2 showMenubar=true showFullScreen=false mainWindowSize=@Size(1513 1001) showPlaylist=true playStream=false splitterState=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x2\0\0\x1|\0\0\x2:\x1\0\0\0\x1\x1\0\0\0\x1) page=ContextPage contextZoom=-1 contextSplitterState=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x3\0\0\x2\x6\0\0\x1\xe8\0\0\x1\xf7\x1\0\0\0\x6\x1\0\0\0\x1) contextAutoScroll=false contextTrackView=2 hiddenStreamCategories=@Invalid() searchCategory=artist showTimeRemaining=false hiddenOnlineProviders=@Invalid() forceSingleClick=true startHidden=false lyricProviders=lyrics.wikia.com, lyricstime.com, lyricsreg.com, lyricsmania.com, metrolyrics.com, azlyrics.com, songlyrics.com, elyrics.net, lyricsdownload.com, lyrics.com, lyrics$ inhibitSuspend=true storeBackdropsInMpdDir=true libraryArtistImage=true libraryView=icontop libraryYear=true albumsView=icontop albumSort=artist-year folderView=detailedtree playlistsView=detailedtree playListsStartClosed=true streamsView=detailedtree onlineView=detailedtree groupSingle=true useComposer=false filteredOnly=false showDeleteAction=true devicesView=detailedtree searchView=table playQueueView=grouped playQueueAutoExpand=true playQueueStartClosed=false playQueueScroll=true playQueueBackground=1 playQueueBackgroundOpacity=69 playQueueBackgroundBlur=0 playQueueBackgroundFile= playQueueConfirmClear=true playQueueSearch=true infoTooltips=true touchFriendly=true showStopButton=true showCoverWidget=true showRatingWidget=true useSystemTray=true showPopups=true minimiseOnClose=true startupState=show fetchCovers=true lang= hiddenPages=@Invalid() sidebar=17 monoSidebarIcons=false splitterAutoHide=false httpInterface=lo cdAuto=true cddbHost=freedb.freedb.org cddbPort=8880 paranoiaFull=true paranoiaNeverSkip=true useCddb=true wikipediaIntroOnly=true contextDarkBackground=true contextAlwaysCollapsed=false contextBackdrop=1 contextBackdropOpacity=30 contextBackdropBlur=0 contextBackdropFile= contextSwitchTime=1000 wikipediaLangs=en:en contextSlimPage=artist playQueueHeaderState="@ByteArray(P,\x95\xf\x1\0\0\0\f\0\0\0N\0\0\0\0\0\0\x1\x83\0\0\x1\xbd\0\0\x2\x42\0\0\0l\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\f\0\0\0\0\0\0\0\$ searchHeaderState="@ByteArray(P,\x95\xf\x1\0\0\0\t\0\0\0\x1d\0\0\0\x1b\0\0\0#\0\0\0\0\0\0\0\a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\t\0\0\0\0\0\0\0\x1\0\0\0\x2\0\0\0\x3\0\0\0\x4\0$ mainWindowCollapsedSize=@Size(611 86) [Connection--] host=/home/rj/.local/share/cantata/mpd/socket port=6600 dir=~/Music passwd= coverName= streamUrl= [PreferencesDialog] size=@Size(891 1051) [PlayQueuePage] searchActive=true [DevicesPage] searchActive=false [DynamicPage] searchActive=false [PlaylistsPage] searchActive=false [FolderPage] searchActive=false [AlbumsPage] searchActive=false [LibraryPage] searchActive=false [Jamendo] format=ogg [PodcastSettingsDialog] size=@Size(550 160) [StreamProviderListDialog] size=@Size(466 876) [Magnatune] membership=streaming download=mp3 username= password= [Scrobbling] enabled=false loveEnabled=true[/size]
```


----------



## watchpocket

So it turns out that Cantata has a "basic" configuration mode where you can't set the host and port.  To set those, you need to got to Edit -> Preferences -> Collection, and create a new Collection with your preferred host and port settings. (Otherwise it's set to a local path socket.)  Once that's done, Cantata will allow mpd to play .dsf and .dff files at their own native, higher sample rates without re-sampling them down to 44100 or 48000.


----------



## eimis

trippeeyyy​


----------



## aroldan

Here's mine


----------



## bixby

Where are you guys getting these cool graphs?  Are they plugins for Deadbeef or are they part of it hiding from me?


----------



## aroldan

bixby said:


> Where are you guys getting these cool graphs?  Are they plugins for Deadbeef or are they part of it hiding from me?


 
 The top seekbar It's a plugin called waveform seekbar, the right plugin is infobar. All the rest is native from Deadbeef, and all was put together using the design mode.


----------



## eimis

If you're on Arch Linux install these from the AUR:
 deadbeef-plugin-musical-spectrum-git
 deadbeef-plugin-spectrogram-git
 deadbeef-plugin-waveform-git
  
 They're from this guy https://github.com/cboxdoerfer


----------



## SoAmusing777

So how exactly can I get 24 bit 88.2khz sound, which is an upconversion of 16bit44.1khz, out of my GeekOut 450 on linux? I know I can set the audio on Pulse configuration file, but heard it's not the best way to go about it. I don't seem to have the asound or asoundrc file for alsa. I have asround.conf_jack and _oss, but not just .conf.  I'm on Linux Mint 17.1 KDE.


----------



## kazcou

soamusing777 said:


> So how exactly can I get 24 bit 88.2khz sound, which is an upconversion of 16bit44.1khz, out of my GeekOut 450 on linux? I know I can set the audio on Pulse configuration file, but heard it's not the best way to go about it. I don't seem to have the asound or asoundrc file for alsa. I have asround.conf_jack and _oss, but not just .conf.  I'm on Linux Mint 17.1 KDE.


 
 If you are using MPD, I find this : http://www.diyaudio.com/oldwiki/index.php?page=LINUX+Audio+MusicPlayerDaemon.


----------



## SoAmusing777

kazcou said:


> If you are using MPD, I find this : http://www.diyaudio.com/oldwiki/index.php?page=LINUX+Audio+MusicPlayerDaemon.


 
 Can MPD be used with Google Play streaming music? EDIT: Guess that's what GMusicProxy is for.


----------



## kazcou

soamusing777 said:


> Can MPD be used with Google Play streaming music? EDIT: Guess that's what GMusicProxy is for.


 
 No you can't MPD for a streaming flux, isn't a audio driver, but a music player.
 You can use this link if you are using ALSA http://www.alsa-project.org/main/index.php/Asoundrc
  
 Or just modifie this file $HOME/.asoundrc
  
 pcm.device{
         format S32_LE or S24_LE (all format available http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gaa14b7f26877a812acbb39811364177f8)
         rate (your rate)
         type hw
         card (your card number)
         device (the output port used)
 }
  
 pcm.!default{
     type plug
     slave.pcm "device"
 }


----------



## SoAmusing777

kazcou said:


> No you can't MPD for a streaming flux, isn't a audio driver, but a music player.
> You can use this link if you are using ALSA http://www.alsa-project.org/main/index.php/Asoundrc
> 
> Or just modifie this file $HOME/.asoundrc
> ...


 
 I can't find that file. I looked for it.


----------



## undersys

soamusing777 said:


> I can't find that file. I looked for it.


 
 If the file is missing, then simply create it 
 It may not be present by default.


----------



## SoAmusing777

undersys said:


> If the file is missing, then simply create it
> It may not be present by default.


 
 Interesting. Got any steps?


----------



## undersys

soamusing777 said:


> Interesting. Got any steps?


 
  
 vim ~/.asoundrc
  
 ^ replace vim with your editor of choice 
 Then insert the above with the gaps filled in for your set up.
  
 hope that helps.


----------



## SoAmusing777

undersys said:


> vim ~/.asoundrc
> 
> ^ replace vim with your editor of choice
> Then insert the above with the gaps filled in for your set up.
> ...


 
 Not sure what you mean by editor. I'm a total newb. Feel free to share screenshots. Thank you much btw.


----------



## bcschmerker4

soamusing777 said:


> Not sure what you mean by editor. I'm a total newb. Feel free to share screenshots. Thank you much btw.


 
 LinUX has several text editors available, depending on distribution.  Most have Visual Editor Improved, /usr/bin/vim, and/or GNU EMACS, /usr/bin/emacs.  Distros with GNOME have a Text Editor, /usr/bin/gedit.  The Advanced LinUX Sound Architecture Project has a comprehensive wikipage on asoundrc.  As an example, were I doing a direct program for the Realtek® ALC-889A sound chip on the Hot Rod gPC's™ Gigabyte® GA-MA78GM-S2HP, ./.asoundrc might look similar to the example below (thanks, kazcou, for the template):
   


> Originally Posted by *kazcou* /img/forum/go_quote.gif
> 
> pcm.device{
> format S24_LE, S16_LE
> ...


 

  
 A list of available devices can be retrieved with the command:  aplay -l dump


----------



## watchpocket (May 8, 2020)

If your new to Linux, I wouldn't use either of the Vim or EMACS text editors right now. 

Use gedit or nano. 

But I -highly- recommend taking some time to get up to speed with Vim. 
Once you're past its learning curve, you'll write like a bat outta hell, and you can do anything you want with it.

Someone else will chime in with a similar sentiment about EMACS.  Both are extremely fine and full-featured tools.


----------



## thelastwaltz

@Rizlaw (re Post #3)
  
 You are the man....sometimes I love Linux (when people far more intelligent and knowledgeable than me tell me what to do).
  
 Thank you


----------



## Rizlaw

thelastwaltz said:


> @Rizlaw (re Post #3)
> 
> You are the man....sometimes I love Linux (when people far more intelligent and knowledgeable than me tell me what to do).
> 
> Thank you


 
 "far more intelligent" probably not.  But, I'm glad my post helped you.


----------



## eimis

rizlaw said:


> thelastwaltz said:
> 
> 
> > @Rizlaw (re Post #3)
> ...


 
 I see you've got Windows installed on your PC as well. As much as I would like to refrain from discussing such nonsense(?) as one operating system sounding better than another, I can't help but hear a difference. Don't you think Windows sounds better than Linux? To me, JRMC/Winyl > WASAPI > ODAC on Windows outdoes Deadbeef/Clementine > ALSA > ODAC on Arch Linux. Windows sounds sharper, kind of hi-res — just right — while Linux sounds fuzzier and as if the music was downsampled to 32khz. That is one of very few reasons making me keep Windows on my hard drive. Maybe there's an option in ALSA's configs that makes it tamper with the sound in some way?


----------



## Rizlaw

eimis said:


> I see you've got Windows installed on your PC as well. As much as I would like to refrain from discussing such nonsense(?) as one operating system sounding better than another, I can't help but hear a difference. Don't you think Windows sounds better than Linux? To me, JRMC/Winyl > WASAPI > ODAC on Windows outdoes Deadbeef/Clementine > ALSA > ODAC on Arch Linux. Windows sounds sharper, kind of hi-res — just right — while Linux sounds fuzzier and as if the music was downsampled to 32khz. That is one of very few reasons making me keep Windows on my hard drive. Maybe there's an option in ALSA's configs that makes it tamper with the sound in some way?


 
  
 eimis,
  
 What you describe is certainly not my experience with Linux. I hear no _fuzziness_ or _downsampling_ effects in any of my Linux media players. I don't use Clementine. While I prefer Ubuntu Linux, I have tried several Ubuntu derivatives (like Mate, Mint, Kubuntu), as well as Antergos (an Arch based distro), Sabayon (Gentoo based), Red Hat Fedora and a few others, sonically, they all sound the same to me. Ultimately, there are simply too many variables that factor in to what you or I ultimately hear in our respective systems.
  
 For about a year or two, I dual booted Win7 with Ubuntu Linux to compare the two OSs for music playback.  It was during this period of music playback testing that I finally switch to Linux permanently because I felt Linux was sonically as good as Windows and maybe better.  During the test period, I used my licensed copy of JRMC as well as Foobar2000 for Windows bit perfect music playback. For Linux I used: gmusicbrowser, guayadeque, Quod Libet, and Deadbeef (these are the players capable of bypassing Pulse Audio for direct bit perfect playback via ALSA without resampling. All the music files consisted of my entire CD collection ripped, over the years to FLAC, using a combination of EAC (Exact Audio Copy), JRMC and dbpoweramp under WinXP, Win 7 and for Linux using "Asunder" and WINE/Crossover for running dbpoweramp. When set up for bit perfect output, I heard no perceptible differences and none of the kind you describe. The very minor differences I "thought" I heard were not worth mentioning as they were not repeatable.
  
 Bottom line: to the best of my limited knowledge while your ALSA config files can be tweaked, it shouldn't be necessary if Deadbeef is properly setup to bypass PulseAudio and the Linux resampler which is better than the Window's resampler, but still leaves much to be desired. In my setup I have Deadbeef's "Preferences > "Sound" Tab set to:
  
 Output plugin:  ALSA output plugin
 Output device: 32bit 384kHz DSD Interface, USB Audio
                        Direct hardwdare device without any conversions
  
 For me, the device in question is my W4S DAC-2seDSD, and I would add that there are 12 different variations for the same "output device" so you have to be careful which one you pick. Pick the wrong one and you won't get bit perfect stereo output.
  
 Under Deadbeef:  Preferences > Plugins > ALSA output plugin > Configure button :
  
                                                                                                                             Uncheck "Use ALSA resampling
                                                                                                                             Check    "Release device while stopped"
  
 Finally, I'm not familiar with your ODAC, but if it has a front panel display of the incoming music data file, or perhaps an led that lights up, you should be able to tell if the audio files you are playing via Deadbeef are being output and received as bit perfect 16/44.1 or 24/96 or 24/192 files and not resampled to a different rate.
  
 P.S. I recently purchased ($150) Signalyst's HQ Player for Linux (also available for Windows and Mac). It does sound interestingly different. It's available for a free 30 day trial with no limitations in use (except under Linux it only works for 20 minutes at a time. Not sure why). The GUI is poor and need much work as it is designed for a tablet and not a desktop machine.


----------



## yay101

Unless you still have pluseaudio running, using alsa and playing back a supported rate will ALWAYS result in bit perfect playback.


----------



## KMASCII

yay101 said:


> Unless you still have pluseaudio running, using alsa and playing back a supported rate will ALWAYS result in bit perfect playback.


 

 I had to reinstall Linux Mint the other day and I'm having difficulties again figuring out how to get proper, bit perfect output to my DAC. Just as before, the audio sounds like there's some kind of preprocessing going on even though I have ALSA selected as the output device in gmusicbrowser. The audio is sounding a bit animated and somewhat spatially flattened. It's a bit annoying without the proper settings 
	

	
	
		
		

		
			





.
  
 This is a problem I'd encountered using other media players in the past in both Ubuntu and Mint installations even though ALSA was selected as the output device. I'm pretty sure it had to do with PulseAudio but I can't find the solution again.
  
 FYI: I used to listen to Windows->WASAPI->DAC->amp. Then tried Linux and wasn't impressed at first until I came across a bitperfect output that circumvented pulseaudio... then I was sold. I'm not into going back to Windows for my media playback.
  
 I'll keep searching for my solution but if anyone can suggest how to get around pulseaudio I'd appreciate it.


----------



## yay101

Used the guide in my SIG? 

Quick and dirty, run "killall pulseaudio" in a terminal.

No output = pulse was still running and you need to disable it from auto spawning.


----------



## Rizlaw

kmascii said:


> I had to reinstall Linux Mint the other day and I'm having difficulties again figuring out how to get proper, bit perfect output to my DAC. Just as before, the audio sounds like there's some kind of preprocessing going on even though I have ALSA selected as the output device in gmusicbrowser. The audio is sounding a bit animated and somewhat spatially flattened. It's a bit annoying without the proper settings
> 
> 
> 
> ...


 
  
  
 Please read my post (noted below) on setting up gmusicbrowser for proper playback. It should resolve your issue provided you enter the correct information under "*Advanced Options > Alsa Device*". Just setting gmusicbrowser to ALSA is not enough without also entering correct info into the "Alsa device" field.
  
 To find your ALSA device info, in a terminal window, use the command "*aplay -l*" to determine your sound card's settings. If you have more than one sound card device, select the primary one you use for digital playback. It's also a good idea to disable the motherboard sound chip in your BIOS to avoid future confusion.  There really is no need to remove pulseaudio, you just need to bypass pulseaudio and talk directly to ALSA/hardware for bit perfect playback.
  
 http://www.head-fi.org/t/561961/bit-perfect-audio-from-linux#post_7596563


----------



## KMASCII

Thanks guys... bookmarked. Being just a little more than a casual Linux user I'm one of those guys who, at this point in time, knows just enough to get into trouble. Much appreciated.


----------



## powerhouse64

@Rizlaw: great thread - many thanks, you really helped me out. I hope to be able to repay a little here.
  
 My PC has 2 graphics cards, a USB sound card and an Asus Xonar STX. This can cause problems with the order in which the sound devices are assigned, so the numbering scheme you propose to use does not always work. Here my suggestions when using *gmusicbrowser* (might be good for other players too):
  
 1. Open a terminal and enter the following (copy & paste):
  
*aplay -l | awk -F \: '/,/{print $2}' | awk '{print $1}' | uniq*
  
 You will get one or more names for available audio devices, depending on how many you got. In my case I get:
  
 STX
 HDMI
 Device
  
 2. Inside gmusicbrowser, select *Settings -> Audio*:
  
 3. Select *output device = ALSA*
  
 4. Click "*advanced options*"
  
 5. Enter the device of choice you found above into the "*alsa device*" field as follows: *hw:STX,0*
  
 I selected the STX option which represents the Asus Xonar STX.
  
 6. To make sure you got the right entry, double check using the following terminal command:
  
*aplay -l*
  
 Here the output on my PC (shortened list):
  
 **** List of PLAYBACK Hardware Devices ****
 card 0: STX [Xonar STX], device 0: Multichannel [Multichannel]
   Subdevices: 0/1
   Subdevice #0: subdevice #0
 card 0: STX [Xonar STX], device 1: Digital [Digital]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 ...
  
  
 Hope it helps.


----------



## powerhouse64

kmascii said:


> I had to reinstall Linux Mint the other day and I'm having difficulties again figuring out how to get proper, bit perfect output to my DAC. Just as before, the audio sounds like there's some kind of preprocessing going on even though I have ALSA selected as the output device in gmusicbrowser. The audio is sounding a bit animated and somewhat spatially flattened. It's a bit annoying without the proper settings
> 
> 
> 
> ...


 

 I'm running Linux Mint and gmusicbrowser and Rizlaw's instructions work. I tested it by playing a 24bit / 192kHz file and checked as follows (terminal command):
  
*cat /proc/asound/card0/pcm0p/sub0/hw_params*
  
 The above is for card 0, sub 0. Check with aplay -l which card (number) you need to specify. With 24bit files the output looks like that:
  
 user@PC ~ $ cat /proc/asound/card0/pcm0p/sub0/hw_params
 access: RW_INTERLEAVED
 format: S32_LE
 subformat: STD
 channels: 2
 rate: 192000 (192000/1)
 period_size: 1920
 buffer_size: 38400
  
 The rate above is 192000 Hz compared to my regular music files using 48000 Hz, so there is no resampling.


----------



## aristos_achaion

watchpocket said:


> If your new to Linux, I wouldn't use either of the Vim or EMACS text editors right now.
> 
> Use gedit or nano.
> 
> ...




I'm an Emacs guy, but I agree that vim is well worth learning to use. The reason being that vi (the text editor that vim is an improved version of) is part of the POSIX standard and can be found on just about any Unix-like installation, whereas Emacs usually needs to be installed after the fact. In practice, that means if your system is ever messed up to the point of not having an internet connection (or even a gui), you can count on vi to be there, even if it's a fresh install. I had to learn to use vi on a broken Debian install on my laptop in college...at 8AM...in my bathrobe...using a friend's laptop to google the documentation.

Yeah, if you're going to be messing around with Linux, learning vi can potentially save a lot of headaches.


----------



## Nalor

aristos_achaion said:


> I'm an Emacs guy, but I agree that vim is well worth learning to use. The reason being that vi (the text editor that vim is an improved version of) is part of the POSIX standard and can be found on just about any Unix-like installation, whereas Emacs usually needs to be installed after the fact. In practice, that means if your system is ever messed up to the point of not having an internet connection (or even a gui), you can count on vi to be there, even if it's a fresh install. I had to learn to use vi on a broken Debian install on my laptop in college...at 8AM...in my bathrobe...using a friend's laptop to google the documentation.
> 
> Yeah, if you're going to be messing around with Linux, learning vi can potentially save a lot of headaches.


 
 I'm an emacs guy as well. I will give a warning, though focus on core vi over vim if you are worried about recovery systems. There are some minor differences, but you will find vi everywhere. I learned only the very basics of vi to use in busybox instances. Busybox has vi, not vim, so it tripped up a couple of users. Another editor you will find on a lot of linux systems is nano.


----------



## bcschmerker4

Thanks for the note on the original Bell Visual Editor and POSIX vim.  I'm used to Joe's Own Editor, /usr/bin/joe, which is not likely to be in a LinUX system's /bin directory.  Any good manuals for /bin/vi and/or /bin/vim?


----------



## Nalor

I just google a vi cheat sheet for quick use if its beyond basic movement and editing.
  
 I brought up the vi and vim difference, more of a warning. Vim has a lot of goodies, so everyone I know who uses vi for coding is actually a vim user.  Basic vi is really small, and thus its included with a lot of things in base systems. (Like BSD's and Busybox). 
  
 My emacs though is rather heavy weight for emacs... but its lighter than most modern IDE's.


----------



## enthusiast

Wow gmusicbrowser is indeed very nice. Thanks for the tip. If you want to listen to ALAC on gmusicbrowser you need to install gstreamer ffmpeg plugin.
  

```
sudo add-apt-repository ppa:mc3man/trusty-media sudo apt-get update sudo apt-get install gstreamer0.10-ffmpeg
```
  
 Source:http://www.webupd8.org/2014/04/10-things-to-do-after-installing-ubuntu.html


----------



## WayneWoondirts

hello there,
 does anyone know if it's possible to access Tidal via MPD or within Cantata?
  
 my System: 
 Cayin OpenSUSE Leap 42.1 - mpd (0.19.10)/Cantata (2.0.0 - 20.1) - Cayin iDAC6


----------



## yay101

Bubble upnp > mpd + upnp plugin has very good results.

There may be newer methods but I haven't used tidal for a long long time.


----------



## WayneWoondirts

yay101 said:


> Bubble upnp > mpd + upnp plugin has very good results.
> 
> There may be newer methods but I haven't used tidal for a long long time.


 
 Thanks, thought so.
 Would be nice to see it implemented in Cantata or MPD one day.


----------



## yay101

waynewoondirts said:


> Thanks, thought so.
> Would be nice to see it implemented in Cantata or MPD one day.




The more we ask the more likely they are to include a real api so we can include support in everything.


----------



## powerhouse64

enthusiast said:


> Wow gmusicbrowser is indeed very nice. Thanks for the tip. If you want to listen to ALAC on gmusicbrowser you need to install gstreamer ffmpeg plugin.
> 
> 
> ```
> ...


 
  
 Thanks for sharing the info. I just like to caution the readers: It's NOT a good idea to add external repositories. Some (many?) Linux distributions contain gstreamer0.10-ffmpeg in their standard repositories, so there is no need to add the above repository (my Linux Mint distribution does have gstreamer0.10-ffmpeg in the repos).
  
 That said, it's been reported that Ubuntu 14.04 and perhaps other Ubuntu releases or Ubuntu-based distros do not support gstreamer0.10-ffmpeg out of the box, in which case you would need to add the above repository.
  
 Try to install using:

```
sudo apt-get update sudo apt-get install gstreamer0.10-ffmpeg
```
 If that doesn't work, you can always add the repo as suggested above.
  
 Background: Adding external repos can open a door to malicious software being installed on your computer. While Linux is quite good in keeping malware at bay, it is not immune to hackers/criminals. It's best to double-check when asked to add repositories, as this is the easiest way to compromise a Linux system. Sorry if I sound like a lecturer.


----------



## WayneWoondirts

I have an iDAC-6 at home, set up mpd to output DSD over PCM but it still downsamples to 352.8MHz. It seems that ALSA doesn't detect the DAC as DoP capable device.
  
 Anyone know what the source of the problem could be? Could try to disable pulseaudio when I'm home...
  
 System: OpenSUSE Leap 42.1, mpd 0.19.10, Cantata 2.0.0
  
music_directory    "/media/Daten/Musik"
playlist_directory "~/.mpd/playlists"
db_file            "~/.mpd/database"
log_file           "~/.mpd/log"
pid_file           "~/.mpd/pid"
state_file         "~/.mpd/state"


decoder {
      plugin "ffmpeg"
      enabled "yes"
}

audio_output { 
 type              "alsa" 
 name              "Cayin" 
 device            "hw:iDAC6"
 mixer_type        "hardware"
 dop               "yes"
 auto_resample     "no"
 auto_channels     "no"
 auto_format       "no"
}


----------



## WayneWoondirts

FYI
 still no luck on getting DSD over PCM to my DAC.
 even without pulseaudio it still downsamples to 352.8kHz

 The problem is also there with my ALO CDM, it also doesn't do DSD like it should.
 Anyone with better insight and knowledge able to help?


----------



## yay101

I'll bite even though i dont use DSD.
  
 Go here, let me know what it tells you https://lacocina.nl/detect-alsa-output-capabilities


----------



## WayneWoondirts

yay101 said:


> I'll bite even though i dont use DSD.
> 
> Go here, let me know what it tells you https://lacocina.nl/detect-alsa-output-capabilities


 
 Thank you so much, I really appreciate you taking your time and helping me.
 I have connected the CDM now, so these outputs are for the Continental:
  
 felix@linux-r2ul:~> bash <(wget -q -O - "http://lacocina.nl/alsa-capabilities") -l usb -s                                                                                                                                         
 0) USB Audio Class Digital alsa audio output interface `hw:2,0'                                                                                                                                                                  
 - device name       = USB2.0 High-Speed True HD Audio                                                                                                                                                                            
 - interface name    = USB Audio                                                                                                                                                                                                  
 - usb audio class   = 2 - isochronous asynchronous                                                                                                                                                                               
 - character device  = /dev/snd/pcmC2D0p                                                                                                                                                                                          
 - rates per format  = S24_3LE:             44100Hz 48000Hz 88200Hz 96000Hz 176400Hz 192000Hz                                                                                                                                     
                       S16_LE:              44100Hz 48000Hz 88200Hz 96000Hz 176400Hz 192000Hz                                                                                                                                     
                       SPECIAL:             44100Hz 48000Hz 88200Hz 96000Hz 176400Hz 192000Hz                                                                                                                                     
 - monitor file      = /proc/asound/card2/pcm0p/sub0/hw_params                                                                                                                                                                    
 - stream file       = /proc/asound/card2/stream0


----------



## yay101

Alrighty.

 DSD format's you are trying?
  
 MPD version 
  

```
[color=rgb(17, 17, 17)] mpd --version[/color]
```
  
 Alsa version 
  

```
[color=rgb(17, 17, 17)] cat /proc/asound/version[/color]
```


----------



## WayneWoondirts

DSD 64 (dff files)
  
 mpd: 0.19.10 (from Packman repository)
 Advanced Linux Sound Architecture Driver Version k4.1.15-8-default.


----------



## yay101

"The DSD to PCM conversion process converts from 1-bit DSD to 64-bit PCM at 1/8th of the DSD sample rate. The total amount of data from this conversion grows by 8x, so the process is effectively lossless / perfect. Once you have PCM, it will be 64bit @ 352.8 kHz for DSD"

 There you go, apparently that is perfectly normal for DSD64. Just for me personally: do either of your dac's allow straight dsd without dop? I kind of wish i had one on hand to play with for future dsd based problems.


----------



## WayneWoondirts

right for D2P but not DoP, at DoP the DSD file gets packed in a fake PCM but will be unpacked in DSD again, as far as I know.
  
 Besides, I just tried DSD128 and that also gets downsampled. 
  
 The Continental Dual Mono handles DSD natively.


----------



## yay101

I have a feeling your mpd log is going to be answer here, as mpd should only output as plain pcm as fallback from actual dsd, never when dop is enabled.


----------



## yay101

Also might be worth seeing if straight DSD plays properly with dsd_usb "yes"


----------



## WayneWoondirts

yay101 said:


> Also might be worth seeing if straight DSD plays properly with dsd_usb "yes"


 
 not changing anything.
 weirdly enough I can't get a log with mpd --verbose, there's also nothing in the folder "~/.mpd/log"
  
 I'm now thinking of switching distributions because of this... thinking Manjaro
 what are you guys running?


----------



## yay101

Got manjaro at home for web app/ Dev/ daily use. Love it to death, can recommend. 

I use headless arm players for playback though (cuboxi's).


----------



## WayneWoondirts

yay101 said:


> Got manjaro at home for web app/ Dev/ daily use. Love it to death, can recommend.
> 
> I use headless arm players for playback though (cuboxi's).


 
 cool, thanks!
 I will test it this weekend and then decide if I'm going to install it on both of my machines
  
 What DE do you use? I really want to keep KDE/Plasma


----------



## yay101

Same. KDE user here as well, my only gripe with the default install is I don't like guake/ drop down terminals and its installed/ starts on boot by defualt but that took all of 4 seconds to remove. The default install is quite nice otherwise.


----------



## WayneWoondirts

yay101 said:


> Same. KDE user here as well, my only gripe with the default install is I don't like guake/ drop down terminals and its installed/ starts on boot by defualt but that took all of 4 seconds to remove. The default install is quite nice otherwise.


 
 huh, drop down terminals... never seen that before (I think).
 How's KDE in Manjaro? It's incredibly well implemented in SUSE, never been more happy with it than with OpenSUSE.


----------



## yay101

I haven't used suse for like 8 years, but its comparable to kubuntu as far as completeness. Just not as nice of a store, but I'm sure that will change.


----------



## WayneWoondirts

not in my opinion, SUSE is way beyond Kubuntu. Been using it for 2.5 years now never had any problem (aside from ALSA/mpd/DSD now).
 looking forward to Manjaro, the things I've heard so far were only positive.


----------



## WayneWoondirts

found the solution to my problem:
  
 Cantata does store a custom mpd.conf file under ~/.local/share/cantata/mpd/ which is used if at first setup option number one is chosen (simple setup). 
 I simply created a shortcut to the systemwide mpd configuration file and am now good to go.


----------



## rootsandculture

I follow those instructions. I have an EMU Creative DAC, but when I put a custom "hw:EMU0404" command inside alsa device in gmusicbrowser the music plays accelerated. If I clear that commend and leaves empty, plays fine. I'm trying to get the best sound I can with that nice soundcard. Any ideas how to fix it?
  
 https://dl.dropboxusercontent.com/u/69141415/Screenshot%20from%202016-04-25%2022%3A45%3A13.png
 https://dl.dropboxusercontent.com/u/69141415/Screenshot%20from%202016-04-25%2022%3A45%3A23.png


----------



## yay101

Do your alsa settings designate the emu0404 as default?


----------



## rootsandculture

How can I check that? I uploaded 2 screenshots with my config. The audio is playing trough emu0404, but accelerated.


----------



## yay101

cat $HOME/.asoundrc

Or

cat /etc/asound.conf

Depending on whether your config is system wide or user based.

If in doubt do both.


----------



## rootsandculture

rootsandculture@Roots:~$ cat $HOME/.asoundrc
 cat: /home/rootsandculture/.asoundrc: No such file or directory
 rootsandculture@Roots:~$ cat /etc/asound.conf
 cat: /etc/asound.conf: No such file or directory


----------



## RRod

rootsandculture said:


> I follow those instructions. I have an EMU Creative DAC, but when I put a custom "hw:EMU0404" command inside alsa device in gmusicbrowser the music plays accelerated. If I clear that commend and leaves empty, plays fine. I'm trying to get the best sound I can with that nice soundcard. Any ideas how to fix it?
> 
> https://dl.dropboxusercontent.com/u/69141415/Screenshot%20from%202016-04-25%2022%3A45%3A13.png
> https://dl.dropboxusercontent.com/u/69141415/Screenshot%20from%202016-04-25%2022%3A45%3A23.png


 
  
 When I used my 0404 via ALSA I found I had to either adjust the sample rate slider in alsamixer or record something to get it to work right. It's a bit of a fussy beast. Even now being back on Pulseaudio I still have to make sure to turn the E-MU on before I plug it in to USB, or it just hangs.


----------



## rootsandculture

Mine is PCI: http://media.soundonsound.com/sos/sep04/images/emu0404.l.jpg
  
 How can I access to the sample rate slider in alsamixer?


----------



## whell

rootsandculture said:


> How can I check that? I uploaded 2 screenshots with my config. The audio is playing trough emu0404, but accelerated.




Try typing "aplay -l" at a command prompt.


----------



## RRod

rootsandculture said:


> Mine is PCI: http://media.soundonsound.com/sos/sep04/images/emu0404.l.jpg
> 
> How can I access to the sample rate slider in alsamixer?


 
  
 For me, I select the E-MU as the soundcard and then the slider is labeled "Clock rate Selector."


----------



## delooper

This is an amazing thread.  I've learned quite a few things.  Thank you all. 
  
 I am in the process of setting up a small Linux box to power my stereo system.  It appears I'm doing something slightly new as I haven't been able to Google a solution to my problem. . . but I know I'm close! 
  
 I have a miniDSP "usbstreamer b" device powering a miniDSP 4x10HD device that's plugged into my amplifiers.  The usbstreamer takes a usb input.   I am trying to determine how to set up ALSA so that I can serve my music using MPD, direct to ALSA. 
  
 What I *can* do is: 
  
  - set up MPD to play music locally on my laptop using Pulse. 
  
  - play music to the miniDSP using either (a) Jack -> ALSA -> usbstreamer or (b) Deadbeef -> ALSA . I thank this thread for informing me about deadbeef.   So easy to set up!
  
 My current problem is (1) I can't get mplayer to play direct to my usbstreamer device, without using something like Jack. (2) MPD isn't currently able to play to the usbstreamer. 
  
 I imagine I need to tweak my /var/lib/alsa/asound.state file (I'm running Ubuntu 16.04) and the /etc/mpd.conf file. . . but I'm unsure what to do.   Any advice? Bit-perfect performance would be great, but anything close would make me very happy.  Especially in the beginning I would like the system to be fairly robust, converting 16-bit to 24-bit for the purpose of sending to the USB device.  My usb device is 24-bit only, even though ALSA thinks its S32_LE. 
  
 aplay -L:
  


> Spoiler: Click for code
> 
> 
> 
> ...


 
  
 deadbeef works with the hw:USBStreamer device without problems. 
  
 /var/lib/alsa/asound.state:
  


> Spoiler: Click for code
> 
> 
> 
> ...


 
  
 the value.8 and value.9 settings in control.1 for usbstreamer was what I needed to modify to get things like speaker-test working. The usbstreamer is hooked up to the miniDSP 4x10hd unit via a TOSLink cable and the last two (of the ten) channels are the L/R speaker signals. 
  


> speaker-test -c 10 -t sin -F S32_LE -D hw:USBStreamer


 
  
 works fine.
  
 /etc/mpd.conf  (I'm not fussy about what this file needs to be, it currently reflects me just seeing if *anything* might work)
  


> Spoiler: Click for code
> 
> 
> 
> ...


 
  
 Anyhow, thanks in advance for any advice. 
  
[Mod Edit - added spoilers to shorten post]


----------



## yay101

Hey there, firstly.
  
 Tweaking /var/lib/alsa/asound.state will do nothing as it is created by alsa.
  
 This is alsa's global config file.

```
/etc/asound.conf
```
  
 Between this file and /etc/mpd.conf you should be able to do everything you want.
  
 Your asound.conf will need to read something like
  
  


> pcm.!default {
> type hw
> card USBStreamer
> device 0
> ...


 
  
  
  
 and your mpd conf will need to read something like
  

```
[color=rgb(34, 34, 34)] audio_output { type "alsa" name "My USB DAC" mixer_type "hardware" # optional }[/color]
```


----------



## delooper

Thanks.  Are you sure about that?  In Ubuntu 16.04, there is no /etc/asound.conf 
  
 All I can find is /var/lib/alsa/asound.state.  
  
 I can modify the file, and load those modifications into ALSA using the alsactl store/restore commands.
  
 What role does /etc/asound.conf play?  If you have or do not have one, what difference does it make?
  
 I'm surprised it doesn't exist in my distro.     
  
 I'll try playing around with your suggestion.  Once I modify asound.conf, what do I have to do to load that information into ALSA?


----------



## yay101

> Thanks.  Are you sure about that?  In Ubuntu 16.04, there is no /etc/asound.conf


 
 You may need to create it. Pulseaudio by default controls alsa on ubuntu through extra libraries.


> All I can find is /var/lib/alsa/asound.state.


 
 As the name suggests this is the current settings and is generated by alsa when it starts, you should never put information IN this file, it is for output purposes and apart from in the absence of the actual configuration file does nothing but store loaded settings.
  


> What role does /etc/asound.conf play?  If you have or do not have one, what difference does it make?


 
 It is the configuration file for alsa. The user specific version (which you may have as well) is stored here: ~/.asoundrc
  


> I'm surprised it doesn't exist in my distro.


 
 Ubuntu is designed to be used by everyone on everything, by default it is not set for bitperfect output nor for people to NEED to use a configuration file.
  


> I'll try playing around with your suggestion.  Once I modify asound.conf, what do I have to do to load that information into ALSA?


 
 Restart your machine is probably easiest.

  
 You may need the package:


> gstreamer0.10-alsa


 
 or


> gstreamer1.0-alsa


 
 To get alsa playback working with some apps that strictly use gstreamer default as output.


----------



## bcschmerker4

delooper said:


> Thanks.  Are you sure about that?  In Ubuntu 16.04, there is no /etc/asound.conf
> 
> All I can find is /var/lib/alsa/asound.state.
> 
> ...


 

 Actually, the files in question for ALSA in Ubuntu® 16.04._n_-LTS include /etc/default/alsa, /usr/share/alsa/alsa.conf, and /usr/share/alsa/pulse-alsa.conf.  No mention of asound except in the Processes directories  /proc/asound/*.  Don't know if the system will respond to an /etc/asoundrc or a /home/<username>/.asoundrc as was the case in previous Releases.


----------



## yay101

Again. There is no mention of the file because Ubuntu uses pulse to configure alsa, not because alsa itself has changed. Even in upstream versions not to hit Ubuntu for a while alsa uses the exact same configuration as every other distro.

Also, asoundrc is the local user file that lives hidden under home/user/ not the global one that is used in etc.


----------



## delooper

Thanks for all the comments.  I want to avoid using .asoundrc as this will be for a music server.  I'd like the unit to be as robust as possible -- just turn it on and it works.  I'd rather avoid having to log into the unit regularly, as it won't have a display attached to it. 
  
 It also looks like I'll have to create a channel table. . . something like this:
  
 pcm.stereo {
     type plug
     slave.pcm "hw:1"   # or whatever
     ttable.0.8 1
     ttable.1.9 1
 }
  
 to ensure the proper channels are mapped to.    
  
 Will try all your suggestions out this weekend.  Still building the cabinet for my amplifiers...


----------



## yay101

For reliability on a music server I would suggest following the guide in my SIG, but instead of using numbers for card use the name instead, as the numbers relate to initialisation order on startup and can change when other devices are enabled or disabled. Removing or disabling pulseaudio would also be suggested as it is useless on a music server. You could even go as far as using a realtime kernel and changing the priority of playback, editing /etc/default/grub to text only boot so the desktop and related services don't start by default. These things only take a few minutes if you are interested.


----------



## delooper

Thanks for all the comments. 
  
 I have my music server working seamlessly with ALSA now. 
  
 Here is the /etc/asound.conf file that I've found works.  It look me a little while to determine how to do the channel re-mapping.
  


> pcm.usbSTR {
> type hw
> card USBStreamer
> device 0
> ...


 
  
 The only difficulty I'm having now is with mpd.  The daemon is running and it can be controlled locally by clients like ARIO, but MPDroid on my cell phone is unable to connect to the server.
  
 When I attempt to connect with MPDroid, the /var/log/mpd/mod.log file adds the lines:
  


> Jul 09 23:35 : client: [0] opened from 127.0.0.1:37398
> ALSA lib dlmisc.c:254snd1_dlobj_cache_get) Cannot open shared library /usr/lib/i386-linux-gnu/alsa-lib/libasound_module_ctl_plug.so


 
  
 Is this a blocked port? Perhaps a permissions issue?  Those would be my guesses but I'm not sure where to look.
  
 I am using the "bind to address" line of mpd.  I have the same IP address in MPDroid as in the "bind to address" field.
  
 Hmm, MPDroid was giving me "connection failed EHOSTUNREACH" errors.  But as I type this in to confirm, MPDroid connected to the mpd daemon.   I don't think I've changed anything.  This is annoying.
  
 I'll see if I can determine what makes this problem appear and disappear. . . at present I am clueless.
  
 nmap says all ports are closed:
  


> Starting Nmap 7.01 ( https://nmap.org ) at 2016-07-10 00:48 PDT
> Nmap scan report for localhost (127.0.0.1)
> Host is up (0.00027s latency).
> All 1000 scanned ports on localhost (127.0.0.1) are closed
> Nmap done: 1 IP address (1 host up) scanned in 0.14 seconds


----------



## delooper

I have another post that's being held for moderator approval.  This one won't make sense until that one appears, apologies. In short, ALSA is working fine on my music server now.  My only problem is I'm having ?intermittent? connectivity problems from my cell phone to mpd now.  I'm running MPDroid on my cell phone.  I'm wondering if ports are not being listened to.
  
 My netstat output:
  


> Active Internet connections (w/o servers)
> Proto Recv-Q Send-Q Local Address           Foreign Address         State
> tcp        0      0 localhost:51904         localhost:6600          ESTABLISHED
> tcp        0      0 192.168.1.88:49128      151.101.52.249:http     ESTABLISHED
> ...


 
  
 One other symptom is MPDroid can't save playlists on the mpd server.  I am storing all the music in /home/Music.
  
 The owner of the directory is mpd, and group is audio.
  


> $ ls -l -a
> total 20
> drwxr-xr-x  5 root root  4096 Jul  8 16:38 .
> drwxr-xr-x 22 root root  4096 Jul  8 15:39 ..
> ...


----------



## delooper

Oh, that was simple.  Apparently mpd won't create the playlist directory on its own.  So I created the directory (the one stated in the mpd.conf file).  And it saves playlists now. 
  
 Alright, my setup appears complete.  Well, next I'll make some kind of USB device to trigger my amps...  But that's not so relevant for this thread.
  
 Thanks everyone.


----------



## delooper

I'm still getting the intermittent MPD errors, it appears as if sometime MPD is listening on the port, and sometimes it is not. I'm not sure what the cause is. On MPDroid I get the EHOSTUNREACH error. The MPD log gives:

Jul 09 23:35 : client: [0] opened from 127.0.0.1:37398
ALSA lib dlmisc.c:254snd1_dlobj_cache_get) Cannot open shared library /usr/lib/i386-linux-gnu/alsa-lib/libasound_module_ctl_plug.so

Errors.

Perhaps what's happening is simpler -- maybe the computer decides to turn off ports when nobody is logged in? That would make sense, for power conservation... There could be something like that going on in BIOS, and perhaps some configuration issues like that in Linux as well. Will poke around...


----------



## yay101

Is there any reason your alsa config is so busy? You shouldn't need to use plug or remap channels for stereo. I'd also put money on your connectivity errors coming from that alsa error.


----------



## delooper

Yes, channels 0-7 are reserved for other signals with the usbstreamer.   8 and 9 are for the stereo signals.   If you know a simpler configuration that would work, I'm all ears. 
  
 The usbstreamer is a pretty versatile thing, designed for more than stereo output, as far as I can tell. 
  
 I'm starting to think the ALSA error above is that mpd is currently configured to be launched only when a user is logged into a GUI session.  Or ports are closed if there's no user logged in.  Something like that.  It is starting to look like the latter.  mpd is unresponsive when I reboot the music server, but if I log in (even with no GUI) mpd is enabled.  Same with ssh.   
  
 So I think I need to move mpd and ssh to a different autostart position.   I ?think? this just entails moving files between the various /etc/rc?.d directories... but this requires some care as I'd rather not disable my music server.


----------



## delooper

Oh!  I think it's a far simpler problem.  My LUbuntu box is currently connected to the network via wifi.  And wifi is only configured for users, it's not set-up system-wide.  Ha.   Okay, so now I just have to tell it to connect to the wifi on boot. . . That might require restarting ssh and mpd but that's okay. 
  
 Solution: log into the LUbuntu GUI.  Click on the network connections, edit wifi.  Click on "all users can use this".  Reboot.  Done.  ssh and mpd are available on boot-up now. 
  
 Sigh.  That was far simpler than I thought it might be.


----------



## eimis

Anyone knows how to make Spotify use my USB DAC without involving Pulse, straight through ALSA?


----------



## yay101

Disable pulse and everything will use alsa in a first come first served basis.

Pretty sure there are players with alsa support our of the box though, Clementine comes to mind.


----------



## acer5513

Alsa is best choice, but unfortunately clementine in recent versions disabled ALSA support. I use some pulseaudio tweak for acceptable sound. 
  
 Change _*/etc/pulse/daemon.conf*_
  
 comment: resample-method = speex-float-1
 insert: resample-method = copy
  
 comment: default-sample-format = s16le
 insert: default-sample-format = float32se (may be s24le)
  
 change:
 default-sample-rate = 44100
 alternate-sample-rate = 192000
  
 Restart pulseaudio in command line: _pulseaudio -k _
 as a result the sound quality will be comparable with ALSA.


----------



## Chs177

acer5513 said:


> Alsa is best choice, but unfortunately clementine in recent versions disabled ALSA support. I use some pulseaudio tweak for acceptable sound.


 
 You are using pulseaudio in this case, not just ALSA.
 You may try deadbeaf player. It can play directly to ALSA devices.


----------



## bortek

Hi
  
 Can you please share what USB sounds cards with SPDIF/optical or coaxial digital output you use on Linux (ALSA) that you know works. Thanks!


----------



## Chs177

bortek said:


> Hi
> 
> Can you please share what USB sounds cards with SPDIF/optical or coaxial digital output you use on Linux (ALSA) that you know works. Thanks!


 

 Hi, any card with XMOS chip will work fine.


----------



## bortek

chs177 said:


> Hi, any card with XMOS chip will work fine.




Can you give me at least one example so that I have something to start with my research,? Thanks!


----------



## Chs177

bortek said:


> Can you give me at least one example so that I have something to start with my research,? Thanks!


 

 Let manage it by following way - what is your goal? What do you want to do with such card?
 Just for example:
 www.ebay.com/itm/251550012954
 www.ebay.com/itm/232043414419


----------



## bortek

chs177 said:


> Let manage it by following way - what is your goal? What do you want to do with such card?
> Just for example:
> www.ebay.com/itm/251550012954
> www.ebay.com/itm/232043414419




Okej, my ultame goal is to have dts-passthrough/bit perfect sound on pine64 single board computer with coaxial or spdif digital outto my receiver. It has to run either Ubuntu or Debian. 

I already achived dts passthrough/bit perfect on pi3+hidiberry board. But hidiberry alike board is not available for pine64. Therefore a need for such a setup.


----------



## bortek

chs177 said:


> Let manage it by following way - what is your goal? What do you want to do with such card?




Okej, my ultame goal is to have dts-passthrough/bit perfect sound on pine64 single board computer with coaxial or spdif digital outto my receiver. It has to run either Ubuntu or Debian. 

I already achived dts passthrough/bit perfect on pi3+hidiberry board. But hidiberry alike board is not available for pine64. Therefore a need for such a setup.


----------



## Chs177

bortek said:


> Okej, my ultame goal is to have dts-passthrough/bit perfect sound on pine64 single board computer with coaxial or spdif digital outto my receiver. It has to run either Ubuntu or Debian.
> 
> I already achived dts passthrough/bit perfect on pi3+hidiberry board. But hidiberry alike board is not available for pine64. Therefore a need for such a setup.


 

 Hi, Gustard H12(H10) will be a good option in this way if you have no budget constraints. Or you can try any card with XMOS chip as usb receiver. I have no problems with XMOS cards on Fedora at all. Good luck!


----------



## slav0nic

acer5513 said:


> resample-method = copy


 
  
 you can try play 96000 audio with you setting, and see as it will be still resampled to 192000 with low quality algorithm (speex-float-1)
 so, i don't understand why many guys recommended use `copy` method, official pulseaudio wiki have another opinion about hi-res settings (as i understand, here is no way for `disable` resampling )


----------



## acer5513

You're right. If you use copy method, only default-sample-rate and alternative-sample-rate will not be resample. In other cases will do. Use "copy" method is only way to play sound without resampling through pulseaudio. I use pulseaduio with quite good quality only on office desktop with clementine, while on my home system i remove pulseaudio and use alsa.


----------



## slav0nic

acer5513 said:


> Use "copy" method is only way to play sound without resampling through pulseaudio


 
 `copy resampling` on config doesn't make sense  =)
 it using by default if sound source rate == default-sample-rate or alternate-sample-rate, you can check pulseaudio verbose logs to make sure, on all other situations pulse will try do resampling, here is no way disable resampling (it needed for playing difference souces on same time).
  
 i usually use `speex-float-5` as resample-method method, also from version 7 pulse supported soxr resamples (soxr-vhq/soxr-hq)
  
 ps: copy is not good choose, in practice pulse will be selected bad  quality resampler


----------



## Ulises

Apparently you can play bit-perfect audio in Rythmbox!
  
 This is what I did:
  
 - I disabled respawned from pulseaudio
 - log out and back in (so that pulseaudio wasn't running)
  
 That's it!
  
 I played a 24/192 file in rhythmbox and checked the output in /proc/asound, also 24/192.
  
 As others have mentioned I still have volume control, so I'm not 100% sure it is bit perfect.'
  
 However, this seems to be by far the easiest way to have bit perfect sound. You literally have to change one line in the pulseaudio config file


----------



## Ulises

Update 2. There might be something wrong with my pulseaudio settings... or pulseaudio sucks. 
  
 Using my PC ubuntu  14.04 USB > schiit uber 2 uber > magni 2 > beyerdynamic T5P (1st gen) 
  
 Songs sound thin, clippy when using pulseaudio in rythmbox. It's very fatiguing to listen. In files with 24//96 I can actually hear clipping noises
  
 Alsa with the same settings in rythmbox sounds lush, non fatiguing.
  
 Was actually thinking on getting a tube amp to make the sound sweeter. Turns out, it was an OS issue!


----------



## yay101

Pulses default resampling and mixing settings are rubbish. Especially way back on14.04.


----------



## bcschmerker4

I'll probably need to check Dependencies for the Package *ubuntu-desktop* to see whether I can scrub PulseAudio™ from the Hot Rod gPC™ and not break other routine updates.  The ASUS® XONAR® STX™ should be able to drive an ALO Audio® Studio 6™ bit-perfect, assuming I use the correct dual amplifiers at the I-V and line-level buffer; ALSA snd-virtuoso defaults to the dual-RCA analog outputs when installed.


----------



## Ulises

Good news folks running Linux:
  
 If you disable respawn from pulseaudio and then kill it (so that the OS uses ALSA)
  
 you can actually hear Spotify bit perfect using the Linux client. I know this isn't ideal since Spotify isn't lossless, but according to rumors, Spotify lossless is coming which means that soon we'll be able to stream lossless bit perfectly in Linux!
  
 PS.: I haven't found any way to stream tidal bit perfect in Linux sadly


----------



## yay101

Kodi/ anything that can stream tidal will do lossless bitperfect when pulse is disabled.


----------



## Ulises

Tidal to the best of my knowledge can only be streamed in FLAC in Google chrome and I haven't been able to get sound from Google chrome when pulse audio is disabled


----------



## yay101

Way back when I bothered with tidal you could get lossless streams in the Kodi plugin with the tick of a box. Things however do change.

Don't forget that chrome does its own resampling and mixing in its own engine before sending to the os layer. That said, chrome will happily output to alsa in the absence of pulse.


----------



## Ulises

yay101 said:


> Way back when I bothered with tidal you could get lossless streams in the Kodi plugin with the tick of a box. Things however do change.
> 
> Don't forget that chrome does its own resampling and mixing in its own engine before sending to the os layer. That said, chrome will happily output to alsa in the absence of pulse.


 
 Thank you for your answer!
  
 I haven't been able to get google-chrome to output sound to ALSA (tried: AE_SINK=ALSA google-chrome in terminal)
 I did manage to get Kodi to output to ALSA, but sadly the Tidal plugin seems to be broken


----------



## drtechno

skamp said:


> I'm surprised. Even the Benchmark DAC1 USB only supports up to 96kHz. Try listening to some 24/192 material, and run the following command in a terminal:  Code:
> 
> ```
> cat /proc/asound/card*/stream0
> ...


 
  
 well most of the pro audio interfaces don't have linux profiles, so the usb interfaces do the generic profile. But all you have to do is edit the profile and enter the other sampling rates. That is how I got my little stienburg box can go to 24/192K


----------



## Ulises

I'll share my experience playing bit perfect music on Tidal on Ubuntu 14.04
  
 1. Create a web app from google chrome out of Tidal
 2. pulseaudio -k (kill pulseaudio). Before this, disable auto respawn
 3. Do your browsing in Firefox (Firefox recently dropped support for ALSA). There will be no sound coming from Firefox
  
 Tidal will play bit perfect


----------



## Kantilo

Hello, I configured the "mpd.conf", I put "0,0" which correspond to my sound card, however I wanted to know, after that you have to create a file ".asoundrc"? Or there is no link?


----------



## GioF71

Hello, if mpd.conf is in /etc, then no, the .asoundrc is not relevant.
Which configuration do you need to specify?


----------



## GioF71

If you need some help, please post the output of this command:

cat /proc/asound/cards


----------



## Kantilo (Jun 28, 2017)

My mpd.conf is in my home

I know how to put the hardware but I would like to add a dac and I do not know if I have to add an entry in .mpd/mpd.conf and if I have to modify the .asoundrc : https://www.head-fi.org/f/threads/guide-newb-guide-to-bit-perfect-linux-audio.700447/


----------



## GioF71 (Jun 29, 2017)

Why do you need to modify the .asound?
It is not strictly needed, at least for a bitperfect configuration.
I have mpd also running on my desktop PC so mpd starts as a user process. As long as this process reads a correct conf file, you need to set something like


```
"hw:DAC,0"
```

on your alsa output device, if your dac is named DAC of course.

Also make sure mpd uses the current user. This should mean comment the configuration entry or set it to your login username.

Hope this helps


----------



## Kantilo

I do not know, I thought we had to edit ".asoundrc" because it says in the page I gave, and you told me there was no need to Edit it if I use the configuration in "/etc/mpd.conf" (so the general config), but I use it in my home so I always thought it was necessary to edit the asoundrc

So if I have several SACs I add several entries ?

Thanks


----------



## GioF71

There are situations where you need a .asoundrc (or at system level, a /etc/asound.conf).
But it's not strictly necessary if you simply want to configure one or more alsa output on mpd.
Yes of course you may configure more output. 

The list of sound devices is given by the command posted before.

Let me know if you need more information, I will try to help.


----------



## Kantilo (Jul 5, 2017)

In my file "mpd.conf", I have a section like this:

audio_output {
    type        "alsa"
    name        "My ALSA Device"
    device        "hw:0,0"    # optional
#    format        "44100:16:2"    # optional
    mixer_type      "hardware"    # optional
    mixer_device    "default"    # optional
    mixer_control    "Master"        # optional
   mixer_index    "0"        # optional
}


So I have to copy this section several times for each dac?


----------



## GioF71

Exactly.
You might want to also use different names so you can easily select your output configuration in your mpd client.

Also consider using device names instead of device numbers.

Hope this helps


----------



## Kantilo (Jul 6, 2017)

Thank you so much for your help 


I think it's better to put the name in the "device" part instead of the device number?

For find the name i think it's with the aplay-l command but i don't know where is the name and how to know if it works

In the "name" part I put the name I want, for example "The name of my dac", or the real name for example "STX"?

I can not understand the parts "mixer_device" "mixer_control" and "mixer_index", could someone help me?


----------



## GioF71

the two commands are pretty much equivalent:


```
giof71@desktopmusicplayer:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: x20 [xCORE USB Audio 2.0], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
giof71@desktopmusicplayer:~$ cat /proc/asound/cards
 1 [x20            ]: USB-Audio - xCORE USB Audio 2.0
                      XMOS xCORE USB Audio 2.0 at usb-0000:00:1d.7-1.1, high speed
```

In your case I think you have a Asus Xonar Essence ST(X) as I also have on my desktop pc, if so the name of the dac it STX.
From my mpd.conf:

audio_output {
        type            "alsa"
        name            "STX"
        auto_resample   "no"
        device          "hw:STX,1"
}

In my case I use STX,1 because I have a DAC connected to the STX digital output. If you use its analog output, just write "hw:STX,0".
There is no particular need to specify the other parameters in the output configuration, but I am no expert. 
OTOH, I let MPD set the volume via software. Just enable the global parameter:

mixer_type      "software"

but keep in mind that if you use a volume under 100%, this in some ways degrades the sound quality. So do not digitally lower you volume if you also have an analog volume control in your signal path.
Though it might be useful if you want to connect active speakers directly to your analog output. 
This is quite a dangerous setup if you ask me, but feasible. One needs to be extra careful the volume is not @ 100% when the active speakers are powered.
Of course if you have a volume control in your DAC or amp/preamp, you can safely disable mixer_type.


----------



## Kantilo (Jul 7, 2017)

Thanks for your help, so I have an asus STX, and a USB DAC, there I configured my USB DAC, however for the mixer I put hardware because the software is not bit-perfect like Indicated on the site MPD

So if I understand correctly, you use the RCA output of your STX or another output? And you put STX, 1 because you do not use the STX DAC? But what is the use of STX then?

When I lower the volume in my player, the sound does not move so I guess it's bit-perfect, but in deadbeef the volume drops even when choosing alsa, so I do not know how to do

In deadbeef I did a test with the sound card of the PC, I have "default audio device" and "front speakers", even if I put front speakers, the sound in the headphones works but with front speakers :

```
cat /proc/asound/card0/pcm0p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 1024
buffer_size: 8192
```

And with default output device :


```
cat /proc/asound/card0/pcm0p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 1024
buffer_size: 16384
```

In alsamixer, for the DAC I have mounted and lowered the volume but nothing moves in reading so it must be really bit-perfect, well I do not know

So the name of your card is x20, right? I do not understand why you put STX of the blow


----------



## GioF71 (Jul 8, 2017)

Hello, I understand my post might be confusing. Let me explain my desktop setup.
I have a regular desktop PC with Linux Mint 18.2 as well as a dedicated low power box with an Atom D510 with ubuntu server 16.04.
I named the latter "desktop media player".

Both have mpd and upmpdcli installed, although in with different configurations.
On the DesktopMediaPlayer, mpd and upmpdcli working as services.
On the PC, they run in the user session.

The desktop media player (dmp from now on) is connected via USB to a Gustard U12 (a USB DDC interface), which is the device named 'x20'.
The Gustard U12 is connected to the Gustard X12 DAC via I2S (through a HDMI cable).
The Gustard X12 DAC is also connected to the desktop pc via both USB and the optical output of the xonar essence stx.
Of course with this configuration I am not really using the DAC section of the STX. The Gustard X12 DAC fed by the digital output of the STX sound better than the STX's DAC. And, I can also decode DSD (using DSD over PCM) with this connection, a thing the STX's DAC cannot do.

This is the main reason I still use the STX over the onboard spdif. The onboard spdif does not 88.2kHz and 176.4kHz. I do not have a lot of content with that sampling rate, but I have some DSD albums which are in fact streamed to the dac as 24bit/176.4 (dop). The onboard spdif can't do that, the STX can.

Also, I prefer this configuration over the USB connection to the X12 because it seems to me it sounds better, although the spdif input does not support sampling rates over 192kHz. The I2S and the USB support up to 352.8/384kHz, useful if one want to do some upsampling.

Of course the desktop music player, with its dedicated digital-to-digital converter (the gustard U12) and the I2S connection to the Gustard X12 is currently my best configuration.
The desktop pc is good enough for casual listening like, for example, listening to a webradio through the browser, spotify, etc etc.

Hope this clarifies!

Cheers


----------



## Kantilo (Jul 8, 2017)

Thank you for your help, I learn a lot with you, so if I understand correctly :

The dmp is USB connected to the U12, which is connected to the X12, and the X12 is connected to the desktop via the S / PDIF

You tell me optical, but it's S/PDIF no? I do not see any optical output

So by putting STX,1 it asks the STX not to decode, and to send in S/PDIF ? But how did you adjust the s / pdif output?

What is I2S? I have a raspberry pi, for me I2S it's the pins but there it does not look like it

Does S/PDIF not support the sampling rates of 88.2 and 176 kHz? I did not know

Here i see a review of the card : http://www.hdfever.fr/2012/02/24/test-asus-xonar-essence-stx/comment-page-6/

He say : Port S/PDIF* :* connexion à la carte graphique compatible via le port HDMI
It's an error, no ?

You advise me what for Deadbeef outings? I have several as indicated


----------



## bcschmerker4

@Kantilo  The ASUS® XONAR® Essence™ Series uses an RCA jack with integrated optical transmitter for the S/P-DIF Digital Output; load may be coaxial (RCA plug) or optical (3.5mm TOSLINK adapter).


----------



## Kantilo

For me, optical is this : http://static.homecinemabuyer.co.uk/wp-content/uploads/5453-615.jpg

I don't have this on my STX


----------



## GioF71

Yes, the STX only has a different connection.
Look at the last picture of this page:

http://www.guru3d.com/articles-pages/asus-essence-stx-ii-7-1-sound-card-review,4.html

and see the adapter on the bottom right of the picture. That adapter allows you to connect a regular optical to your STX.
The plug is combined as @*bcschmerker4* said.
If you want to use the optical output and do not want that adapter, you can consider buying a cable like this one:

https://www.amazon.com/Whizzotech-T...F8&qid=1499586811&sr=8-3&keywords=spdif+3.5mm

I hope the link works. This is just the first hit on amazon, I am not advising this cable against any other brand.

Anyway, both rca coaxial and optical connections can be called SPDIF: see https://en.wikipedia.org/wiki/S/PDIF


----------



## GioF71 (Jul 9, 2017)

Kantilo said:


> Thank you for your help, I learn a lot with you, so if I understand correctly :
> 
> The dmp is USB connected to the U12, which is connected to the X12, and the X12 is connected to the desktop via the S / PDIF
> 
> ...



It's not spdif that does not support 88.2 and 176.4. It's the digital output of my mainboard that doesn't. The STX supports all sampling rates up to 192kHz, including 88.2 and 176.4.
About "STX,1": this means the output is the digital output. If you specify STX,0, you are using the analog output (so the signal goes through the DAC).
If with "adjust" you mean how to control the volume, you can use alsamixer from the command line.

I2S is another way to transfer digital audio signal. See: https://en.wikipedia.org/wiki/I²S
This protocol separates data from clock, this results in lower jitter.
Typically you find I2S input in some DACs, for example (but not limited to) on the PS Audio, Audio-GD, Gustard, etc.
Of course you will need an interface that can output I2S. One is the Gustard U12. There are some on shenzhenaudio.com from LKS for example.

For the raspberry pi, there should be some modules to be connected to the GPIO connector.
See this implementation: http://www.audiophonics.fr/en/netwo...2s-lvds-hdmi-audio-gd-compatible-p-12031.html

About the card review: I think it is not very correct because you cannot connect some HDMI out of to the spdif out of the essence STX. The spdif connector of the essence STX is an OUTPUT connector.
But you can do something with some specific adapter:
https://www.amazon.com/ViewHD-Extractor-Optical-Converter-VHD-H2HSAs/dp/B00KBHX072
This one for example can split the hdmi out of your TV so you can decode audio through the digital input of any DAC which has an optical SPDIF input.

Please note that HDMI when transferring I2S has nothing to do with the hdmi output of the typical TV set. This has been asked multiple times. It's always hdmi, but the signal is different. If you connect the HDMI out of a TV to the HDMI I2S of an audio DAC, no sound will happen.

About Deadbeef: I do not use it currently but I have used it some time ago. I currently use MPD+upmpdcli pretty much every time I want to play back audio from my pc. If I want to play local files from my PC to the dms, I do it through a DLNA media server (rygel) pointing to my "~/Music" folder. For my music library, I have MinimServer running on my NAS.

Hope this helps!
Cheers


----------



## bcschmerker4

@Kantilo  Shaxon® manufactures optical links for TOSLINK-through-RCA applications.  One example is a 1m 3.5mm-to-TOSLINK, P/N POTL35M5001MBRB ($9.95 as of 9 July 2017 at Fry's Electronics®); the 3.5mm end goes to the Digital Out, and the TOSLINK end goes to a standard Optical In on another component.


----------



## delooper (Jan 18, 2018)

Hi folks,

It's been two years now I've been playing music on my headless linux box with mpd and ALSA.  Everything was going great until a system update last night.  I ?suspect? the update modified some file permissions and that's caused the trouble.  But I can't seem to isolate the problem.

To begin with, it appears ALSA is running fine.  mplayer plays through ALSA, and speaker-test works as expected.

mpd is having troubles, though.  mpd communicates with my cell phone (running MPDroid).  The trouble appears to be the mpd to ALSA connection.

The first error message that appears in /var/log/mpd/mpd.log after my system update is:

zeroconf: No global port, disabling zeroconf​
Running mpd from the command line gives:

errno: failed to open log file "/var/log/mpd/mpd.log" (config line 38): Permission denied​
But permissions appear to be set appropriately for the log file (user mpd, group audio, rw access).

Similarly the mpd log file has other peculiar entries:

output: Failed to open mixer for 'USB Streamer - LX521.4'​
db: No such directory

alsa_mixer: Failed to read mixer for 'USB Streamer - LX521.4': no such mixer control: PCM​
Groups appear to be set correctly for mpd:

ps -eo user,group,supgrp,args | grep mpd
mpd      audio    -                                        /usr/bin/mpd --no-daemon​
The complaints above made me wonder if perhaps the audio_output section of my mpd.conf file needs to be changed.   My amixer output for my USBstreamer:

Simple mixer control 'Mic',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer - Side Left - Side Right - Rear Center - ?
  Limits: Capture 0 - 255
  Front Left: Capture 255 [100%] [0.00dB] [on]
  Front Right: Capture 255 [100%] [0.00dB] [on]
  Rear Left: Capture 255 [100%] [0.00dB] [on]
  Rear Right: Capture 255 [100%] [0.00dB] [on]
  Front Center: Capture 255 [100%] [0.00dB] [on]
  Woofer: Capture 255 [100%] [0.00dB] [on]
  Side Left: Capture 255 [100%] [0.00dB] [on]
  Side Right: Capture 255 [100%] [0.00dB] [on]
  Rear Center: Capture 255 [100%] [0.00dB] [on]
  ?: Capture 255 [100%] [0.00dB] [on]
Simple mixer control 'Mic',1
  Capabilities: cvolume cvolume-joined cswitch cswitch-joined
  Capture channels: Mono
  Limits: Capture 0 - 255
  Mono: Capture 255 [100%] [0.00dB] [on]
Simple mixer control 'USBStreamer Clock Selector',0
  Capabilities: enum
  Items: 'USBStreamer Internal Clock' 'USBStreamer TOSLINK Clock'
  Item0: 'USBStreamer Internal Clock'
Simple mixer control 'USBStreamer Output',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer - Side Left - Side Right - Rear Center - ?
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB] [on]
  Front Right: Playback 255 [100%] [0.00dB] [on]
  Rear Left: Playback 255 [100%] [0.00dB] [on]
  Rear Right: Playback 255 [100%] [0.00dB] [on]
  Front Center: Playback 255 [100%] [0.00dB] [on]
  Woofer: Playback 255 [100%] [0.00dB] [on]
  Side Left: Playback 255 [100%] [0.00dB] [on]
  Side Right: Playback 255 [100%] [0.00dB] [on]
  Rear Center: Playback 255 [100%] [0.00dB] [on]
  ?: Playback 255 [100%] [0.00dB] [on]
Simple mixer control 'USBStreamer Output',1
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 255
  Mono: Playback 245 [96%] [-5.00dB] [on]​If I add

    mixer_control   "USBStreamer Output"

to my audio_output section of mpd.conf, the "no such mixer control: PCM" error messages are replaced with:

    alsa_output: "USB Streamer - LX521.4" [alsa] failed to play: Broken pipe

changing mpd's logging to verbose there's one more clue:

alsa_mixer: Failed to read mixer for 'USB Streamer - LX521.4': no such mixer control: USBStreamer Output​Is there another way to specify the mixer?  I'm at a loss now.

Would the remapping in my asound.conf file be causing this problem?

pcm.usbSTR {
  type hw
  card USBStreamer
  device 0
}

pcm.usbREMAP {
  type plug
  slave.pcm usbSTR
  ttable.0.8 1
  ttable.1.9 1
}

pcm.!default {
  type plug
  slave.pcm usbREMAP
}

ctl.!default {
  type plug
  slave.pcm usbREMAP
}​


----------



## chokini (Jan 26, 2018)

Hello,

Here is an issue I am having with gstreamer ALSA output (on Ubuntu 16.04):
the following command fails with one of my DACs (iFi Audio iDSD Nano BL)


```
gst-launch-1.0 filesrc location="song.flac" ! decodebin ! alsasink device=hw:1,0
```


```
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstFlacParse:flacparse0: GStreamer encountered a general stream error.
Additional debug info:
gstbaseparse.c(3599): gst_base_parse_loop (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstFlacParse:flacparse0:
streaming stopped, reason not-negotiated
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
```

With my other DAC, the same command produces music from the flac file.
Do you have any idea about what might be going on ?

Update: this is fixed by

filesrc ! decodebin ! audioconvert ! alsasink


----------



## delooper

I think I'm zeroing-in on the source of my problems.  Its starting to look like a change in alsamixer's behaviour.

alsamixer
ALSA lib dlmisc.c:254snd1_dlobj_cache_get) Cannot open shared library /usr/lib/i386-linux-gnu/alsa-lib/libasound_module_ctl_plug.so
cannot open mixer: No such device or address​
If I run alsamixer with no hardware parameters, it fails as above.   If I specify the hardware device:

alsamixer -D hw:USBStreamer​
alsamixer works perfectly.

The issue with mpd is that the above error message appears in the mpd.log file, when I tell mpd.conf to use the default alsa device. . . and this appears to be the reason why mpd isn't communicating with ALSA anymore.

audio_output {
    type            "alsa"
    name            "USB Streamer - LX521.4"
}​
So my question is, can I constrain mpd to call alsamixer with a hardware parameter, to avoid this alsamixer crash?


----------



## chokini (Jan 25, 2018)

Hello,

In MPD audio_ouput description, 'name' is a just a name given to the output.
I think you need 'device':


audio_output {
     type       "alsa"
     name       "name..."
     device       "hw:xyz,0"  or "hw:1,0"
}


----------



## delooper

chokini said:


> Hello,
> 
> In MPD audio_ouput description, 'name' is a just a name given to the output.
> I think you need 'device':
> ...



Thanks, that's had some effect but it isn't enough to fix my problem.  Let me show you.  My audio_output:


audio_output {
        type            "alsa"
        name            "USB Streamer - LX521.4"
        device          "hw:USBStreamer,0"
}


Restarting mpd, the new mpd error log mpd.log:


Jan 25 02:47 : decoder_thread: probing plugin flac
Jan 25 02:47 : decoder: audio_format=44100:16:2, seekable=true
Jan 25 02:47 : alsa_output: opened hw:USBStreamer,0 type=HW
Jan 25 02:47 : alsa_output: format=S32_LE (Signed 32 bit Little Endian)
Jan 25 02:47 : alsa_output: buffer: size=12..26214 time=272..594422
Jan 25 02:47 : alsa_output: period: size=6..13107 time=136..297211
Jan 25 02:47 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Jan 25 02:47 : alsa_output: buffer_size=22050 period_size=5513
Jan 25 02:47 : output: opened plugin=alsa name="USB Streamer - LX521.4" audio_format=44100:32:10
Jan 25 02:47 : output: converting from 44100:16:2
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/i386-linux-gnu/alsa-lib/libasound_module_ctl_plug.so
Jan 25 02:47 : output: Failed to open mixer for 'USB Streamer - LX521.4'


So it seems to be recognising the alsa device, but then it seems to have the same mixer problem, again.


----------



## delooper

Small progress.   Here is my channel remapping in /etc/asound.conf

pcm.usbSTR {
type hw
card USBStreamer
device 0
}

pcm.usbREMAP {
type plug
slave.pcm usbSTR
ttable.0.8 1
ttable.1.9 1
}

pcm.!default {
type plug
slave.pcm usbREMAP
}

ctl.!default {
type plug
slave.pcm usbREMAP
}​I noticed that if I erase the ctl.!default block, alsamixer no longer crashes.  Moreover, that alsamixer error from the mpd.log file goes away. 

**But**, alsa does not remap the channels, i.e. I hear nothing out of my speakers.   I've read that "type plug" is not allowed in ctl.!default statements in /etc/asound.conf anymore but I have not found proper documentation of this statement.  It looks like I'll have to learn a little more about ALSA and how to properly perform this channel remapping.


----------



## delooper

delooper said:


> ctl.!default {
> type plug
> slave.pcm usbREMAP
> }​


​
The above block seems to be a key problem with my asound.conf file.  If I erase it, alsamixer loads without parameters.  mpd.log no longer has alsamixer errors.  Well, not of that type.  Now the mpd.log errors look like:

Jan 26 01:42 : playlist: play 0:"n00s/Akashic/Conservative/Track 5.flac"
Jan 26 01:42 : decoder_thread: probing plugin flac
Jan 26 01:42 : decoder: audio_format=44100:16:2, seekable=true
Jan 26 01:42 : alsa_output: opened hw:USBStreamer,0 type=HW
Jan 26 01:42 : alsa_output: format=S32_LE (Signed 32 bit Little Endian)
Jan 26 01:42 : alsa_output: buffer: size=12..26214 time=272..594422
Jan 26 01:42 : alsa_output: period: size=6..13107 time=136..297211
Jan 26 01:42 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Jan 26 01:42 : alsa_output: buffer_size=22050 period_size=5513
Jan 26 01:42 : output: opened plugin=alsa name="USB Streamer - LX521.4" audio_format=44100:32:10
Jan 26 01:42 : output: converting from 44100:16:2
Jan 26 01:42 : output: Failed to open mixer for 'USB Streamer - LX521.4'​If I understand the mixer complaint, I believe this means ALSA is looking for a ctl device.  From what I've found, the only ctl devices that are valid are of the form

ctl.!default {
 type hw
 card USBStreamer
}​
well, I could set "card" to any device but it's not clear to me if there's any other options.


----------



## delooper

With my asound.conf file like this:

pcm.!default {
  type plug
  slave.pcm {
   slave.pcm {
    type hw
    card USBStreamer
    device 0
    }
  ttable.0.8 1
  ttable.1.9 1
  }
}​
I get no errors at all in my mpd.log file:

Jan 26 11:05 : playlist: play 0:"n00s/Akashic/Conservative/Track 5.flac"
Jan 26 11:05 : decoder_thread: probing plugin flac
Jan 26 11:05 : decoder: audio_format=44100:16:2, seekable=true
Jan 26 11:05 : alsa_output: opened hw:USBStreamer,0 type=HW
Jan 26 11:05 : alsa_output: format=S32_LE (Signed 32 bit Little Endian)
Jan 26 11:05 : alsa_output: buffer: size=12..26214 time=272..594422
Jan 26 11:05 : alsa_output: period: size=6..13107 time=136..297211
Jan 26 11:05 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Jan 26 11:05 : alsa_output: buffer_size=22050 period_size=5513
Jan 26 11:05 : output: opened plugin=alsa name="USB Streamer - LX521.4" audio_format=44100:32:10
Jan 26 11:05 : output: converting from 44100:16:2
Jan 26 11:05 : state_file: Saving state file /var/lib/mpd/state​
but I also get no sound out of my speakers.   Checking with alsamixer, all the levels are fine -- unchanged from when it used to work.  Strangely, speaker-test no longer works:

speaker-test 1.1.0

Playback device is plughw:USBStreamer
Stream parameters are 48000Hz, S16_LE, 10 channels
Sine wave rate is 440.0000Hz
Playback open error: -16,Device or resource busy​But I can't seem to figure out what is making ALSA think its busy.  Similarly:

aplay -D plughw:USBStreamer /usr/share/sounds/alsa/Front_Center.wav 
aplay: main:722: audio open error: Device or resource busy​
Trying to discover what is making ALSA think its busy:

lsof /dev/snd/*
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/108/gvfs
      Output information may be incomplete.​


----------



## delooper (Jan 26, 2018)

sudo fuser -v /dev/snd/*​Showed me mpd was the culprit making ALSA busy.  So I shut down the mpd service and now speaker-test works again.   But mplayer is not.  I thought something like:

mplayer -ao alsa:device=plughw=USBStreamer.0 *.flac​would play, but I'm not getting any sound.  

Simplified /etc/asound.conf:

pcm.!default {
  type plug
  slave.pcm {
    type hw
    card USBStreamer
    device 0
    }
  ttable {
   0.8 1
   1.9 1
  }
}​
On speaker-test, 8 is the left speaker and 9 is the right speaker.   

The command "aplay -Dplughw:USBStreamer /usr/share/sounds/alsa/Rear_Center.wav" works fine.

Also "aplay -D default /usr/share/shounds/alsa/Rear_Center.wav" works as well.  So it looks like my channel remapping is working.

Okay, real progress.  mplayer is working too.  I suppose I should have thought of this -- I had to tell it to use the default alsa device, rather than go to USBStreamer.   It makes some sense as the default device is where the channel remapping is.

Next step, mpd!

I configure mpd to use the default ALSA device:

audio_output {
        type            "alsa"
        name            "USB Streamer - LX521.4"
}​
restart mpd, and it works again.  This took way more time than I wanted, but I'm very happy with the outcome!


----------



## 111MilesToGo (Feb 14, 2018)

I am looking for help from the community here at Head-Fi / this particular thread. First of all, thanks to all here, your advice and communications have been enormously helpful already.

I am looking for specific help in getting Linux to play DSD natively to my Chord Hugo 2 DAC/HA. In short, what I did achieve / think to have achieved in bit-perfect manner is:

Windows 8.1, foobar2000 with appropriate components, Chord-supplied driver (Windows 10 pre-Creators, incl. ASIO):
PCM, DoP and native DSD - all fine
Linux openSUSE Tumbleweed (KDE), Linux Mint (Cinnamon):
PCM via stand-alone music players (DeaDBeeF, Audacious, some others)
DoP via MPD (Music Player Daemon) and some clients (GMPC, Cantata)
At this point one can lean back and enjoy the music fully. However, the completist / perfectionist / curious person in me still is looking for how to achieve the last missing piece, native DSD to the Hugo 2 under Linux. Any help from the community is very welcome.


Now, for the long write-up.

Chord Hugo 2:
Capable of accepting PCM in both 44.1 and 48 kHz series, complete up to 705.6 and 768 kHz
Capable of accepting native DSD64 (single), DSD128 (double), DSD256 (fourfold), DSD512 (eightfold)
Capable of DoP (DSD over PCM), for DSD64 to DSD256, resulting in "fake" 24/176.4, 24/352.8 and 24/705.6, resp.
This is not stated in the Chord specs on their website / the Hugo 2 manual, but it is (a) understood for an Apple-compatible device, and (b) it was confirmed to me in an e-mail from Chord.
For a good reference on DoP, I'd like to quote http://dsd-guide.com/dop-open-standard.


My main Linux system is openSUSE Tumbleweed (KDE version), since it offers up-to-date software in quite a complete manner. In particular:
ALSA 1.1.5

MPD 0.20.16
GMPC 11.8.16
Cantata 2.2.0

According to the MPD documentation at https://www.musicpd.org/doc/user/, these building blocks should be sufficient to do native DSD output: ALSA >= 1.0.27.1, current MPD doing native DSD automatically when throwing *.dsf or *.dff DSD files at it if the receiving device is capable of it. Otherwise, DoP can be enabled in the MPD configuration file (/etc/mpd.conf).

Thus, my question seems to boil down as to whether the Hugo 2 is informing Linux / ALSA of its native DSD capability. The crucial point might be that Chord is using a custom-coded Xilinx Artix 7 chipset in the Hugo 2, i.e. not the common XMOS chipset.


Here are my diagnoses on Tumbleweed and ALSA:

```
aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: PCH [HDA Intel PCH], Gerät 0: 92HD81B1X5 Analog [92HD81B1X5 Analog]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 3: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 7: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 8: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 9: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 2: Hugo2 [Hugo2], Gerät 0: USB Audio [USB Audio]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
```


```
aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
    Default ALSA Output (currently PulseAudio Sound Server)
... abridged ...
sysdefault:CARD=Hugo2
    Hugo2, USB Audio
    Default Audio Device
front:CARD=Hugo2,DEV=0
    Hugo2, USB Audio
    Front speakers
surround21:CARD=Hugo2,DEV=0
    Hugo2, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Hugo2,DEV=0
    Hugo2, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Hugo2,DEV=0
    Hugo2, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Hugo2,DEV=0
    Hugo2, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Hugo2,DEV=0
    Hugo2, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Hugo2,DEV=0
    Hugo2, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Hugo2,DEV=0
    Hugo2, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
```
A script published by Ronald van Engelen (RonaldE here, thanks for it!) on https://lacocina.nl/detect-alsa-output-capabilities shows other details:

```
bash alsa-capabilities
... abridged ...
 6) USB Audio Class Digital alsa audio output interface `hw:2,0'
 - device name       = Hugo2                                                      
 - interface name    = USB Audio                                                  
 - usb audio class   = 2 - isochronous asynchronous                              
 - character device  = /dev/snd/pcmC2D0p                                          
 - encoding formats  = S32_LE                                                    
 - monitor file      = /proc/asound/card2/pcm0p/sub0/hw_params                    
 - stream file       = /proc/asound/card2/stream0
```


Now for what happens when playing music.

Here's the monitoring of the ALSA parameter and stream files during playback of a 24/192 PCM (FLAC) file:

```
cat /proc/asound/card2/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 1024
buffer_size: 8192
```


```
cat /proc/asound/card2/stream0
Chord Electronics Ltd Hugo2 at usb-0000:26:00.0-2, high speed : USB Audio

Playback:
  Status: Running
    Interface = 2
    Altset = 1
    Packet Size = 288
    Momentary freq = 191997 Hz (0x17.ffe8)
    Feedback Format = 16.16
  Interface 2
    Altset 1
    Format: S32_LE
    Channels: 2
    Endpoint: 5 OUT (ASYNC)
    Rates: 32000, 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000, 705600, 768000
    Data packet interval: 125 us
```


Switching to MPD now in order to play DSD files, something the stand-alone players like DeadDBeeF or Audacious can't do.

Ronald van Engelen also provides a script to generate an MPD configuration file /etc/mpd.conf for bit-perfect playback at https://lacocina.nl/audiophile-mpd. My audio section of this file looks like

```
audio_output {
    type                "alsa"
    name                "Hugo2 - USB Audio"
##    device              "hw:2,0"
    device              "hw:CARD=Hugo2,DEV=0"
##    device              "iec958:CARD=Hugo2,DEV=0"
    auto_resample       "no"
    auto_format         "no"
    auto_channels       "no"
    dop                 "yes"
    replay_gain_handler "none"
    mixer_type          "none"
}
replaygain              "off"
```
As compared to Ronald van Engelen's script output, I have simply inserted the line
dop "yes"
in order to enable DoP playback.

And now the monitoring for playing a DSD64 (*.dsf) file via MPD in DoP mode:

```
cat /proc/asound/card2/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 176400 (176400/1)
period_size: 22050
buffer_size: 88200
```


```
cat /proc/asound/card2/stream0
Chord Electronics Ltd Hugo2 at usb-0000:26:00.0-2, high speed : USB Audio

Playback:
  Status: Running
    Interface = 2
    Altset = 1
    Packet Size = 272
    Momentary freq = 176404 Hz (0x16.0cf0)
    Feedback Format = 16.16
  Interface 2
    Altset 1
    Format: S32_LE
    Channels: 2
    Endpoint: 5 OUT (ASYNC)
    Rates: 32000, 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000, 705600, 768000
    Data packet interval: 125 us
```

When I turn off DoP in MPD, I would have expected MPD (version 0.20.16) to use native DSD automatically, but it doesn't. Instead, it seems to do an upsampled PCM, again for the DSD64 file going out as 352.8 kHz PCM:

```
cat /proc/asound/card2/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 352800 (352800/1)
period_size: 32768
buffer_size: 131072
```


```
cat /proc/asound/card2/stream0
Chord Electronics Ltd Hugo2 at usb-0000:26:00.0-2, high speed : USB Audio

Playback:
  Status: Running
    Interface = 2
    Altset = 1
    Packet Size = 536
    Momentary freq = 352807 Hz (0x2c.19d0)
    Feedback Format = 16.16
  Interface 2
    Altset 1
    Format: S32_LE
    Channels: 2
    Endpoint: 5 OUT (ASYNC)
    Rates: 32000, 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000, 705600, 768000
    Data packet interval: 125 us
```

Further remarks: I have not yet tampered with the alsa configuration files, neither pulseaudio. From the stand-alone players, I think to get as bit-perfect PCM playback as one can get.


Sorry to you, this "long write-up" has become quite long and involved.


In the end, my question to the community is: How do I get Linux (openSUSE Tumbleweed in particular) to play DSD files natively to the Chord Hugo 2, using MPD via bit-perfect ALSA? Is it possible at all?

I would also like to see what settings and alsa monitoring others folks here do get, if somebody has a DAC that does PCM and native DSD under Linux. Maybe the Oppo HA-2SE could be a suitable candidate (has an XMOS chipset).


----------



## gimmeheadroom

Hi, thanks for your post. It will take me awhile to go over it. I guess from a quick look at the mpd doc you should make sure you're using the correct protocol for DSD, one of them converts to PCM (we don't want that) and the other one uses a PCM container. That's the one we want. Check the mpd site and your config.

I have devices that support DSD 64 and 128 (and maybe higher, I have to check) but I don't have anything but small music files from the Norweigen site at the higher sampling rates. Got a bunch of SACD rips that seem to be DSD 64, still trying to figure it out.

I'll be dealing with this in the upcoming weeks and months between business trips


----------



## 111MilesToGo

111MilesToGo said:


> I am looking for specific help in getting Linux to play DSD natively to my Chord Hugo 2 DAC/HA. In short, what I did achieve / think to have achieved in bit-perfect manner is:
> 
> ...
> Linux openSUSE Tumbleweed (KDE), Linux Mint (Cinnamon):
> ...



Well, in order to finish up on diagnosing the chain

Linux openSUSE Tumbleweed -> MPD -> ALSA -> Chord Hugo 2,
I did look at the verbose logging from MPD for the three relevant cases.


First, playing a 24/192 PCM (FLAC) file doesn't show anything unexpected - at least to me:

```
Feb 19 10:52 : zeroconf: No global port, disabling zeroconf
Feb 19 10:52 : state_file: Loading state file /etc/state
Feb 19 10:52 : inotify: initializing inotify
Feb 19 10:52 : inotify: watching music directory
Feb 19 10:52 : client: [0] opened from [::1]:34694
Feb 19 10:52 : client: [0] process command "commands"
Feb 19 10:52 : client: [0] command returned 0
...
Feb 19 10:52 : client: [0] process command "playid "56""
Feb 19 10:52 : playlist: play 55:"XXX XXX XXX.flac"
Feb 19 10:52 : decoder_thread: probing plugin flac
Feb 19 10:52 : client: [0] command returned 0
Feb 19 10:52 : playlist: queue song 56:"XXX XXX XXX XXX.flac"
Feb 19 10:52 : decoder: audio_format=192000:24:2, seekable=true
...
Feb 19 10:52 : alsa_output: opened hw:CARD=Hugo2,DEV=0 type=HW
Feb 19 10:52 : alsa_output: buffer: size=48..131072 time=250..682667
Feb 19 10:52 : alsa_output: period: size=24..65536 time=125..341334
Feb 19 10:52 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Feb 19 10:52 : alsa_output: format=S32_LE (Signed 32 bit Little Endian)
Feb 19 10:52 : alsa_output: buffer_size=96000 period_size=24000
Feb 19 10:52 : output: opened plugin=alsa name="Hugo2 - USB Audio" audio_format=192000:32:2
Feb 19 10:52 : output: converting in=192000:24:2 -> f=192000:24:2 -> out=192000:32:2
Feb 19 10:52 : client: [0] process command "playlistid "57""
Feb 19 10:52 : client: [0] command returned 0
...
Feb 19 10:53 : client: [0] process command "stop"
Feb 19 10:53 : playlist: stop
Feb 19 10:53 : player: played "XXX XXX XXX.flac"
Feb 19 10:53 : output: closed plugin=alsa name="Hugo2 - USB Audio"
Feb 19 10:53 : client: [0] command returned 0
...
Feb 19 10:53 : state_file: Saving state file /etc/state
```


Secondly, playing a DSD64 (*.dsf) file in DoP mode to the Hugo 2, i.e. with the line
	
	



```
dop "yes"
```
 in the audio section of the MPD configuration file /etc/mpd.conf:

```
Feb 19 11:02 : client: [0] process command "playid "32""
Feb 19 11:02 : playlist: play 31:"YYY YYY YYY.dsf"
Feb 19 11:02 : decoder_thread: probing plugin dsf
Feb 19 11:02 : client: [0] command returned 0
Feb 19 11:02 : playlist: queue song 32:"YYY YYY YYY YYY.dsf"
...
Feb 19 11:02 : client: [0] process command "playlistid "32""
Feb 19 11:02 : client: [0] command returned 0
Feb 19 11:02 : decoder: audio_format=dsd64:2, seekable=true
Feb 19 11:02 : client: [0] process command "playlistid "33""
Feb 19 11:02 : client: [0] command returned 0
Feb 19 11:02 : alsa_output: opened hw:CARD=Hugo2,DEV=0 type=HW
Feb 19 11:02 : alsa_output: buffer: size=46..131072 time=260..743039
Feb 19 11:02 : alsa_output: period: size=23..65536 time=130..371520
Feb 19 11:02 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Feb 19 11:02 : alsa_output: format=S32_LE (Signed 32 bit Little Endian)
Feb 19 11:02 : alsa_output: buffer_size=88200 period_size=22050
Feb 19 11:02 : alsa_output: DoP (DSD over PCM) enabled
Feb 19 11:02 : output: opened plugin=alsa name="Hugo2 - USB Audio" audio_format=dsd64:2
Feb 19 11:02 : client: [0] process command "playlistid "33""
Feb 19 11:02 : client: [0] command returned 0
...
Feb 19 11:03 : client: [0] process command "stop"
Feb 19 11:03 : playlist: stop
Feb 19 11:03 : player: played "YYY YYY YYY.dsf"
Feb 19 11:03 : output: closed plugin=alsa name="Hugo2 - USB Audio"
Feb 19 11:03 : client: [0] command returned 0
```
Seems fine to me. MPD/ALSA understand to use DoP, and I think the alsa output plugin does the correct selection of fake 24/176.4 PCM as the DoP "sample rate", although "176.4" don't show up literally in the MPD verbose log. I guess it is noteworthy here to realize that this DoP to the Hugo 2 at 32 bits (i.e. a 32/176.4 bit rate) does imply a 100% overhead above the bare minimum bit rate of 16/176.4 corresponding to DSD64.


Lastly, look at what happens when trying to throw native DSD at the Hugo 2, i.e. modifying the /etc/mpd.conf to be

```
dop "no"
or no line with dop at all, since "no" is the MPD default for the dop switch
```
. In this case, MPD/ALSA fall back to pure PCM at 352.8 kHz as is seen in the log:

```
Feb 19 11:12 : client: [0] process command "playid "34""
Feb 19 11:12 : playlist: play 33:"YYY YYY YYY.dsf"
Feb 19 11:12 : client: [0] command returned 0
Feb 19 11:12 : decoder_thread: probing plugin dsf
Feb 19 11:12 : playlist: queue song 34:"YYY YYY YYY YYY.dsf"
Feb 19 11:12 : client: [0] process command "status"
Feb 19 11:12 : client: [0] command returned 0
Feb 19 11:12 : client: [0] process command "idle"
Feb 19 11:12 : client: [0] command returned 1
Feb 19 11:12 : client: [0] process command "playlistid "34""
Feb 19 11:12 : client: [0] command returned 0
Feb 19 11:12 : decoder: audio_format=dsd64:2, seekable=true
Feb 19 11:12 : alsa_output: opened hw:CARD=Hugo2,DEV=0 type=HW
Feb 19 11:12 : alsa_output: buffer: size=90..131072 time=255..371520
Feb 19 11:12 : alsa_output: period: size=45..65536 time=127..185760
Feb 19 11:12 : alsa_output: default period_time = buffer_time/4 = 371519/4 = 92879
Feb 19 11:12 : alsa_output: format=S32_LE (Signed 32 bit Little Endian)
Feb 19 11:12 : alsa_output: buffer_size=131072 period_size=32768
Feb 19 11:12 : output: opened plugin=alsa name="Hugo2 - USB Audio" audio_format=352800:32:2
Feb 19 11:12 : output: converting in=dsd64:2 -> f=dsd64:2 -> out=352800:32:2
...
Feb 19 11:13 : client: [0] process command "stop"
Feb 19 11:13 : playlist: stop
Feb 19 11:13 : player: played "YYY YYY YYY.dsf"
Feb 19 11:13 : output: closed plugin=alsa name="Hugo2 - USB Audio"
Feb 19 11:13 : client: [0] command returned 0
```


My feeling now is, as underpinned by these logs:

Either ALSA even in its latest version does not have appropriate code to output native DSD to the specific Chord Hugo 2 hardware,
and/or the Hugo 2 does not reveal its native DSD capability appropriately to ALSA/Linux.
I am suspecting the first-mentioned item to encompass the solution, i.e. I am suspecting the ALSA folks should take care of the Hugo 2 specifics.


----------



## 111MilesToGo (Jun 18, 2018)

111MilesToGo said:


> My feeling now is, as underpinned by these logs:
> 
> Either ALSA even in its latest version does not have appropriate code to output native DSD to the specific Chord Hugo 2 hardware,
> and/or the Hugo 2 does not reveal its native DSD capability appropriately to ALSA/Linux.
> I am suspecting the first-mentioned item to encompass the solution, i.e. I am suspecting the ALSA folks should take care of the Hugo 2 specifics.



In fact, it is the Linux quirks.c that handles DSD matters: https://github.com/torvalds/linux/blob/master/sound/usb/quirks.c. It doesn‘t have anything for Chord‘s... too bad. But doing DSD as DoP up to DSD256 with Hugo 2 is great. quirks.c a.o. handles XMOS devices like e.g. the Oppo HA-2.

Regarding MPD, I am missing one capability now: Decoding the infamous HDCD format!


----------



## Jonas Kvinge

If you like the look of Amarok 1.4 and Clementine, but want an updated player with more advanced settings audio output, you can check out my fork of Clementine called Strawberry: https://github.com/jonaski/strawberry/releases
It's aimed at audio enthusiasts and users who play local music files.
It has support for multiple backends (gstreamer, xine and VLC), with advanced audio device options, like setting a custom alsa device string.


----------



## filippoaceto

Jonas Kvinge said:


> If you like the look of Amarok 1.4 and Clementine, but want an updated player with more advanced settings audio output, you can check out my fork of Clementine called Strawberry: https://github.com/jonaski/strawberry/releases
> It's aimed at audio enthusiasts and users who play local music files.
> It has support for multiple backends (gstreamer, xine and VLC), with advanced audio device options, like setting a custom alsa device string.


Hi, how i can play in native mode dsd file with strawberry? i think that my topping d10 play in Dop becaouse the bitrate remain 44 hz


----------



## luemas

Rizlaw said:


> You can get bit-perfect audio from Linux without too much difficulty using ALSA. Most popular distributions of Linux (Ubuntu, Mint, Fedora, OpenSuse) to name but a few, use the Pulse Audio Sound Server which, by default, will mix all audio down to 16/44.1 or 48 for movies. Not good for 24/96 or higher. Those who want bit perfect audio in Linux need to bypass this "feature"
> 
> 
> 
> ...



Thank you! This helped me


----------



## Stevko

what linux distro/player is best for bitperfect?


----------



## delooper

Stevko said:


> what linux distro/player is best for bitperfect?



I think any of them should be pretty-much equivalent.  Maybe in some you might have to do a little more work to set things up.  On my server I've been using LUbuntu. 

I think the main concern I'd have setting something up is trying to avoid lots of updates.  So something fairly minimalist. The more bells-and-whistles your distribution has, the more frequently you'll need/want to update the system, which means more frequent issues.


----------



## 111MilesToGo

Stevko said:


> what linux distro/player is best for bitperfect?





delooper said:


> I think any of them should be pretty-much equivalent.  Maybe in some you might have to do a little more work to set things up.  On my server I've been using LUbuntu.
> 
> I think the main concern I'd have setting something up is trying to avoid lots of updates.  So something fairly minimalist. The more bells-and-whistles your distribution has, the more frequently you'll need/want to update the system, which means more frequent issues.


Regarding Linux distros, I agree, it is a matter of your tastes, not of the distro capabilities. I guess all will do well. I suppose you are into listening only, you don‘t need low latency for live music production. Myself, I use openSUSE Tumbleweed and Manjaro, which are rolling releases with frequent updates (as opposed to the previous recommendation). I did find that standard fixed-update distros are lagging behind with software updates, which often hurts the more demanding audio software (like mpd, cf. below).

Regarding music player software and bit perfectness:

The most important point is to bypass pulseaudio in your audio chain. This is most easily accomplished by correct preference settings for your players, i.e. let them do audio output directly to alsa. Discard any player that doesn‘t give you such setting right away. And don‘t even try to remove pulseaudio from your system as you find recommended every once in a while - nonsense which will cause more harm and grief.

If you want a stand-alone player: My recommendation would be DeaDBeeF. Easy right out of the box, set output to be alsa directly to your hardware. If you want it to look different and provide more features, you can tweak and design it a lot.

But the best audio replay system would use mpd (Music Player Daemon) as a player. Lots of true audio goodies at your disposal. Even though the hurdle of creating an appropriate configuration file for mpd might look complicated, it in fact is straightforward. As mpd is a server-type of player, one needs a GUI front-end for it. To me, Cantata is the most appealing one.

Depending on what your background is: You might like to start with DeaDBeeF, then add mpd/Cantata to your system.

In summary, I do in fact think that a Linux system with either of the audio softwares mentioned is a great alternative to Windows, actually better. No driver hassles, great resource efficiency, old machines do exceptionally well. The only things you will miss are streaming services like Qobuz and Tidal, and you might miss Roon and the like if that were your routes.


----------



## Stevko (Jul 28, 2021)

thank you. trying to buy most music in flac.  why rent music forever? using qobuz, deezer etc to discover new music. but all these offer webplayer. Webplayer will work in Linux?
Today I use Musicbee and windows. looks like my Thinkpad x260 don`t will support win 11.
I will not buy a new pc.
So Linux next...


----------



## cycler2

Stevko said:


> thank you. trying to buy most music in flac.  why rent music forever? using qobuz, deezer etc to discover new music. but all these offer webplayer. Webplayer will work in Linux?
> Today I use Musicbee and windows. looks like my Thinkpad x260 don`t will support win 11.
> I will not buy a new pc.
> So Linux next...


I'll add my 2 cents, as a Linux noob.  As others have suggested, use ALSA when you set up your music player, not pulseaudio.  I use Linux Mint and find it very noob friendly.  It's a derivative of Ubuntu, which is probably the most popular distro.  But Mint is very familiar to Windows users, like me.  As for music players/library managers, I use JRiver Media Center (https://www.jriver.com/).  I use it on Windows, so using it on Linux was an easy choice.    Strawberry is another option, which I like (https://www.strawberrymusicplayer.org/).  Both are free to try; a JRiver license is inexpensive and Strawberry asks for donations if memory serves me.  Both music players yield bit perfect music playback if you set it up correctly using ALSA.
I hope you enjoy music playback through Linux.  I'm beginning to think that it yields better sound quality than Windows using the same music player.


----------



## delooper

Yes, as mentioned the key is to set up mpd through ALSA.   Most distributions will be using pulseaudio as their main sound mixer. You need to bypass that, and pump your music out directly via ALSA.  mpd is probably the most popular music server, as it's unobtrusive, flexible and is happy interacting directly with ALSA.  I think all cell phone operating systems have good cheap applications that interact directly with mpd. 

Any linux distribution will let you do this.   Depending on the distribution you choose there will be slightly different issues. 

I run a headless linux server, i.e. the computer has no monitor or keyboard connected to it.  Basically it's a computer with no moving parts, that's tucked away where nobody notices it.  The advantages is it's minimalist.  The downside is it's a bit of work to perform major software updates -- most can be done by wifi, but occasionally you need a monitor and keyboard for direct access.  That's why I prefer distributions with little overhead and infrequent updates.


----------



## Stevko

thanks. will check out strawberry. tried jriver for a 2 years ago. works ok. but i dont need so much futures. like it simply.
not installed linux yet. will try to find a old laptop for testing distros and musicsoftware.


----------



## Stevko (Jul 29, 2021)

Tried strawberry in win10. work great. easy and great. Look like clementine as I tried yesterday.

But wasapi don`t work in windows.
I choose wasapi. But i can hear all windows sound!
maybe it works better in linux


----------



## Stevko

I really don`t need a laptop.
can I use ubuntu on a RPI4 with strawberry and music libarry on o USB stick?


----------



## tjw321

Stevko said:


> I really don`t need a laptop.
> can I use ubuntu on a RPI4 with strawberry and music libarry on o USB stick?


You should be able to but I haven't tried that exact combination. I'm running Ubuntu on a Raspberry Pi, but not playing music on that one (it's a server). I have another one to play music with Raspbian (the default Raspberry Pi linux)  with my music library on an external 1TB SSD.


----------



## Stevko (Jul 29, 2021)

so a RPI with std pi linux and a usb SSD works ok? what player do you use on rpi? strawberry?


----------



## tjw321

Stevko said:


> so a RPI with std pi linux and a usb SSD works ok? what player do you use on rpi? strawberry?


I've used a few and haven't really found one that I am completely happy with. I'm currently using "Quod Libet" but I change quite often.

I haven't tried Strawberry yet, so that may be next...


----------



## disaster8tio

I use DeadBeef 1.8.8 as player with Debian 11. Easy to get DAC handling the sound Hz and bits. Choose ALSA then choose the DAC - Direct hardware device without any conversions. Then remove DSD/P pluggin under "DSP". Restart Deadbeef and it is on. May depend on DAC, i use a Topping D10s. And the Deadbeef layout is constumized to my preference.


----------



## gimmeheadroom (Jan 22, 2022)

I didn't see any post in this thread that proves anybody is getting bit-perfect output. It seems like people think if they get some music app to use a specific device that's all it takes. But that isn't proof of anything.

The only proof I know of bit-perfect is to send an MQA bitstream to an MQA DAC. If your bitstream isn't bit-perfect, it won't play in MQA.

I have not found anything that can play SACD ISOs on Linux. Can anyone recommend a good player comparable to Foobar2000?


----------



## 111MilesToGo (Jan 23, 2022)

gimmeheadroom said:


> I didn't see any post in this thread that proves anybody is getting bit-perfect output. It seems like people think if they get some music app to use a specific device that's all it takes. But that isn't proof of anything.
> 
> The only proof I know of bit-perfect is to send an MQA bitstream to an MQA DAC. If your bitstream isn't bit-perfect, it won't play in MQA.


Or send an HDCD bitstream to an HDCD DAC (if one has such), as is being used by the Computer Audiophile, founder of the Audiophile Style website.



gimmeheadroom said:


> I have not found anything that can play SACD ISOs on Linux. Can anyone recommend a good player comparable to Foobar2000?


AFAIK, the closest you can get is MPD, the Music Player Daemon:
- The official version plays DSD nicely from DSF *.dsf and DSDIFF *.dff track files, but not from SACD-ISOs. What you could do in this regard is extract the separate tracks from your ISO on a Windows computer. This is what I am used to do.
- There is an unofficial fork of MPD which says to play SACD-ISOs. I haven‘t tried it. However,  use of this fork is sort of disrespected; in particular, one should NEVER ask for help with this fork on the official MPD forum.

The closest analogy to foobar2000 is DeaDBeeF, but not 100%. The wealth of foobar2000 plug-ins remains unsurpassed.


----------



## gimmeheadroom

111MilesToGo said:


> Or send an HDCD bitstream to an HDCD DAC (if one has such), as is being used by the Computer Audiophile, founder of the Audiophile Style website.


Interesting, I did not know that HDCD required bit perfect. Of course, very few people in this thread can use that method to test and I haven't seen that anybody did.

Anyway, it's troubling to see 34 pages of unsubstantiated claims in this thread. I think it has been a confusing and unhelpful discussion until now. Many people seem to be taking it on faith that if they go through the motions then they get bitperfect. But we have no reason to believe that. It should be verified. And since nothing but Volumio paid subscription seems to claim MQA support on Linux, I would guess most of the bitperfect claims of various distros and setups are untrue.



111MilesToGo said:


> AFAIK, the closest you can get is MPD, the Music Player Daemon:


I know this is a good one, but to my understanding, the player is not the main issue with bitperfect but rather the many layers of software that gets involved in audio on a general purpose desktop distro.



111MilesToGo said:


> - The official version plays DSD nicely from DSF *.dsf and DSDIFF *.dff track files, but not from SACD-ISOs. What you could do in this regard is extract the separate tracks from your ISO on a Windows computer. This is what I am used to do.


I think this is not a realistic option for many people and it's also not desireable. I have about 400 SACD ISO rips. I don't plan to spend any time breaking them into individual DSDs, and I don't need to. My goal is to play music in the best environment and despite my hatred of Windows, the best music player environment seems to remain foobar with ASIO. And all my gear supports that.



111MilesToGo said:


> - There is an unofficial fork of MPD which says to play SACD-ISOs. I haven‘t tried it. However,  use of this fork is sort of disrespected; in particular, one should NEVER ask for help with this fork on the official MPD forum.


Thanks for the heads up 



111MilesToGo said:


> The closest analogy to foobar2000 is DeaDBeeF, but not 100%. The wealth of foobar2000 plug-ins remains unsurpassed.


I built deadbeef from source a few years ago and didn't like it. At that time it couldn't play DSD and certainly not SACD ISO. I just tried it again last night from a package repo and supposedly it can invoke ffpmeg to play DSD but after taking a quick look I uninstalled it again.

I get it that people prefer Linux to Windows, I'm certainly one of them. And I get it that Linux drivers and USB have been good enough for years already that USB DACs just work with Linux, unlike in the bad old days. But I don't get it that people don't go for the easy, proven solution of Windows and ASIO and factory-supplied ASIO DAC drivers. To me it is the most sensible solution.


----------



## powerhouse64

gimmeheadroom said:


> I didn't see any post in this thread that proves anybody is getting bit-perfect output. It seems like people think if they get some music app to use a specific device that's all it takes. But that isn't proof of anything.
> 
> The only proof I know of bit-perfect is to send an MQA bitstream to an MQA DAC. If your bitstream isn't bit-perfect, it won't play in MQA.
> 
> I have not found anything that can play SACD ISOs on Linux. Can anyone recommend a good player comparable to Foobar2000?



I may not be able to answer the question fully, but there are several ways in Linux to see how your audio is handled. After you installed one of the audio players suggested at the beginning of this thread (plus perhaps Strawberry), you can do some checks to see how audio is handled:

lsof /dev/snd/*

lists the programs that are using sound.

watch -n0.5 'pacmd list-sink-inputs | tee -a sound-inputs.log'

shows / monitors the pulseaudio inputs currently active. Only relevant when you have pulseaudio running on your Linux system. This command can be helpful when playing music via alsa to monitor if any pulseaudio is "interfering". If nothing else is producing sound, it will show
0 sink input(s) available.

I'm running gmusicbrowser as my audio player using the settings described in this thread and - while playing - it will block other sound output. In other words, gmusicplayer is able to take exclusive control of the sound output on the specified device. This goes a long way in ensuring that the audio is not mixed.

Assuming you use ALSA, you can list your output devices like this:

aplay -l

While playing music, check with this command:

cat /proc/asound/card0/pcm0p/sub0/hw_params

Replace the card0. pcm0, sub0 entries with what you found with aplay -l. Here is an example output:
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 440
buffer_size: 8820

The above should give a good indication on the audio output.

In general, Linux should provide more and better tools for bit-perfect audio. The reason I'm saying that is because Linux can be downsized to the essential tasks, and there are real-time Linux distros or options. There are some audiophile distros as well, see for example https://www.thewelltemperedcomputer.com/Linux/Distro.htm.

Hope it helps.


----------



## gimmeheadroom

powerhouse64 said:


> I may not be able to answer the question fully, but there are several ways in Linux to see how your audio is handled. After you installed one of the audio players suggested at the beginning of this thread (plus perhaps Strawberry), you can do some checks to see how audio is handled:
> 
> lsof /dev/snd/*
> 
> ...


This is all good info, but the proof of bit perfect audio is that a DAC can decode MQA (or HDCD as @111MilesToGo suggested above)


----------



## Roseval

I doubt if MQA is a good test for bit perfect.
Here https://audiophilestyle.com/forums/...s-to-16-bits-and-the-blue-light-still-shines/ you have a guy truncating a 24 bit to 16 and the MQA light still works!

If your media player can write to a file or you can record the digital out of your PC, you can do a null test.
Load the original file and the recorded in a editor
Time align
Substract
If you end up with null's only, the two files are identical.


----------



## gimmeheadroom

Roseval said:


> I doubt if MQA is a good test for bit perfect.
> Here https://audiophilestyle.com/forums/...s-to-16-bits-and-the-blue-light-still-shines/ you have a guy truncating a 24 bit to 16 and the MQA light still works!



Thank you, great thread!



Roseval said:


> If your media player can write to a file or you can record the digital out of your PC, you can do a null test.
> Load the original file and the recorded in a editor
> Time align
> Substract
> If you end up with null's only, the two files are identical.


Well yeah, if everything works... I'm not sure it's more than theory at this point.

Anyway, from a practical point of view MQA is the best test of bit perfect we have.


----------



## powerhouse64

gimmeheadroom said:


> This is all good info, but the proof of bit perfect audio is that a DAC can decode MQA (or HDCD as @111MilesToGo suggested above)


My first post offered some tools to narrow down issues with the audio path. If I use both pulse audio and ALSA, I want to make sure my music player uses ALSA and doesn't mix the sound. For me, this is my only concern.

In your post #498 you are asking for proof that Linux offers bit-perfect sound. The question suggests that Linux isn't capable of outputting bit-perfect audio.
While I can't proof or disproof bit-perfect audio under Linux, at least not right now, I suggest to look at what vendors of top end audiophile music players are selling you: essentially Linux boxes.

I didn't do an all inclusive survey, but have a look at aurender, Lumin, Music Fidelity, Naim, and probably more. There are exceptions too: Taiko Audio Extreme runs a Custom Windows 10 Enterprise LTSC OS.

With music server vendors that run Linux, you have to look for the small print to identify them as Linux servers. I guess Linux still carries the stigma of a nerd OS.

I hope you accept this indirect answer. It's not a proof (perhaps someone else can proof it). My other post may help narrow down issues with your Linux audio configuration.


----------



## 111MilesToGo (Jan 25, 2022)

So here is the proof for Linux being bit-perfect through alsa, as far as such proof can be gathered with the proposed method.

Whatever the inner details of MQA workings and handlings might be, I thought the idea of testing Linux / alsa with an MQA file is a good idea. I used an album by 2L (Christian Grøvlen: Bach - Inside Polyphony) that I got as PCM176, DSD64, and MQA352 (the latter means published as MQA 24/44.1 and unfolding to 24/352.8).

I played the various files from hard disk both under Windows with foobar2000 and Linux openSUSE Tumbleweed with MPD/Cantata to my Cayin N6ii, used as USB-DAC. On Windows I utilized the Cayin ASIO driver, while on Linux I set up MPD to play directly to alsa (circumventing pulseaudio and pipewire, whatever). In addition, I streamed this MQA album from Tidal under Windows using both the Tidal app and Roon with Tidal integration.

The N6ii displays what is happening on the USB audio coming in, and what it does on its DAC. On Windows, I checked the Cayin ASIO driver to show the correct sample rate, while on Linux I checked the alsa hardware parameters to show the correct sample rate and expected bit depth.

Guess what: As far as it can be ”proven“ by MQA detection and unfolding happening in the N6ii, EVERYTHING IS BIT-PERCECT.

The results as per the N6ii display do all make sense. This holds for Tidal under Windows, where the Tidal App does the first unfold, as well as for Roon on Windows, where I can set Roon to do the first unfold or leave all unfolding to the N6ii DAC. foobar2000 on Windows and MPD/Cantata on Linux do produce the same results as Roon without first unfold, as is expected in the case of bit-perfect output from the PC USB port.

As has been said, the premise is that MQA detection in the DAC would imply that all audio bits come out of the USB port in unaltered fashion.

Addendum: Unfortunately, I don‘t have a DAC capable of HDCD detection and decoding. In HDCD, the least significant bit of the encoded 16/44.1 audio contains control and data sequences that enable the HDCD decoder to expand up to 20/44.1. If the bits and in particular the least significant one are being tampered with, HDCD control sequences get destroyed - no HDCD anymore.


----------



## gimmeheadroom (Jan 25, 2022)

powerhouse64 said:


> My first post offered some tools to narrow down issues with the audio path. If I use both pulse audio and ALSA, I want to make sure my music player uses ALSA and doesn't mix the sound. For me, this is my only concern.
> 
> In your post #498 you are asking for proof that Linux offers bit-perfect sound. The question suggests that Linux isn't capable of outputting bit-perfect audio.


There is no reason to expect that Linux does offer bit perfect. It was not designed for audio at all, much less bitperfect audio. It's a general purpose OS (kinda). The default setup is certainly not bitperfect and this is why we have 34 pages of thread.



powerhouse64 said:


> While I can't proof or disproof bit-perfect audio under Linux, at least not right now, I suggest to look at what vendors of top end audiophile music players are selling you: essentially Linux boxes.


That has nothing to do with anything. The streamers are not a desktop Linux distro and they don't have the USB issue. They're embedded Linux with a real-timer kernel and the DAC on board. They can also not use ALSA, pulse, jack, or anything else they need. It's a custom setup, which is mostly what Linux is good for, after all...



111MilesToGo said:


> Whatever the inner details of MQA workings and handlings might be, I thought the idea of testing Linux / alsa with an MQA file is a good idea.


I said above that MQA is the only test I'm aware of for bitperfect audio generally, yes.



111MilesToGo said:


> I used an album by 2L (Christian Grøvlen: Bach - Inside Polyphony) that I got as PCM176, DSD64, and MQA352 (the latter means published as MQA 24/44.1 and unfolding to 24/352.8).
> 
> I played the various files from hard disk both under Windows with foobar2000 and Linux openSUSE Tumbleweed with MPD/Cantata to my Cayin N6ii, used as USB-DAC. On Windows I utilized the Cayin ASIO driver, while on Linux I set up MPD to play directly to alsa (circumventing pulseaudio and pipewire, whatever). In addition, I streamed this MQA album from Tidal under Windows using both the Tidal app and Roon with Tidal integration.
> 
> The N6ii displays what is happening on the USB audio coming in, and what it does on its DAC. On Windows, I checked the Cayin ASIO driver to show the correct sample rate, while on Linux I checked the alsa hardware parameters to show the correct sample rate and expected bit depth.


Correct sample rate and bit depth are not proof of bit perfect. Of course that's necessary, but it's not enough.



111MilesToGo said:


> Guess what: As far as it can be ”proven“ by MQA detection and unfolding happening in the N6ii, EVERYTHING IS BIT-PERCECT.
> 
> The results as per the N6ii display do all make sense. This holds for Tidal under Windows, where the Tidal App does the first unfold, as well as for Roon on Windows, where I can set Roon to do the first unfold or leave all unfolding to the N6ii DAC. foobar2000 on Windows and MPD/Cantata on Linux do produce the same results as Roon without first unfold, as is expected in the case of bit-perfect output from the PC USB port.


I don't understand what you are trying to say. Does your Cayin have indication of MQA, and did you get it to work via Linux? You have said a lot about Windows and Roon and Foobar, but I don't see a clear description of the Linux experiment.



111MilesToGo said:


> As has been said, the premise is that MQA detection in the DAC would imply that all audio bits come out of the USB port in unaltered fashion.


I agree with that. If that's what you verified, this is definitely good info. 

I'll do a similar test on my Brooklyn DAC+ but I don't have a good way to connect it from my Linux server right now.


----------



## 111MilesToGo (Jan 25, 2022)

Here‘s a photograph of my experiment with Linux: Cantata controlling MPD, playing an MQA track. The conky monitor shows MPD data as well as alsa hardware parameters in its lower two paragraphs. Up front is the Cayin N6ii, showing MQA Studio detection and unfolding.


----------



## gimmeheadroom

111MilesToGo said:


> Here‘s a photograph of my experiment with Linux: Cantata controlling MPD, playing an MQA track. The conky monitor shows MPD data as well as alsa hardware parameters in its lower two paragraphs. Up front is the Cayin N6ii, showing MQA Studio detection and unfolding.


Thanks, this is great info. I can't study it all at the moment but you answered my question.

Can you please describe the mpd setup? I'll try to recreate your test over my Brooklyn DAC+ via optical.


----------



## tjw321

FWIW, I've lit up the MQA light on my Meridian Explorer2 DAC from my Raspberry Pi running Linux as well. I'm not using it ATM so I can't recall the exact set up but I do remember that the key was, as @powerhouse64 stated, to go to the correct ALSA device direct. IIRC I had about 4 to choose from with names which didn't directly relate to the DAC so I just went through them in turn until I lit up the MQA light.


----------



## 111MilesToGo (Jan 25, 2022)

gimmeheadroom said:


> Thanks, this is great info. I can't study it all at the moment but you answered my question.
> 
> Can you please describe the mpd setup? I'll try to recreate your test over my Brooklyn DAC+ via optical.


Of course, this is my mpd setup in mpd.conf:

```
############################################################################
### begin of mpd configuration file
### created by `mpd-configure' (version 0.9.5) on 2018-02-21T11:17:54+01:00.
### see: Ronald van Engelen, https://github.com/ronalde/mpd-configure/
############################################################################
### This is the mpd configuration in a per-user setup.
### Local configuration stored in ~/.config/mpd (all files)
###
### Autostart of mpd with systemd, running the user unit (NO sudo priv's!):
### systemctl enable --user mpd.service
###
### Devices: Chord Hugo 2, miniDSP USB Streamer B,
### Cayin N6ii, Cayin RU6, AudioQuest DragonFly Red, Internal Sound Cards
##
### Hugo 2 DSD only via DoP, Linux quirks.c w/o native DSD patch for Chord.
### Dito Cayin N6ii and RU6
###
### Cayin RU6 PCM enforced to be 24-bit, since bit depth changes
### from track to track are hit-or-miss. Requires specifying DSD, too
###
### Resampling is applied by mpd only to DragonFly,
### but doesn't adhere to the 44.1/48k ladders yet (feature request to mpd)
###
############################################################################

## start processing `01_output-audio-alsa.conf'

#### Chord Hugo 2
audio_output {
    type                "alsa"
    name                "Chord Hugo2 - USB Audio"
##    device              "hw:2,0"
    device              "hw:CARD=Hugo2,DEV=0"
    auto_resample       "no"
    auto_format         "no"
    auto_channels       "no"
    dop                 "yes"
    replay_gain_handler "none"
    mixer_type          "none"
}
#### end of Chord Hugo 2

#### miniDSP USB Streamer B (optical input to Hugo 2)
audio_output {
    type                "alsa"
    name                "miniDSP USB-to-Optical - USB Audio"
##    device              "hw:2,0"
    device              "hw:CARD=USBStreamer,DEV=0"
    auto_resample       "no"
    auto_format         "no"
    auto_channels       "no"
    dop                 "yes"
    replay_gain_handler "none"
    mixer_type          "none"
}
#### end of miniDSP USB Streamer B

#### Cayin N6ii
audio_output {
    type                "alsa"
    name                "Cayin N6ii - USB Audio"
##    device              "hw:2,0"
    device              "hw:CARD=MK2,DEV=0"
    auto_resample       "no"
    auto_format         "no"
    auto_channels       "no"
    dop                 "yes"
    replay_gain_handler "none"
    mixer_type          "none"
}
#### end of Cayin N6ii

#### Cayin RU6
audio_output {
    type                "alsa"
    name                "Cayin RU6 - USB Audio"
##    device              "hw:2,0"
    device              "hw:CARD=RU6,DEV=0"
    auto_resample       "no"
    auto_format         "no"
    auto_channels       "no"
##    format              "*:24:*"
    allowed_formats     "*:24:* dsd64:*=dop dsd128:*=dop"
    dop                 "yes"
    replay_gain_handler "none"
    mixer_type          "none"
}
#### end of Cayin RU6

#### AudioQuest DragonFly Red
audio_output {
    type                "alsa"
    name                "AudioQuest Dragonfly Red - USB Audio"
##    device              "hw:2,0"
    device              "hw:CARD=v10,DEV=0"
    auto_resample       "no"
    auto_format         "no"
    auto_channels       "no"
    dop                 "no"
    replay_gain_handler "none"
    mixer_type          "none"
}
#### end of AudioQuest DragonFly Red

#### Internal Sound Card - HP 8570w
audio_output {
    type                "alsa"
    name                "Internal Sound Card - HP 8570w"
##    device              "hw:0,0"
    device              "hw:CARD=PCH,DEV=0"
    auto_resample       "no"
    auto_format         "no"
    auto_channels       "no"
    dop                 "no"
    replay_gain_handler "none"
    mixer_type          "none"
}
#### end of Internal Sound Card - HP 8570w

#### general settings for all output devices
resampler {
    plugin              "libsamplerate"
    type                "0"
}
replaygain                  "off"

## done processing

## start additional settings

#### input plugins
input {
    plugin              "qobuz"
    enabled             "no"
}
input {
    plugin              "tidal"
    enabled             "no"
}

## done additional

## start processing `02_paths.conf'
music_directory        "~/AVs/I/Music"
db_file                "~/.config/mpd/database"
log_file               "~/.config/mpd/mpd.log"
playlist_directory     "~/.config/mpd/playlists"
pid_file               "~/.config/mpd/pid"
state_file             "~/.config/mpd/state"
sticker_file           "~/.config/mpd/sticker.sql"
save_absolute_paths_in_playlists  "no"
## done processing

## start processing `03_general.conf'
filesystem_charset     "UTF-8"
## id3v1_encoding         "UTF-8"
log_level              "default"
## log_level              "verbose"
auto_update            "yes"
auto_update_depth      "4096"
## done processing

## start processing `04_client-limits.conf'
connection_timeout     "60"
max_connections        "10"
max_playlist_length    "16384"
max_command_list_size  "2048"
max_output_buffer_size "8192"
## done processing

## start processing `05_network.conf'
bind_to_address        "0.0.0.0"
## done processing

## start processing `06_zeroconf.conf'
zeroconf_enabled       "yes"
## done processing

############################################################################
### end of mpd configuration file
############################################################################
```
As mentioned at the beginning, I had built my mpd config originally by running a script by Ronald van Engelen. His - defunct - website taught me how to get up and running with audio under Linux. Remnants of his website can be found on github, and the old lacocina.nl site can be accessed via the wayback machine.

mpd is set up in a per-user configuration, cf. the respective comment.

I have a number of DACs, as specified in the above file. The Hugo 2 can be fed via USB directly from my computer, which is specified in the "Hugo 2" section. It can also be fed via optical, for which I use a little USB-to-optical converter by miniDSP between computer and Hugo 2.

I hope that helps.

I am using two Linux operating systems, openSUSE Tumbleweed and Manjaro. The mpd/Cantata system with the a.m. configuration works extremely reliably on both. Cantata's setup is no wizardry at all, as Cantata just controls mpd; setting up Cantata is a matter of personal preferences regarding the library display a.o. When listening, Cantata allows to easily switch between the various (alsa) output devices. There is a big advantage as compared to foobar2000: An mpd/Cantata playlist can arbitrarily mix PCM and DSD tracks, since mpd.conf specifies in one place how these types shall be handled. In foobar2000. switching to PCM to DSD unfortunately is a two-step manual process.


----------



## gimmeheadroom

111MilesToGo said:


> ############################################################################
> ### end of mpd configuration file
> ############################################################################


Thanks a lot, I have been too lazy to set up mpd on my FreeBSD box but I really should.  Thanks for the links and info!



111MilesToGo said:


> An mpd/Cantata playlist can arbitrarily mix PCM and DSD tracks, since mpd.conf specifies in one place how these types shall be handled. In foobar2000. switching to PCM to DSD unfortunately is a two-step manual process.


This is an interesting comment. I don't use playlists but I don't understand why foobar can't play any time of audio in a playlist. I set the ASIO DSD driver and all formats including PCM plays fine. Is there something else? Or maybe foobar's playlist support is broken somehow?


----------



## 111MilesToGo (Jan 25, 2022)

gimmeheadroom said:


> Thanks a lot, I have been too lazy to set up mpd on my FreeBSD box but I really should.  Thanks for the links and info!
> 
> 
> This is an interesting comment. I don't use playlists but I don't understand why foobar can't play any time of audio in a playlist. I set the ASIO DSD driver and all formats including PCM plays fine. Is there something else? Or maybe foobar's playlist support is broken somehow?


Off-topic, but nevertheless. Regarding foobar2000 under Windows: To me, the output selection is not as straightforward as it should be. Maybe that's me only. Let's say I have a couple of PCM albums and some DSD albums in my playlist (which actually is the dafault list = standard window), and let's say they appear in an arbitrary order, i.e. foobar2000 has to switch between PCM/DSD types.

What I have to do is: When playing PCM, I select one of my ASIO drivers, as required by the device in use, e.g. the Hugo 2 or the Cayin N6ii or the RU6. That is a one-click process, as the Output Preference is in the selction box at the top. However, before going to play a DSD track as native DSD, I have to select the "DSD Transcoder (DoP/Native)" as the output device, and I have to select the actual ASIO driver as the targeted output of this transcoder. The latter is a multiple-click process, kind of a nuisance - Preferences -> Playback -> Output -> ASIO. The reason behind that is that the famous SACD plugin provides DoP audio data only, and the "DSD Transcoder (DoP/Native)" has to be used as the output in order to recover the native DSD stream from the DoP stream, which by the way of course is bit perfect since DoP is a fake-PCM wrapper around the native DSD.

The attached screenshots show these: (1) PCM playback; (2) switching the outputs for DSD; (3) DSD playback.

Remark: My foobar2000 setup is built along the directions given on the "diyaudioheaven" website, where Part 1 has the basics and Part 2 teaches DSD replay. Maybe things could be done in an easier fashion.

But I guess off-topic should end here ...


----------



## 111MilesToGo (Jan 25, 2022)

gimmeheadroom said:


> Thanks a lot, I have been too lazy to set up mpd on my FreeBSD box but I really should.  Thanks for the links and info!


You are very welcome. Please feel free to ask here or in a PM in case I could be of further help.

EDIT: There are a number of GUI controllers for mpd. Cantata just did and still does fit my personal preferences best, even though it is out of active development afaik.


----------



## gimmeheadroom

111MilesToGo said:


> Off-topic, but nevertheless. Regarding foobar2000 under Windows: To me, the output selection is not as straightforward as it should be. Maybe that's me only. Let's say I have a couple of PCM albums and some DSD albums in my playlist (which actually is the dafault list = standard window), and let's say they appear in an arbitrary order, i.e. foobar2000 has to switch between PCM/DSD types.
> 
> What I have to do is: When playing PCM, I select one of my ASIO drivers, as required by the device in use, e.g. the Hugo 2 or the Cayin N6ii or the RU6. That is a one-click process, as the Output Preference is in the selction box at the top. However, before going to play a DSD track as native DSD, I have to select the "DSD Transcoder (DoP/Native)" as the output device, and I have to select the actual ASIO driver as the targeted output of this transcoder. The latter is a multiple-click process, kind of a nuisance - Preferences -> Playback -> Output -> ASIO. The reason behind that is that the famous SACD plugin provides DoP audio data only, and the "DSD Transcoder (DoP/Native)" has to be used as the output in order to recover the native DSD stream from the DoP stream, which by the way of course is bit perfect since DoP is a fake-PCM wrapper around the native DSD.


Some of my DACs support DoP even at high rates (256) others only until 128. Only this week I started using the transcoder proxy so I can't remember if I had any issues to play PCM with it enabled. I'll check later.

And, I don't use playlists. But it seems to me I can play any kind of file without changing anything. I agree, if you want to select a specific device it's annoying but I guess not more than other players. And I didn't see any good SACD ISO player for Linux at all.

Anyway, I solved the device selection problem to some extent by using a DDC as the main output and not changing it. From there I can go to various devices: reclocker, DACs, format converter/switch to digital recorders etc.



111MilesToGo said:


> The attached screenshots show these: (1) PCM playback; (2) switching the outputs for DSD; (3) DSD playback.


I think you can playback PCM without changing anything in the DSD setup, can't you?



111MilesToGo said:


> Remark: My foobar2000 setup is built along the directions given on the "diyaudioheaven" website, where Part 1 has the basics and Part 2 teaches DSD replay. Maybe things could be done in an easier fashion.
> 
> But I guess off-topic should end here ...


We can talk about it here https://www.head-fi.org/threads/the...ad-got-problems-or-questions-ask-here.624628/


----------



## BaTou069

gimmeheadroom said:


> MQA is the only test I'm aware of for bitperfect audio


Hey, isn't it you that chimed into my thread about converting flacs on linux and told me how linux was not built for sound, has way more layers of crap in the chain and whatnot?
1. Why do you think bitperfect is the holy grail? 2) Why do you think that MQA is a viable test for bitperfect? 3) Why do you even think that MQA is bitperfect? 
I recommend you check out this post about MQA and think again.

The advantage of Linux VS Mac/Win is that you can directly communicate with ANY hardware. No need for drivers. Of course Linux was never built for audio, you're right, exactly like mac or windows weren't build for audio as well. I don't know how old you are but I can still remember the sound of the early computers end 80s early 90s: AdLib, Creative Labs Sound Blaster (8bit/44.1), Roland LAPC-I... Sound was always an afterthought so who cares if Linux wasn't built for audio playback? Even if there are 10 processes/layers the sounds has to go through, it doesn't matter. The 1s and 0s will arrive at the DAC and you won't hear a difference


----------



## 111MilesToGo

BaTou069 said:


> 1. Why do you think bitperfect is the holy grail? 2) Why do you think that MQA is a viable test for bitperfect? 3) Why do you even think that MQA is bitperfect?


I‘ll try to provide answers.

1. The capability to provide a bit-perfect reproduction of a digitized recording is a basic requirement. Bit errors shouldn‘t be tolerated. Of course, any (digital) sound processing like EQ’ing results in (bit-wise) deviations from the original - on purpose.

2. The jury still is out on whether using an MQA track is a viable test for bit-perfect reproduction. That is due to the fact that MQA is proprietary, we don’t know precisely what it does. In fact, HDCD would definitely provide a viable test, since control and data sequences are encoded in the least significant bit - tampering with the bits kills HDCD.

3. No, the term bit-perfect does not refer to MQA itself. Bit-perfect refers to output versus input in any digital audio reproduction system - a must as explained above. What you mean is ”lossy“. Yes, MQA is a lossy way of encoding higher sample rates and bit depths (not sure about the latter) into 24/44.1 or 24/48.

Hope to have clarified matters a bit.


----------



## tjw321

BaTou069 said:


> ... 2) Why do you think that MQA is a viable test for bitperfect? ...





111MilesToGo said:


> ...
> 3. No, the term bit-perfect does not refer to MQA itself. Bit-perfect refers to output versus input in any digital audio reproduction system - a must as explained above. What you mean is ”lossy“. Yes, MQA is a lossy way of encoding higher sample rates and bit depths (not sure about the latter) into 24/44.1 or 24/48.
> ...


Ironically, it's the lossy bit (sort of) of MQA that makes it work as a test for bit-perfect. The bits that MQA messes with effectively contain a watermark which identifies the bits as MQA encoded bits (that's the "authentication", which is the A of MQA). If you do anything to that watermark, the MQA light on your DAC goes out.


----------



## 111MilesToGo (Jan 26, 2022)

tjw321 said:


> Ironically, it's the lossy bit (sort of) of MQA that makes it work as a test for bit-perfect. The bits that MQA messes with effectively contain a watermark which identifies the bits as MQA encoded bits (that's the "authentication", which is the A of MQA). If you do anything to that watermark, the MQA light on your DAC goes out.


Yeah, similar to HDCD, which operates from the least significant bit, putting control codes and data therein. These give the prescription how to recalculate the other bits of the 16/44.1 data stream during (actually before) digital-to-analog conversion in order to get the original 20/44.1 audio stream back. Tampering with the least significant bit kills HDCD, i.e. the HDCD light on the DAC goes out. Actually, I figure the least significant bit in HDCD is sacrificed during the process; audio that was there originally isn‘t recoverable.


----------



## BaTou069

111MilesToGo said:


> I‘ll try to provide answers.
> 
> 1. The capability to provide a bit-perfect reproduction of a digitized recording is a basic requirement. Bit errors shouldn‘t be tolerated. Of course, any (digital) sound processing like EQ’ing results in (bit-wise) deviations from the original - on purpose.
> 
> ...


1. Can you define biterrors? Are those a real concern happening?
2. As you wrote, MQA is proprietary, nobody knows what it does, so how can this please become THE VIABLE TEST for bit-perfect audio reproduction? You understand how this makes no sense?




tjw321 said:


> Ironically, it's the lossy bit (sort of) of MQA that makes it work as a test for bit-perfect. The bits that MQA messes with effectively contain a watermark which identifies the bits as MQA encoded bits (that's the "authentication", which is the A of MQA). If you do anything to that watermark, the MQA light on your DAC goes out.


Its nothing special to take a signal of lets say 24/96, to downsample it to 14bit/20khz, and then to upsample it back to 24/96. Yes, your DAC will shows 24/96, but is that bitperfect? I think this whole MQA discussion makes no sense, just check out goldenears headfi thread, youtube video, you name it. Many people showed how you can play non MQA files and still get that soothing light - MQA if anything degrades the sound and certainly is by no means a reference for bitperfect playback OMG




111MilesToGo said:


> Yeah, similar to HDCD, which operates from the least significant bit, putting control codes and data therein. These give the prescription how to recalculate the other bits of the 16/44.1 data stream during (actually before) digital-to-analog conversion in order to get the original 20/44.1 audio stream back. Tampering with the least significant bit kills HDCD, i.e. the HDCD light on the DAC goes out. Actually, I figure the least significant bit in HDCD is sacrificed during the process; audio that was there originally isn‘t recoverable.


ive never heard if hdcd before but a hydrogen audio wiki post says its a scam



My main points were about these claims:


gimmeheadroom said:


> There is no reason to expect that Linux does offer bit perfect. It was not designed for audio at all, much less bitperfect audio. It's a general purpose OS (kinda). The default setup is certainly not bitperfect and this is why we have 34 pages of thread.


Like this is somehow different with mac or win, it wasnt designed for audio, much less for bitperfect, its a general purpose OS and the default setup is certainly not bitperfect. All true for mac and windows... with the only difference that with linux you directly communicate with hardware, IO, Kernel. Not sure why using a driver from a manufacturer due to windows incompatibility to just exchange bits with hardware is better in your eyes


gimmeheadroom said:


> I didn't see any post in this thread that proves anybody is getting bit-perfect output. It seems like people think if they get some music app to use a specific device that's all it takes.
> 
> The only proof I know of bit-perfect is to send an MQA bitstream to an MQA DAC. If your bitstream isn't bit-perfect, it won't play in MQA.


1. What would be a proof of bit perfect audio? dont even start with mqa
2. again, false. MQA is not bitperfect. Im amazed how someone with so many unix based computers in his home, someone who breathes and lives open source, can say that some stupid blue light that some company charges for with proprietary technology without any transparence into what they actually do & if its legit at all, making all those crazy claims and charging royalties from anyone from hardware manufacturers to streaming companies to US (mfr pays more > equipment more expensive)

WE, People who love music, sound, equipment, open source and the ability to tinker around and to optimize it, WE and all of headfi, Audiosciencereview, superaudiofriends, hydrogeneaudio, diyaudio and more, all of those should stand up and rise against such insanity. We are creating the demand for this BS and we have the power to stop it. Enough artists that pulled music from tidal or manufacturers that voiced their opinions but only implement MQA because of US, because the demand is there and audio device manufacturers after all are companies with the goal to provide value and revenue.


----------



## tjw321

BaTou069 said:


> 1. Can you define biterrors? Are those a real concern happening?
> 2. As you wrote, MQA is proprietary, nobody knows what it does, so how can this please become THE VIABLE TEST for bit-perfect audio reproduction? You understand how this makes no sense?
> 
> 
> ...


I think you are missing the point. Nobody has said that MQA is good, nobody has said that MQA is bitperfect, nobody has offered any support or desire for MQA. We are simply taking advantage of the fact that it is very hard to persuade an MQA DAC to indicate that a stream is MQA unless the stream contains the bits that it started with at the time the fie was created - i.e. that the stream is bitperfect. In my case I don't use tidal or MQA. That doesn't mean that I can't take advantage of it to do a simple test.


----------



## gimmeheadroom

tjw321 said:


> I think you are missing the point. Nobody has said that MQA is good, nobody has said that MQA is bitperfect, nobody has offered any support or desire for MQA. We are simply taking advantage of the fact that it is very hard to persuade an MQA DAC to indicate that a stream is MQA unless the stream contains the bits that it started with at the time the fie was created - i.e. that the stream is bitperfect. In my case I don't use tidal or MQA. That doesn't mean that I can't take advantage of it to do a simple test.


Well I think MQA sounds good, but true enough, that doesn't mean it _is _good


----------



## BaTou069

tjw321 said:


> I think you are missing the point. Nobody has said that MQA is good, nobody has said that MQA is bitperfect, nobody has offered any support or desire for MQA. We are simply taking advantage of the fact that it is very hard to persuade an MQA DAC to indicate that a stream is MQA unless the stream contains the bits that it started with at the time the fie was created - i.e. that the stream is bitperfect. In my case I don't use tidal or MQA. That doesn't mean that I can't take advantage of it to do a simple test.


I honestly don't think that i missed a point, it's very easy to persuade a MQA DAC to indicate a stream is MQA.
How will the DAC know what was in the file at the time it was created? Did MQA upload a database of all MQA encoded files into those DACs?

I'm intrigued about your simple test please tell me more 


So nobody has said that MQA is bit perfect?


gimmeheadroom said:


> This is all good info, but the proof of bit perfect audio is that a DAC can decode MQA





gimmeheadroom said:


> Anyway, from a practical point of view MQA is the best test of bit perfect we have.


If MQA isn't bit perfect, how is it then the best test for bit perfect we have? Easy, it's neither bit perfect nor the best test for bit perfect.

You know what is?

Looking into hw_params (check first your dacs name)

```
/proc/asound/card1/pcm0p/sub0/hw_params
```

format: S24_3LE indicates 24-bit, rate is sampling rate (sent to DAC)
The stream0 file shows the supported sample rates of your DAC

Then if your DAC supports showing what it plays, check there again. Voila.


This thread clearly is about *playing bit perfect on linux*. *Its not about MQA. *
Telling Linux users, people who clearly value open source, that some blue LED light provided by some secretive organization that charges royalties for a proprietary technology that nobody can even validate works or how it work, nobody really knows why or when its turned on, besides what marketing tells you... telling those users that this blue LED should be a proof for anything besides that the DAC gets current is crazy.




Roseval said:


> I doubt if MQA is a good test for bit perfect.
> Here https://audiophilestyle.com/forums/...s-to-16-bits-and-the-blue-light-still-shines/ you have a guy truncating a 24 bit to 16 and the MQA light still works!


----------



## BaTou069

gimmeheadroom said:


> Well I think MQA sounds good, but true enough, that doesn't mean it _is _good


You're right, people love tube sound that has many distortions, people me including like the Cayin RU6 R2R dac even tho it measures worse than 20y old equipment, and then there is equipment that measures excellently but many people don't like the sound.

To me it's not about being objective VS subjective, it's more about a middle ground. I do expect from gear like DACs for example to measure well with 16/44.1 & I don't really care for improvements beyond the audible threshold. 

Is a measurable difference an audible difference? Will you not enjoy your DSD files because playback is PCM? Will you suffer using PulseAudio?

I don't think so


----------



## tjw321

BaTou069 said:


> I honestly don't think that i missed a point, it's very easy to persuade a MQA DAC to indicate a stream is MQA.
> How will the DAC know what was in the file at the time it was created? Did MQA upload a database of all MQA encoded files into those DACs?
> 
> I'm intrigued about your simple test please tell me more
> ...


"This is all good info, but the proof of bit perfect audio is that a DAC can decode MQA" does not say that MQA is bit perfect, just that it can be used as proof that the MQA bits haven't been altered (but...). I read that thread and it is correct to say that it isn't actually proof - however it is still hard to get that light to illuminate without bit-perfection, or a perl script, or a specific type of truncation,  so it's still a valid test (but not proof).
The DAC doesn't need a database of MQA encoded files - it uses something like a checksum, similarly to how packets on a network are verified without knowing what the contents are in advance. (So again not proof, but reasonably unlikely to be incorrect)
It is the best test in some senses (easy to do, easy to get a result) - but again, I agree it is not proof that you are bit perfect - but you can probably trust a negative result (e.g. no light, not bit-perfect, light possibly bit-perfect).
So it is a useful test, but not proof.
But I'm happy to accept that any statements about MQA should be treated with a healthy degree of scepticism and that this "proof" of bit-perfection in Linux isn't really necessary. But if it's possible to do (it is), and it helps someone feel more comfortable using Linux for audio....why not?
(and that is it from me... I don't actually disagree with you, other than I do think that there is some merit in this test - whether there is merit in MQA itself or not I leave up to individuals to decide for themselves)


----------



## 111MilesToGo

@gimmeheadroom and @tjw321 for sure are correct. An idea was presented of how to test bit-perfect audio reproduction by a computer, from the data coming in (be it a file on disk or a stream from the web or anything) to the output (be it USB or optical or anything else). An idea how to test the entire chain inside the computer, including the operating system (mind you, any OS, be that the big corporation stuff or free and open-source Linux), its audio stack (no matter how complicated or what it was developed for), and all apps used to process and control audio reproduction by the computer. That idea was simply based on two principles: Number 1, take certain audio data that contain special artificial bit sequences and check whether these special bits happen to arrive unaltered in a piece of hardware after the computer, i.e. the DAC. Such audio data were suggested to be MQA or HDCD. Number 2, an easy test was suggested, a test that would not require recording the digital out from the computer and compare it to the input file. Such test is a simple one, check whether those artificial bit sequences happen to light some light on the DAC, it can be done on the fly by everybody who happens to own a DAC with such a light (be it an MQA or HDCD capable DAC). Nothing more, and nothing less.

And it just happened that I was the - lucky or unlucky, whatever - person to perform this test here, since I happened to have an original MQA album (actually purchased it) and a DAC (actually DAP acting as USB-DAC) capable of MQA. It just happens that I have tons of Grateful Dead and other artists‘ albums which are HDCD albums, but unfortunately I don‘t have an HDCD-capable DAC (e.g. Berkeley Alpha boxes).

Nothing was ever implied about those audio data being used, nothing about audio quality, nothing about them being a technical advancement over original Redbook standards or just a scam, nothing about being a good effort to bring music into mankind‘s life or a cleverly designed scheme to just make money. Nothing was ever implied about the entire stack of computer software and hardware involved.

So, I‘m done with discussing all those side aspects, thoughts and feelings beyond the mere core of the test proposed and performed. Saying nothing about agreeing or disagreeing with anything mentioned beyond the core of the test. I‘m out.


----------



## BaTou069

111MilesToGo said:


> @gimmeheadroom and @tjw321 for sure are correct. An idea was presented of how to ...





111MilesToGo said:


> ...audio data that contain special artificial bit sequences and check whether these special bits happen to arrive unaltered....





111MilesToGo said:


> Such test is a simple one, check whether those artificial bit sequences happen to light some light on the DAC


Look, I understood the idea and didn't agree that its a valid one. Playing a file that has "some artificial sequence" in it, and that only some light that comes out of some black box would confirm that it wasn't altered, that is not a test that it works, it's just something you or people believe in. And as it is with believers, you can't convince them of the opposite even if its in front of their eyes.

In the real world (or in physics/math, thats what i know at least) if you want to proof something, there is logic involved, the rules and the process are clear, all parts are known, there is a globaly accepted language. Once a theory was disproved with an experiment, the theory isn't valid anymore, no matter how much you liked the theory and wanted it to be real. MQA was proven not to be bit perfect and to degrade the sound, which of course doesn't mean that you can't enjoy listening to it.


Now back to Linux
From reading about roon on linux I discovered those two things that make linux support native dsd:

https://github.com/lintweaker/xmos-native-dsd
https://github.com/lintweaker/mpd-dsd-018

both haven't been updated for quite some time even years, but maybe still interesting for someone here

cheers


----------



## 111MilesToGo

Although I didn't want to take part in this discussion anymore and still stick to this refusal, I feel I should complete what has been said and provide links to contributions by "The Computer Audiophile" on his "Audiophile Style" forum website. Please regard this as an addendum to the original suggestion here by @gimmeheadroom to use MQA tracks for testing the bit-perfectness of audio transmission in any audio track > computer > DAC system. When I had read his suggestion a few days ago, I was reminded of what "The Computer Audiophile" had done recently. He used HDCD tracks for the exact same purpose (testing for bit-perfect throughput) in the exact same way (lighting a hardware light based on special artificial bit sequences). The only difference to the MQA test is that HDCD-capable DACs are really rare today. These are the links to his papers:
https://audiophilestyle.com/ca/bits-and-bytes/apple-musics-lossless-and-hi-res-mess-r1022/
https://audiophilestyle.com/ca/bits-and-bytes/apple-music-lossless-mess-part-2-airplay-r1026/
Enjoy!
Please also note - with a little smile on your face - that "The Computer Audiophile" uses such testing for bit-perfect throughput for his ultimate goal of "attacking" the company that currently has the highest market capitalization in the world ... and tries to conquer markets galore ...


----------



## BaTou069

111MilesToGo said:


> Although I didn't want to take part in this discussion anymore and still stick to this refusal, I feel I should complete what has been said and provide links to contributions by "The Computer Audiophile" on his "Audiophile Style" forum website. Please regard this as an addendum to the original suggestion here by @gimmeheadroom to use MQA tracks for testing the bit-perfectness of audio transmission in any audio track > computer > DAC system. When I had read his suggestion a few days ago, I was reminded of what "The Computer Audiophile" had done recently. He used HDCD tracks for the exact same purpose (testing for bit-perfect throughput) in the exact same way (lighting a hardware light based on special artificial bit sequences). The only difference to the MQA test is that HDCD-capable DACs are really rare today. These are the links to his papers:
> https://audiophilestyle.com/ca/bits-and-bytes/apple-musics-lossless-and-hi-res-mess-r1022/
> https://audiophilestyle.com/ca/bits-and-bytes/apple-music-lossless-mess-part-2-airplay-r1026/
> Enjoy!
> Please also note - with a little smile on your face - that "The Computer Audiophile" uses such testing for bit-perfect throughput for his ultimate goal of "attacking" the company that currently has the highest market capitalization in the world ... and tries to conquer markets galore ...


I really like that site thanks for the links certainly interesting reads


----------



## tjw321

BaTou069 said:


> ...
> In the real world (or in physics/math, thats what i know at least) if you want to proof something, there is logic involved, the rules and the process are clear, all parts are known, there is a globaly accepted language. Once a theory was disproved with an experiment, the theory isn't valid anymore, no matter how much you liked the theory and wanted it to be real. MQA was proven not to be bit perfect and to degrade the sound, which of course doesn't mean that you can't enjoy listening to it.
> ...


I also said that I wasn't going to engage any more but I should just say that I am a mathematician...


----------



## 111MilesToGo

tjw321 said:


> I also said that I wasn't going to engage any more but I should just say that I am a mathematician...


Makes me smile, as that could precisely be my sentence, too - just replace ”mathematician“ by ”physicist“ (long time ago).


----------



## BaTou069

tjw321 said:


> I also said that I wasn't going to engage any more but I should just say that I am a mathematician...





111MilesToGo said:


> Makes me smile, as that could precisely be my sentence, too - just replace ”mathematician“ by ”physicist“ (long time ago).


So we all have a science background and know, so let’s not forget 
Physics here


----------



## D3adc0de

gimmeheadroom said:


> I didn't see any post in this thread that proves anybody is getting bit-perfect output. It seems like people think if they get some music app to use a specific device that's all it takes. But that isn't proof of anything.
> 
> The only proof I know of bit-perfect is to send an MQA bitstream to an MQA DAC. If your bitstream isn't bit-perfect, it won't play in MQA.
> 
> I have not found anything that can play SACD ISOs on Linux. Can anyone recommend a good player comparable to Foobar2000?


You've been shown multiple times how to see the stream being sent to your DAC but you've chose to ignore them. If you follow Disaster8tio post you'll get bit-perfect audio in seconds, it's not that complicated. MPD-SACD (you can find it in the AUR) plays SACD and DVD iso's and it's easy to use. 

You asked in a post why this thread has some pages. The answer is, there's multiple ways of doing everything on Linux and that's the strength of the platform. It's up to you as the user to build the OS that works best for you.


----------

