Comment 8 for bug 1040873

Thiago Martins (tcmartins) wrote :

I think I'm making some progress in a workaround for the sleep issue.

The issue (sound missing after wakeup) seems to manifest itself only when the machine is suspended *after* a user pin reconfigure. Since the reconfigure interface is still labeled as an "experimental feature", I wouldn't be surprised if there was a problem with it. We should probably create a bug report for that as well.

Apparently, just by reissuing the reconfigure commands again you can have a working sound. The problem is, of course, pulseaudio won't let you touch the reconfigure interface. So, the solution I found was to write an /etc/pm/sleep.d that temporarily kills pulseaudio, reload user pin configs (surprisingly, the values are already present in user_pin_configs, but must be rewritten) and then reloads pulseaudio.

A few issues:

- There's an audible loud "click" noise when the pins are reconfigured. It probably is a good idea to mute the audio before performing the reconfiguration, just like the old /usr/lib/pm-utils/sleep.d/01PulseAudio (in fact I already borrowed heavily from that script).

- There's a potential racing condition here. If pulseaudio ever reloads before the pin reconfiguration (autospawn makes this a possibility), the whole thing fails.

Anyway, here's my script. I hope it helps.