* [Alsa-dev]detecing if a device is already used by an other app
@ 2004-05-26 7:31 Cournapeau David
2004-05-26 7:46 ` Måns Rullgård
0 siblings, 1 reply; 2+ messages in thread
From: Cournapeau David @ 2004-05-26 7:31 UTC (permalink / raw)
To: alsa-devel
Hi there,
I am currently using two computers which have a crappy intl8x0 audio
chipset, and these chipset cannot be used by two different apps in the
same time. For example, if an audio app is using the soundcard, trying
to launch xmms ( with alsa output plugin) gives an error message which
says something like "check that no other app is blocking the device".
But if I launch alsaplayer (alsa output plugin) instead of xmms, the app
doesn't complain: it 'just' blocks on the snd_pcm_open call.
Basically, after having looked at the source, is seems like this
difference is coming from the flag in snd_pcm_open: if SND_PCM_NONBLOCK
is used, opening an already opened device failed, if SND_PCM_ASYNC is
used, the app just blocks, until the other app releases the device.
Is there a (simple) way to use the blocking call and detecting if
the device is already opened ?
Thank you,
David
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Alsa-dev]detecing if a device is already used by an other app
2004-05-26 7:31 [Alsa-dev]detecing if a device is already used by an other app Cournapeau David
@ 2004-05-26 7:46 ` Måns Rullgård
0 siblings, 0 replies; 2+ messages in thread
From: Måns Rullgård @ 2004-05-26 7:46 UTC (permalink / raw)
To: alsa-devel
Cournapeau David <cournape@atr.jp> writes:
> Hi there,
>
> I am currently using two computers which have a crappy intl8x0
> audio chipset, and these chipset cannot be used by two different
> apps in the same time. For example, if an audio app is using the
> soundcard, trying to launch xmms ( with alsa output plugin) gives
> an error message which says something like "check that no other
> app is blocking the device". But if I launch alsaplayer (alsa
> output plugin) instead of xmms, the app doesn't complain: it
> 'just' blocks on the snd_pcm_open call.
> Basically, after having looked at the source, is seems like this
> difference is coming from the flag in snd_pcm_open: if
> SND_PCM_NONBLOCK is used, opening an already opened device
> failed, if SND_PCM_ASYNC is used, the app just blocks, until the
> other app releases the device.
This is correct.
> Is there a (simple) way to use the blocking call and detecting if
> the device is already opened ?
You can open it in non-blocking mode and set it to blocking later, if
you want that behavior when writing data.
--
Måns Rullgård
mru@kth.se
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-05-26 7:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-26 7:31 [Alsa-dev]detecing if a device is already used by an other app Cournapeau David
2004-05-26 7:46 ` Måns Rullgård
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.