[pulseaudio-tickets] [Bug 100064] HDMI output source not remembered

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Mar 9 17:14:47 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=100064

--- Comment #31 from Martin Ejdestig <marejde at gmail.com> ---
(In reply to Tanu Kaskinen from comment #28)
> 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.

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 comment 12
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 comment 12 matches "Stopped User Manager"
timestamps in the system wide journal. 

> 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.

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.

> 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.)

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 comment 12) and "Restart"
is set to "on-failure" in the service file. I have no idea why though.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20170309/c40e9126/attachment.html>


More information about the pulseaudio-bugs mailing list