<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - module-switch-on-port-available will only select unavailable ports when a new sink or source appears"
href="https://bugs.freedesktop.org/show_bug.cgi?id=100451#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - module-switch-on-port-available will only select unavailable ports when a new sink or source appears"
href="https://bugs.freedesktop.org/show_bug.cgi?id=100451">bug 100451</a>
from <span class="vcard"><a class="email" href="mailto:vivek@collabora.co.uk" title="Vivek Dasmohapatra <vivek@collabora.co.uk>"> <span class="fn">Vivek Dasmohapatra</span></a>
</span></b>
<pre>I don't think your analysis of what this function does matches what happens
here.
Here is some logging I added with the logic corrected per my analysis
(MSOPA lines are logging added by me):
MSOPA: no port mapping, iterating:
MSOPA: current : (null) / 0
MSOPA: candidate: analog-output / 9900
MSOPA: no port mapping, iterating:
MSOPA: current : analog-output / 9900
MSOPA: candidate: analog-output-speaker / 10000
MSOPA: no port mapping, iterating:
MSOPA: current : analog-output-speaker / 10000
MSOPA: candidate: analog-output-headphones / 9000
MSOPA: availability (0) is UNKNOWN, would return NULL // this is where we would
have returned
MSOPA: picking port analog-output-speaker on (null)
MSOPA: Change initial port for sink alsa_output.pci-0000_00_1f.3.analog-stereo?
(0xc1bd50)
Switching initial port for sink 'alsa_output.pci-0000_00_1f.3.analog-stereo' to
'analog-output-speaker'
MSOPA: no port mapping, iterating:
MSOPA: current : (null) / 0
MSOPA: candidate: analog-output / 9900
MSOPA: no port mapping, iterating:
MSOPA: current : analog-output / 9900
MSOPA: candidate: analog-output-speaker / 10000
MSOPA: no port mapping, iterating:
MSOPA: current : analog-output-speaker / 10000
MSOPA: candidate: analog-output-headphones / 9000
MSOPA: availability (0) is UNKNOWN, returning NULL (original logic)
MSOPA: Change initial port for sink alsa_output.pci-0000_00_1f.3.analog-stereo?
((nil))
MSOPA: Leaving initial port for alsa_output.pci-0000_00_1f.3.analog-stereo
alone
Shortly thereafter , with the original logic, PA says this
[pulseaudio] module-device-restore.c: Database contains invalid data for key:
sink:alsa_output.pci-0000_00_1f.3.analog-stereo:null
Whereas with the fixed logic:
[pulseaudio] module-device-restore.c: Restoring volume for sink
alsa_output.pci-0000_00_1f.3.analog-stereo: front-left: 49145 / 75%,
front-right: 49145 / 75%
[pulseaudio] module-device-restore.c: Restoring mute state for sink
alsa_output.pci-0000_00_1f.3.analog-stereo.
Net result: with the inverted logic volume and mute state are restored on
reboot on this laptop, with the original logic they are not.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>