You are not logged in.
Pages: 1
Hello!
Is there an easy way to "restart" my sound device without needing to reboot my machine?
For some reason I often get the following error:
[~]$ mpd
ALSA lib pcm_dmix.c:1008:(snd_pcm_dmix_open) unable to open slave
No audio_output specified and unable to detect a default audio output device
I guess something is blocking my sound device.
Ørjan Pettersen
Offline
Offline
Do you have MPD configured to use the device?
See the part below in your mpd.conf, where you can specifically set a device (hw:x:x) in case MPD can't find an output by itself:
#audio_output {
# type "alsa"
# name "My ALSA Device"
# device "hw:0,0" # optional
# format "44100:16:2" # optional
#}
It could also be that you have to create an .asoundrc file. Though ALSA usually doesn't require one anymore there might be a legacy program on your system that needs it, to prevent it from claiming the device exclusively. More information about that here: http://alsa.opensrc.org/.asoundrc
Last you can try installing OSS4 instead of ALSA, which generally handles multiple audio streams better: http://wiki.archlinux.org/index.php/OSS
ᶘ ᵒᴥᵒᶅ
Offline
MPD usually works fine. But sometimes it don't. A reboot does fix it.
Same goes for aplay <somefile>.
Doing a /etc/rc.d/alsa restart doesn't work.
I believe the problem is caused by another program locking the sound exclusively. OSS would have been worth a try if it wasn't for my AC'97 sound.
So I guess i have a look at the .asoundrc thing.
I have tried to remove sound modules, but some modules can't be removed because they are in use. Even if it isn't indicated that it is in use when doing a lsmod
[~]# lsmod | grep snd
snd_pcm_oss 40192 1
snd_mixer_oss 16512 1 snd_pcm_oss
snd_intel8x0 30748 1
snd_ac97_codec 100516 1 snd_intel8x0
ac97_bus 3584 1 snd_ac97_codec
snd_pcm 69636 3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec
snd_timer 21384 1 snd_pcm
snd 50724 6 snd_pcm_oss,snd_mixer_oss,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer
soundcore 8160 2 snd
snd_page_alloc 9224 2 snd_intel8x0,snd_pcm
[~]# rmmod snd_intel8x0
ERROR: Module snd_intel8x0 is in use
Thanks.
Last edited by orjanp (2008-12-08 12:44:05)
Ørjan Pettersen
Offline
OSS4 should be able to work fine with i8x0 AC97 afaik?
And please say hi to Geir Jenssen for me when you see him!
ᶘ ᵒᴥᵒᶅ
Offline
All you should have to do is unload any sound modules in use and then reload them. Gentoo has a script for this, perhaps I'll try to port it.
[git] | [AURpkgs] | [arch-games]
Offline
Ok, here is the gentoo alsa initscript... Look at the terminate() function, it should do what you want.
[git] | [AURpkgs] | [arch-games]
Offline
I have the same problem. Sometimes the sound just lock up. Sadly the above script does not seems to work either.
Edit: typo.
Last edited by hk2717 (2008-12-09 14:45:16)
Offline
You're not supposed to run it as a script. I just provided it as an example.
[git] | [AURpkgs] | [arch-games]
Offline
Out of curiosity, for the people that sometimes things are working and sometimes they're not, do you have alsa, oss, mpd, network, and such, backgrounded in the daemons array in rc.conf? From my experience, sometimes things start faster than others. In the case of mpd for example, if it tries to start before everything it needs does, it will happily fail and you won't know about it until you try to use it.
Offline
sudo /etc/rc.d/alsa restart
For future reference, that will never have any effect on any sound devices. Read the script.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
Out of curiosity, for the people that sometimes things are working and sometimes they're not, do you have alsa, oss, mpd, network, and such, backgrounded in the daemons array in rc.conf? From my experience, sometimes things start faster than others. In the case of mpd for example, if it tries to start before everything it needs does, it will happily fail and you won't know about it until you try to use it.
Exactly. I once have all the daemons starting in the background but now I find that it is definitely not the best practice. However, my current problem is the sound suddenly dies during daily use.
Someone please provide a usable script! For I am a programming noob.:( Rebooting every couple of hours is so annoying! Even Windows is more stable than this.:|
Offline
Take a look at the gentoo alsa rc script. It is more functional than the our alsa daemon and will give you the commands you need.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
OSS4 should be able to work fine with i8x0 AC97 afaik?
And please say hi to Geir Jenssen for me when you see him!
That is true, despite the fact that the WIKI says that AC'97 sound isn't supported. So I installed OSS4. Time will show if this is a working solution.
It was often Firefox and flash videos that blocked my sound. A restart of Firefox often fixed that. Flash was the bad apple here.
Will do.
Ok, here is the gentoo alsa initscript... Look at the terminate() function, it should do what you want.
Had a look at it, but since OSS4 works fine for now, I went for that solution.
Out of curiosity, for the people that sometimes things are working and sometimes they're not, do you have alsa, oss, mpd, network, and such, backgrounded in the daemons array in rc.conf? From my experience, sometimes things start faster than others. In the case of mpd for example, if it tries to start before everything it needs does, it will happily fail and you won't know about it until you try to use it.
Good point. But I start mpd manually after login.
r6 wrote:sudo /etc/rc.d/alsa restart
For future reference, that will never have any effect on any sound devices. Read the script.
Just what I thought to, but I wasn't entirely sure.
Thanks for all the help and pointers. As of now, my sound is working fine with OSS4.
Ørjan Pettersen
Offline
Well occasionally you'll need to kill a program that's hogging the audio device. Execute 'lsof /dev/snd/* /dev/dsp' to see which programs are using the audio device and kill any that you think might be causign the problem.
Arch on a Thinkpad T400s
Offline
fuser can also be used, which is more likely to be installed since it's in core (psmisc).
You need to install an RTFM interface.
Offline
Pages: 1