Skip to content

Feature: Adding support for retrieval of ASIO channel names - 0.3.1 - #1303

Open
SpruceCloud wants to merge 2 commits into
RustAudio:masterfrom
SpruceCloud:feat/asio-sys-channel-info-0.3.1
Open

Feature: Adding support for retrieval of ASIO channel names - 0.3.1#1303
SpruceCloud wants to merge 2 commits into
RustAudio:masterfrom
SpruceCloud:feat/asio-sys-channel-info-0.3.1

Conversation

@SpruceCloud

Copy link
Copy Markdown

No description provided.

SpruceCloud and others added 2 commits August 10, 2026 19:28
An ASIO driver names its channels, and for aggregating drivers such as
ASIO4ALL — which concatenates the channels of whichever WDM devices are
enabled in its control panel — those names are the only stable way to map
a channel index to physical hardware. The channel count and ordering can
change between sessions, so a host that persists "output channels 4 and 5"
may address a different pair of speakers on the next launch.

`asio-sys` already called `ASIOGetChannelInfo`, but only privately, and
`stream_data_type` discarded everything but channel 0's sample type.

Add `ChannelInfo` plus `input_channel_info`, `output_channel_info`,
`input_channel_infos` and `output_channel_infos` on `Driver`, whose
existence already proves the driver is loaded and initialised. Index bounds
are checked before calling into the SDK, since drivers are not required to
validate them. `sample_type` is an `Option` rather than reusing
`stream_data_type`'s `expect`, so an unfamiliar format enum cannot panic a
name lookup.

Purely additive: no signature or behaviour changes to existing items.

Verified with `cargo run --example enumerate` against ASIO4ALL v2, which
reports the underlying WDM pin names ("HD Audio output 1", ...).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bump `asio-sys` to 0.3.1 for the additive `ChannelInfo` API, update cpal's
dependency lower bound to match, and record the change in the changelog.

Use `i32` rather than `c_long` in the new public signatures, matching the
convention adopted for the rest of the public surface in 0.3.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant