Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Issue 15203009: posix thread: Attempt to set audio threads to real time. (Closed)

Created:
7 years, 7 months ago by dgreid
Modified:
7 years, 6 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, sail+watch_chromium.org, DaleCurtis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

posix thread: Attempt to set audio threads to real time. Set the scheduling class of audio threads to SCHED_RR if possible. If not, fall back to setting the nice level. Setting the thread to real time helps when playing/recording low latency audio. Also changing the scheduler keeps audio threads from being limited by bandwidth limits placed on background tabs, those apply to SCHED_OTHER threads only. The rest of the process will be limited by these, only the audio threads will have high priority. This still isn't perfect, youtube will occasionally glitch on arm, either because of video decode or maybe a thread audio is dependent on that isn't real time. BUG=chromium:213118 TEST=check audio thread priorities with ps, see that they are set. Play audio from grooveshark or youtube in the background while loading other tabs and listen for dropouts. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203896

Patch Set 1 #

Total comments: 6

Patch Set 2 : move to new platform_thread_linux #

Total comments: 2

Patch Set 3 : Add DHCHECK for rt prio success on cros #

Total comments: 4

Patch Set 4 : switch back from dcheck to return for cros #

Patch Set 5 : braces for if. #

Total comments: 11

Patch Set 6 : remove log and extra chromeos return #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -2 lines) Patch
M base/threading/platform_thread_linux.cc View 1 2 3 4 5 2 chunks +15 lines, -2 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
dgreid
This will do nothing on desktop linux unless the user has allowed the chrome process ...
7 years, 7 months ago (2013-05-17 18:53:41 UTC) #1
Chris Rogers
On 2013/05/17 18:53:41, dgreid wrote: > This will do nothing on desktop linux unless the ...
7 years, 7 months ago (2013-05-17 19:21:03 UTC) #2
dgreid
All the OS side changes for ChomeOS to allow this are ready to land.
7 years, 7 months ago (2013-05-23 16:58:04 UTC) #3
DaveMoore
https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (right): https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc#newcode70 base/threading/platform_thread_posix.cc:70: #if defined(OS_LINUX) If we're doing something different on OS_CHROMEOS ...
7 years, 7 months ago (2013-05-23 17:20:15 UTC) #4
dgreid
https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (right): https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc#newcode70 base/threading/platform_thread_posix.cc:70: #if defined(OS_LINUX) On 2013/05/23 17:20:16, DaveMoore wrote: > If ...
7 years, 7 months ago (2013-05-23 17:24:46 UTC) #5
DaveMoore
https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (right): https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc#newcode70 base/threading/platform_thread_posix.cc:70: #if defined(OS_LINUX) Then I think we should explicitly avoid ...
7 years, 7 months ago (2013-05-23 18:21:12 UTC) #6
dgreid
also all this code was moved yesterday, I'll update the patch to reflect that shortly. ...
7 years, 7 months ago (2013-05-23 18:36:28 UTC) #7
piman
On Fri, May 17, 2013 at 11:53 AM, <dgreid@chromium.org> wrote: > Reviewers: DaveMoore, Chris Rogers, ...
7 years, 7 months ago (2013-05-23 19:34:44 UTC) #8
dgreid
On 2013/05/23 19:34:44, piman wrote: > On Fri, May 17, 2013 at 11:53 AM, <mailto:dgreid@chromium.org> ...
7 years, 7 months ago (2013-05-23 20:03:49 UTC) #9
DaveMoore
https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (right): https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc#newcode70 base/threading/platform_thread_posix.cc:70: #if defined(OS_LINUX) It's at best misleading, and at worst ...
7 years, 7 months ago (2013-05-23 20:16:30 UTC) #10
dgreid
https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (right): https://codereview.chromium.org/15203009/diff/1/base/threading/platform_thread_posix.cc#newcode70 base/threading/platform_thread_posix.cc:70: #if defined(OS_LINUX) On 2013/05/23 20:16:31, DaveMoore wrote: > It's ...
7 years, 7 months ago (2013-05-23 20:37:49 UTC) #11
DaveMoore
Testing all the way into Chrome could be tricky as you say. Perhaps a standalone ...
7 years, 7 months ago (2013-05-23 20:50:02 UTC) #12
dgreid
On 2013/05/23 20:50:02, DaveMoore wrote: > Testing all the way into Chrome could be tricky ...
7 years, 7 months ago (2013-05-24 03:09:42 UTC) #13
DaveMoore
lgtm
7 years, 6 months ago (2013-05-28 18:32:12 UTC) #14
DaleCurtis
I defer to our Linux experts for correctness review. One suggestion though. https://codereview.chromium.org/15203009/diff/14001/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc ...
7 years, 6 months ago (2013-05-28 19:15:24 UTC) #15
dgreid
https://codereview.chromium.org/15203009/diff/14001/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/15203009/diff/14001/base/threading/platform_thread_linux.cc#newcode86 base/threading/platform_thread_linux.cc:86: if (pthread_setschedparam(pthread_self(), SCHED_RR, &sched_param) == 0) { On 2013/05/28 ...
7 years, 6 months ago (2013-05-28 20:29:42 UTC) #16
piman
https://codereview.chromium.org/15203009/diff/13002/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/15203009/diff/13002/base/threading/platform_thread_linux.cc#newcode89 base/threading/platform_thread_linux.cc:89: return; nit: need braces if the clause takes multiple ...
7 years, 6 months ago (2013-05-28 21:58:56 UTC) #17
dgreid
https://codereview.chromium.org/15203009/diff/13002/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/15203009/diff/13002/base/threading/platform_thread_linux.cc#newcode89 base/threading/platform_thread_linux.cc:89: return; On 2013/05/28 21:58:56, piman wrote: > nit: need ...
7 years, 6 months ago (2013-05-28 22:18:53 UTC) #18
piman
LGTM, but I'm not an OWNER.
7 years, 6 months ago (2013-05-28 22:21:55 UTC) #19
dgreid
add some more owners
7 years, 6 months ago (2013-05-29 00:55:04 UTC) #20
jar (doing other things)
https://codereview.chromium.org/15203009/diff/18002/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/15203009/diff/18002/base/threading/platform_thread_linux.cc#newcode78 base/threading/platform_thread_linux.cc:78: #ifndef OS_NACL nit: To make this a bit more ...
7 years, 6 months ago (2013-05-29 02:07:03 UTC) #21
dgreid
https://codereview.chromium.org/15203009/diff/18002/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/15203009/diff/18002/base/threading/platform_thread_linux.cc#newcode78 base/threading/platform_thread_linux.cc:78: #ifndef OS_NACL On 2013/05/29 02:07:04, jar wrote: > nit: ...
7 years, 6 months ago (2013-05-29 18:52:34 UTC) #22
jar (doing other things)
https://codereview.chromium.org/15203009/diff/18002/base/threading/platform_thread_linux.cc File base/threading/platform_thread_linux.cc (right): https://codereview.chromium.org/15203009/diff/18002/base/threading/platform_thread_linux.cc#newcode78 base/threading/platform_thread_linux.cc:78: #ifndef OS_NACL On 2013/05/29 18:52:34, dgreid wrote: > On ...
7 years, 6 months ago (2013-05-30 18:15:25 UTC) #23
dgreid
Thanks for the comments, I also found a way to add a test that the ...
7 years, 6 months ago (2013-05-30 18:59:21 UTC) #24
jar (doing other things)
lgtm
7 years, 6 months ago (2013-05-31 02:39:00 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dgreid@chromium.org/15203009/34001
7 years, 6 months ago (2013-06-03 21:34:34 UTC) #26
commit-bot: I haz the power
7 years, 6 months ago (2013-06-04 07:26:54 UTC) #27
Message was sent while issue was closed.
Change committed as 203896

Powered by Google App Engine
This is Rietveld 408576698