- Mar 06, 2023
-
-
Volker Rümelin authored
Audio recording with ALSA default settings currently doesn't work. The debug log shows updates every 0.75s and 1.5s. audio: Elapsed since last alsa run (running): 0.743030 audio: Elapsed since last alsa run (running): 1.486048 audio: Elapsed since last alsa run (running): 0.743008 audio: Elapsed since last alsa run (running): 1.485878 audio: Elapsed since last alsa run (running): 1.486040 audio: Elapsed since last alsa run (running): 1.485886 The time between updates should be in the 10ms range. Audio recording with ALSA has the same timing contraints as playback. Reintroduce the default recording settings and use the same default settings for recording as for playback. The term "reintroduce" is correct because commit a93f3281 ("alsaaudio: port to -audiodev config") removed the default settings for recording. Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230121094735.11644-11-vr_qemu@t-online.de>
-
Volker Rümelin authored
The currently used default playback settings in the ALSA audio backend are a bit unfortunate. With a few emulated audio devices, audio playback does not work properly. Here is a short part of the debug log while audio is playing (elapsed time in seconds). audio: Elapsed since last alsa run (running): 0.046244 audio: Elapsed since last alsa run (running): 0.023137 audio: Elapsed since last alsa run (running): 0.023170 audio: Elapsed since last alsa run (running): 0.023650 audio: Elapsed since last alsa run (running): 0.060802 audio: Elapsed since last alsa run (running): 0.031931 For some audio devices the time of more than 23ms between updates is too long. Set the period time to 5.8ms so that the maximum time between two updates typically does not exceed 11ms. This roughly matches the 10ms period time when doing playback with the audio timer. After this patch the debug log looks like this. audio: Elapsed since last alsa run (running): 0.011919 audio: Elapsed since last alsa run (running): 0.005788 audio: Elapsed since last alsa run (running): 0.005995 audio: Elapsed since last alsa run (running): 0.011069 audio: Elapsed since last alsa run (running): 0.005901 audio: Elapsed since last alsa run (running): 0.006084 Acked-by:
Christian Schoenebeck <qemu_oss@crudebyte.com> Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230121094735.11644-10-vr_qemu@t-online.de>
-
Volker Rümelin authored
Replace audio_calloc() with the equivalent g_new0(). The value of the g_new0() argument count is >= 1, which means g_new0() will never return NULL. Also remove the unnecessary NULL check. Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230121094735.11644-6-vr_qemu@t-online.de>
-
- Dec 13, 2022
-
-
Markus Armbruster authored
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/audio.json. Said commit explains the transformation in more detail. The invariant violations mentioned there do not occur here. Additionally, helper get_str() loses its @has_dst parameter. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20221104160712.3005652-8-armbru@redhat.com>
-
- Oct 11, 2022
-
-
Volker Rümelin authored
Change the buffer_get_free pcm_ops function to report the free ALSA playback buffer. The generic buffer becomes a temporary buffer and is empty after a call to audio_run_out(). Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Acked-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220923183640.8314-4-vr_qemu@t-online.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Mar 22, 2022
-
-
Marc-André Lureau authored
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>
-
- Mar 04, 2022
-
-
Volker Rümelin authored
Commit ff095e52 "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>
-
- Jun 17, 2021
-
-
Volker Rümelin authored
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>
-
- Jan 15, 2021
-
-
Zhang Han authored
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>
-
Volker Rümelin authored
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>
-
Volker Rümelin authored
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>
-
- Feb 18, 2020
-
-
Philippe Mathieu-Daudé authored
Fixes: 286a5d20 Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> Message-Id: <20200218094402.26625-3-philmd@redhat.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Feb 06, 2020
-
-
Kővágó, Zoltán authored
This adds proper support for float samples in mixeng by adding a new audio format for it. Limitations: only native endianness is supported. None of the virtual sound cards support float samples (it looks like most of them only support 8 and 16 bit, only hda supports 32 bit), it is only used for the audio backends (i.e. host side). Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Acked-by:
Markus Armbruster <armbru@redhat.com> Message-id: 8a8b0b5698401b78d3c4c8ec90aef83b95babb06.1580672076.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jan 31, 2020
-
-
Volker Rümelin authored
The combined generic buffer management code and buffer run out code in function audio_generic_put_buffer_out has a problematic behaviour. A few hundred milliseconds after playback starts the mixing buffer and the generic buffer are nearly full and the following pattern can be seen. On first call of audio_pcm_hw_run_out the buffer run code in audio_generic_put_buffer_out writes some data to the audio hardware but the generic buffer will fill faster and is full when audio_pcm_hw_run_out returns. This is because emulated audio devices can produce playback data at a higher rate than the audio backend hardware consumes this data. On next call of audio_pcm_hw_run_out the buffer run code in audio_generic_put_buffer_out writes some data to the audio hardware but no audio data is transferred to the generic buffer because the buffer is already full. Then the pattern repeats. For the emulated audio device this looks like the audio timer period has doubled. This patch splits the combined generic buffer management code and buffer run out code and calls the buffer run out code after buffer management code to break this pattern. The bug report is for the wav audio backend. But the problem is not limited to this backend. All audio backends which use the audio_generic_put_buffer_out function show this problem. Buglink: https://bugs.launchpad.net/qemu/+bug/1858488 Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-5-vr_qemu@t-online.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Oct 18, 2019
-
-
Kővágó, Zoltán authored
Which currently only means removing some checks. Old code won't require more than two channels, but new code will need it. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 7e53be1f97e939ed3bb729ef39e76b775643118a.1570996490.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
The bit shifting trick worked because the number of bytes per frame was always a power-of-two (since QEMU only supports mono, stereo and 8, 16 and 32 bit samples). But if we want to add support for surround sound, this no longer holds true. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 1351fd9bcce0ff20d81850c5292722194329de02.1570996490.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Sep 23, 2019
-
-
Kővágó, Zoltán authored
This way we no longer need vararg functions, improving compile time error detection. Also now it's possible to check actually what commands are supported, without needing to manually update ctl_caps. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 2b08b3773569c5be055d0a0fb2f29ff64e79f0f4.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: ab9768e73dfe7b7305bd6a51629846e0d77622a5.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Aug 21, 2019
-
-
Kővágó, Zoltán authored
Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: c5193e687fc6cc0f60cb3e90fe69ddf2027d0df1.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
They just called audio_pcm_sw_read/write anyway, so it makes no sense to have them too. (The noaudio's read is the only exception, but it should work with the generic code too.) Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 92ddc98133bc4b687c6e4608b9321e7b64c0e496.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
audio_run is called manually by alsa and oss backends when polling. In this case only the requesting backend should be run, not all of them. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 10221fcea2028fa18d95cf531526ffe3b1d9b21a.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
There's already a MIN and MAX macro in include/qemu/osdep.h, use them instead. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 303222477df6f7373217e0df768635fab5855745.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jun 12, 2019
-
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-4-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for hw/usb/dev-hub.c hw/misc/exynos4210_rng.c hw/misc/bcm2835_rng.c hw/misc/aspeed_scu.c hw/display/virtio-vga.c hw/arm/stm32f205_soc.c; ui/cocoa.m fixed up]
-
- Mar 11, 2019
-
-
Kővágó, Zoltán authored
Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 663d2c918a11ef44d4042e56c796d6dbf40be70c.1552083282.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
Audio drivers now get an Audiodev * as config paramters, instead of the global audio_option structs. There is some code in audio/audio_legacy.c that converts the old environment variables to audiodev options (this way backends do not have to worry about legacy options). It also contains a replacement of -audio-help, which prints out the equivalent -audiodev based config of the currently specified environment variables. Note that backends are not updated and still rely on environment variables. Also note that (due to moving try-poll from global to backend specific option) currently ALSA and OSS will always try poll mode, regardless of environment variables or -audiodev options. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: e99a7cbdac0d13512743880660b2032024703e4c.1552083282.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
I had to include an enum for audio sampling formats into qapi, but that meant duplicating the audfmt_e enum. This patch replaces audfmt_e and associated values with the qapi generated AudioFormat enum. This patch is mostly a search-and-replace, except for switches where the qapi generated AUDIO_FORMAT_MAX caused problems. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-id: 01251b2758a1679c66842120b77c0fb46d7d0eaf.1552083282.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Dec 12, 2018
-
-
Thomas Huth authored
Both GCC v4.8 and Clang v3.4 support the -Waddress option, so we do not need the compiler version check here anymore. Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Mar 12, 2018
-
-
Gerd Hoffmann authored
Add registry for audio drivers, using the existing audio_driver struct. Make all drivers register themself. The old list of audio_driver struct pointers is now a list of audio driver names, specifying the priority (aka probe order) in case no driver is explicitly asked for. Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20180306074053.22856-2-kraxel@redhat.com
-
- Feb 06, 2018
-
-
Alistair Francis authored
Apparently we don't use __MSC_VER as a compiler anymore and we always require a C99 compiler (which means we always have __func__) so we don't need a special AUDIO_FUNC macro. We can just replace AUDIO_FUNC with __func__ instead. Checkpatch failures were manually fixed. Signed-off-by:
Alistair Francis <alistair.francis@xilinx.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180203084315.20497-2-armbru@redhat.com>
-
- Feb 02, 2016
-
-
Peter Maydell authored
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 1453138432-8324-1-git-send-email-peter.maydell@linaro.org Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jun 15, 2015
-
-
Kővágó, Zoltán authored
Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
Currently the opaque pointer returned by audio_driver's init is only exposed to the driver's fini, but not to audio_pcm_ops. This way if someone wants to share a variable with the driver and the pcm, he must use global variables. This patch fixes it by adding a third parameter to audio_pcm_op's init_out and init_in. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jun 12, 2015
-
-
Fam Zheng authored
The function cannot fail, so the check is superfluous. Signed-off-by:
Fam Zheng <famz@redhat.com> Message-id: 1433400324-7358-10-git-send-email-famz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Jun 13, 2014
-
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Dec 19, 2012
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Touching char/char.h basically causes the whole of QEMU to be rebuilt. Avoid this, it is usually unnecessary. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Various header files rely on qemu-char.h including qemu-config.h or main-loop.h, but they really do not need qemu-char.h at all (particularly interesting is the case of the block layer!). Clean this up, and also add missing inclusions of qemu-char.h itself. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Aug 21, 2011
-
-
Anthony Liguori authored
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Jan 12, 2011
-
-
Michael Walle authored
Refactor the volume mixing, so it can be reused for capturing devices. Additionally, it removes superfluous multiplications with the nominal volume within the hardware voice code path. Signed-off-by:
Michael Walle <michael@walle.cc> Signed-off-by:
malc <av1474@comtv.ru>
-