kvm/internal/audio
Alex P 94cab8b2ac Fix: prevent race condition crash in audio playback using pthread mutexes
Root cause: ALSA assertion failure `snd_pcm_writei: Assertion 'pcm' failed`
when pcm_playback_handle became NULL during concurrent write operations.

The crash occurred because:
1. Thread A checks pcm_playback_handle != NULL (passes)
2. Thread B calls jetkvm_audio_playback_close(), sets handle = NULL
3. Thread A calls snd_pcm_writei(NULL, ...) → SIGABRT

Solution: Added pthread mutexes to protect concurrent access:
- playback_mutex protects pcm_playback_handle in decode_write and close
- capture_mutex protects pcm_capture_handle in read_encode and close

All critical sections now acquire mutex before accessing ALSA handles,
preventing the NULL pointer from being passed to ALSA functions.
2025-11-18 00:53:15 +02:00
..
c Fix: prevent race condition crash in audio playback using pthread mutexes 2025-11-18 00:53:15 +02:00
cgo_source.go Fix: improve EDID compatibility and add audio configuration options 2025-11-18 00:53:15 +02:00
cgo_source_stub.go Add runtime configurable audio parameters with UI controls 2025-11-17 21:51:08 +02:00
relay.go Add runtime configurable audio parameters with UI controls 2025-11-17 21:51:08 +02:00
source.go Fix: improve EDID compatibility and add audio configuration options 2025-11-18 00:53:15 +02:00