Comment 24 for bug 1391230

Revision history for this message
Olivier Tilloy (osomon) wrote : Re: [TOPBLOCKER] web audio, pulse runs at 6% and screen will not blank on idle

> Actually, pausing the playback would release the keepDisplayOn
> request, so what we need is oxide to pause playback when stopped.

After a bit of investigation, it turns out that there is no API in chromium to request pausing all currently playing media. Even if there was one, the SIGSTOP signal can’t be caught anyway.

Quoting chriscoulson: "Requiring apps to pause their own media is broken by design anyway. what should happen is the other session bits responsible for handling it (eg, pulseaudio) should be told when a client has been stopped. Doing it any other way is quite fragile - even if an application doesn't ignore it, it could be busy with something else when it goes in to the background, so it doesn't have time to stop its media before the process is stopped"

So what we really need is for pulseaudio and unity to be notified when an app is stopped, and release the corresponding resources (audio stream, screen dim lock), to restore them when the app is continued.