Bit-perfect sound with MPD

OSS specific Linux discussion (x86/amd64)

Moderators: cesium, dev, kodachi, hannu

Bit-perfect sound with MPD

Postby Storken » Wed Mar 31, 2010 7:56 am

Hi, all.
Lately, I installed another distribution, and naturally ALSA came with it. So while it was there anyway, I decided to test out bit-perfect sound, because as an eee consumer I hate to waste CPU cycles on the software mixer. Well, after a simple setting in the mpd.conf it seemingly worked, as all other sound output was blocked and MPD ate about 1%, while with ALSA it was usually around 10 to 20%.
So, is it possible? With ALSA I just had to set

Code: Select all
audio_output {
        type                    "alsa"
        name                    "SPDIF"
        device                  "hw:0,0"
}


into the mpd.conf. But I can't find any information whatsoever on doing something similar with OSS.
I know OSS consumes less CPU with its resampling to 48000 (Intel HDA), I'd still like to test that out.
Storken
New Member
 
Posts: 8
Joined: Wed Dec 09, 2009 10:00 pm

Re: Bit-perfect sound with MPD

Postby igorzwx » Wed Mar 31, 2010 2:12 pm

Storken wrote:Hi, all.
Lately, I installed another distribution, and naturally ALSA came with it. So while it was there anyway, I decided to test out bit-perfect sound, because as an eee consumer I hate to waste CPU cycles on the software mixer. Well, after a simple setting in the mpd.conf it seemingly worked, as all other sound output was blocked and MPD ate about 1%, while with ALSA it was usually around 10 to 20%.
So, is it possible? With ALSA I just had to set

Code: Select all
audio_output {
        type                    "alsa"
        name                    "SPDIF"
        device                  "hw:0,0"
}


into the mpd.conf.


Why do you believe that this configuration produces "bit-perfect sound"?

http://en.wikipedia.org/wiki/SPDIF
QUOTE:
"S/PDIF is meant to be used for transmitting 20-bit audio data streams plus other related information. To transmit sources with less than 20 bits of sample accuracy, the superfluous bits will be set to zero. S/PDIF can also transport 24-bit samples by way of four extra bits; however, not all equipment supports this, and these extra bits might be ignored...
...may be further influenced by noise or distortion introduced in the data cable[3][4][5].
...noise will be introduced into the resulting analogue signal. However, receivers can implement various strategies which limit this influence[5]."
End of QUOTE

If it is about "accuracy" and "noise reduction", it cannot be "bit-perfect", by definition.
igorzwx
Supporter
 
Posts: 987
Joined: Sun Jun 28, 2009 9:31 pm

Re: Bit-perfect sound with MPD

Postby cesium » Wed Mar 31, 2010 8:07 pm

SRC and mixing is done by vmix component in OSS. To achieve bit-perfect sound, you can simply disable vmix or set up mpd to output to a device where OSS has not enabled vmix (it depends on your soundcard if this is possible). Can you paste 'ossinfo -v3' and 'ossmix' output? It would help us help you...

Anyhow, I suggest you first see in ossinfo where you have an 'spdout' device. Try to set up mpd so that it outputs to that device (OSS usually doesn't attach vmix to such devices). If so, we're done. Otherwise, you may have to use main output without vmix. To disable SRC alone, set vmix0-src to OFF in the mixer. To disable vmix entirely, set vmix0-enable to OFF in the mixer. Disabling vmix entirely will prevent multiple clients from using the device, while disabling SRC would force all other programs to use same format and rate as mpd uses.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: Bit-perfect sound with MPD

Postby igorzwx » Wed Mar 31, 2010 8:20 pm

cesium wrote:SRC and mixing is done by vmix component in OSS. To achieve bit-perfect sound, you can simply disable vmix


It is not always true, because SRC might be done by the soundcard itself. The absolute "bit-perfectness" might be impossible to achieve.

For Intel ICH4 souncard, for example, you may better enable "vmix" and "Production quality", if you want to have a relatively perfect sound without strong harmonic distortions.
igorzwx
Supporter
 
Posts: 987
Joined: Sun Jun 28, 2009 9:31 pm

Re: Bit-perfect sound with MPD

Postby Storken » Thu Apr 01, 2010 11:44 am

Well, calling it "bit-perfect" was probably way off. By that, I meant mpd to send it to the sound card without getting it re-sampled by the mixer.
But holy crap, I just had to disable vmix in ossxmix. And it does exactly what I wanted, no CPU usage at all. Well that's all I need, thank you guys for helping out :)
Storken
New Member
 
Posts: 8
Joined: Wed Dec 09, 2009 10:00 pm


Return to Linux

Who is online

Users browsing this forum: Google [Bot] and 1 guest