Closed
Bug 1366359
Opened 9 years ago
Closed 4 years ago
Raise the priority of the MediaStreamGraph thread
Categories
(Core :: Audio/Video: MediaStreamGraph, enhancement, P2)
Core
Audio/Video: MediaStreamGraph
Tracking
()
RESOLVED
FIXED
People
(Reporter: ehsan.akhgari, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: stale-bug)
We currently run this thread with the default priority as far as I can tell (this is created in <https://searchfox.org/mozilla-central/rev/24c443a440104dabd9447608bd41b8766e8fc2f5/dom/media/GraphDriver.cpp#225>).
We should consider raising the priority of this thread, especially in the light of bug 1366356.
Comment 1•9 years ago
|
||
Ehsan: how do you propose we raise the priority of the thread? I presume via the nsThread priority support. (also, the threaded-driver is only used when the graph isn't connected to an output audio device (which normally runs at high OS priority), though that's not entirely relevant)
At least on Linux we generally can't raise thread priorities, only lower them.
The nsThread priority mechanism uses NSPR's priority support, which appears to only work on WindowsNT (including 7/8/10 I hope?), win95 (right), OS/2 and BeOS. If it works on windows, this may be worth doing, perhaps, but we really shouldn't be assuming it will help in general - our designs have to work without it, or be more accomodating of normal-priority defaults on other platforms.
Rank: 15
Component: Audio/Video → Audio/Video: MediaStreamGraph
Flags: needinfo?(ehsan)
Priority: -- → P1
| Reporter | ||
Comment 2•9 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #1)
> Ehsan: how do you propose we raise the priority of the thread?
Yeah that's what I meant, although I'm not sure which backend of the MSG is used in what platforms these days...
> I presume
> via the nsThread priority support. (also, the threaded-driver is only used
> when the graph isn't connected to an output audio device (which normally
> runs at high OS priority), though that's not entirely relevant)
>
> At least on Linux we generally can't raise thread priorities, only lower
> them.
>
> The nsThread priority mechanism uses NSPR's priority support, which appears
> to only work on WindowsNT (including 7/8/10 I hope?), win95 (right), OS/2
> and BeOS. If it works on windows, this may be worth doing, perhaps, but we
> really shouldn't be assuming it will help in general - our designs have to
> work without it, or be more accomodating of normal-priority defaults on
> other platforms.
The real goal here is to just use the OS threading APIs similar to bug 1366353 so that after that bug the priority of the MSG thread doesn't end up being lower than the priority of the compositor, that's all.
Flags: needinfo?(ehsan)
Comment 3•9 years ago
|
||
If audio is not being played back, we are using a regular `nsThread` to run the MSG. We could bump the prio using the system API (mmcss on windows, and other stuff for other platform, although I'm not too sure about linux desktop). Ehsan's note in comment 2 makes sense: the MSG provides the video frames to the compositor, and we risk starving the compositor if we don't bump the prio of the MSG.
If audio is being played back, then the MSG runs off the audio callback, that is already high priority (often the highest, or even a completely separate scheduler). This include pushing video frames to the compositor, so we're good in this case.
This is a P1 bug without an assignee.
P1 are bugs which are being worked on for the current release cycle/iteration/sprint.
If the bug is not assigned by Monday, 28 August, the bug's priority will be reset to '--'.
Keywords: stale-bug
Comment 5•9 years ago
|
||
Mass change P1->P2 to align with new Mozilla triage process
Priority: P1 → P2
Comment 6•4 years ago
|
||
We've been running with real-time threads for some time now, except in some cases on Linux. This is tracked separately.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•