[pulseaudio-discuss] [PATCH 6/6] ucm: Add support for "JackHWMute"
david.henningsson at canonical.com
Mon Mar 30 00:54:02 PDT 2015
On 2015-02-12 14:11, Tanu Kaskinen wrote:
> "JackHWMute" is a UCM device value that, if set, indicates that the
> jack of the device mutes some other device at the hardware or driver
> level. A common example would be a headphone jack that mutes built-in
> speakers. PulseAudio should show such auto-muted devices as
> Previously there was only a simple relationship: each UCM device was
> related to one jack and vice versa. Now each device is still related
> to exactly one jack, but each jack can be related to two devices: one
> that the jack enables, and one that the jack disables (mutes).
Sorry for chiming in this late, but...
Can we instead duplicate the jack, like we do for non-UCM, and set
jack->state_plugged -> PA_AVAILABLE_NO / jack->state_unplugged ->
PA_AVAILABLE_YES for the HWMute jack functionality?
It looks like this would enable us to share code between UCM and non-UCM
code paths instead of duplicating similar functionality.
Also, we would then get automatic support for use cases like "Line Out"
which should only be available if both a) "Line Out Jack" is plugged in
and b) "Headphone Jack" is unplugged.
> The patch adds pa_alsa_jack_set_plugged_in() to encapsulate the logic
> of marking the appropriate ports available/unavailable.
> pa_alsa_jack_set_plugged_in() propagates the status to UCM devices,
> and the devices propagate the status further to ports.
...and then my suggestion would be remain connecting the ports directly
to the jacks, like we make use of today in report_port_state.
(The UCM devices do not need to have availability at all.)
> Previously the
> logic of mapping jack status to port availability was done by
> module-alsa-card.c, which I think is not the right place, so I didn't
> want to add the UCM "mute jack" logic there.
I don't mind moving jack availability logic from module-alsa-card to
somewhere you find more fitting. This applies to both UCM and non-UCM code.
Btw, I also agree with Arun that ports should be of unknown availability
in case they have no jacks at all connected to them.
David Henningsson, Canonical Ltd.
More information about the pulseaudio-discuss