Skip to content

Commit

Permalink
Bug 1561681 - Change log level for audio thread promotion related-mes…
Browse files Browse the repository at this point in the history
…sages. r=kinetik

Differential Revision: https://phabricator.services.mozilla.com/D36077
  • Loading branch information
padenot committed Jun 26, 2019
1 parent b842703 commit 9d2ac4f
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion media/audioipc/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ libc = "0.2"
log = "0.4"
tokio-core = "0.1"
tokio-uds = "0.1.7"
audio_thread_priority = "0.14.0"
audio_thread_priority = "0.15.0"
lazy_static = "1.2.0"
cfg-if = "0.1.0"
4 changes: 2 additions & 2 deletions media/audioipc/client/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ fn open_server_stream() -> Result<audioipc::MessageStream> {
fn register_thread(callback: Option<extern "C" fn(*const ::std::os::raw::c_char)>) {
match promote_current_thread_to_real_time(0, 48000) {
Ok(_) => {
debug!("Audio thread promoted to real-time.");
info!("Audio thread promoted to real-time.");
}
Err(_) => {
error!("Could not promote thread to real-time.");
warn!("Could not promote thread to real-time.");
}
}
if let Some(func) = callback {
Expand Down
2 changes: 1 addition & 1 deletion media/audioipc/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ cfg_if! {
});
}
Err(_) => {
error!("Could not promote audio threads to real-time during initialization.");
warn!("Could not promote audio threads to real-time during initialization.");
}
}
let thr = thread::current();
Expand Down
2 changes: 1 addition & 1 deletion media/audioipc/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ slab = "0.3.0"
futures = "0.1.18"
tokio-core = "0.1"
tokio-uds = "0.1.7"
audio_thread_priority = "0.14.0"
audio_thread_priority = "0.15.0"

[dependencies.error-chain]
version = "0.11.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"Cargo.toml":"10c60cb364a7cad185590c6ca242413d11f4aa345d74c4ab2058f4a08543f626","Makefile":"8c6b9e8afffb14ae03f9cd95bc7d6011c8b4fe01c474aef17360e3f0c4d202ad","README.md":"bcfa4948edf52fdacd485200a0c1c886a92232cc1931eeb4e1044050f46ec253","audio_thread_priority.h":"880889a154283a87cf84218cc4d6b2b9dd2c8fd09adc6d38f527b08ccd0c6168","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"d1e04bc2901472ce98be1a79b6844b49e38598eda3e4f8c0e7b08c5b33247375","src/mach_sys.rs":"352560fcb9b41d877cff92e5b3b04d6dc68b1f30508ce4b9aed78940120a883e","src/rt_linux.rs":"2b3ee3b42690a050cd50f5b4056160bd4e7241b53409dab188511e6647b8b956","src/rt_mach.rs":"353c768775e1ac7daf9464d0a63ecc002f1e317ce00a835b63900bc036bedda2","src/rt_win.rs":"41fcdb22a9e7f5b6b389bb0791324bccbaecf8523dbef62b224a81d37e780039"},"package":"7877982e3b4ef1d5ed4039d2bb74c2fe08a3a6c4996b5b49f58e9016e3c2b762"}
{"files":{"Cargo.toml":"4c85ca3ce6ee93571667a430f548a1c9e73cfa621b2dac9fffa35bf280a90d9e","Makefile":"8c6b9e8afffb14ae03f9cd95bc7d6011c8b4fe01c474aef17360e3f0c4d202ad","README.md":"bcfa4948edf52fdacd485200a0c1c886a92232cc1931eeb4e1044050f46ec253","audio_thread_priority.h":"880889a154283a87cf84218cc4d6b2b9dd2c8fd09adc6d38f527b08ccd0c6168","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"d1e04bc2901472ce98be1a79b6844b49e38598eda3e4f8c0e7b08c5b33247375","src/mach_sys.rs":"352560fcb9b41d877cff92e5b3b04d6dc68b1f30508ce4b9aed78940120a883e","src/rt_linux.rs":"238264f4a3e010743ea2f44b3b13cb912f2b57786cd97e583575415d7e84b6b2","src/rt_mach.rs":"381f709a59d21031caf70e1bf4e9c26cd25fd3d2618ae0d91c1fbc236ce519ca","src/rt_win.rs":"f8f5b7af21cadd686cf7d8099d1972d3265c3889574020bd4ea088b832fbfa51"},"package":"047460864ea9f62fbdfb80fc04a2e5d844aef9e50727e6e9730ca58d9f1a9267"}
2 changes: 1 addition & 1 deletion third_party/rust/audio_thread_priority/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

[package]
name = "audio_thread_priority"
version = "0.14.0"
version = "0.15.0"
authors = ["Paul Adenot <paul@paul.cx>"]
description = "Bump a thread to real-time priority, for audio work, on Linux, Windows and macOS"
license = "MPL-2.0"
Expand Down
4 changes: 2 additions & 2 deletions third_party/rust/audio_thread_priority/src/rt_linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub fn promote_current_thread_to_real_time_internal(audio_buffer_frames: u32,
let handle = RtPriorityHandleInternal { pthread_id, policy, param};
let r = make_realtime(thread_id, budget_us, RT_PRIO_DEFAULT);
if r.is_err() {
error!("Could not make thread real-time.");
warn!("Could not make thread real-time.");
return Err(());
}
return Ok(handle);
Expand All @@ -124,7 +124,7 @@ pub fn demote_current_thread_from_real_time_internal(rt_priority_handle: RtPrior
if unsafe { libc::pthread_setschedparam(rt_priority_handle.pthread_id,
rt_priority_handle.policy,
&rt_priority_handle.param) } < 0 {
error!("could not demote thread {}", rt_priority_handle.pthread_id);
warn!("could not demote thread {}", rt_priority_handle.pthread_id);
return Err(());
}
return Ok(());
Expand Down
6 changes: 3 additions & 3 deletions third_party/rust/audio_thread_priority/src/rt_mach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ pub fn demote_current_thread_from_real_time_internal(rt_priority_handle: RtPrior
thread_policy_t,
THREAD_TIME_CONSTRAINT_POLICY_COUNT!());
if rv != KERN_SUCCESS as i32 {
error!("thread demotion error: thread_policy_set: RT");
warn!("thread demotion error: thread_policy_set: RT");
return Err(());
}

info!("thread {} priority restored.", h.tid);
warn!("thread {} priority restored.", h.tid);
}

return Ok(());
Expand Down Expand Up @@ -138,7 +138,7 @@ pub fn promote_current_thread_to_real_time_internal(audio_buffer_frames: u32,
(&mut time_constraints) as *mut _ as thread_policy_t,
THREAD_TIME_CONSTRAINT_POLICY_COUNT!());
if rv != KERN_SUCCESS as i32 {
error!("thread promotion error: thread_policy_set: time_constraint");
warn!("thread promotion error: thread_policy_set: time_constraint");
return Err(());
}

Expand Down
4 changes: 2 additions & 2 deletions third_party/rust/audio_thread_priority/src/rt_win.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn demote_current_thread_from_real_time_internal(rt_priority_handle: RtPrior
unsafe {
let rv = AvRevertMmThreadCharacteristics(rt_priority_handle.task_handle);
if rv == 0 {
error!("Unable to restore the thread priority ({})", GetLastError());
warn!("Unable to restore the thread priority ({})", GetLastError());
return Err(())
}
}
Expand All @@ -46,7 +46,7 @@ pub fn promote_current_thread_to_real_time_internal(_audio_buffer_frames: u32,
handle.task_handle = AvSetMmThreadCharacteristicsA("Audio\0".as_ptr() as _, &mut handle.mmcss_task_index);

if handle.task_handle.is_null() {
error!("Unable to use mmcss to bump the thread priority ({})", GetLastError());
warn!("Unable to use mmcss to bump the thread priority ({})", GetLastError());
return Err(())
}
}
Expand Down
2 changes: 1 addition & 1 deletion toolkit/library/rust/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bitsdownload = { path = "../../../components/bitsdownload", optional = true }
storage = { path = "../../../../storage/rust" }
bookmark_sync = { path = "../../../components/places/bookmark_sync", optional = true }
shift_or_euc_c = "0.1.0"
audio_thread_priority = "0.14.0"
audio_thread_priority = "0.15.0"

[build-dependencies]
rustc_version = "0.2"
Expand Down

0 comments on commit 9d2ac4f

Please sign in to comment.