Bug 364687 - Default device is not remembered
Summary: Default device is not remembered
Status: RESOLVED WORKSFORME
Alias: None
Product: plasma-pa
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 5.6.95
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-23 21:22 UTC by Weng Xuetian
Modified: 2022-11-21 05:15 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Weng Xuetian 2016-06-23 21:22:19 UTC
I have a bluetooth headphone and I set it as default device in plasma-pa's kcm after I first use it.

After I close it and reopen it, the default device is still the builtin-analog, instead of the bluetooth device.

Reproducible: Always

Steps to Reproduce:
1. Connect bluetooth head set
2. Set it as default in plasma-pa's kcm
3. Close the headset
4. reopen and connect the headset

Actual Results:  
builtin-analog is default device.

Expected Results:  
Bluetooth headset becomes default device when it's available.
Comment 1 David Rosca 2016-06-23 21:44:56 UTC
Hm, that's kind of to be expected actually. All it does is to change the default device in pulseaudio, so ideally pulseaudio should remember it.
Comment 2 Weng Xuetian 2016-06-23 22:09:57 UTC
(In reply to David Rosca from comment #1)
> Hm, that's kind of to be expected actually. All it does is to change the
> default device in pulseaudio, so ideally pulseaudio should remember it.

If you know about start-pulseaudio-kde, you'll know that in the past, kde uses different pulseaudio mechanism to select default device. (by using /usr/bin/pactl load-module module-device-manager "do_routing=1" > /dev/null )

So that the old kcm phonon will be able to set a list of device to pa. I don't think it uses the same "default" device mechanism  like other desktop. And actually select default device from kcm doesn't do anything on my desktop. It doesn't change application to use another device.

I think you probably want to pick up the same mechanism used by kcm phonon to decide the real default device.
Comment 3 David Rosca 2016-06-24 13:42:23 UTC
I know about start-pulseaudio-kde which loads module-device-manager that handles audio routing. It has nothing to do with default device as interpreted by pulseaudio.

You can still use it and there is nothing in plasma-pa code that would conflict with it. Default device in pulseaudio is used as a fallback device.

No, I don't want to pick up the module-device-manager. Initially, I though about it but eventually decided against it. It is module that was specially written for KDE, is not used anywhere else and it doesn't handle the most used case of switching audio output to newly connected device (as in your test case). This is now done by the module-switch-on-connect which I plan to use instead.
Comment 4 Weng Xuetian 2016-06-24 16:03:41 UTC
Then we probably want to inform distro/upstream to disable it first. Otherwise it won't work as expected.
Comment 5 Weng Xuetian 2016-06-24 19:15:44 UTC
I notice another problem is that "changing default device with module-switch-on-connect and without module-device-manager" doesn't affect existing running applications.

BTW, I'm not sure using module-switch-on-connect by default is the right direction. Is any other desktop/distro using it by default?

And obviously it conflicts with module-device-manager.
Quote:
https://wiki.archlinux.org/index.php/PulseAudio#Switch_on_connect
"On KDE/Plasma5 you should furthermore disable module-device-manager. As soon as Plasma5 is started it loads (via start-pulseaudio-x11) the module module-device-manager for pulseaudio to manage the devices."

Quote:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1495865/comments/2
Upstream has generally recommended against loading it by default, claiming the default sink should only be changed on user interaction.
It also kicks out possible role-based routing (i e, phone call on a USB headset and music on speakers).
Comment 6 Gregor Mi 2016-07-09 10:17:51 UTC
I use the audio output from my docking station as default device. This setting also gets lost sometimes.
Comment 7 David Edmundson 2016-07-13 19:15:33 UTC
@David - FYI that patch I just made for combine sinks can make it super easy to load/unload any PA module with only a small amount of code. 

Kai wanted me to add module-switch-on-connect as an option.
Comment 8 David Rosca 2016-07-13 19:26:10 UTC
Great, I was looking into how to do it with just libpulse and there unloading module requires more work (retrieve list of loaded plugins and unload it by id).

For the module-switch-on-connect option we would also need to unload module-device-manager as those two conflicts with each other.
Comment 9 Justin Zobel 2022-10-22 00:00:03 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 10 Bug Janitor Service 2022-11-06 05:07:29 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Bug Janitor Service 2022-11-21 05:15:17 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!