Posts: 6
Joined: Wed Oct 09, 2013 9:38 pm

ALSA gets stuck

Sat Oct 12, 2013 9:00 pm

He everyone, again here...
Im trying very hard to make Pulseaudio work via network. There are problems.
As of debug process, tried to test pulseaudio&alsa on localhost (rpi).
Test consists of starting pulseaudio then let mplayer play some stream via pulse.
Things I have observed: mplayer can't play stream via pulse when pulse is stasrted in verbose mode. It is able to when its started normally (user mode), but then I don't see what's happening to pulse.
Problems starts when pulse is started, mplayer is streaming and volume is being adjusted.
start pulse:

Code: Select all

$pulseaudio --start
start mplayer via pulse:

Code: Select all

$ mplayer -ao pulse
then, when I open alsamixer in another terminal window and start to adjust volume, mplayer responds like this:

Code: Select all

Starting playback...
A:  22.0 (22.0) of 0.0 (unknown) 28.5% 40% 
Audio device got stuck!
at first, I get just one such a line and playback is continuing but after more adjustments, stream got stucked and massage is repeated endlessly in cycle. Also alsamixer is very unresponsible. It takes about 2min to lower the master channel to 0% and then the same to 100%. Weird. LAN have good speed and response too. (Running on edimag wifi dongle).
When I, using RPI as pulse server, Im able to stream for a while but when Im adjusting volume on client I ran into similar situation. XMMS just gets stucked and only way is to kill pulseaudio on server.

I have tied multiple configurations of daemon.conf which I found on internet, but none of this working.
Can you give ma a hand please?
Thank you!

Posts: 1388
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: ALSA gets stuck

Sun Oct 13, 2013 11:30 pm

this is one of those things that requires someone with lots of experience with sound on the Pi to answer. If nobody comes along in the next few days, you might post a query in the Sound subforum. Just make sure they know you are using commandline in ARch so you don't get Raspbian answers!

Meanwhile, I can comment that I just run alsaplayer on my Pi, dozens of times a day, it sounds reminders and alarms and I find it can slow down when the Pi does anything else. I wouldn't be at all surprised if the system got confused when you could be sending commands to adjust volume before it has acted on something else. Know that is not very helpful, but it is what I am thinking.

What I have done with my scripts is build in a command to check and see if something else that could interfere is running, and sleep a few seconds (in a loop) and check again.

It might be worth thinking what events could be slowing things down, not sure the best way to do that in your case, especially as I do not know pulseaudio. Used mplayer quite a while and then realized it would be less CPU intense to just use aplay (which I use instead of aplayer as it works commandline alone in scripts), so I do that.
FORUM TIP: To view just one person's posting history, sign in, click on their user name, then click on "Search User's Posts." || My 512MB Model B only runs Arch.

Posts: 186
Joined: Fri Oct 04, 2013 5:22 pm

Re: ALSA gets stuck

Wed Oct 16, 2013 7:43 am

Pulseaudio can demand high CPU usage. You could try running top or installing htop and monitoring CPU % before
and while pulseaudio is running. This extract is from the arch forum:

I'm not on my RPi at the moment but last two messages suggest modifying /etc/pulse/daemon.conf
Not sure if this file exists on the Pi but if it does you can experiment.

Posts: 6
Joined: Wed Oct 09, 2013 9:38 pm

Re: ALSA gets stuck

Fri Oct 18, 2013 6:25 pm

I appreciate your try but nothing of that you described is my case. On that pi, nothing is running. It just can't behave this way, there is something not playing well and it's pulse of course.

I have modified daemon.conf:

Code: Select all

 resample-method = speex-float-0
   default-sample-format = s16le
   default-sample-rate = 44100
   default-sample-channels = 2
so, basically parameters are very low... pulse is running in user mode of course.

about cpu utilization:
when pulse is not running and alsamixer is being adjusted: alsamixer - around 10%

when pulse IS running and alsamixer is being adjusted(from local): pulse - around 60%; alsamixer - around 30%

This is basically new installation of arch on pi... nothing esle is running on that machine except of edimax wifi and wicd.

My god! Pulse is pure damnation. I can't remember days when it was smooth as it should be.

Posts: 1
Joined: Fri Jan 31, 2014 8:27 pm

Re: ALSA gets stuck

Wed Feb 05, 2014 7:14 pm

Hi greengold, I'm facing exactly the same problem and playing with alsa parameters did not helped at all. Have you managed to solve this issue?

Posts: 1
Joined: Sat Apr 14, 2018 9:00 pm

Re: ALSA gets stuck

Sat Apr 14, 2018 9:05 pm

I used sudo and didn't get a stuck device, so I went through the /etc/group file and gave my account the same privileges as user: pi. That got me unstuck. HTH

Return to “Arch”

Who is online

Users browsing this forum: No registered users and 1 guest