Re: [pulseaudio-discuss] [PATCH 2/3] stream-interaction: Update interaction logic.

2018-08-07 Thread Tanu Kaskinen
On Fri, 2018-07-13 at 11:21 +0300, Juho Hämäläinen wrote: > Stream interaction groups now have hashmaps for all trigger and interaction > states and roles. We track both trigger streams and interaction streams > separately, so that applying interaction (ducking or cork and muting) is > relatively s

[pulseaudio-discuss] [PATCH 0/7] Misc cleanups

2018-08-07 Thread João Paulo Rechi Vita
I've been refactoring and expanding the audio-routing patches we carry downstream at Endless and ended-up with a few cleanup patches in the process. Basically they make the code a bit easier to read and understand (hopefully not only IMO) by either breaking up big conditionals into smaller ones or

[pulseaudio-discuss] [PATCH 6/7] module-rescue-streams: Fix tab used for identation

2018-08-07 Thread João Paulo Rechi Vita
--- src/modules/module-rescue-streams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-rescue-streams.c b/src/modules/module-rescue-streams.c index 52675ecf7..0d8b1be8b 100644 --- a/src/modules/module-rescue-streams.c +++ b/src/modules/module-rescue-streams

[pulseaudio-discuss] [PATCH 1/7] card: Log availability status when choosing initial profile

2018-08-07 Thread João Paulo Rechi Vita
--- src/pulsecore/card.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c index bc5b75b04..c785f00a7 100644 --- a/src/pulsecore/card.c +++ b/src/pulsecore/card.c @@ -186,7 +186,10 @@ void pa_card_choose_initial_profile(pa_card *card) { * or

[pulseaudio-discuss] [PATCH 5/7] switch-on-connect: Add debug logs

2018-08-07 Thread João Paulo Rechi Vita
Log when module-switch-on-connect tries to change the default sink or source. --- src/modules/module-switch-on-connect.c | 36 -- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/modules/module-switch-on-connect.c b/src/modules/module-switch-on-connect.c

[pulseaudio-discuss] [PATCH 7/7] card: Fix typo in comments

2018-08-07 Thread João Paulo Rechi Vita
--- src/pulsecore/card.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h index 5699475d8..09284f6ff 100644 --- a/src/pulsecore/card.h +++ b/src/pulsecore/card.h @@ -128,7 +128,7 @@ pa_card *pa_card_new(pa_core *c, pa_card_new_data *da

[pulseaudio-discuss] [PATCH 2/7] switch-on-port-available: Improve readability

2018-08-07 Thread João Paulo Rechi Vita
Split a big conditional into separate checks and use pa_safe_streq instead of checking if a pointer is valid and calling pa_streq inside a conditional. --- src/modules/module-switch-on-port-available.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/modul

[pulseaudio-discuss] [PATCH 3/7] switch-on-connect: Improve readability

2018-08-07 Thread João Paulo Rechi Vita
Make code easier to read by moving pa_proplist_gets out of the if condition and using pa_safe_streq. --- src/modules/module-switch-on-connect.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/modules/module-switch-on-connect.c b/src/modules/module-switc

[pulseaudio-discuss] [PATCH 4/7] switch-on-connect: Clean-up tabs used for identation

2018-08-07 Thread João Paulo Rechi Vita
--- src/modules/module-switch-on-connect.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/module-switch-on-connect.c b/src/modules/module-switch-on-connect.c index 7b82ff1a6..f277c7945 100644 --- a/src/modules/module-switch-on-connect.c +++ b/src/modules/m

[pulseaudio-discuss] [RFC PATCH 0/4] Audio routing fixes and improvements

2018-08-07 Thread João Paulo Rechi Vita
These are patches we have been carrying downstream for quite some time now at Endless (some of them which are a refactor of an earlier work by Mario Sanchez Prada from ~3.5 years ago), plus a fix for problem I have worked at recently (patches 3 and 4). Essentially we want to have active streams (a

[pulseaudio-discuss] [RFC PATCH 4/4] switch-on-connect: Do not ignore HDMI sinks

2018-08-07 Thread João Paulo Rechi Vita
HDMI ports are normally present on cards connected to an internal bus, and module-switch-on-connect should switch to them when a HDMI monitor is plugged. This is specially relevant on setups where the HDMI port of a machine is connected to a different audio card then the analog outputs, which is t

[pulseaudio-discuss] [RFC PATCH 1/4] card: New API pa_card_profile_has_available_ports

2018-08-07 Thread João Paulo Rechi Vita
New function to check if a card has any ports with a certain availability for a specific direction. This was built uppon previous work by Mario Sanchez Prada. --- src/pulsecore/card.c | 18 ++ src/pulsecore/card.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/src/pulse

[pulseaudio-discuss] [RFC PATCH 3/4] alsa-card: Switch profile when the active one becomes unavailable

2018-08-07 Thread João Paulo Rechi Vita
When the active profile of a card becomes unavailable and no other module changes it to a better profile (i.e. there are no available ports that module-switch-on-port-available could switch to) the card will be stuck on an unavailable profile with a non-working sink/source and any active streams co

[pulseaudio-discuss] [RFC PATCH 2/4] switch-on-port-available: Change criteria for keeping the active profile

2018-08-07 Thread João Paulo Rechi Vita
Prefer the active profile only if it has ports with available status YES on the same direction of the port we are trying to switch to and a higher priority than whichever profile we would select to switch to a new port. This patch removes the code that ensures that no profile switching will happen