A little hint for ALSA hda users

Just because this might come useful to someone, and I gave this hint already three times today, if you own an hda-based soundcard and you head crackling sound while playing mp3s or similar, the problem is probably due to the bad samplerate conversion from 44100 to 48000.

A simple way to fix this without recurring to the use of an external audio server like PulseAudio, is to use the samplerate conversion plugin that is present in the media-plugins/alsa-plugins package (with the libsamplerate useflag enabled, as it uses libsamplerate — Secret Rabbit Code), and put something like this in your asound.conf:

defaults.pcm.rate_converter "samplerate"

this way the rate conversion will happen using the fastest libsamplerate converter, that should also give a better quality; as an alternative you can use “samplerate_medium”, “samplerate_best”, “samplerate_order” or “samplerate_linear” to choose a different rate converter from libsamplerate.

This should probably fix the audio artifacts you hear (although I admit I haven’t tried it first hand, as I don’t have any hda-based soundcard beside the laptop).

3 thoughts on “A little hint for ALSA hda users

  1. Thanks helped with my ICH8 based motherboard and digital out. It used to work just fine without any tricks but at least it’s working now with samplerate and forcing it out to iec958.

    Like

  2. this also happens with CK804 nforce4 onboard audio (snd-intel8x0 driver), at least with mpd playing via alsa.i noticed my mp3s playing a bit slower when didn’t specify samplerate in mpd.confsetting to 48000 fixed the problem – i’ll try your method with pulseaudio.

    Like

  3. Yeah, that helped me too!! You should add that to the ALSA guide; perhaps in a troubleshooting sectiosn

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s