qemu-e2k/audio
Akihiko Odaki eb1a35e47a coreaudio: Lock only the buffer
On macOS 11.3.1, Core Audio calls AudioDeviceIOProc after calling an
internal function named HALB_Mutex::Lock(), which locks a mutex in
HALB_IOThread::Entry(void*). HALB_Mutex::Lock() is also called in
AudioObjectGetPropertyData, which is called by coreaudio driver.
Therefore, a deadlock will occur if coreaudio driver calls
AudioObjectGetPropertyData while holding a lock for a mutex and tries
to lock the same mutex in AudioDeviceIOProc.

audioDeviceIOProc, which implements AudioDeviceIOProc in coreaudio
driver, requires an exclusive access for the device configuration and
the buffer. Fortunately, a mutex is necessary only for the buffer in
audioDeviceIOProc because a change for the device configuration occurs
only before setting up AudioDeviceIOProc or after stopping the playback
with AudioDeviceStop.

With this change, the mutex owned by the driver will only be used for
the buffer, and the device configuration change will be protected with
the implicit iothread mutex.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-id: 20210622201740.38005-1-akihiko.odaki@gmail.com
Message-Id: <20210622201740.38005-1-akihiko.odaki@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-06-23 14:16:48 +02:00
..
alsaaudio.c alsaaudio: remove #ifdef DEBUG to avoid bit rot 2021-06-17 11:54:09 +02:00
audio_int.h audio: move code to audio/audio.c 2021-06-17 11:54:09 +02:00
audio_legacy.c
audio_template.h audio: space prohibited between function name and parenthesis'(' 2021-01-15 11:49:26 +01:00
audio_win_int.c dsoundaudio: fix log message 2021-01-15 11:25:22 +01:00
audio_win_int.h
audio.c audio: Fix format specifications of debug logs 2021-06-17 11:56:57 +02:00
audio.h
coreaudio.c coreaudio: Lock only the buffer 2021-06-23 14:16:48 +02:00
dsound_template.h
dsoundaudio.c audio: Don't use '%#' in format strings 2021-01-15 11:49:26 +01:00
jackaudio.c jackaudio: avoid that the client name contains the word (NULL) 2021-06-17 11:54:09 +02:00
meson.build
mixeng_template.h
mixeng.c
mixeng.h
noaudio.c
ossaudio.c audio: Add braces for statements/fix braces' position 2021-01-15 11:49:26 +01:00
paaudio.c audio: move code to audio/audio.c 2021-06-17 11:54:09 +02:00
rate_template.h
sdlaudio.c
spiceaudio.c
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h
wavaudio.c
wavcapture.c