kvm/internal/audio
Alex P ac568c7bbf Fix HDMI hotplug crash by releasing mutex during blocking ALSA I/O
When HDMI is unplugged during active audio capture, the blocking
snd_pcm_readi() call was holding the mutex, preventing clean shutdown.
This caused snd_pcm_drop() to race with the blocking read, leading to
undefined behavior and crashes.

Solution mirrors PiKVM's approach:
- Release mutex before snd_pcm_readi()/snd_pcm_writei()
- Reacquire mutex after I/O completes
- Verify handle and stop flag before proceeding

This allows snd_pcm_drop() to immediately abort pending I/O when the
device is closed, ensuring clean shutdown during HDMI hotplug events.
2025-11-21 16:50:35 +02:00
..
c Fix HDMI hotplug crash by releasing mutex during blocking ALSA I/O 2025-11-21 16:50:35 +02:00
cgo_source.go Integrate libspeexdsp for high-quality audio resampling 2025-11-21 16:29:02 +02:00
cgo_source_stub.go Simplify audio management 2025-11-17 22:21:47 -06:00
relay.go Simplify audio configuration and error handling 2025-11-21 00:54:32 +02:00
source.go Integrate libspeexdsp for high-quality audio resampling 2025-11-21 16:29:02 +02:00