You are not logged in.

#1 2008-08-01 08:32:45

z0idberg
Member
Registered: 2006-06-27
Posts: 20

[Solved] How do I tell ALSA to use 44100 for my sound card?

I'm having some problems with audio playback on my E-MU 0404 USB. The card (usually) works fine, for example in Fedora and nowadays in Ubuntu too. I believe my problems in Arch are because ALSA plays sound at 48000 Hz while the card is set to 44100 Hz. So my question is: can I make ALSA use 44100 Hz instead? I suppose editing alsa.conf directly isn't the recommended solution... I've tried fooling around with an .asoundrc but didn't get it to work.

Edit: Or is it possible that the problem isn't the rate, it's just that Arch can't "tell" the soundcard to run in 48000 Hz mode? Could this have something to do with permissions? I don't really have any idea how to approach this.

Last edited by z0idberg (2008-08-02 11:29:37)

Offline

#2 2008-08-01 14:59:05

btartsa
Member
Registered: 2004-07-26
Posts: 222

Re: [Solved] How do I tell ALSA to use 44100 for my sound card?

According to this :

https://bugtrack.alsa-project.org/wiki/ … comments=1

your card only supports 48khz. Are you using jack? Try passing jackd the -r option to change rates.

I realize this is not exactly what you are asking but maybe it will help.

Offline

#3 2008-08-01 15:32:16

chromatic
Member
From: France
Registered: 2008-02-21
Posts: 26

Re: [Solved] How do I tell ALSA to use 44100 for my sound card?

Do you have an option in alsamixer to change samplerate ?

A workaround could be to put this in ~/.asoundrc

pcm.!default {
type rate
slave {
pcm "plughw:0,0"
rate 44100
}
}

Offline

#4 2008-08-02 06:40:41

z0idberg
Member
Registered: 2006-06-27
Posts: 20

Re: [Solved] How do I tell ALSA to use 44100 for my sound card?

btartsa wrote:

According to this :

https://bugtrack.alsa-project.org/wiki/ … comments=1

your card only supports 48khz. Are you using jack? Try passing jackd the -r option to change rates.

I realize this is not exactly what you are asking but maybe it will help.

It seems to say that ALSA only supports 48000 Hz for my card (last update: October 2007, though)... So yeah, the problem problably has to do with something else (and I'm not using jack).

chromatic wrote:

Do you have an option in alsamixer to change samplerate ?

A workaround could be to put this in ~/.asoundrc

I'll try that, but even if it helps, it's more of a workaround. No samplerate option in alsamixer.

Still, the card works out of the box in Fedora, so if you have any idea how to find out what makes it work so well there but not in Arch, tell me!

Thanks for your help so far!

Offline

#5 2008-08-02 06:48:13

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

Re: [Solved] How do I tell ALSA to use 44100 for my sound card?

fedora and ubuntu uses pulseaudio by default, the resampling is likely happening there before passing to alsa for output

Offline

#6 2008-08-02 11:01:18

z0idberg
Member
Registered: 2006-06-27
Posts: 20

Re: [Solved] How do I tell ALSA to use 44100 for my sound card?

mpie wrote:

fedora and ubuntu uses pulseaudio by default, the resampling is likely happening there before passing to alsa for output

I installed pulseaudio using the instructions in the wiki, sound seems to work perfectly now. Thanks!

Now I know why it works in Fedora and Ubuntu... seems a bit workaround-ish to install pulseaudio just to get basic sound working, but I suppose the resampling has to happen either in pulseaudio or in dmix? If so, does anyone know if there's any difference between the resampling methods in pulseaudio and in dmix?

Offline

#7 2008-08-02 11:09:52

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

Re: [Solved] How do I tell ALSA to use 44100 for my sound card?

Only difference I can think of is if resampled via dmix, your likely to only play one sound at a time. Where as pulse was written to cure this very thing, so you can have as many streams on the go as your cpu and ram allow.

Offline

#8 2008-08-02 11:49:37

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [Solved] How do I tell ALSA to use 44100 for my sound card?

z0idberg wrote:

resampling methods

For ALSA, see command:

# Choices: samplerate_best samplerate_medium samplerate_order samplerate_linear
defaults.pcm.rate_converter "samplerate_best"

May need to install libsamplerate and recompile alsa-plugins wink

Here's my example asoundrc.

Offline

#9 2008-08-03 17:17:16

z0idberg
Member
Registered: 2006-06-27
Posts: 20

Re: [Solved] How do I tell ALSA to use 44100 for my sound card?

brebs wrote:
z0idberg wrote:

resampling methods

For ALSA, see command:

# Choices: samplerate_best samplerate_medium samplerate_order samplerate_linear
defaults.pcm.rate_converter "samplerate_best"

May need to install libsamplerate and recompile alsa-plugins wink

Here's my example asoundrc.

Thanks, I'll probably test it later, it seems to be exactly what I was looking for.

Offline

Board footer

Powered by FluxBB