frontend-common: prefer jack on linux
This commit is contained in:
parent
101a0fc062
commit
62499865fa
3 changed files with 7 additions and 2 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1122,6 +1122,7 @@ dependencies = [
|
||||||
"core-foundation-sys 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-foundation-sys 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"coreaudio-rs",
|
"coreaudio-rs",
|
||||||
"dasp_sample",
|
"dasp_sample",
|
||||||
|
"jack",
|
||||||
"jni",
|
"jni",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"libc",
|
"libc",
|
||||||
|
|
|
@ -15,7 +15,7 @@ wgpu = ["gb-emu-lib/wgpu-renderer"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
gb-emu-lib = { workspace = true }
|
gb-emu-lib = { workspace = true }
|
||||||
gilrs = "0.10"
|
gilrs = "0.10"
|
||||||
cpal = "0.15"
|
cpal = { version = "0.15", features = ["jack"] }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
nokhwa = { version = "0.10", features = [
|
nokhwa = { version = "0.10", features = [
|
||||||
"input-avfoundation",
|
"input-avfoundation",
|
||||||
|
|
|
@ -10,7 +10,11 @@ use crate::access_config;
|
||||||
const DOWNSAMPLE_TYPE: DownsampleType = DownsampleType::ZeroOrderHold;
|
const DOWNSAMPLE_TYPE: DownsampleType = DownsampleType::ZeroOrderHold;
|
||||||
|
|
||||||
pub fn create_output(muted: bool) -> (AudioOutput, Stream) {
|
pub fn create_output(muted: bool) -> (AudioOutput, Stream) {
|
||||||
let host = cpal::default_host();
|
let host = if cfg!(target_os = "linux") {
|
||||||
|
cpal::host_from_id(cpal::HostId::Jack).unwrap_or_else(|_| cpal::default_host())
|
||||||
|
} else {
|
||||||
|
cpal::default_host()
|
||||||
|
};
|
||||||
|
|
||||||
let device = host
|
let device = host
|
||||||
.default_output_device()
|
.default_output_device()
|
||||||
|
|
Loading…
Add table
Reference in a new issue