This Time Self-Hosted
dark mode light mode Search

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).

Comments 3
  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.

  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.

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.