[pulseaudio-discuss] [PATCH] rescue-streams: try to find best one using availability and priority

2014-05-28 Thread Hui Wang
(same rules apply to the source selecting): If the sinks have the port with PA_AVAILABLE_YES, we will choose the one from them with a highest priority port. If all sinks don't have the port with PA_AVAILABLE_YES, we will choose the one with a highest priority port. Signed-off-by: Hui Wang hui.w

[pulseaudio-discuss] [V2 PATCH] rescue-streams: try to find best one using availability and priority

2014-05-29 Thread Hui Wang
(same rules apply to the source selecting): construct a new hashmap with all ports (of all relevant sinks) and then call find_best on the new hashmap to find the best port, finally find the corresponding sink using the best port. Signed-off-by: Hui Wang hui.w...@canonical.com --- src/modules/module

[pulseaudio-discuss] [V3 PATCH] rescue-streams: try to find best one using availability and priority

2014-06-05 Thread Hui Wang
if the default sink is not available. (same rules apply to the source selecting): construct a new hashmap with all ports (of all relevant sinks) and then call find_best on the new hashmap to find the best port, finally find the corresponding sink using the best port. Signed-off-by: Hui Wang hui.w

[pulseaudio-discuss] [PATCH] module-switch-on-connect: add an argument for conditionally connecting

2014-09-15 Thread Hui Wang
an argument, the policy is if a new source/sink is connected and current default source/sink's active_port is AVAILABLE_NO, we let the new added one switch to default one. BugLink: http://bugs.launchpad.net/bugs/1369476 Signed-off-by: Hui Wang hui.w...@canonical.com --- src/modules/module-switch

[pulseaudio-discuss] [V3 PATCH] module-switch-on-connect: add an argument for conditionally connecting

2014-09-21 Thread Hui Wang
an argument, the policy is if a new source/sink is connected and current default source/sink's active_port is AVAILABLE_NO, we let the new added one switch to default one. BugLink: http://bugs.launchpad.net/bugs/1369476 Signed-off-by: Hui Wang hui.w...@canonical.com --- In the V3

Re: [pulseaudio-discuss] [V4 PATCH] module-switch-on-connect: add an argument for conditionally connecting

2014-09-25 Thread Hui Wang
On 09/26/2014 12:13 AM, Raymond Yau wrote: On a machine without fixed connecting audio devices like internal microphone or internal speaker, and when there is no external audio devices plugging in, the default source/sink is alsa_input/alsa_output and there is no input

[pulseaudio-discuss] [PATCH] module-switch-on-port-available: make the output more accurate

2014-09-25 Thread Hui Wang
It is possible that the chosen active_port doesn't equal new_data-active_port, using p-name is more accurate. Please refer to sink_new_hook_callback() Signed-off-by: Hui Wang hui.w...@canonical.com --- src/modules/module-switch-on-port-available.c | 3 +-- 1 file changed, 1 insertion(+), 2

Re: [pulseaudio-discuss] [V4 PATCH] module-switch-on-connect: add an argument for conditionally connecting

2014-09-28 Thread Hui Wang
On 09/28/2014 05:50 PM, Tanu Kaskinen wrote: On Sun, 2014-09-28 at 12:41 +0300, Tanu Kaskinen wrote: On Mon, 2014-09-22 at 11:50 +0800, Hui Wang wrote: On a machine without fixed connecting audio devices like internal microphone or internal speaker, and when there is no external audio devices

Re: [pulseaudio-discuss] ThinkPad T-510 audio output mute LED non-workingness

2015-03-30 Thread Hui Wang
On 03/31/2015 05:54 AM, Glenn Golden wrote: HW: ThinkPad T-510, x86_64 SW: Arch Linux (synched within a week) kernel = 3.19.2, PA 6.0 On the above setup, the mic mute function (invoked via pavucontrol) works as expected: Click the mute icon, it mutes the mic input, indicates the muted state by

[pulseaudio-discuss] [PATCH] tests: add tolerant variation for comparing the rewind result

2015-05-24 Thread Hui Wang
, the storing from FPU register to memory will introduce some variation, and this small variation will introduce small variation to the rewinding result. So adding the tolerant variation for comparing the rewind result, make this test case can work on both 64bits OS and 32bits OS. Signed-off-by: Hui Wang

[pulseaudio-discuss] [PATCH] tests: Remove a redundant mempool_new from resampler-test

2015-05-24 Thread Hui Wang
Signed-off-by: Hui Wang hui.w...@canonical.com --- src/tests/resampler-test.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tests/resampler-test.c b/src/tests/resampler-test.c index 751d2dc..9832a31 100644 --- a/src/tests/resampler-test.c +++ b/src/tests/resampler-test.c @@ -330,8

[pulseaudio-discuss] [V2 PATCH] tests: add tolerant variation for comparing the rewind result

2015-05-25 Thread Hui Wang
, the storing from FPU register to memory will introduce some variation, and this small variation will introduce small variation to the rewinding result. So adding the tolerant variation for comparing the rewind result, make this test case can work on both 64bits OS and 32bits OS. Signed-off-by: Hui Wang

[pulseaudio-discuss] [PATCH] switch-on-port-available: check and change default sink or source

2017-04-26 Thread Hui Wang
e sound card), there is no issue. It looks like the current switch-on-port-available can't handle multiple sound cards well. To fix it, adding a function to check and change default sink or source after executing switch_to_port() or switch_from_port(). Signed-off-by: Hui Wang <hui.w...@canonica

[pulseaudio-discuss] [PATCH] switch-on-port-available: check and change default sink or source

2017-04-26 Thread Hui Wang
e sound card), there is no issue. It looks like the current switch-on-port-available can't handle multiple sound cards well. To fix it, adding a function to check and change default sink or source after executing switch_to_port() or switch_from_port(). Signed-off-by: Hui Wang <hui.w...@canonica

Re: [pulseaudio-discuss] [PATCH] switch-on-port-available: check and change default sink or source

2017-04-27 Thread Hui Wang
Hello Tanu, Could you please take a look at this patch, you are the maintainer and recently contributed couple of commits to module-switch-on-port-available.c. :-) Thanks in advance. Hui. On 04/27/2017 11:20 AM, Hui Wang wrote: Suppose your machine has two sound cards as below: Card

[pulseaudio-discuss] [PATCH] alsa: make headset-mic scanned earlier than headphone-mic

2017-05-15 Thread Hui Wang
, but this jack can't work with headphone. A simple fix for this issue is to exchange the position of headphone-mic and headset-mic, then the headset-mic will be the active_port of pa-source if there is no internal microphone and no other available input devices. Signed-off-by: Hui Wang <hu

Re: [pulseaudio-discuss] [PATCH] switch-on-port-available: check and change default sink or source

2017-05-16 Thread Hui Wang
On 05/03/2017 06:51 PM, Tanu Kaskinen wrote: On Wed, 2017-05-03 at 11:23 +0800, Hui Wang wrote: Today I tested the latest master branch (already including your two patches), seems it did not fix the problem. Below is my testing detail: Install ubuntu 16.04 on my laptop. clone the latest

Re: [pulseaudio-discuss] [PATCH] alsa: make headset-mic scanned earlier than headphone-mic

2017-05-22 Thread Hui Wang
On 05/20/2017 10:51 PM, Tanu Kaskinen wrote: On Fri, 2017-05-19 at 09:29 +0800, Hui Wang wrote: Hello Tanu, Could you please help take a look at this patch? This patch really fix an issue on some Dell machines (with realtek codec and has no internal microphone on them), And I think this minor

Re: [pulseaudio-discuss] [PATCH] alsa: make headset-mic scanned earlier than headphone-mic

2017-05-24 Thread Hui Wang
keep the headphone-mic's priority to 87, after booting up, the default input active_port is headset-mic (that is expected), I plug a microphone and select "headphone-mic" from UI program, the input active_port is headphone-mic now, then I unplug the headphone-mic, the input active_port is

Re: [pulseaudio-discuss] [PATCH] alsa: make headset-mic scanned earlier than headphone-mic

2017-05-23 Thread Hui Wang
On 05/23/2017 07:35 PM, Tanu Kaskinen wrote: On Tue, 2017-05-23 at 17:36 +0800, Hui Wang wrote: On 05/23/2017 04:20 PM, Tanu Kaskinen wrote: On Tue, 2017-05-23 at 11:04 +0800, Hui Wang wrote: On 05/20/2017 10:51 PM, Tanu Kaskinen wrote: On Fri, 2017-05-19 at 09:29 +0800, Hui Wang wrote

[pulseaudio-discuss] [PATCH] alsa: make priority of the port headset-mic higher than headphone-mic

2017-05-24 Thread Hui Wang
than traditional microphone, It is highly possible that users plug in a headset instead of microphone, it makes sense to make the headset-mic's priority higher than headphone-mic's. Signed-off-by: Hui Wang <hui.w...@canonical.com> --- src/modules/alsa/mixer/paths/analog-input-headset-mic.co

[pulseaudio-discuss] [PATCH] alsa-mixer: Add support for usb audio in the Dell dock TB16

2017-05-26 Thread Hui Wang
://www.dell.com/support/article/sg/en/sgbsdt1/SLN301105 Signed-off-by: Hui Wang <hui.w...@canonical.com> --- .../alsa/mixer/profile-sets/90-pulseaudio.rules| 1 + .../profile-sets/dell-dock-tb16-usb-audio.conf | 55 ++ 2 files changed, 56 insertions(+) create mode

Re: [pulseaudio-discuss] [PATCH] alsa: make headset-mic scanned earlier than headphone-mic

2017-05-18 Thread Hui Wang
/2017 11:21 AM, Hui Wang wrote: On some Dell machines with realtek codec, they have a headset audio jack which supports headphone, headset and pure microphone, but this audio jack can only detect something is plugged in but doesn't have capabilites to distinguish what is plugged in. So we need

Re: [pulseaudio-discuss] [PATCH] alsa: make headset-mic scanned earlier than headphone-mic

2017-05-23 Thread Hui Wang
On 05/23/2017 04:20 PM, Tanu Kaskinen wrote: On Tue, 2017-05-23 at 11:04 +0800, Hui Wang wrote: On 05/20/2017 10:51 PM, Tanu Kaskinen wrote: On Fri, 2017-05-19 at 09:29 +0800, Hui Wang wrote: Hello Tanu, Could you please help take a look at this patch? This patch really fix an issue on some

Re: [pulseaudio-discuss] [PATCH] switch-on-port-available: check and change default sink or source

2017-05-02 Thread Hui Wang
On 05/02/2017 09:27 PM, Tanu Kaskinen wrote: On Tue, 2017-05-02 at 08:55 +0800, Hui Wang wrote: On 04/29/2017 09:04 PM, Tanu Kaskinen wrote: On Fri, 2017-04-28 at 12:21 +0800, Hui Wang wrote: Hello Tanu, Could you please take a look at this patch, you are the maintainer and recently

Re: [pulseaudio-discuss] [PATCH] switch-on-port-available: check and change default sink or source

2017-05-01 Thread Hui Wang
On 04/29/2017 09:04 PM, Tanu Kaskinen wrote: On Fri, 2017-04-28 at 12:21 +0800, Hui Wang wrote: Hello Tanu, Could you please take a look at this patch, you are the maintainer and recently contributed couple of commits to module-switch-on-port-available.c. :-) Well, I'm trying to concentrate

[pulseaudio-discuss] [PATCH 0/4] The tentative fix of the issue #185

2018-11-04 Thread Hui Wang
the source and source_output yet. Based on these patches, I tested the switch between HDMI output and speaker, it worked as expected. If the way of changing sink/sink_input is basically correct and is worth to apply to the source/source_output, I will continue to write patches for them too. Hui Wang (4

[pulseaudio-discuss] [PATCH 3/4] move streams to new appeared sinks if they prefer these sinks

2018-11-04 Thread Hui Wang
When a new sink appears, all streams that have their "preferred_sink" set to the new sink should be moved to the new sink. Signed-off-by: Hui Wang --- src/pulsecore/sink.c | 31 +++ src/pulsecore/sink.h | 1 + 2 files changed, 32 insertions(+) diff -

[pulseaudio-discuss] [PATCH 2/4] move stream after default sink is changed.

2018-11-04 Thread Hui Wang
, then it will move the stream conditionally. Signed-off-by: Hui Wang --- src/modules/dbus/iface-core.c | 2 +- src/modules/module-default-device-restore.c | 2 +- src/modules/module-switch-on-connect.c | 28 ++- src/pulsecore/cli-command.c | 2 +- src

[pulseaudio-discuss] [PATCH 4/4] move stream when the active_port changes

2018-11-04 Thread Hui Wang
k. Signed-off-by: Hui Wang --- src/pulsecore/device-port.c | 16 src/pulsecore/sink.c| 13 + src/pulsecore/sink.h| 1 + 3 files changed, 30 insertions(+) diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c index 464c3f8a2..2604c9

[pulseaudio-discuss] [PATCH 1/4] change bool save_sink to char *preferred_sink

2018-11-04 Thread Hui Wang
and the entry->device will be cleared too from database. Signed-off-by: Hui Wang --- src/modules/module-device-manager.c| 2 +- src/modules/module-intended-roles.c| 2 +- src/modules/module-stream-restore.c| 47 +- src/modules/module-switch-on-connect.c |

Re: [pulseaudio-discuss] Audio APP (sink-input) bind to the sink with only unplugged hdmi-audio ports on it

2018-09-30 Thread Hui Wang
On 2018年09月30日 18:30, Tanu Kaskinen wrote: On Sun, 2018-09-30 at 15:03 +0800, Hui Wang wrote: This issue is also reported to: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/579 Recently we found a weird issue on many laptops with the ubuntu 18.04, it uses the pulseaudio-11.1 (I

Re: [pulseaudio-discuss] Audio APP (sink-input) bind to the sink with only unplugged hdmi-audio ports on it

2018-10-02 Thread Hui Wang
On 2018年10月02日 18:50, Georg Chini wrote: On 02.10.2018 11:49, Tanu Kaskinen wrote: On Mon, 2018-10-01 at 10:18 +0800, Hui Wang wrote: On 2018年09月30日 18:30, Tanu Kaskinen wrote: On Sun, 2018-09-30 at 15:03 +0800, Hui Wang wrote: This issue is also reported to: https://gitlab.freedesktop.org

[pulseaudio-discuss] Audio APP (sink-input) bind to the sink with only unplugged hdmi-audio ports on it

2018-09-30 Thread Hui Wang
This issue is also reported to: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/579 Recently we found a weird issue on many laptops with the ubuntu 18.04, it uses the pulseaudio-11.1 (I guess the PA of the latest version also has this problem). The issue is like this: 1. boot

Re: [pulseaudio-discuss] Audio APP (sink-input) bind to the sink with only unplugged hdmi-audio ports on it

2018-09-30 Thread Hui Wang
; +   check_and_move_sink_inputs_to_default_sink(c, port); break; default: break; On 2018年09月30日 15:03, Hui Wang wrote: This issue is also reported to: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/579 Recently we found a weird issue on many laptops with

[pulseaudio-discuss] [PATCH v2 2/8] sink-input: add a new API pa_sink_input_set_preferred_sink

2019-01-16 Thread Hui Wang
API to simplify the entry_apply in the module-stream-restore.c. Signed-off-by: Hui Wang --- src/modules/module-stream-restore.c | 10 ++ src/pulsecore/sink-input.c | 14 ++ src/pulsecore/sink-input.h | 2 ++ 3 files changed, 18 insertions(+), 8 deleti

[pulseaudio-discuss] [PATCH v2 1/8] sink-input: change bool save_sink to char *preferred_sink

2019-01-16 Thread Hui Wang
The finial objective is to store the preferred sink name in the sink-input struct, and use module-stream-restore to save and restore it. This patch just replaces the save_sink with preferred_sink, and tries to keep the original logic. Signed-off-by: Hui Wang --- src/modules/module-device

[pulseaudio-discuss] [PATCH v2 0/8] Change the bool sink_save to char *preferred_sink

2019-01-16 Thread Hui Wang
by Tanu. It will be easy to review in the future. The 0007 and 0008 are not in the design of the above, I guess the 0007 is needed but am not sure. The 0008 is a workaround for current gnome-control-center. Hui Wang (8): sink-input: change bool save_sink to char *preferred_sink sink-input: add

[pulseaudio-discuss] [PATCH v2 4/8] core: move sink-inputs conditionally when update default_sink

2019-01-16 Thread Hui Wang
When the default sink changes, the streams from the old default sink should be moved to the new default sink, unless the preferred_sink string is set to the old default sink and the active port of the old default sink is not unavailable Signed-off-by: Hui Wang --- src/modules/dbus/iface-core.c

[pulseaudio-discuss] [PATCH v2 6/8] device-port: moving streams due to changing the status of active_port

2019-01-16 Thread Hui Wang
When the active port of a sink becomes unavailable, all streams from that sink should be moved to the default sink. When the active port of a sink changes state from unavailable, all streams that have their preferred_sink set to this sink should be moved to this sink. Signed-off-by: Hui Wang

[pulseaudio-discuss] [PATCH v2 8/8] stream-restore: skip entries setting action from gnome-control-center

2019-01-16 Thread Hui Wang
in the database, let all stream entries to bind the sink users select, this is not correct since the sink is default_sink now. This is a temp fix for this issue, after gnome-control-center fixes this problem, this patch should be reverted. Signed-off-by: Hui Wang --- src/modules/module-stream-restore.c | 14

[pulseaudio-discuss] [PATCH v2 7/8] sink: move the streams to the default_sink when the sink is unlinked

2019-01-16 Thread Hui Wang
When a sink is unlinked, all streams of this sink are moved to default_sink, this action is implemented in the core rather than modules now. Signed-off-by: Hui Wang --- src/modules/module-stream-restore.c | 50 - src/pulsecore/sink.c| 3 ++ 2 files

[pulseaudio-discuss] [PATCH v2 3/8] sink-input: clear the preferred_sink if it is default_sink

2019-01-16 Thread Hui Wang
When the user moves a stream to the current default sink, the preferred_sink should be set to NULL and module-stream-restore should clear the routing for that stream in the stream database. From that point on the stream will be always routed to the default sink. Signed-off-by: Hui Wang --- src

[pulseaudio-discuss] [PATCH v2 5/8] sink: move streams to new appeared sinks if they prefer these sinks

2019-01-16 Thread Hui Wang
When a new sink appears, all streams that have their preferred_sink set to the new sink should be moved to the new sink. Signed-off-by: Hui Wang --- src/modules/module-stream-restore.c | 53 - src/pulsecore/core.c| 28 +++ src/pulsecore

[pulseaudio-discuss] [PATCH] alsa-mixer: Adding Jack of Front Headphone Front and Surround

2018-12-20 Thread Hui Wang
users plug a headset or headphone, the path of headphone will not be activated, and users can't see headphones from UI like gnome-control-center. Signed-off-by: Hui Wang --- For alsa-info.txt of one of machines, please access: https://pastebin.ubuntu.com/p/CjCGySMpM5/ .../alsa/mixer/paths/analog-in

Re: [pulseaudio-discuss] [PATCH 2/4] move stream after default sink is changed.

2018-12-25 Thread Hui Wang
On 2018/12/23 上午2:57, Tanu Kaskinen wrote: On Sat, 2018-12-15 at 14:48 +0800, Hui Wang wrote: On 2018/12/13 下午5:16, Tanu Kaskinen wrote: On Mon, 2018-11-05 at 09:47 +0800, Hui Wang wrote: When default sink changes, the stream should be moved to new default_sink too. Except if the stream's

Re: [pulseaudio-discuss] [PATCH 1/4] change bool save_sink to char *preferred_sink

2018-12-25 Thread Hui Wang
On 2018/12/23 上午3:06, Tanu Kaskinen wrote: On Sat, 2018-12-15 at 16:47 +0800, Hui Wang wrote: On 2018/12/12 下午9:39, Tanu Kaskinen wrote: Thanks for working on this! Sorry for slow review, I hope I'll be much quicker to comment on subsequent iterations. On Mon, 2018-11-05 at 09:47 +0800, Hui

Re: [pulseaudio-discuss] [PATCH 2/4] move stream after default sink is changed.

2018-12-14 Thread Hui Wang
On 2018/12/13 下午5:16, Tanu Kaskinen wrote: On Mon, 2018-11-05 at 09:47 +0800, Hui Wang wrote: When default sink changes, the stream should be moved to new default_sink too. Except if the stream's preferred sink is the old default sink. If it is user to call change default function, all

Re: [pulseaudio-discuss] [PATCH 1/4] change bool save_sink to char *preferred_sink

2018-12-15 Thread Hui Wang
On 2018/12/12 下午9:39, Tanu Kaskinen wrote: Thanks for working on this! Sorry for slow review, I hope I'll be much quicker to comment on subsequent iterations. On Mon, 2018-11-05 at 09:47 +0800, Hui Wang wrote: And don't move the stream in the module-stream-restore anymore

Re: [pulseaudio-discuss] [PATCH 3/4] move streams to new appeared sinks if they prefer these sinks

2019-01-02 Thread Hui Wang
On 2019/1/1 上午2:10, Tanu Kaskinen wrote: On Mon, 2018-12-31 at 20:01 +0200, Tanu Kaskinen wrote: On Mon, 2018-11-05 at 09:47 +0800, Hui Wang wrote: diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index 63a3456e7..a2a390beb 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c

Re: [pulseaudio-discuss] [PATCH] alsa-mixer: Adding Jack of Front Headphone Front and Surround

2019-01-02 Thread Hui Wang
On 2018/12/31 下午9:46, Tanu Kaskinen wrote: On Fri, 2018-12-21 at 11:05 +0800, Hui Wang wrote: We have 2 HP desktop models which have one front headphone Jack and one front headset Jack, in the Linux kernel, these two jacks are named "Front Headphone Front Jack" and "Front Hea

[pulseaudio-discuss] [PATCH v2 0/2] Handle two Headphone Jacks with the same name

2019-01-13 Thread Hui Wang
ut-speaker.conf +++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf @@ -32,6 +32,11 @@ state.unplugged = unknown state.plugged = no state.unplugged = unknown +[Jack Front Headphone@1] +index = 1 +state.plugged = no +state.unplugged = unknown + [Jack Front Headphone] state.plugged = no

[pulseaudio-discuss] [PATCH v2 1/2] alsa-mixer: Add alsa index number support for Element and Jack

2019-01-13 Thread Hui Wang
. When probing jacks or elements, we add index as a parameter. Signed-off-by: Hui Wang --- src/modules/alsa/alsa-mixer.c | 59 ++- src/modules/alsa/alsa-mixer.h | 2 + src/modules/alsa/alsa-ucm.c | 2 +- src/modules/alsa/alsa

[pulseaudio-discuss] [PATCH v2 2/2] alsa-mixer: set different strings to name and alsa-name for jack and element

2019-01-13 Thread Hui Wang
to @1, then in the alsa-mixer.c, the "@1" will be set to the element->name, and the "" will be set to the element->alsa_name, we generated the new element based on the element->name, then this issue is fixed. Signed-off-by: Hui Wang --- src/modules

Re: [pulseaudio-discuss] [PATCH 4/4] move stream when the active_port changes

2019-01-02 Thread Hui Wang
On 2019/1/1 上午2:33, Tanu Kaskinen wrote: On Mon, 2018-11-05 at 09:47 +0800, Hui Wang wrote: When the active port of a sink becomes unavailable, all streams from that sink should be moved to the default sink. When the active port of an existing sink changes state from unavailable, all streams

Re: [pulseaudio-discuss] [PATCH 1/3] alsa: fix infinite loop with Intel HDMI LPE

2019-03-25 Thread Hui Wang
On 2017/12/28 下午6:09, Tanu Kaskinen wrote: > The Intel HDMI LPE driver works in a peculiar way when the HDMI cable is > not plugged in: any written audio is immediately discarded and underrun > is reported. That resulted in an infinite loop, because PulseAudio tried > to keep the buffer filled,

Re: [pulseaudio-discuss] [PATCH 1/3] alsa: fix infinite loop with Intel HDMI LPE

2019-03-26 Thread Hui Wang
On 2019/3/27 上午1:44, Tanu Kaskinen wrote: > On Tue, 2019-03-26 at 13:17 +0800, Hui Wang wrote: >> On 2017/12/28 下午6:09, Tanu Kaskinen wrote: >>> The Intel HDMI LPE driver works in a peculiar way when the HDMI cable is >>> not plugged in: any written audio is immedia

Re: [pulseaudio-discuss] [alsa-devel] [PATCH] ALSA: hda: set the 2nd headphone's name to be Headphone2

2019-03-06 Thread Hui Wang
On 2019/3/6 下午4:10, Jaroslav Kysela wrote: > Dne 06. 03. 19 v 1:23 Hui Wang napsal(a): >> On 2019/3/6 上午4:00, Jaroslav Kysela wrote: >>> Dne 05. 03. 19 v 15:09 Hui Wang napsal(a): >>>> Recently I saw two Headphones on some HP machines, the 1st Headphone >>&g

[pulseaudio-discuss] [PATCH] stream-restore: Don't restore if the active_port is PA_AVAILABLE_NO

2019-05-15 Thread Hui Wang
the database, so the users' preference is still saved in the database, after the active_port is not PA_AVAILABLE_NO, the new streams will still restore to the preferred device. Signed-off-by: Hui Wang --- src/modules/module-stream-restore.c | 12 1 file changed, 8 insertions(+), 4 deletions

Re: [pulseaudio-discuss] [PATCH v2 7/8] sink: move the streams to the default_sink when the sink is unlinked

2019-07-02 Thread Hui Wang
On 2019/6/30 下午8:15, Georg Chini wrote: On 17.01.19 07:53, Hui Wang wrote: When a sink is unlinked, all streams of this sink are moved to default_sink, this action is implemented in the core rather than modules now. Signed-off-by: Hui Wang ---   src/modules/module-stream-restore.c | 50

Re: [pulseaudio-discuss] [PATCH v2 3/8] sink-input: clear the preferred_sink if it is default_sink

2019-07-02 Thread Hui Wang
On 2019/6/30 下午6:47, Georg Chini wrote: On 17.01.19 07:53, Hui Wang wrote: When the user moves a stream to the current default sink, the preferred_sink should be set to NULL and module-stream-restore should clear the routing for that stream in the stream database. From that point on the stream

Re: [pulseaudio-discuss] [PATCH v2 2/8] sink-input: add a new API pa_sink_input_set_preferred_sink

2019-07-02 Thread Hui Wang
On 2019/6/30 下午6:44, Georg Chini wrote: Sorry for the late feedback. On 17.01.19 07:53, Hui Wang wrote: If the sink here is NULL, that means users want to clear the preferred_sink and move the sink-input to the default_sink, otherwise set the preferred_sink to the sink->name and move the s

[pulseaudio-discuss] [PATCH v3 6/8] device-port: moving streams due to changing the status of active_port

2019-08-17 Thread Hui Wang
When the active port of a sink becomes unavailable, all streams from that sink should be moved to the default sink. When the active port of a sink changes state from unavailable, all streams that have their preferred_sink set to this sink should be moved to this sink. Signed-off-by: Hui Wang

[pulseaudio-discuss] [PATCH v3 0/8] Change the bool sink_save to char *preferred_sink

2019-08-17 Thread Hui Wang
s design: https://lists.freedesktop.org/archives/pulseaudio-discuss/2018-October/030531.html And this is only for sink-input and sink, not for source-output and source. In the V2, I addressed all comments of V1 and split the big patch into small patches as suggested by Tanu. It will be easy to review in the future

[pulseaudio-discuss] [PATCH v3 1/8] sink-input: change bool save_sink to char *preferred_sink

2019-08-17 Thread Hui Wang
The finial objective is to store the preferred sink name in the sink-input struct, and use module-stream-restore to save and restore it. This patch just replaces the save_sink with preferred_sink, and tries to keep the original logic. Signed-off-by: Hui Wang --- src/modules/module-device

[pulseaudio-discuss] [PATCH v3 8/8] stream-restore: skip entries setting action from gnome-control-center

2019-08-17 Thread Hui Wang
in the database, let all stream entries to bind the sink users select, this is not correct since the sink is default_sink now. This is a temp fix for this issue, after gnome-control-center fixes this problem, this patch should be reverted. Signed-off-by: Hui Wang --- src/modules/module-stream-restore.c | 14

[pulseaudio-discuss] [PATCH v3 4/8] core: move sink-inputs conditionally when update default_sink

2019-08-17 Thread Hui Wang
When the default sink changes, the streams from the old default sink should be moved to the new default sink, unless the preferred_sink string is set to the old default sink and the active port of the old default sink is not unavailable Signed-off-by: Hui Wang --- src/modules/dbus/iface-core.c

[pulseaudio-discuss] [PATCH v3 7/8] sink: move the streams to the default_sink when the sink is unlinked

2019-08-17 Thread Hui Wang
When a sink is unlinked, all streams of this sink are moved to default_sink, this action is implemented in the core rather than modules now. Signed-off-by: Hui Wang --- src/modules/module-rescue-streams.c | 134 +--- src/modules/module-stream-restore.c | 50

[pulseaudio-discuss] [PATCH v3 2/8] sink-input: add a new API pa_sink_input_set_preferred_sink

2019-08-17 Thread Hui Wang
API to simplify the entry_apply in the module-stream-restore.c. Signed-off-by: Hui Wang --- src/modules/module-stream-restore.c | 10 ++ src/pulsecore/sink-input.c | 13 + src/pulsecore/sink-input.h | 2 ++ 3 files changed, 17 insertions(+), 8 deletions(-) d

[pulseaudio-discuss] [PATCH v3 3/8] sink-input: clear the preferred_sink if it is default_sink

2019-08-17 Thread Hui Wang
When the user moves a stream to the current default sink, the preferred_sink should be set to NULL and module-stream-restore should clear the routing for that stream in the stream database. From that point on the stream will be always routed to the default sink. Signed-off-by: Hui Wang --- src

[pulseaudio-discuss] [PATCH v3 5/8] sink: move streams to new appeared sinks if they prefer these sinks

2019-08-17 Thread Hui Wang
When a new sink appears, all streams that have their preferred_sink set to the new sink should be moved to the new sink. Signed-off-by: Hui Wang --- src/modules/module-stream-restore.c | 53 - src/pulsecore/core.c| 28 +++ src/pulsecore

Re: [pulseaudio-discuss] [PATCH v3 0/8] Change the bool sink_save to char *preferred_sink

2019-08-24 Thread Hui Wang
Done. https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/158 On 2019/8/24 上午9:25, Hui Wang wrote: OK, I will create a merge request. Thanks, Hui. On 2019/8/23 下午3:48, Georg Chini wrote: On 18.08.19 07:32, Hui Wang wrote: In the V3, I addressed all Tanu's and Georg's

Re: [pulseaudio-discuss] [PATCH v3 0/8] Change the bool sink_save to char *preferred_sink

2019-08-23 Thread Hui Wang
OK, I will create a merge request. Thanks, Hui. On 2019/8/23 下午3:48, Georg Chini wrote: On 18.08.19 07:32, Hui Wang wrote: In the V3, I addressed all Tanu's and Georg's comments: 0002-xxx.patch: remove the pa_subscription_post() in the pa_sink_input_set_preferred_sink() 0003-xxx.patch