summaryrefslogtreecommitdiff
path: root/audio
AgeCommit message (Collapse)Author
2022-07-08audio/dbus: fix buildingMarc-André Lureau
Commit c9c847481 broken dbus audio module compilation with bad 'CONFIG_GIO' usage. Furthermore, it implied extra dependency on audio module which aren't necessary. The problem was that 'dbus_display' is not correctly automatically set on MacOS, because opengl dependency wasn't taken into account. Fixes: c9c847481 ("audio/dbus: Fix building with modules on macOS") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220622154918.560870-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-14introduce -audio as a replacement for -soundhwPaolo Bonzini
-audio is used like "-audio pa,model=sb16". It is almost as simple as -soundhw, but it reuses the -audiodev parsing machinery and attaches an audiodev to the newly-created device. The main 'feature' is that it knows about adding the codec device for model=intel-hda, and adding the audiodev to the codec device. In the future, it could be extended to support default models or builtin devices, just like -nic, or even a default backend. For now, keep it simple. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-06Remove qemu-common.h include from most unitsMarc-André Lureau
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-33-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-06include: move qemu_get_vm_name() to sysemu.hMarc-André Lureau
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-26-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-06Replace config-time define HOST_WORDS_BIGENDIANMarc-André Lureau
Replace a config-time define with a compile time condition define (compatible with clang and gcc) that must be declared prior to its usage. This avoids having a global configure time define, but also prevents from bad usage, if the config header wasn't included before. This can help to make some code independent from qemu too. gcc supports __BYTE_ORDER__ from about 4.6 and clang from 3.2. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> [ For the s390x parts I'm involved in ] Acked-by: Halil Pasic <pasic@linux.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323155743.1585078-7-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-22Replace GCC_FMT_ATTR with G_GNUC_PRINTFMarc-André Lureau
One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
2022-03-21Use g_new() & friends where that makes obvious senseMarkus Armbruster
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with size arguments of the form sizeof(T). Patch created mechanically with: $ spatch --in-place --sp-file scripts/coccinelle/use-g_new-etc.cocci \ --macro-file scripts/cocci-macro-file.h FILES... Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20220315144156.1595462-4-armbru@redhat.com> Reviewed-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
2022-03-18audio/mixeng: Do not declare unused variablesAkihiko Odaki
The unused variables when FLOAT_MIXENG is defined caused warnings on Apple clang version 13.1.6 (clang-1316.0.21.2). Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220316061053.60587-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-15audio: Rename coreaudio extension to use Objective-C compilerPhilippe Mathieu-Daudé
The coreaudio library includes Objective-C declarations (using the caret '^' symbol to declare block references [*]). When building with a C compiler we get: [175/839] Compiling C object libcommon.fa.p/audio_coreaudio.c.o In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h:18, from ../../audio/coreaudio.c:26: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:162:2: error: expected identifier or '(' before '^' token 162 | (^AudioObjectPropertyListenerBlock)( UInt32 inNumberAddresses, | ^ FAILED: libcommon.fa.p/audio_coreaudio.c.o Rename the file to use the Objective-C default extension (.m) so meson calls the correct compiler. [*] https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2022-03-15coreaudio: Always return 0 in handle_voice_changeAkihiko Odaki
handle_voice_change() is a CoreAudio callback function as of CoreAudio type AudioObjectPropertyListenerProc, and for the latter MacOSX.sdk/System/ Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h says "The return value is currently unused and should always be 0.". Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220306123410.61063-1-akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2022-03-15audio: Log context for audio bugAkihiko Odaki
Without this change audio_bug aborts when the bug condition is met, which discards following useful logs. Call abort after such logs. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220306063202.27331-1-akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2022-03-15audio/dbus: Fix building with modules on macOSPhilippe Mathieu-Daudé
When configuring QEMU with --enable-modules we get on macOS: --- stderr --- Dependency ui-dbus cannot be satisfied ui-dbus depends on pixman and opengl, so add these dependencies to audio-dbus. Fixes: 739362d420 ("audio: add "dbus" audio backend") Reviewed-by: Li Zhang <lizhang@suse.de> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2022-03-15audio/coreaudio: Remove a deprecation warning on macOS 12Philippe Mathieu-Daudé
When building on macOS 12 we get: audio/coreaudio.c:50:5: error: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Werror,-Wdeprecated-declarations] kAudioObjectPropertyElementMaster ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kAudioObjectPropertyElementMain /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain ^ Replace by kAudioObjectPropertyElementMain, redefining it to kAudioObjectPropertyElementMaster if not available. Suggested-by: Akihiko Odaki <akihiko.odaki@gmail.com> Suggested-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Suggested-by: Roman Bolshakov <roman@roolebo.dev> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com> Tested-by: Akihiko Odaki <akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2022-03-04coreaudio: Notify error in coreaudio_init_outAkihiko Odaki
Otherwise, the audio subsystem tries to use the voice and eventually aborts due to the maximum number of samples in the buffer is not set. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220226115953.60335-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04sdlaudio: fix samples vs. frames mix-upVolker Rümelin
Fix the same samples vs. frames mix-up that the previous commit fixed for the PulseAudio backend. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-15-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04paaudio: fix samples vs. frames mix-upVolker Rümelin
Now that the mixing buffer size no longer adds to playback latency, fix the samples vs. frames mix-up in the mixing buffer size calculation. This change will go largely unnoticed as long as the user doesn't use a buffer-size smaller than timer-period. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-14-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04ossaudio: reduce effective playback buffer sizeVolker Rümelin
Return the free buffer size for the mmapped case in function oss_buffer_get_free() to reduce the effective playback buffer size. All intermediate audio playback buffers become temporary buffers. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-13-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04dsoundaudio: reduce effective playback buffer sizeVolker Rümelin
Add the buffer_get_free pcm_ops function to reduce the effective playback buffer size. All intermediate audio playback buffers become temporary buffers. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-12-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04paaudio: reduce effective playback buffer sizeVolker Rümelin
Add the buffer_get_free pcm_ops function to reduce the effective playback buffer size. All intermediate audio playback buffers become temporary buffers. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-11-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04audio: restore mixing-engine playback buffer sizeVolker Rümelin
Commit ff095e5231 "audio: api for mixeng code free backends" introduced another FIFO for the audio subsystem with exactly the same size as the mixing-engine FIFO. Most audio backends use this generic FIFO. The generic FIFO used together with the mixing-engine FIFO doubles the audio FIFO size, because that's just two independent FIFOs connected together in series. For audio playback this nearly doubles the playback latency. This patch restores the effective mixing-engine playback buffer size to a pre v4.2.0 size by only accepting the amount of samples for the mixing-engine queue which the downstream queue accepts. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20220301191311.26695-10-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04Revert "audio: fix wavcapture segfault"Volker Rümelin
This reverts commit cbaf25d1f59ee13fc7542a06ea70784f2e000c04. Since previous commit every audio backend has a pcm_ops function table. It's no longer necessary to test if the table is available. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-9-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04audio: add pcm_ops function table for capture backendVolker Rümelin
Add a pcm_ops function table for the capture backend. This avoids additional code in the next patches to test if the pcm_ops table is available. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-8-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04audio: copy playback stream in sequential orderVolker Rümelin
Change the code to copy the playback stream in sequential order. The advantage can be seen in the next patches where the stream copy operation effectively becomes a write through operation. The following diagram shows the average buffer fill level and the stream copy sequence. ### represents a timer_period sized chunk. The rest of the buffer sizes are not to scale. With current code: |--------| |#####111| |---#####| sw->buf mix_buf backend buffer 1. clip |--------| |---#####| |111##222| sw->buf mix_buf backend buffer 2. write to audio device 333 -> |--------| |---#####| |---111##| -> 222 sw->buf mix_buf backend buffer 3a. sw device write |-----333| |---#####| |---111##| sw->buf mix_buf backend buffer 3b. resample and mix |--------| |333#####| |---111##| sw->buf mix_buf backend buffer With this patch: 111 -> |--------| |---#####| |---#####| sw->buf mix_buf backend buffer 1a: sw device write |-----111| |---#####| |---#####| sw->buf mix_buf backend buffer 1b. resample and mix |--------| |111##222| |---#####| sw->buf mix_buf backend buffer 2. clip |--------| |---111##| |222##333| sw->buf mix_buf backend buffer 3. write to audio device |--------| |---111##| |---222##| -> 333 sw->buf mix_buf backend buffer The effective total playback buffer size is reduced by timer_period. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-7-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04jackaudio: use more jack audio buffersVolker Rümelin
The next patch reduces the effective qemu playback buffer size by timer-period. Increase the number of jack audio buffers by one to preserve the total effective buffer size. The size of one jack audio buffer is 512 samples. With audio defaults that's 512 samples / 44100 samples/s = 11.6 ms and only slightly larger than the timer-period of 10 ms. The larger jack audio buffer increases audio dropout safety, because the high priority jack-audio worker threads can provide audio data for a longer period of time as with a smaller buffer and more audio data in the mixing engine buffer that they can't access. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <20220301191311.26695-6-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04paaudio: increase default latency to 46msVolker Rümelin
This is a patch to improve the pulseaudio playback experience. Asking pulseaudio for a playback latency of 15ms is quite demanding. Increase this to 46ms. The total playback latency now is 31ms larger. One of the next patches will reduce the total playback latency again by more than 46ms. Here is a quote from the PulseAudio Latency Control documentation: 'For the sake of (...) drop-out safety always make sure to pick the highest latency possible that fulfills your needs.' Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-5-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04audio: inline function audio_pcm_sw_get_rpos_in()Volker Rümelin
Simplify code by inlining function audio_pcm_sw_get_rpos_in() at the only call site and remove the duplicated audio_bug() test. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-4-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04audio: add function audio_pcm_hw_conv_in()Volker Rümelin
Add a function audio_pcm_hw_conv_in() similar to the existing counterpart function audio_pcm_hw_clip_out(). This function reduces the number of calls to the pcm_ops functions get_buffer_in() and put_buffer_in(). That's one less call to get_buffer_in() and put_buffer_in() every time the conv_buffer wraps around. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04audio: move function audio_pcm_hw_clip_out()Volker Rümelin
Move the function audio_pcm_hw_clip_out() into the correct section 'Hard voice (playback)'. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04audio: replace open-coded buffer arithmeticVolker Rümelin
Replace open-coded buffer arithmetic with the new function audio_ring_posb(). That's the position in backward direction of a given point at a given distance. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20220301191311.26695-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-01-13dsoundaudio: fix crackling audio recordingsVolker Rümelin
Audio recordings with the DirectSound backend don't sound right. A look a the Microsoft online documentation tells us why. From the DirectSound Programming Guide, Capture Buffer Information: 'You can safely copy data from the buffer only up to the read cursor.' Change the code to read up to the read cursor instead of the capture cursor. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20211226154017.6067-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-01-13jackaudio: use ifdefs to hide unavailable functionsVolker Rümelin
On Windows the jack_set_thread_creator() function and on MacOS the pthread_setname_np() function with a thread pointer paramater is not available. Use #ifdefs to remove the jack_set_thread_creator() function call and the qjack_thread_creator() function in both cases. The qjack_thread_creator() function just sets the name of the created thread for debugging purposes and isn't really necessary. From the jack_set_thread_creator() documentation: (...) No normal application/client should consider calling this. (...) Resolves: https://gitlab.com/qemu-project/qemu/-/issues/785 Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <20211226154017.6067-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21audio: add "dbus" audio backendMarc-André Lureau
Add a new -audio backend that accepts D-Bus clients/listeners to handle playback & recording, to be exported via the -display dbus. Example usage: -audiodev dbus,in.mixing-engine=off,out.mixing-engine=off,id=dbus -display dbus,audiodev=dbus Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-10-14configure, meson: move audio driver detection to MesonPaolo Bonzini
This brings a change that makes audio drivers more similar to all other modules. All drivers are built by default, while --audio-drv-list only governs the default choice of the audio driver. Meson options are added to disable the drivers, and the next patches will fix the help messages and command line options, and especially make the non-default drivers available via -audiodev. Cc: Gerd Hoffman <kraxel@redhat.com> Cc: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20211007130630.632028-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-10-14audio: remove CONFIG_AUDIO_WIN_INTPaolo Bonzini
Ever since winwaveaudio was removed in 2015, CONFIG_AUDIO_WIN_INT is only set if dsound is in use, so use CONFIG_AUDIO_DSOUND directly. Cc: Gerd Hoffman <kraxel@redhat.com> Cc: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20211007130630.632028-3-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-08-10audio: Never send migration sectionDr. David Alan Gilbert
The audio migration vmstate is empty, and always has been; we can't just remove it though because an old qemu might send it us. Changes with -audiodev now mean it's sometimes created when it didn't used to be, and can confuse migration to old qemu. Change it so that vmstate_audio is never sent; if it's received it should still be accepted, and old qemu's shouldn't be too upset if it's missing. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20210809170956.78536-1-dgilbert@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-07-09modules: add audio module annotationsGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jose R. Ziviani <jziviani@suse.de> Message-Id: <20210624103836.2382472-9-kraxel@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-06-23coreaudio: Lock only the bufferAkihiko Odaki
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-17coreaudio: Fix output stream format settingsAkihiko Odaki
Before commit 7d6948cd98cf5ad8a3458a4ce7fdbcb79bcd1212, it was coded to retrieve the initial output stream format settings, modify the frame rate, and set again. However, I removed a frame rate modification code by mistake in the commit. It also assumes the initial output stream format is consistent with what QEMU expects, but that expectation is not in the code, which makes it harder to understand and will lead to breakage if the initial settings change. This change explicitly sets all of the output stream settings to solve these problems. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210616141721.54091-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-06-17audio: Fix format specifications of debug logsAkihiko Odaki
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-id: 20210616141411.53892-1-akihiko.odaki@gmail.com Message-Id: <20210616141411.53892-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-06-17jackaudio: avoid that the client name contains the word (NULL)Volker Rümelin
Currently with jackaudio client name and qemu guest name unset, the JACK client names are out-(NULL) and in-(NULL). These names are user visible in the patch bay. Replace the function call to qemu_get_vm_name() with a call to audio_application_name() which replaces NULL with "qemu" to have more descriptive names. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210517194604.2545-4-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-06-17audio: move code to audio/audio.cVolker Rümelin
Move the code to generate the pa_context_new() application name argument to a function in audio/audio.c. The new function audio_application_name() will also be used in the jackaudio backend. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210517194604.2545-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-06-17paaudio: remove unused stream flagsVolker Rümelin
In current code there are no calls to pa_stream_get_latency() or pa_stream_get_time() to receive latency or time information. Remove the flags PA_STREAM_INTERPOLATE_TIMING and PA_STREAM_AUTO_TIMING_UPDATE which instruct PulseAudio to calculate this information in regular intervals. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210517194604.2545-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-06-17alsaaudio: remove #ifdef DEBUG to avoid bit rotVolker Rümelin
Merge the #ifdef DEBUG code with the if statement a few lines above to avoid bit rot. Suggested-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210517194604.2545-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-06-02docs: fix references to docs/devel/tracing.rstStefano Garzarella
Commit e50caf4a5c ("tracing: convert documentation to rST") converted docs/devel/tracing.txt to docs/devel/tracing.rst. We still have several references to the old file, so let's fix them with the following command: sed -i s/tracing.txt/tracing.rst/ $(git grep -l docs/devel/tracing.txt) Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210517151702.109066-2-sgarzare@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-03-16coreaudio: Handle output device changeAkihiko Odaki
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 Odaki
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 Odaki
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é
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 Han
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 Han
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>