Ask Your Question
0

Can you force unlock an alsa device with type "hw"?

asked 2014-02-19 12:26:01 -0600

acyclic gravatar image

updated 2014-09-29 00:20:42 -0600

mether gravatar image

I'm using alsa audio for digital output to an external DAC. It works well, but some processes (eg. firefox) lock the audio device even when no sound is playing, so I have to kill firefox before playing music through a different app. Is there a way to force-unlock an alsa hw device without terminating the process?

My reason for using alsa with type "hw" is to output an unmodified digital waveform to the external DAC. I do not want to use type "dmix" or type "plug" as these will resample the waveform, and it's easy to tell the difference with a high quality DAC & headphones. Pulseaudio also resamples the waveform.

I've read about JACK, but I can't install it as I don't have root access to this machine, and the current alsa-plugins source doesn't compile for Fedora 17.

This is my .asoundrc file :

pcm.!default {
  type hw
  card 2
}

ctl.!default {
  type hw
  card 2
}
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-09-29 07:19:42 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

To unlock audio device captured by Firefox:

$ killall plugin-container
edit flag offensive delete link more
0

answered 2015-07-26 09:19:26 -0600

acyclic gravatar image

You can find out the pid which has the lock on the asound device using /proc/asound. eg. for card0, playback device 0, use :

$ cat /proc/asound/card0/pcm0p/sub0/status | grep pid

Then you can kill that process.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-02-19 12:26:01 -0600

Seen: 898 times

Last updated: Sep 29 '14