FS#17239 - [alsa-utils] add alsa unblock option to /etc/rc.d/alsa

Attached to Project: Arch Linux
Opened by Tomas Mudrunka (harvie) - Sunday, 22 November 2009, 00:13 GMT
Last edited by Tobias Powalowski (tpowa) - Monday, 21 February 2011, 18:03 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description: Some applications (eg.: adobe flash + pm utils) are causing alsa to hang, so there should be another option in /etc/rc.d/alsa. note that i am not killing processes that are accessing control devices (this will cause only annoying crash of alsamixer, alsamix applet, etc...)

this is how i imagine it:


force-restart)
stat_busy "Trying to TERM or KILL processes that are blocking ALSA..."
FILES="$(ls -1 /dev/snd/* | grep -vi control)"
fuser -k -SIGTERM $FILES
fuser -k $FILES
stat_done
$0 restart
;;

This task depends upon

Closed by  Tobias Powalowski (tpowa)
Monday, 21 February 2011, 18:03 GMT
Reason for closing:  Implemented
Additional comments about closing:  1.0.24.2
Comment by Tomas Mudrunka (harvie) - Sunday, 22 November 2009, 00:16 GMT
maybe there can be something like 2>/dev/null after fuser commands...
Comment by Gerardo Exequiel Pozzi (djgera) - Sunday, 22 November 2009, 21:42 GMT
  • Field changed: Status (Unconfirmed → Waiting on Response)
  • Field changed: Category (Packages: Extra → Upstream Bugs)
If alsa drivers fails for some weird reason, please report to upstream. In this way alsa developers can help a lot more instead of band-aid solution ;)
Comment by Tomas Mudrunka (harvie) - Sunday, 22 November 2009, 21:52 GMT
djgera: this is no weird reason. sometimes appliction can open alsa device in some privileged mode and just hang for some another reason. alsa developers are knowing this and for a long time it's in their FAQ. eg. debian solves this problem in similar way that i supposed...
Comment by Tomas Mudrunka (harvie) - Sunday, 22 November 2009, 22:00 GMT
i've just looked again and i see that i misunderstood the problem. ALSA seems to be OK, but if some application hangs somewhere then /etc/rc.d/alsa restart fails... (and i think that sometimes alsa modules can't be reloaded) so it would be nice to have this script to get rid of those ghost processes...
Comment by Tomas Mudrunka (harvie) - Sunday, 22 November 2009, 23:33 GMT
but i found another bit related issue... pm-utils are not waking up alsa devices after suspend/hybernate in some cases (eg. when pc is suspended during the playback)
this is solution:
please include following /etc/pm/sleep.d/90alsa to alsa-utils (since it's not alsa issue nor pm-utils issue it has to be solved by distribution)

#!/bin/sh
#
# 90alsa: suspend/wakeup ALSA devices

case "$1" in
hibernate|suspend)
;;
thaw|resume)
aplay -d 1 /dev/zero
;;
*) exit $NA
;;
esac
Comment by Gerardo Exequiel Pozzi (djgera) - Sunday, 28 February 2010, 19:40 GMT
any news on this issue?
Comment by Tomas Mudrunka (harvie) - Monday, 01 March 2010, 12:01 GMT
I think there should be those two scripts...
i am using some unsupported alsa plugins and according to authors there is no way to get them better in next few years.
i've found that pm-utils script working very well and i have no more problems with sound when suspending my laptop.
but when using some special plugin, jackd or some older application that is blocking audio device, the script in topic of this bug is also very helpful.

Loading...