I have a soundcard that is only partially supported in Alsa, i.e. playback is only working in 48 kHz. Most of my audio files are in 44.1 kHz, and I would like to use Exaile as my audio player, as it has all the functionality that I need.

The problem is, that gstreamer - the backend for exaile - does not convert the sample rate with my current settings, so playing back the audio files will result in a speed up, while playing the files with mplayer works just fine, mplayer does sample rate conversion on playback.

Is there a way to get gstreamer to convert the sample rate?

EDIT: The sound card in question is an E-MU 0404 PCI express, see http://alsa-project.org/main/index.php/Matrix:Vendor-Creative_Labs and http://alsa-project.org/main/index.php/Matrix:Module-emu10k1-fpga

  • 1
    Which sound card? – CL. Nov 23 '13 at 18:26

I've recently acquired an E-MU 0404 USB, so perhaps my experience with it can help you.

After some struggle, it seems capable of playing back both 44100Hz and 48000Hz (and, probably - but I've not checked - various frequencies up to 192kHz...)

GStreamer's capable of doing sample rate conversion, but it's probably not the correct place to configure this. As you've doubtless noticed, how one would configure it is incredibly obfuscated and would likely involve gconf. However, there's a number of other locations that should work. I've listed them in descending order of preference.

The trick with these devices appears to be to set the 'Clock Rate' slider in the the mixer (the terminal based alsamixer should just show it, I think others require you to unhide the slider). Setting it to 0 gives 44100Hz, 1 gives 48000Hz, and so forth. Irritating - but workable.

Note; If you want to use the SPDIF output, you need to configure your media player to output from device 1. if anyone's trying to get passthrough (AC3/DTS), this won't work, unless your sample rate is set correctly (usually, the 48000kHz aka '1' setting).

At this point it should be working, below talks about how to do things without fiddling with that slider:

If you really want to do sample rate conversion, you should be able to get the desired effect by creating the appropriate ~/.asoundrc (this assumes that the E-MU is the second sound device - you can check with aplay -l). The following is untested as I've not got analogue cables handy for mine:

pcm.!default {
         card 1
         device 0
         rate 48000

ctl.!default {
         type hw           
         card 1

Configuring by ALSA should have got things working, however, if you'd prefer to configure it via PulseAudio, edit /etc/pulse/daemon.conf and make sure the default-sample-rate line reads (ensure it's not commented out with a ';' and the number is correct):

default-sample-rate = 48000

(from https://wiki.archlinux.org/index.php/PulseAudio#Choppy.2C_overdriven_sound )

| improve this answer | |
  • Unfortunately, this is not working. Both audio cards use different drivers. The driver for E-MU 0404 PCI express only works with 48kHz currently. – Residuum Mar 4 '14 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.