* "default" device. Is there a way to detect if it's a plugin, and if so which one?
@ 2011-04-03 12:22 Colin Guthrie
2011-04-04 10:57 ` Takashi Iwai
2011-04-04 11:38 ` Sebastian H.
0 siblings, 2 replies; 4+ messages in thread
From: Colin Guthrie @ 2011-04-03 12:22 UTC (permalink / raw)
To: alsa-devel
Hi,
If the user opens the "default" device in alsa, is there a way to find
out if that "device" is actually a plugin?
i.e. is it possible to tell if you have opened the pulseaudio plugin via
alsa?
There are various hacky ways (e.g. checking hints etc.) but that relies
on downstream packaging which certainly isn't fool proof.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mageia Contributor [http://www.mageia.org/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: "default" device. Is there a way to detect if it's a plugin, and if so which one?
2011-04-03 12:22 "default" device. Is there a way to detect if it's a plugin, and if so which one? Colin Guthrie
@ 2011-04-04 10:57 ` Takashi Iwai
2011-04-04 11:22 ` Colin Guthrie
2011-04-04 11:38 ` Sebastian H.
1 sibling, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2011-04-04 10:57 UTC (permalink / raw)
To: Colin Guthrie; +Cc: alsa-devel
At Sun, 03 Apr 2011 13:22:34 +0100,
Colin Guthrie wrote:
>
> Hi,
>
> If the user opens the "default" device in alsa, is there a way to find
> out if that "device" is actually a plugin?
>
> i.e. is it possible to tell if you have opened the pulseaudio plugin via
> alsa?
>
> There are various hacky ways (e.g. checking hints etc.) but that relies
> on downstream packaging which certainly isn't fool proof.
There is no clean way, AFAIK.
A new API would be needed. For example, something like:
snd_pcm_contains_type(pcm, SND_PCM_TYPE_EXTPLUG);
But checking whether PA-plugin is used is difficult with the API above
because pulse plugin has no unique PCM type but it's a sub-plugin
of extplug plugin...
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: "default" device. Is there a way to detect if it's a plugin, and if so which one?
2011-04-04 10:57 ` Takashi Iwai
@ 2011-04-04 11:22 ` Colin Guthrie
0 siblings, 0 replies; 4+ messages in thread
From: Colin Guthrie @ 2011-04-04 11:22 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
'Twas brillig, and Takashi Iwai at 04/04/11 11:57 did gyre and gimble:
> At Sun, 03 Apr 2011 13:22:34 +0100,
> Colin Guthrie wrote:
>>
>> Hi,
>>
>> If the user opens the "default" device in alsa, is there a way to find
>> out if that "device" is actually a plugin?
>>
>> i.e. is it possible to tell if you have opened the pulseaudio plugin via
>> alsa?
>>
>> There are various hacky ways (e.g. checking hints etc.) but that relies
>> on downstream packaging which certainly isn't fool proof.
>
> There is no clean way, AFAIK.
> A new API would be needed. For example, something like:
> snd_pcm_contains_type(pcm, SND_PCM_TYPE_EXTPLUG);
>
> But checking whether PA-plugin is used is difficult with the API above
> because pulse plugin has no unique PCM type but it's a sub-plugin
> of extplug plugin...
Yeah I didn't think there was an easy way.
I guess just "strongly recommending" the distros use a hint when they
redirect the "default" makes sense.
I do this:
aplay aplaymidi
[colin@jimmy build-master (master)]$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
default
Default ALSA Output (currently PulseAudio Sound Server)
....
SO that the "default" hint contains the word "PulseAudio" which apps
could check. It's obviously not fool proof, but if this is only for
"hinting" purposes at the app level anyway, then it's maybe good enough.
(FWIW, it's for a situation where hinting to the user that they are
going via ALSA, when an optional but more specific pulse output is
supported by the app and may be more appropriate).
Thanks for the info.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mageia Contributor [http://www.mageia.org/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: "default" device. Is there a way to detect if it's a plugin, and if so which one?
2011-04-03 12:22 "default" device. Is there a way to detect if it's a plugin, and if so which one? Colin Guthrie
2011-04-04 10:57 ` Takashi Iwai
@ 2011-04-04 11:38 ` Sebastian H.
1 sibling, 0 replies; 4+ messages in thread
From: Sebastian H. @ 2011-04-04 11:38 UTC (permalink / raw)
To: Colin Guthrie; +Cc: alsa-devel
Am 03.04.2011 14:22, schrieb Colin Guthrie:
> Hi,
>
> If the user opens the "default" device in alsa, is there a way to find
> out if that "device" is actually a plugin?
>
> i.e. is it possible to tell if you have opened the pulseaudio plugin via
> alsa?
>
> There are various hacky ways (e.g. checking hints etc.) but that relies
> on downstream packaging which certainly isn't fool proof.
Hi
Maybe one could parse the config files with snd_config_xxx and friends
and look what the type pcm.default is.
I've stumpled upon something similar when qasmixer tries to open
ctl.default which in some cases doesn't exist.
Sebastian H.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-04 11:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-03 12:22 "default" device. Is there a way to detect if it's a plugin, and if so which one? Colin Guthrie
2011-04-04 10:57 ` Takashi Iwai
2011-04-04 11:22 ` Colin Guthrie
2011-04-04 11:38 ` Sebastian H.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).