Opening a stream with the default input config is unsupported

Đang mở
#657 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
audio-video-rtc, backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

host - coreaudio platform - macos

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(())
}
Ngôn ngữ chính
Rust
Star
4k
Fork
554
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RustAudio/cpal

Tất cả issue của RustAudio/cpal

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.