Skip to content

If ASIO fails to load, the build crashes, but I need it to be optional #1083

@Toni997

Description

@Toni997

Hello,

I am developing an audio application and I need to have ASIO support for low-latency. So, considering that, in my cargo.toml I have "cpal = { version = "0.17.0", features = ["asio"] }". However, if it fails to download SDK or ASIO doesn't get properly loaded for whatever reason, the app just crashes and never runs. Which is not ideal for me.

Errors in my example:

error: IO error for operation on C:...\asio_sdk\host: The system cannot find the path specified. (os error 3)
error: IO error for operation on C:...\asio_sdk\host/pc: The system cannot find the path specified. (os error 3)
error: IO error for operation on C:...\asio_sdk\common: The system cannot find the path specified. (os error 3)

I don't know how this error happened, I already had ASIO SDK installed because I use FL Studio, but the folder isn't named "asio_sdk", it is "ASIOSDK". And because of that, it crashes, but I would like it to just fallback to WASAPI for example and log errors for debugging. ASIO isn't required for my application.

I know how to fix this error btw, I just set "CPAL_ASIO_DIR" env variable myself, that's not an issue.

Any ideas on how I can achieve this at the moment? Or if it might be possible in the future? Thanks for taking the time to read this. Any help is greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions