Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Asio4All results in StreamConfigNotSupported #884

Open
YPares opened this issue May 10, 2024 · 0 comments
Open

Using Asio4All results in StreamConfigNotSupported #884

YPares opened this issue May 10, 2024 · 0 comments

Comments

@YPares
Copy link

YPares commented May 10, 2024

The following code

fn main() -> Result<(), Box<dyn Error>> {
    let host = cpal::host_from_id(cpal::HostId::Asio)?;
    let device = host
        .default_output_device()
        .ok_or("No output device available")?;
    println!("Output device: {}", device.name()?);
    let def_output_cfg = device.default_output_config()?;
    println!("{:?}", def_output_cfg);
    let stream = device.build_output_stream(
        &def_output_cfg.into(),
        move |data: &mut [f32], _: &cpal::OutputCallbackInfo| {
            println!("{}", data.len());
            // react to stream events and read or write stream data here.
        },
        move |_err| {
            // react to errors here.
        },
        None, // None=blocking, Some(Duration)=timeout
    )?;
    stream.play().unwrap();

    std::thread::sleep(std::time::Duration::from_secs(1));

    Ok(())
}

result in the following output:

Cannot connect to named pipe after wait = \\.\pipe\server_jack_default_0 err = 2
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Open error: is JACK server running?
jack_deactivate called with a NULL client
jack_deactivate called with a NULL client
jack_client_close called with a NULL client
Output device: ASIO4ALL v2
SupportedStreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Range { min: 64, max: 2048 }, sample_format: I32 }
Error: StreamConfigNotSupported
error: process didn't exit successfully: `target\debug\cpal_test.exe` (exit code: 1)

Two problems:

  • It's weird it tries to use JACK. JACK is indeed installed on my system, but I don't see why cpal would try to use both JACK and ASIO at the same time (starting the jack server makes the first errors about jack go away, but the error about StreamConfigNotSupported remains). In any case, nothing in my Asio4All config is jack-related.
  • It says the the stream config isn't supported, but I'm just using the default one, and the range seems to be OK. Asio4All works in other contexts (eg. I'm using it with Bitwig). I have nothing else using Asio4All in the meantime.
@YPares YPares changed the title Using ASIO results in StreamConfigNotSupported Using Asio4All results in StreamConfigNotSupported May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant