Bug 366149 - Cannot handle pulseaudio card profile and sink change
Summary: Cannot handle pulseaudio card profile and sink change
Status: RESOLVED FIXED
Alias: None
Product: plasma-pa
Classification: Plasma
Component: general (show other bugs)
Version: 5.7.3
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-27 01:14 UTC by Raman Gupta
Modified: 2016-09-21 10:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raman Gupta 2016-07-27 01:14:45 UTC
This is a regression in Plasma 5.7.1 relative to Plasma 5.6.5.

I have an Intel-HDA card with PulseAudio 7.1.1 on Fedora 23. My card is hooked up to both my external speakers as well as a headset. I can switch the audio from headset to speakers by using the commands:

```
pactl set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-surround-40+input:analog-stereo
pactl set-sink-port alsa_output.pci-0000_00_1b.0.analog-surround-40 analog-output-lineout
amixer -c $CARD sset "Auto-Mute Mode" Disabled
amixer -c $CARD sset 'Headphone',1 100 mute
```

and vice-versa:

```
pactl set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo+input:analog-stereo
pactl set-sink-port alsa_output.pci-0000_00_1b.0.analog-stereo analog-output-headphones
amixer -c $CARD sset "Auto-Mute Mode" Enabled
amixer -c $CARD sset 'Headphone',1 100 unmute
```

As of Plasma 5.7.1, the above commands still work, but KDE seems to lose its connection to PulseAudio when they are run. In `.xsession-errors`, immediately upon the switch I see:

org.kde.plasma.pulseaudio: No object for name "alsa_output.pci-0000_00_1b.0.analog-surround-40"

After that point, I cannot, use the volume up/down/mute keys successfully. Though moving the sliders in the pulse-pa applet does still work.

A restart of plasma restores the connection to pulseaudio and restores the up/down/mute key functionality.

Reproducible: Always

Steps to Reproduce:
1. Change pulseaudio card profile and sink port
2. Attempt to use volume up/down/mute buttons

Actual Results:  
Volume buttons no longer work

Expected Results:  
Volume buttons should still work
Comment 1 Erick Osorio 2016-08-30 02:21:46 UTC
This happen to changing the sound card's profile from phonon.
Comment 2 David Rosca 2016-09-21 10:45:41 UTC
Git commit 270110e5520f2ea3f2f50b0dc7e5b0e0f4647e07 by David Rosca.
Committed on 21/09/2016 at 10:45.
Pushed by drosca into branch 'Plasma/5.8'.

Make sure that default devices are not null

Sometimes at the time when default sink/source change is signalled
by pa, we don't have that device in sinks/sources list yet.
Try to update default devices also when sinks/sources are added and
deleted.

Differential Revision: https://phabricator.kde.org/D2824

M  +27   -9    src/server.cpp
M  +6    -1    src/server.h

http://commits.kde.org/plasma-pa/270110e5520f2ea3f2f50b0dc7e5b0e0f4647e07