You are not logged in.

#1 2011-04-02 18:30:38

invalidArgument597
Member
From: Ohio, United States
Registered: 2011-04-02
Posts: 37

Alsa playback rate issue

Well, after a few stints with Gentoo (too much compiling for THIS machine, great distro overall though) and Debian (not a fan...), I'm back to Arch, which I've used since '08. Easily a tie with Gentoo for my favorite distro, and it flies on this machine. However, I have the first issue I simply have NOT been able to resolve, and it's with sound. Very strange issue, too.

After I got the OS installed and a user created, one of the first things I installed was, of course, alsa-utils. I ran alsaconf, it (as always) found my onboard sound, no problem. (FWIW, it's using snd-intel8x0, according to modprobe.d/sound.conf) However, I ran into the first issue I have ever had with this, regardless of distro. When I try to play _anything_ through the console, be it pianobar for Pandora, or ogg123 for my music, I get this error:

ao_alsa WARNING: sample rate 44100 not supported by the hardware, using 48000

Mind you, Daft Punk sounds kinda neat like that, it's obviously not what I'm going for. The strangest part of it all, is that Gstreamer plays everything just fine. Rhythmbox / Pithos (buggy, but working) play the songs right. Whether it's properly re-rating it, or it has a way to bypass the "hardware" issue that I've never had before, I'll never know. All I know is, I can't use my beloved terminal if I want to, and to me that's a bit of a disappointment, tongue

I've Googled this, and pretty much turned up nothing, so I'm now turing to our great community to tell me whether I've overlooked something, or if I should go bug report. Only thing I ask here is that if you respond with "RTFM", at least tell me WHICH manual, because all of 'em I've read tell me nothing useful. Thanks guys!


This account replaced by 'iv597'. Just can't delete old accounts on here...

Offline

#2 2011-04-02 18:54:30

joseperezc
Member
Registered: 2011-03-02
Posts: 80

Re: Alsa playback rate issue

check the config for pianobar
many times alsa is default configured to use 44100hz
just adjust it
probe which config works better
and keep it


Hope to be helpfull

Offline

#3 2011-04-02 19:03:57

invalidArgument597
Member
From: Ohio, United States
Registered: 2011-04-02
Posts: 37

Re: Alsa playback rate issue

EDIT: Take that back... time to edit config files >.>

I'm kinda weirded out. I changed _nothing_, but for some reason pianobar and ogg123 are BOTH working just fine right...
*temp-fixed?*
Thanks to the magic of forum posting? >.> Thanks for the help though, I'll do that if it starts acting up again. Still doesn't explain why it always has worked til now o.0

Last edited by invalidArgument597 (2011-04-02 19:05:48)


This account replaced by 'iv597'. Just can't delete old accounts on here...

Offline

#4 2011-04-02 19:29:09

joseperezc
Member
Registered: 2011-03-02
Posts: 80

Re: Alsa playback rate issue

-LOL- smile
for play the piano i use the fully bloated -but great- Synthesia
under wine, and for sound with frepats and timidity++
with the default config after a five or six keypress the horrible sound almost make me to die.
but added this to /etc/timidity++/timidity.cfg
opt EFresamp=l
opt EFreverb=g,42
opt EFchorus=s
opt s32kHz
opt p64a

and in winecfg in sound checked alsa and put 48000 in frec an 16bit

and all go very well


Hope to be helpfull

Offline

#5 2011-04-02 19:46:19

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

Re: Alsa playback rate issue

invalidArgument597 wrote:

ao_alsa WARNING: sample rate 44100 not supported by the hardware, using 48000

That's pretty self-explanatory. libao (rather than ALSA) is upmixing. I repeat - libao is doing the upmixing.

Mind you, Daft Punk sounds kinda neat like that, it's obviously not what I'm going for

You are not helping by being vague. Does the music sound too fast, or not? If so, then presumably the upmixing is buggy, which would be surprising.

If you have two options:
1. Upmix to a rate your hardware supports
2. Hear either broken audio, or silence
... Which would you prefer?

Do you suspect that libao is lying about your hardware?

Offline

#6 2011-04-02 19:57:02

invalidArgument597
Member
From: Ohio, United States
Registered: 2011-04-02
Posts: 37

Re: Alsa playback rate issue

Sorry, not exactly a ALSA power user, more or less a "I hope it works" user. As for the Daft Punk statement, yep. Faster, higher pitch, etc. Think playing a cassette too fast...
And also, as I've said, playing though GUI apps works, which is the part that is a bit... confusing. Sorry if I seem... noobish? but I have always just done alsaconf and gone on with life, just fine.

brebs wrote:

<snip>
That's pretty self-explanatory. libao (rather than ALSA) is upmixing. I repeat - libao is doing the upmixing.
<snip>
You are not helping by being vague. Does the music sound too fast, or not? If so, then presumably the upmixing is buggy, which would be surprising.

If you have two options:
1. Upmix to a rate your hardware supports
2. Hear either broken audio, or silence
... Which would you prefer?

Do you suspect that libao is lying about your hardware?


This account replaced by 'iv597'. Just can't delete old accounts on here...

Offline

#7 2011-05-11 20:46:05

invalidArgument597
Member
From: Ohio, United States
Registered: 2011-04-02
Posts: 37

Re: Alsa playback rate issue

Slightly shameful bump here, as I'm back to Arch after attempting Gentoo again. Runninf a console only setup and still have the issue. No other distros have had this. I have too fast of audio from ogg123. In fact, here's the full output for all the Alsa-ninjas out there:

[invalidargue597@Desktop ~]$ cat OUT

Audio Device:   Advanced Linux Sound Architecture (ALSA) output

Playing: tmp/ogg2/Bullet For My Valentine - Fever/04 - A Place Where You Belong.ogg
Ogg Vorbis stream: 2 channel, 44100 Hz
Artist: Bullet For My Valentine
Title: A Place Where You Belong
Album: Fever
Date: 2010-01-01
Track number: 4
Genre: Metal
ao_alsa WARNING: sample rate 44100 not supported by the hardware, using 48000

Done.

This appears to be an issue in libao, I just have no idea where to start fixing it. Thanks in advance for any help.


This account replaced by 'iv597'. Just can't delete old accounts on here...

Offline

#8 2011-05-11 21:25:32

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: Alsa playback rate issue

Unfortunately, this is more of a "me too" than anything constructive. I recently set up a plug device (pogoplug) connected to an external USB sound card, and am having a similar issue (specifically with pianobar). I tried switching to pulse audio as my backend with:

[nogoma@freya ~]$ cat /etc/libao.conf 
default_driver=pulse

This works (uses pulse), but pulseaudio runs like a dog on this machine (audio is extremely choppy). I think it's doing a better job of resampling, but the audio is actually too choppy for me to tell. It may simply be the answer that the hardware in this machine is insufficient to handle the resampling, but the reason I tried pulseaudio to begin with is that I can't seem to configure alsa to resample the audio to 48000. That is, the USB soundcard only supports this rate, but I'm sort of expecting that libao provide alsa w/ the 44100 rate, and alsa should handle the resample to 48000. I guess it's unclear to me where the resampling should occur; in libao? In alsa?

My current asound.rc is:

[nogoma@freya ~]$ cat /etc/asound.conf
pcm.!default { 
type plug 
slave { 
pcm "hw:Pro" 
channels 2 
rate 48000
} 
} 

pcm.dmixer6 {
type dmix
ipc_key 2342
slave {
pcm "hw:Pro"
channels 6
period_time 0
period_size 4096
buffer_size 262144
rate 48000
}
}

(This is admittedly hacked up from various sources). Should the default device be advertising a rate of 44100, and the dmix device 48000, and alsa should resample then? Basically, it seems like libao is trying to produce a 48000 rate that ALSA is expecting, but doing it poorly (audio definitely has a "too fast", chipmunk, effect to it), but not really sure where I should be poking to fix... Maybe the answer is finding a different sound device that supports 44100 natively (but, I'd presumably have the same issue if I had an audio source that was a different rate again!). That, or put some beefier hardware in there and use pulseaudio...

Last edited by nogoma (2011-05-11 21:26:02)


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#9 2011-05-11 21:36:34

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

Re: Alsa playback rate issue

Here's my ~/.asoundrc

Change the occurrences of 44100 in the "pcm.dmixed" block to 48000.

Offline

#10 2011-05-12 01:03:43

invalidArgument597
Member
From: Ohio, United States
Registered: 2011-04-02
Posts: 37

Re: Alsa playback rate issue

Sadly that's still not helping, though I thank you for trying. SOME of those devices show up on an aplay -L, but ogg123 still sounds, erm, chipmunky.


This account replaced by 'iv597'. Just can't delete old accounts on here...

Offline

#11 2011-05-12 01:08:59

invalidArgument597
Member
From: Ohio, United States
Registered: 2011-04-02
Posts: 37

Re: Alsa playback rate issue

More confirmation that this is a libao issue: cmus works just fine. Since I use MPD, I'll test that next...


This account replaced by 'iv597'. Just can't delete old accounts on here...

Offline

#12 2011-05-12 06:44:39

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,470

Re: Alsa playback rate issue

check this too:
https://bbs.archlinux.org/viewtopic.php … 29#p927129
It solved any problems i had with wine audio quality


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#13 2011-05-16 14:24:31

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: Alsa playback rate issue

Well, not a very satisfactory answer, but I wanted to post back and point out that running the same setup on slightly better hardware, and moving to using PulseAudio (and pointing libao to use it) solved my issues (tested with pianobar, which was my problem app, as well as mpd). I tried both the configs posted in this thread, but neither seemed to help; I'm sure I'm doing something wrong, but it just seemed like libao insisted on doing the resampling to 48000, which was having horrible (chipmunk-style) results. None of the configs I tried (from here or elsewhere on the web) would avoid the message:

    ao_alsa WARNING: sample rate 44100 not supported by the hardware, using 48000

Again, it seems like I'd need some way for ALSA to advertise 44100 so libao is completely unaware, but none of the stuff here managed to do that.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#14 2011-06-03 02:47:48

invalidArgument597
Member
From: Ohio, United States
Registered: 2011-04-02
Posts: 37

Re: Alsa playback rate issue

Hmm.. I have a rather severe PulseAudio allergy, so running Pithos in DWM is doing for now. STILL no idea on what will fix this, shy of 1) Me spending more time actually dealing with it rather than finding alternatives or 2) A libao bug report.

Also, no .asoundrc files have worked here, sadly. You know... maybe it's time to give PA another shot... *gulp*


This account replaced by 'iv597'. Just can't delete old accounts on here...

Offline

#15 2011-06-03 02:49:10

invalidArgument597
Member
From: Ohio, United States
Registered: 2011-04-02
Posts: 37

Re: Alsa playback rate issue

Oh, one more note: I tried OSS for a while out of curiosity. Pointing libao to that worked. Although PianoBar spit tons of errors about trying to find Alsa anyway, it DID work and play as expected. Darn, libao. Work? Thanks man... >.>


This account replaced by 'iv597'. Just can't delete old accounts on here...

Offline

#16 2012-02-04 05:34:49

iv597
Member
From: United States
Registered: 2011-09-18
Posts: 96
Website

Re: Alsa playback rate issue

Hate to bump this, but it's *still* an issue some, what, 10 months later? Not sure if anyone else has this kind of problem still, most people seem to evacuate to Pulse or OSS if it happens. This is actually one of two libao-related issues I've been having, the other is related to pyao. Posted about that one too.

Any ideas?

(Two notes: Mods, I'd say this doesn't really count (to me) as a necro-bump since it still is a valid issue less than a year later. Then again, you run this show, not me.
Rest of the BBS, in case you haven't read the signatures of the above posts, invalidArgument => iv597. One and the same, yo. Name got shortened everywhere else, so it did here as well)


Currently running Arch on a Samsung Chromebook Pro (dual booted with ChromeOS), and various VPSes and Docker containers.

Dotfiles on Github

Offline

#17 2012-02-04 11:50:16

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

Re: Alsa playback rate issue

You should take it to the ALSA Bugzilla, where the ALSA devs might notice it. They won't notice it here.

Offline

Board footer

Powered by FluxBB