Skip to content

AudioDeviceManager: Fix a hang when a device reports a zero buffer size - #1703

Open
emezeske wants to merge 1 commit into
juce-framework:developfrom
emezeske:pr/audiodevicemanager-zero-buffer-size-hang
Open

AudioDeviceManager: Fix a hang when a device reports a zero buffer size#1703
emezeske wants to merge 1 commit into
juce-framework:developfrom
emezeske:pr/audiodevicemanager-zero-buffer-size-hang

Conversation

@emezeske

@emezeske emezeske commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

The audio thread spins forever and the application stops producing audio, when a device reports a current buffer size of 0. The JACK backend does this while its client is unavailable, so an ordinary mid-reconfiguration moment is enough to trigger it.

CallbackMaxSizeEnforcer's chunking loop computes a block length of 0 from that and never advances.

With this change the enforcer emits a silent block instead and recovers on the next audioDeviceAboutToStart(), which restores the real block size.

@emezeske
emezeske marked this pull request as ready for review August 10, 2026 20:06
@juce-push-bot

Copy link
Copy Markdown
Collaborator

This pull request has been mentioned on The JUCE Forum. There might be relevant details there:

https://forum.juce.com/t/pr-audiodevicemanager-fix-a-hang-when-a-device-reports-a-zero-buffer-size/69278/1

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.

2 participants