Originally Posted by 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]).
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:
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,
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) Edit 08/15/12: It seems that Guayadeque 0.3.5 now has issues with using ALSA output via either of the 2 above suggested entries. You can read further, if interested in this player, at this link: http://guayadeque.org/forums/index.php?p=/discussion/576/correct-switching-between-16bit-and-24bit-usb-audio-playback
Now, in each case you will note that hardware device for your 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 remove or disable all sound cards but one. Onboard (motherboard) sound cards 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:
this command will yield a result like:
louis@Gort:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC889 Analog [ALC889 Analog]
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC889 Digital [ALC889 Digital]
Subdevice #0: subdevice #0
This shows that my primary audio card is "hw:0,1" for digital S/PDIF output.
When using exclusive ALSA mode, Gmusicbrowser, Guayadeque and DeaDBeeF has one significant advantage over other players. When you stop playback, 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.
Edited by Rizlaw - 8/15/12 at 4:12pm