Skip to content

Fix malgo concurrent device initialization crash#23

Merged
ctoth merged 1 commit into
ctoth:masterfrom
akj:fix/malgo-device-init-serialization
Jun 14, 2026
Merged

Fix malgo concurrent device initialization crash#23
ctoth merged 1 commit into
ctoth:masterfrom
akj:fix/malgo-device-init-serialization

Conversation

@akj

@akj akj commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Serializes malgo.InitDevice calls against the shared malgo context.
  • Prevents host backends such as PulseAudio from aborting inside ma_device_init when concurrent playback tests initialize devices at the same time.
  • Keeps playback callbacks concurrent after device initialization; only the narrow C-side init section is locked.

Test plan

  • go test ./internal/audio/malgo -count=3
  • go test ./...
  • CGO_ENABLED=0 go test ./...

@ctoth ctoth merged commit e5e9e29 into ctoth:master Jun 14, 2026
6 checks passed
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