[Task Manager] Consider parent PID for audio stream
ClosedPublic

Authored by broulik on Dec 11 2019, 9:34 AM.

Details

Summary

For modern web browsers, the audio stream isn't owned by the same process as the window, making the mapping fail.
When no PID is find for a window, check the streams, whether the PID might be actually the parent PID.

Test Plan
  • I get audio indicator on Chrome again

Effectively KSysGuard is called 3 times here (once for every of my 3 streams) as the ppid is cached, taking ~10ms

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Dec 11 2019, 9:34 AM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 11 2019, 9:34 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Dec 11 2019, 9:34 AM
broulik edited the test plan for this revision. (Show Details)
hein added a comment.Dec 17 2019, 3:51 PM

Just as a sanity check: libtm knows the pid for a window. Have you checked if there might be a faster way of doing this by checking if the stream pid is among its children?

I have not. Given a browser window typically has dozens of children whereas you typically have few audio streams, I think if any it will be slower.

hein accepted this revision.Dec 18 2019, 4:41 PM
This revision is now accepted and ready to land.Dec 18 2019, 4:41 PM
This revision was automatically updated to reflect the committed changes.