Opening a stream with the default input config is unsupported
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- audio-video-rtc, backend
Research direction
Start with the attached Rust example and trace how default_input_config() produces a StreamConfig and how build_input_stream() validates it on macOS. Reproduce with the reported Scarlett Solo, macOS 12.3, and CPAL 0.15.3 setup, then inspect the comments for any existing diagnosis. Done means the reported default input configuration can open a stream, or the issue has a clear explanation of the limitation.
Written by the indexing model from the issue text.
Description
I'm trying to open an basic audio input stream, but can't seem to find any config that works, including any of the configurations that the device claims to support. Sample code is attached.
Mac OS 12.3 / CPAL 0.15.3 / Rust 1.60
Output:
Device: Ok("Scarlett Solo USB")
Config: StreamConfig { channels: 2, sample_rate: SampleRate(48000), buffer_size: Default }
thread 'main' panicked at 'Invalid stream: StreamConfigNotSupported', src/main.rs:23:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
use cpal::traits::DeviceTrait;
use cpal::traits::HostTrait;
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
let host = cpal::default_host();
let device = host
.default_input_device()
.expect("No default input device");
println!("Device: {:?}", device.name());
let config = device
.default_input_config()
.expect("No default input config")
.config();
println!("Config: {:?}", config);
let stream = device
.build_input_stream(&config, |data: &[i16], callback_info| {}, |error| {})
.expect("Invalid stream");
Ok(())
}
- Dominant language
- Rust
- Stars
- 4k
- Forks
- 554
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RustAudio/cpal
-
API design
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
correctness
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
aaudio: dynamic buffer tuning never grows the buffer (set_buffer_size_in_frames reports Err on success)Possibly taken @dannyward630 claimed this 39 days ago. Openhost - aaudio platform - android
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
-
WebAudio wasm build fails with wasm-bindgen panic=unwind closuresPossibly taken @bogusyogi claimed this 48 days ago. Openhost - webaudio platform - web
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
PipeWire: dropping callback captures on the realtime worker can terminate the process with SIGXCPUOpenhost - pipewire platform - linux
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
ci: migrate pinned macos-15 runners to macos-26 and macos-26-intelPossibly taken @hawkingrei claimed this today. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
nowledge-co/hawdb#2224 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-score/coverage_tool#95 ·
Maintainers usually reply within 2 days
-
bug nvim
Difficulty 2/5 1-3 hours Newbie friendliness 74/100