-
Notifications
You must be signed in to change notification settings - Fork 477
Open
Description
Summary
On Windows ASIO, host.output_devices() behaves differently depending on whether the iterator is collected first.
- Iterating directly prints all devices.
- Collecting into
Vec<_>first, then iterating, only prints the first device.
collect should not change the visible device set.
Environment
- cpal:
0.17.1 - OS: Windows (x64)
- Backend: ASIO (
cpal::HostId::Asio) - Devices in my setup:
Focusrite USB ASIORealtek ASIOUSB DAC ASIO
Minimal Repro
use anyhow::Result;
use cpal::traits::{DeviceTrait, HostTrait};
fn list_output_devices() -> Result<()> {
let host = cpal::host_from_id(cpal::HostId::Asio)?;
let devices = host.output_devices()?;
// let devices = devices.collect::<Vec<_>>();
for device in devices {
println!("{}", device.description()?);
}
Ok(())
}
fn main() -> Result<()> {
list_output_devices()
}Actual Behavior
Without collect:
Focusrite USB ASIO
Realtek ASIO
USB DAC ASIO
With:
let devices = devices.collect::<Vec<_>>();Only the first device is printed:
Focusrite USB ASIO
Expected Behavior
Both versions should enumerate the same set of devices (all 3 in this environment).
Related
Possibly related to ASIO enumeration/lifetime behavior in #798 (this repro is single-threaded and triggered by collecting Device values).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels