Skip to content

fix(asio): paused streams, draining timeouts and in-use drivers - #1374

Merged
roderickvd merged 4 commits into
masterfrom
fix/asio-pause-and-in-use
Sep 20, 2026
Merged

roderickvd merged 4 commits into
masterfrom
fix/asio-pause-and-in-use

Conversation

@roderickvd

Copy link
Copy Markdown
Member

@roderickvd
roderickvd force-pushed the fix/asio-pause-and-in-use branch from f4ad1f9 to 3af43da Compare September 19, 2026 14:09
@LastExceed

Copy link
Copy Markdown
Contributor

@LastExceed could you review?

Will do

@LastExceed LastExceed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 1 semantic technicality, rest LGTM

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md Outdated
- **ASIO**: Fix loading a driver while a previous driver was still unloading.
- **ASIO**: `Stream` no longer risks blocking or panicking in the driver callback while another stream is being created or destroyed.
- **ASIO**: A paused output stream now goes silent instead of looping the last buffered audio.
- **ASIO**: Building a stream while another driver is loaded now reports `DeviceBusy` instead of `DeviceNotAvailable`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this one. If I understand correctly, then the situation is basically:

this device is not available

because

another device is busy

As a user, I'd intuitively assume the error to be about the device that I am accessing, not about another which happens to be in the way. In that mindset, DeviceBusy is misleading. Knowing the inside details, I understand that DeviceBusy better expresses the cause of the problem, but from an outside perspective, DeviceNotAvailable is more representative of the resulting situation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is an interesting point, you could say that DeviceBusy is a specialisation of DeviceNotAvailable. But, from src/error.rs:

    /// The device is temporarily busy. This can happen when another application or stream
    /// is using the device. Retrying after a short delay may succeed.
    DeviceBusy,

    /// The requested audio device is not available.
    ///
    /// This can happen if the device has been disconnected while the program is running, or if
    /// the device identifier refers to a device that does not exist on this system.
    DeviceNotAvailable,

DeviceBusy seems to closer match the definition, wouldn't you agree?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The doc comment says "The device" twice. But which device? As a user I would naturally expect it to be the one I am trying to use. I might not even be aware that there is an alternative at all.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, you're right. I guess doing that still addresses #1356 sufficiently by having clarified the asio-sys error message.

@roderickvd
roderickvd force-pushed the fix/asio-pause-and-in-use branch from 45434d6 to b12a340 Compare September 20, 2026 17:12
@roderickvd
roderickvd merged commit 4d0216c into master Sep 20, 2026
37 checks passed
@roderickvd
roderickvd deleted the fix/asio-pause-and-in-use branch September 20, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants