Something most users ignore is that the default Dmix's resampling to 48khz quite screws up 44.1khz sound. The Dmix behaviour might change in the future, but for now this isn't the right behaviour for most users.. If you have a standard usage of your desktop, you would like the best sound quality from music and movies and, on the other hand, while listening music you might do other stuff requiring sound ( watching Web videos, gaming, voip, .. ). Almost all music is 44.1khz material, so the first right thing to do is to set Dmix default samplerate to 44.1khz.. :
Code:
#Into /etc/asound.conf
pcm.!default {
type plug
slave.pcm {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
rate 44100
}
}
}
..in such a way you can enjoy Dmix ( the "default" pseudo-device ) in your music players without quality loss. And if you want to avoid 48khz->44.1khz resampling in movies either, setup your movies players to use the "plughw:0,0" device ( for mono/stereo ), taking into account that no other sound will be played when watching movies ( which may be what you want )
Also from Feisty, there will be the "samplerate" plugin available in official packages. Once you will have upgraded ( not before ), install the "libasound2-plugins" package and add this line at the top of /etc/asound.conf :
Code:
defaults.pcm.rate_converter "samplerate"
Dmix will then employ a much better resampling algorithm than the default one, and some apps such as Skype(32khz) will greatly benefit from it.
NOTE 1 :
My tip doesn't take into account arts, esound, and other sound servers, which may "replace" Dmix and hide your configuration. Note that there's always a way to get rid of them - at least for non-too-exotic software.
NOTE 2 :
There are others resampling algorithms in the libasound2-plugins package :
samplerate_best
samplerate_linear
samplerate_medium
samplerate_order
IMO (just) "samplerate" is the best load/quality compromise, but if you're interested in testing also the others simply replace "samplerate" in the asound.conf file by one of the above.
NOTE 3 :
A specific case is for soundcards doing resampling everything to 48khz themselves : AC'97 onboard chipsets, all Creative Live and Audigy series, Hercules Fortissimo I/II/III ( not the IV ). Due to their limited power and flexibility, they perform quite crappy resampling on non-48khz material. On Windows this is avoided because kmixer resample everything by default to 48khz ( and certainely perform some other nasty destructive voodoo.. ). We might want something like this in that case :
Code:
defaults.pcm.rate_converter "samplerate" # from Feisty only
pcm.!default {
type plug
slave.pcm {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
rate 48000
}
}
}
Same than above except the rate set to 48000. This is the default Dmix configuration, but Dmix is not enabled by default on soundcards featuring "hardware" mixing. Software mixing instead of hardware mixing increases of course the CPU load, but it's negligible on all modern machines, and the difference in sound quality is really worth it.
Et voilà!
Bookmarks