<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - HDMI output source not remembered"
href="https://bugs.freedesktop.org/show_bug.cgi?id=100064#c31">Comment # 31</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - HDMI output source not remembered"
href="https://bugs.freedesktop.org/show_bug.cgi?id=100064">bug 100064</a>
from <span class="vcard"><a class="email" href="mailto:marejde@gmail.com" title="Martin Ejdestig <marejde@gmail.com>"> <span class="fn">Martin Ejdestig</span></a>
</span></b>
<pre>(In reply to Tanu Kaskinen from <a href="show_bug.cgi?id=100064#c28">comment #28</a>)
<span class="quote">> I suspect that the "extra" pulseaudio instance overwrites the database.
> Things might happen like this:
>
> Instance 1 (the "real" instance) starts.
>
> You change the output to HDMI 3, and preferred_output_port is written to the
> database, but the database is not written on disk yet (there's a 10 second
> delay).
>
> You initiate logout.
>
> Instance 2 (the "extra" instance) starts (you mentioned that it seems to
> start around the time you log out). The database file that instance 2 reads
> doesn't yet contain the update.
>
> Instance 1 exits and writes the database on disk. The update is now on the
> disk.
>
> Instance 2 exits and writes the database on disk. The update is now lost,
> because instance 2 was not aware of the update.</span >
I do not think this is the case. I think systemd spawns the extra instance as a
result of the first instance terminating. In the journal output in <a href="show_bug.cgi?id=100064#c12">comment 12</a>
you can see "Main process exited" first and then "Starting Sound Service...".
So it does not look like two pulseaudio instances are running at the same time.
The timestamps for when this happens is during logout though. The timestamps in
the user journal that looks like in <a href="show_bug.cgi?id=100064#c12">comment 12</a> matches "Stopped User Manager"
timestamps in the system wide journal.
<span class="quote">> If instance 2 always starts when you log out, you could try waiting for at
> least 10 seconds before logging out after changing the output to HDMI 3. The
> theory is that the extra instance will then read the up-to-date database,
> and not overwrite it with old data.</span >
Looking at the latest log I can see:
( 21.405| 0.000) D: [pulseaudio] module-card-restore.c: foobar -
alsa_card.pci-0000_01_00.1: Storing preferred_output_port = hdmi-output-2 in
the database.
and:
( 36.710| 3.415) D: [pulseaudio] module-x11-xsmp.c: Got die message from
XSMP.
~14s between db write and logout? I tried a couple of times more just now and
waited >> 10s but same result.
<span class="quote">> Also, you mentioned that you saw this in the journal:
>
> ICE default IO error handler doing an exit(), pid = 31127, errno = 32
>
> According to the internet[1], you can get rid of that error by deleting
> ~/.ICEauthority. Perhaps that will stop the extra pulseaudio instance from
> starting? (I find that unlikely, though.)</span >
Yeah, did not help.
But I think systemd correctly restarts pulseaudio after the first instance
exits since it exits with a non zero exit code (see <a href="show_bug.cgi?id=100064#c12">comment 12</a>) and "Restart"
is set to "on-failure" in the service file. I have no idea why though.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>