aboutsummaryrefslogtreecommitdiff
path: root/audio
AgeCommit message (Collapse)AuthorFilesLines
2021-03-16coreaudio: Handle output device changeAkihiko Odaki1-42/+164
An output device change can occur when plugging or unplugging an earphone. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210311151512.22096-3-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-16coreaudio: Extract device operationsAkihiko Odaki1-57/+80
This change prepare to support dynamic device changes, which requires to perform device initialization/deinitialization multiple times. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210311151512.22096-2-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-16coreaudio: Drop support for macOS older than 10.6Akihiko Odaki1-103/+0
Mac OS X 10.6 was released in 2009. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210311151512.22096-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-09sysemu: Let VMChangeStateHandler take boolean 'running' argumentPhilippe Mathieu-Daudé1-1/+1
The 'running' argument from VMChangeStateHandler does not require other value than 0 / 1. Make it a plain boolean. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20210111152020.1422021-3-philmd@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2021-01-15audio: space prohibited between function name and parenthesis'('Zhang Han1-6/+6
Delete spaces between function name and open parenthesis'(' Signed-off-by: Zhang Han <zhanghan64@huawei.com> Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-8-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: Suspect code indent for conditional statementsZhang Han1-1/+1
Fix code indent. Signed-off-by: Zhang Han <zhanghan64@huawei.com> Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-7-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: Don't use '%#' in format stringsZhang Han1-1/+1
Use '0x' prefix instead of '%#' Signed-off-by: Zhang Han <zhanghan64@huawei.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-6-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: Fix lines over 90 charactersZhang Han1-10/+27
Fix the line width of code. Signed-off-by: Zhang Han <zhanghan64@huawei.com> Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-5-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: foo* bar" should be "foo *bar".Zhang Han1-6/+6
transfer "foo* " to "foo *" Signed-off-by: Zhang Han <zhanghan64@huawei.com> Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-4-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: Add spaces around operator/delete redundant spacesZhang Han4-4/+4
Fix problems about spaces: -operator needs spaces around it, add them. -somespaces are redundant, remove them. Signed-off-by: Zhang Han <zhanghan64@huawei.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-3-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: Add braces for statements/fix braces' positionZhang Han6-48/+29
Fix problems about braces: -braces are necessary for all arms of if/for/while statements -else should follow close brace '}' Signed-off-by: Zhang Han <zhanghan64@huawei.com> Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-2-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15dsoundaudio: fix log messageVolker Rümelin1-1/+1
There is a mismatch between message and used argument. Change the argument from frequency to format. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-23-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15dsoundaudio: enable f32 audio sample formatVolker Rümelin1-24/+47
Enable the f32 audio sample format for the DirectSound backend. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-22-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15dsoundaudio: rename dsound_open()Volker Rümelin1-2/+2
Rename dsound_open() to dsound_set_cooperative_level(). The only task of that function is to set the cooperative level for DirectSound. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-21-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15dsoundaudio: replace GetForegroundWindow()Volker Rümelin2-2/+2
GetForegroundWindow() doesn't necessarily return the own window handle. It just returns a handle to the currently active window and can even return NULL. At the time dsound_open() gets called the active window is most likely the shell window and not the QEMU window. Replace GetForegroundWindow() with GetDesktopWindow() which always returns a valid window handle, and at the same time replace the DirectSound buffer flag DSBCAPS_STICKYFOCUS with DSBCAPS_GLOBALFOCUS where Windows only expects a valid window handle for DirectSound function SetCooperativeLevel(). The Microsoft online docs for IDirectSound::SetCooperativeLevel recommend this in the remarks. This fixes a bug where you can't hear sound from the guest. To reproduce start qemu with -machine pcspk-audiodev=audio0 -device intel-hda -device hda-duplex,audiodev=audio0 -audiodev dsound,id=audio0,out.mixing-engine=off from a shell and start audio playback with the hda device in the guest. The guest will be silent. To hear guest audio you have to activate the shell window once. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-20-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15paaudio: send recorded data in smaller chunksVolker Rümelin1-2/+3
Tell PulseAudio to send recorded audio data in smaller chunks than timer_period, so there's a good chance that qemu can read recorded audio data every time it looks for new data. PulseAudio tries to send buffer updates at a fragsize / 2 rate. With fragsize = timer_period / 2 * 3 the update rate is 75% of timer_period. The lower limit for the recording buffer size maxlength is fragsize * 2. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-19-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15paaudio: limit minreq to 75% of audio timer_rateVolker Rümelin1-1/+2
Currently with the playback buffer attribute minreq = -1 and flag PA_STREAM_EARLY_REQUESTS PulseAudio uses minreq = tlength / 4. To improve audio playback with larger PulseAudio server side buffers, limit minreq to a maximum of 75% of audio timer_rate. That way there is a good chance qemu receives a stream buffer size update before it tries to write data to the playback stream. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-18-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15paaudio: comment bugs in functions qpa_init_*Volker Rümelin1-0/+8
The audio buffer size in audio/paaudio.c is typically larger than expected. Just comment the bugs in qpa_init_in() and qpa_init_out() for now. Fixing these bugs may break glitch free audio playback with fine tuned user audio settings. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-17-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15paaudio: remove unneeded codeVolker Rümelin1-8/+2
Commit baea032ec7 "audio/paaudio: fix ignored buffer_length setting" added code to handle buffer_length defaults. This was unnecessary because the audio_buffer_* functions in audio/audio.c already handle this. Remove the unneeded code. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-16-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15paaudio: wait until the playback stream is readyVolker Rümelin1-0/+7
Don't call pa_stream_writable_size() in qpa_get_buffer_out() before the playback stream is ready. This prevents a lot of the following pulseaudio error messages. pulseaudio: pa_stream_writable_size failed pulseaudio: Reason: Bad state To reproduce start qemu with -parallel none -device gus,audiodev=audio0 -audiodev pa,id=audio0 Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-15-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15paaudio: wait for PA_STREAM_READY in qpa_write()Volker Rümelin1-0/+6
Don't call pa_stream_writable_size() in qpa_write() before the playback stream is ready. This prevents a lot of the following pulseaudio error messages. pulseaudio: pa_stream_writable_size failed pulseaudio: Reason: Bad state To reproduce start qemu with -parallel none -device gus,audiodev=audio0 -audiodev pa,id=audio0,out.mixing-engine=off Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-14-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15paaudio: avoid to clip samples multiple timesVolker Rümelin1-1/+31
The pulseaudio backend currently converts, clips and copies audio playback samples in the mixing-engine sample buffer multiple times. In qpa_get_buffer_out() the function pa_stream_begin_write() returns a rather large buffer and this allows audio_pcm_hw_run_out() in audio/audio.c to copy all samples in the mixing-engine buffer to the pulse audio buffer. Immediately after copying, qpa_write() notices with a call to pa_stream_writable_size() that pulse audio only needs a smaller part of the copied samples and ignores the rest. This copy and ignore process happens several times for each audio sample. To fix this behaviour, call pa_stream_writable_size() in qpa_get_buffer_out() to limit the number of samples audio_pcm_hw_run_out() will convert. With this change the pulseaudio pcm_ops functions put_buffer_out and write are no longer identical and a separate qpa_put_buffer_out is needed. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-13-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: remove remaining unused plive codeVolker Rümelin1-16/+1
Commit 73ad33ef7b "audio: remove plive" forgot to remove this code. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-12-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15sdlaudio: enable (in|out).mixing-engine=offVolker Rümelin1-2/+2
Enable the SDL2 backend options -audiodev sdl,out.mixing- engine=off,in.mixing-engine=off. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-11-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: break generic buffer dependency on mixing-engineVolker Rümelin1-7/+4
Break the unnecessary dependency of the generic buffer management code on mixing-engine. This is required for the next patch. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-10-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15sdlaudio: add recording functionsVolker Rümelin1-3/+139
Add audio recording functions. SDL 2.0.5 or later is required to use the recording functions. Playback continues to work with earlier SDL 2.0 versions. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-9-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: split pcm_ops function get_buffer_inVolker Rümelin7-4/+21
Split off pcm_ops function run_buffer_in from get_buffer_in and call run_buffer_in before get_buffer_in. The next patch only needs the generic buffer management part from audio_generic_get_buffer_in(). Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-8-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15sdlaudio: replace legacy functions with modern onesVolker Rümelin1-57/+50
With the modern audio functions it's possible to add new features like audio recording. As a side effect this patch fixes a bug where SDL2 can't be used on Windows. This bug was reported on the qemu-devel mailing list at https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg04043.html Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-7-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15sdlaudio: fill remaining sample buffer with silenceVolker Rümelin1-1/+2
Fill the remaining sample buffer with silence. To fill it with zeroes is wrong for unsigned samples because this is silence with a DC bias. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-6-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15sdlaudio: always clear the sample bufferVolker Rümelin1-17/+16
Always fill the remaining audio callback buffer with silence. SDL 2.0 doesn't initialize the audio callback buffer. This was an incompatible change compared to SDL 1.2. For reference read the SDL 1.2 to 2.0 migration guide. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-5-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15sdlaudio: don't start playback in init routineVolker Rümelin1-1/+0
Every emulated audio device has a way to enable audio playback. Don't start playback until the guest enables the audio device. This patch keeps the SDL2 device pause state in sync with hw->enabled. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-4-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15sdlaudio: add -audiodev sdl,out.buffer-count optionVolker Rümelin4-5/+13
Currently there is a crackling noise with SDL2 audio playback. Commit bcf19777df: "audio/sdlaudio: Allow audio playback with SDL2" already mentioned the crackling noise. Add an out.buffer-count option to give users a chance to select sane settings for glitch free audio playback. The idea was taken from the coreaudio backend. The in.buffer-count option will be used with one of the next patches. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Acked-by: Markus Armbruster <armbru@redhat.com> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15audio: fix bit-rotted codeVolker Rümelin2-2/+2
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15sdlaudio: remove leftover SDL1.2 codeVolker Rümelin1-17/+13
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-12-18qdev: Move softmmu properties to qdev-properties-system.hEduardo Habkost1-0/+1
Move the property types and property macros implemented in qdev-properties-system.c to a new qdev-properties-system.h header. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20201211220529.2290218-16-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-12-15audio: add sanity checkGerd Hoffmann1-1/+3
Check whenever we actually found the spiceaudio driver before flipping the can_be_default field. Fixes: f0c4555edfdd ("audio: remove qemu_spice_audio_init()") Buglink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977301 Reported-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20201215081151.20095-1-kraxel@redhat.com>
2020-12-15audio: Simplify audio_bug() removing old codePhilippe Mathieu-Daudé1-18/+1
This code (introduced in commit 1d14ffa97ea, Oct 2005) is likely unused since years. Time to remove it. If the condition is true, simply call abort(). Suggested-by: Gerd Hoffmann <gerd@kraxel.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20201210223506.263709-1-philmd@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-12-15audio: remove unused function audio_is_cleaning_up()Volker Rümelin2-9/+0
The previous commit removed the last call site of audio_is_cleaning_up(). Remove the now unused function. Tested-by: Howard Spoelstra <hsp.cat7@gmail.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20201213130528.5863-4-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-12-15coreaudio: always stop audio playback on shut downVolker Rümelin1-20/+16
Always stop audio playback and remove the playback callback when QEMU exits. On shut down the function coreaudio_fini_out() destroys the coreaudio mutex but fails to stop audio playback and to remove the audio playback callback, because function audio_is_cleaning_up() always returns true when called from coreaudio_fini_out(). Now there is a time window from pthread_mutex_destroy() to program exit where Core Audio may call the audio playback callback which tries to lock the destroyed coreaudio mutex. This leads to the following error. coreaudio: Could not lock voice for audioDeviceIOProc Reason: Invalid argument This bug was reported on the qemu-discuss mailing list. https://lists.nongnu.org/archive/html/qemu-discuss/2020-10/msg00018.html Tested-by: Howard Spoelstra <hsp.cat7@gmail.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20201213130528.5863-3-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-12-15coreaudio: don't start playback in init routineVolker Rümelin1-11/+0
Every emulated audio device has a way to enable audio playback. Don't start playback until the guest enables the audio device to keep the Core Audio device run state in sync with hw->enabled. Tested-by: Howard Spoelstra <hsp.cat7@gmail.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20201213130528.5863-2-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-12-15coreaudio: rename misnamed variable fake_asVolker Rümelin1-3/+3
While the variable once was used to fake audio settings, since commit ed2a4a7941 "audio: proper support for float samples in mixeng" this is no longer true. Rename the variable to obt_as. This is the same naming scheme as in audio/sdlaudio.c Tested-by: Howard Spoelstra <hsp.cat7@gmail.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20201213130528.5863-1-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-11-13audio/jack: fix use after free segfaultGeoffrey McRae1-13/+37
This change registers a bottom handler to close the JACK client connection when a server shutdown signal is received. Without this libjack2 attempts to "clean up" old clients and causes a use after free segfault. Signed-off-by: Geoffrey McRae <geoff@hostfission.com> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <20201108063351.35804-2-geoff@hostfission.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-10-21spice: move add_interface() to QemuSpiceOps.Gerd Hoffmann1-2/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20201019075224.14803-6-kraxel@redhat.com
2020-10-15meson: add spice_headers dependency.Gerd Hoffmann1-1/+1
Used for files which (with CONFIG_SPICE=y) depend on spice header files to pick up some enum, but which do not depend on on the actual spice shared library. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20201014121120.13482-6-kraxel@redhat.com
2020-10-09monitor: Use getter/setter functions for cur_monKevin Wolf1-4/+4
cur_mon really needs to be coroutine-local as soon as we move monitor command handlers to coroutines and let them yield. As a first step, just remove all direct accesses to cur_mon so that we can implement this in the getter function later. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20201005155855.256490-4-kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2020-09-24Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell1-9/+9
staging Pull request This includes the atomic_ -> qatomic_ rename that touches many files and is prone to conflicts. # gpg: Signature made Wed 23 Sep 2020 17:08:43 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: qemu/atomic.h: rename atomic_ to qatomic_ tests: add test-fdmon-epoll fdmon-poll: reset npfd when upgrading to fdmon-epoll gitmodules: add qemu.org vbootrom submodule gitmodules: switch to qemu.org meson mirror gitmodules: switch to qemu.org qboot mirror docs/system: clarify deprecation schedule virtio-crypto: don't modify elem->in/out_sg virtio-blk: undo destructive iov_discard_*() operations util/iov: add iov_discard_undo() virtio: add vhost-user-fs-ccw device libvhost-user: handle endianness as mandated by the spec MAINTAINERS: add Stefan Hajnoczi as block/nvme.c maintainer Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-23qemu/atomic.h: rename atomic_ to qatomic_Stefan Hajnoczi1-9/+9
clang's C11 atomic_fetch_*() functions only take a C11 atomic type pointer argument. QEMU uses direct types (int, etc) and this causes a compiler error when a QEMU code calls these functions in a source file that also included <stdatomic.h> via a system header file: $ CC=clang CXX=clang++ ./configure ... && make ../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid) Avoid using atomic_*() names in QEMU's atomic.h since that namespace is used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h and <stdatomic.h> can co-exist. I checked /usr/include on my machine and searched GitHub for existing "qatomic_" users but there seem to be none. This patch was generated using: $ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \ sort -u >/tmp/changed_identifiers $ for identifier in $(</tmp/changed_identifiers); do sed -i "s%\<$identifier\>%q$identifier%g" \ $(git grep -I -l "\<$identifier\>") done I manually fixed line-wrap issues and misaligned rST tables. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200923105646.47864-1-stefanha@redhat.com>
2020-09-23audio: build spiceaudio as moduleGerd Hoffmann1-2/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200916084117.21828-3-kraxel@redhat.com
2020-09-23audio: remove qemu_spice_audio_init()Gerd Hoffmann2-5/+16
Handle the spice special case in audio_init instead. With the qemu_spice_audio_init() symbol dependency being gone we can build spiceaudio as module. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200916084117.21828-2-kraxel@redhat.com
2020-09-23audio: run downstream playback queue unconditionallyVolker Rümelin1-0/+3
Run the downstream playback queue even if there are no samples in the mixing engine buffer. The downstream queue may still have queued samples. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-7-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>