- Jan 15, 2021
-
-
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
Currently there is a crackling noise with SDL2 audio playback. Commit bcf19777: "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>
-
- Dec 15, 2020
-
-
Gerd Hoffmann authored
Check whenever we actually found the spiceaudio driver before flipping the can_be_default field. Fixes: f0c4555e ("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>
-
Philippe Mathieu-Daudé authored
This code (introduced in commit 1d14ffa9, 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>
-
Volker Rümelin authored
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>
-
- Sep 23, 2020
-
-
Gerd Hoffmann authored
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
-
Volker Rümelin authored
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>
-
Volker Rümelin authored
The function audio_generic_write should work exactly like audio_pcm_hw_run_out. It's a very similar function working on a different buffer. This patch significantly reduces the number of drop-outs with the DirectSound backend. To hear the difference start qemu with -audiodev dsound,id=audio0,out.mixing-engine=off and play a song in the guest with and without this patch. Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-6-vr_qemu@t-online.de Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Volker Rümelin authored
This patch removes unnecessary calls to the pcm_ops function put_buffer_in(). No audio backend needs this call if the returned length of pcm_ops function get_buffer_in() is zero. For the DirectSound backend this prevents a call to dsound_unlock_in() without a preceding call to dsound_lock_in(). While Windows doesn't complain it seems wrong anyway. Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-5-vr_qemu@t-online.de Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Volker Rümelin authored
The function audio_generic_read should work exactly like audio_pcm_hw_run_in. It's a very similar function working on a different buffer. Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-4-vr_qemu@t-online.de Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Volker Rümelin authored
The playback rate with the spiceaudio backend is currently too fast if there's no spice client connected or the spice client can't play audio. Rate limit the audio playback stream in all cases. To calculate the rate correctly the limiter has to know the maximum buffer size. Fixes: 8c198ff0 ("spiceaudio: port to the new audio backend api") Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-3-vr_qemu@t-online.de Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Volker Rümelin authored
This patch allows the audio backends get_buffer_out() functions to drop audio data and mitigates a bug reported on the qemu-devel mailing list. https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03832.html The new rules for the variables buf and size returned by get_buffer_out() are: size == 0: Downstream playback buffer is full. Retry later. size > 0, buf != NULL: Copy size bytes to buf for playback. size > 0, buf == NULL: Drop size bytes. The audio playback rate with spiceaudio for the no audio case is too fast, but that's what we had before commit fb35c2ce "audio/dsound: fix invalid parameters error". The complete fix comes with the next patch. Reported-by:
Qi Zhou <atmgnd@outlook.com> Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-2-vr_qemu@t-online.de Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Sep 17, 2020
-
-
zhaolichang authored
I found that there are many spelling errors in the comments of qemu, so I used the spellcheck tool to check the spelling errors and finally found some spelling errors in the folder. Signed-off-by:
zhaolichang <zhaolichang@huawei.com> Reviewed-by:
Alex Bennee <alex.bennee@linaro.org> Message-Id: <20200917075029.313-2-zhaolichang@huawei.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- May 26, 2020
-
-
Bruce Rogers authored
Commit 571a8c52 caused the HMP wavcapture command to segfault when processing audio data in audio_pcm_sw_write(), where a NULL sw->hw->pcm_ops is dereferenced. This fix checks that the pointer is valid before dereferincing it. A similar fix is also made in the parallel function audio_pcm_sw_read(). Fixes: 571a8c52 (audio: split ctl_* functions into enable_* and volume_*) Signed-off-by:
Bruce Rogers <brogers@suse.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20200521172931.121903-1-brogers@suse.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- May 25, 2020
-
-
Geoffrey McRae authored
This commit adds a new audiodev backend to allow QEMU to use JACK as both an audio sink and source. Signed-off-by:
Geoffrey McRae <geoff@hostfission.com> Message-Id: <20200512101603.E3DB73A038E@moya.office.hostfission.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Apr 06, 2020
-
-
Volker Rümelin authored
This patch prevents an underflow of variable samples in function audio_pcm_hw_run_in(). See commit 599eac4e "audio: audio_generic_get_buffer_in should honor *size". This time the while loop in audio_pcm_hw_run_in() will terminate nevertheless, because it seems the recording stream in Windows is always rate limited. Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200405075017.9901-3-vr_qemu@t-online.de Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- 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>
-
Kővágó, Zoltán authored
Windows (unlike wine) bails out when IDirectSoundBuffer8::Lock is called with zero length. Also, hw->pos_emul handling was incorrect when calling this function for the first time. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reported-by:
KJ Liew <liewkj@yahoo.com> Tested-by:
Howard Spoelstra <hsp.cat7@gmail.com> Message-id: fe9744216d9d421a2dbb09bcf5fa0dbd18f77ac5.1580684275.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jan 31, 2020
-
-
Volker Rümelin authored
The function generic_get_buffer_in currently ignores the *size parameter and may return a buffer larger than *size. As a result the variable samples in function audio_pcm_hw_run_in may underflow. The while loop then most likely will never termiate. Buglink: http://bugs.debian.org/948658 Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-9-vr_qemu@t-online.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
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>
-
Volker Rümelin authored
With audiodev parameter out.mixing-engine=off hw->mix_buf is NULL. This leads to a segmentation fault in AUD_get_buffer_size_out. This patch reverts a small part of dc88e38f "audio: unify input and output mixeng buffer management". To reproduce the problem start qemu with -soundhw adlib -audiodev pa,id=audio0,out.mixing-engine=off Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-4-vr_qemu@t-online.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Volker Rümelin authored
It seems the function audio_generic_read started as a copy of function audio_generic_write and some necessary changes were forgotten. Fix the mixed up source and destination pointers and rename misnamed variables. Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-2-vr_qemu@t-online.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Volker Rümelin authored
The pcm_ops function put_buffer_out expects the returned pointer of function get_buffer_out as argument. Fix this. Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20200123074943.6699-1-vr_qemu@t-online.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Jan 24, 2020
-
-
Philippe Mathieu-Daudé authored
When building with GCC9 using CFLAG -Wimplicit-fallthrough=2 we get: audio/audio.c: In function ‘audio_pcm_init_info’: audio/audio.c:306:14: error: this statement may fall through [-Werror=implicit-fallthrough=] 306 | sign = 1; | ~~~~~^~~ audio/audio.c:307:5: note: here 307 | case AUDIO_FORMAT_U8: | ^~~~ cc1: all warnings being treated as errors Similarly to e4634941, add the missing fall through comment to hint GCC. Fixes: 2b9cce8c Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by:
Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20191218192526.13845-2-philmd@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jan 06, 2020
-
-
Volker Rümelin authored
Tell the compiler to do a 32bit * 32bit -> 64bit multiplication because period_ticks is a 64bit variable. The overflow occurs for audio timer periods larger than 4294967us. Fixes: be1092af "audio: fix audio timer rate conversion bug" Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-id: 8893a235-66a8-8fbe-7d95-862e29da90b1@t-online.de Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Nov 20, 2019
-
-
Volker Rümelin authored
With current code audio recording with all audio backends except PulseAudio and DirectSound is broken. The generic audio recording buffer management forgot to update the current read position after a read. Fixes: ff095e52 "audio: api for mixeng code free backends" Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Reviewed-by:
Zoltán Kővágó <DirtY.iCE.hu@gmail.com> Message-id: 2fc947cf-7b42-de68-3f11-cbcf1c096be9@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>
-
Kővágó, Zoltán authored
Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 5d3dd2ee3baaa62805e79c3901abb7415ae32461.1570996490.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
Implementation of the previously added mixing-engine option. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: c05bc258889ed289e8ee1bdbcc5e84174ec221e7.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
This commit removes the ad-hoc rate-limiting code from noaudio and wavaudio, and replaces them with a (slightly modified) code from spiceaudio. This way multiple write calls (for example when the circular buffer wraps around) do not cause problems. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: fd0fe5b95b13fa26d09ae77a72f99d0ea411de14.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
Usage notes: hw->samples became hw->{mix,conv}_buf->size, except before initialization (audio_pcm_hw_alloc_resources_*), hw->samples gives the initial size of the STSampleBuffer. The next commit tries to fix this inconsistency. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: a78caeb2eeb6348ecb45bb2c81709570ef8ac5b3.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: 497decab6d0f0fb9529bea63ec7ce0bd7b553038.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
This will make it possible to skip mixeng with audio playback and recording, allowing us to free ourselves from the limitations of the current mixeng (stereo, int64 samples only). In this case, HW and SW voices will be essentially the same, for every SW voice we will create a HW voice, since we can no longer mix multiple voices together. Some backends expect us to call a function when we have data ready write()/read() style, while others provide a buffer and expects us to directly write/read it, so for optimal performance audio_pcm_ops provide methods for both cases. Previously backends asked mixeng for more data in run_out/run_it, now instead mixeng or the frontends will call the backends, so that's why two sets of functions required. audio.c contains glue code between the two styles, so backends only ever have to implement one style and frontends are free to call whichever is more convenient for them. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 15a33c03a62228922d851f7324c52f73cb8d2414.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Aug 28, 2019
-
-
Kővágó, Zoltán authored
Unfortunately, changes introduced in af2041ed "audio: audiodev= parameters no longer optional when -audiodev present" breaks backward compatibility. This patch changes the error into a deprecation warning. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 02d4328c33455742d01e0b62395013e95293c3ba.1566847960.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Kővágó, Zoltán authored
The code used sizeof(AudiodevAlsaPerDirectionOptions) instead of the appropriate per direction options for the audio backend. If the size of the actual audiodev's per direction options are larger than alsa's, it could cause a buffer overflow. However, alsa has three fields in per direction options: a string, an uint32 and a bool. Oss has the same fields, coreaudio has a single uint32, paaudio has a string and an uint32, all other backends only use the common options, so currently no per direction options struct should be larger than alsa's. Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-Id: <7808bc816ba7da8b8de8a214713444d85f7af3c6.1566847960.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> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: ed35e9e72aa77c9376e9c8a8f3a5443703fe6fbe.1566168923.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: 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>
-