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)
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:
for a single sound card setup, this command (aplay -l) will display a result like:
**** 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
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.
Edited by Rizlaw - 12/13/15 at 6:45am