Commit 42a128b7 authored by Max Morin's avatar Max Morin Committed by Commit Bot

Reenable realtime audio threads on 2-core Chrome OS.

Workaround shouldn't be needed anymore after crrev.com/530835.
Reenabling realtime priority should reduce audio glitches.

This really shouldn't cause any regressions, but adding the old
bugs as FYI just in case.

Bug: 754213,734490,710245,770312,803419
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I2f7c6c793fade47a205a896a25468a7312ba55de
Reviewed-on: https://chromium-review.googlesource.com/913272Reviewed-by: default avatarOlga Sharonova <olka@chromium.org>
Commit-Queue: Max Morin <maxmorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536069}
parent c1edeaaa
......@@ -9,22 +9,6 @@
#include "base/logging.h"
#include "base/sys_info.h"
namespace {
base::ThreadPriority GetAudioThreadPriority() {
#if defined(OS_CHROMEOS)
// On Chrome OS, there are priority inversion issues with having realtime
// threads on systems with only two cores, see crbug.com/710245.
return base::SysInfo::NumberOfProcessors() > 2
? base::ThreadPriority::REALTIME_AUDIO
: base::ThreadPriority::NORMAL;
#else
return base::ThreadPriority::REALTIME_AUDIO;
#endif
}
} // namespace
namespace media {
// AudioDeviceThread::Callback implementation
......@@ -66,8 +50,9 @@ AudioDeviceThread::AudioDeviceThread(Callback* callback,
base::SyncSocket::Handle socket,
const char* thread_name)
: callback_(callback), thread_name_(thread_name), socket_(socket) {
CHECK(base::PlatformThread::CreateWithPriority(0, this, &thread_handle_,
GetAudioThreadPriority()));
CHECK(base::PlatformThread::CreateWithPriority(
0, this, &thread_handle_, base::ThreadPriority::REALTIME_AUDIO));
DCHECK(!thread_handle_.is_null());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment