summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gdbstub: drop gdbserver_cleanup in favour of gdb_exitAlex Bennée2021-01-183-11/+12
| | | | | | | | | | Despite it's name it didn't actually clean-up so let us document gdb_exit() better and use that. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210108224256.2321-9-alex.bennee@linaro.org>
* gdbstub: drop CPUEnv from gdb_exit()Alex Bennée2021-01-187-9/+9
| | | | | | | | | | | gdb_exit() has never needed anything from env and I doubt we are going to start now. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210108224256.2321-8-alex.bennee@linaro.org>
* gdbstub: add support to Xfer:auxv:read: packetLirong Yuan2021-01-184-0/+121
| | | | | | | | | | | | | This allows gdb to access the target’s auxiliary vector, which can be helpful for telling system libraries important details about the hardware, operating system, and process. Signed-off-by: Lirong Yuan <yuanzi@google.com> [AJB: minor tweaks to test case, update MAINTAINERS, restrict to Linux] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20200730193932.3654677-1-yuanzi@google.com> Message-Id: <20210108224256.2321-7-alex.bennee@linaro.org>
* gdbstub: implement a softmmu based testAlex Bennée2021-01-189-12/+181
| | | | | | | | | | | | | | | | | This adds a new tests that allows us to test softmmu only features including watchpoints. To do achieve this we need to: - add _exit: labels to the boot codes - write a memory.py test case - plumb the test case into the build system - tweak the run_test script to: - re-direct output when asked - use socket based connection for all tests - add a small pause before connection Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210108224256.2321-6-alex.bennee@linaro.org>
* Revert "tests/tcg/multiarch/Makefile.target: Disable run-gdbstub-sha1 test"Alex Bennée2021-01-181-3/+1Star
| | | | | | | | | | We won't attempt to run the test now it's gated on a newer version of gdb. This reverts commit a930cadd83b4681a98ce72abf530a791ee2e42a6. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210108224256.2321-5-alex.bennee@linaro.org>
* configure: gate our use of GDB to 8.3.1 or aboveAlex Bennée2021-01-181-2/+5
| | | | | | | | | | | | | | The support of socket based debugging which we need for linux-user testing is only really stable as of 8.3.1 so lets gate our use of GDB on having a relatively modern version. For direct testing you can just point to a locally compiled version of gdb via configure, e.g.: ../../configure --gdb=$HOME/src/binutils-gdb.git/builds/all/install/bin/gdb Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210108224256.2321-4-alex.bennee@linaro.org>
* test/guest-debug: echo QEMU command as wellAlex Bennée2021-01-181-0/+1
| | | | | | | | This helps with debugging. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210108224256.2321-3-alex.bennee@linaro.org>
* scripts/checkpatch.pl: fix git-show invocation to include diffstatAlex Bennée2021-01-181-1/+1
| | | | | | | | | | | | Without this checkpatch keeps complaining about new/changed files even when MAINTAINERS has been updated. Normal invocations of checkpatch on patch files rather than commit IDs are unaffected. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210114165730.31607-13-alex.bennee@linaro.org>
* gitlab: migrate the minimal tools and unit tests from TravisAlex Bennée2021-01-182-10/+3Star
| | | | | | | | | | | | These tests are good at shaking out missing stubs which otherwise work if we have built targets. Rather than create a new job just add the checks to the existing tools-and-docs build. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210114165730.31607-12-alex.bennee@linaro.org>
* Fix build with new yank feature by adding stubsLukas Straub2021-01-183-0/+31
| | | | | | | | | | Fixes: 50186051f42 ("Introduce yank feature") Signed-off-by: Lukas Straub <lukasstraub2@web.de> [AJB: tweak MAINTAINERS] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210114141918.5201cc9c@gecko.fritz.box> Message-Id: <20210114165730.31607-11-alex.bennee@linaro.org>
* gitlab: move docs and tools build across from TravisAlex Bennée2021-01-182-22/+22
| | | | | | | | | | | | While we are at it we might as well check the tag generation. For bonus points we run GNU globals htags into the public pages directory for publishing with the auto generated pages. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-Id: <20210114165730.31607-10-alex.bennee@linaro.org>
* docker: expand debian-amd64 image to include tag toolsAlex Bennée2021-01-181-1/+4
| | | | | | | | | | This is going to be helpful when we want to both test the tool integration and in the case of global generate a xref doc build. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210114165730.31607-9-alex.bennee@linaro.org>
* Makefile: wrap cscope in quiet-command callsAlex Bennée2021-01-181-3/+11
| | | | | | | | | For prettier output. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210114165730.31607-8-alex.bennee@linaro.org>
* Makefile: wrap etags in quiet-command callsAlex Bennée2021-01-181-2/+7
| | | | | | | | | For prettier output. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210114165730.31607-7-alex.bennee@linaro.org>
* Makefile: wrap ctags in quiet-command callsAlex Bennée2021-01-181-2/+7
| | | | | | | | | For prettier output. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210114165730.31607-6-alex.bennee@linaro.org>
* Add newline when generating DockerfileAlessandro Di Federico2021-01-181-2/+2
| | | | | | | | | Signed-off-by: Alessandro Di Federico <ale@rev.ng> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <1610080146-14968-36-git-send-email-tsimpson@quicinc.com> Message-Id: <20210114165730.31607-5-alex.bennee@linaro.org>
* shippable.yml: Remove jobs duplicated on Gitlab-CIPhilippe Mathieu-Daudé2021-01-181-13/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following jobs are duplicated on Gitlab-CI since commit 6bcb5fc0f7a ("gitlab-ci: Add cross-compiling build tests"): - IMAGE=debian-armel-cross TARGET_LIST=arm-softmmu -> cross-armel-system TARGET_LIST=arm-linux-user -> cross-armel-user TARGET_LIST=armeb-linux-user -> cross-armel-user - IMAGE=debian-armhf-cross TARGET_LIST=arm-softmmu -> cross-armhf-system TARGET_LIST=arm-linux-user -> cross-armhf-user TARGET_LIST=armeb-linux-user -> cross-armhf-user - IMAGE=debian-arm64-cross TARGET_LIST=aarch64-softmmu -> cross-arm64-system TARGET_LIST=aarch64-linux-user -> cross-arm64-user - IMAGE=debian-s390x-cross TARGET_LIST=s390x-softmmu -> cross-s390x-system TARGET_LIST=s390x-linux-user -> cross-s390x-user - IMAGE=debian-mips-cross TARGET_LIST=mipsel-linux-user -> cross-mips-user - IMAGE=debian-mips64el-cross TARGET_LIST=mips64el-softmmu -> cross-mips64el-system TARGET_LIST=mips64el-linux-user -> cross-mips64el-user - IMAGE=debian-ppc64el-cross TARGET_LIST=ppc64-softmmu -> cross-ppc64el-system TARGET_LIST=ppc64-linux-user -> cross-ppc64el-user TARGET_LIST=ppc64abi32-linux-user -> cross-ppc64el-user Remove them from Shippable CI. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210108145103.269353-1-f4bug@amsat.org> Message-Id: <20210114165730.31607-4-alex.bennee@linaro.org>
* Makefile: add GNU global tags supportAlex Bennée2021-01-182-1/+16
| | | | | | | | | | | | | | GNU Global is another tags engine which is more like cscope in being able to support finding both references and definitions. You will be un-surprised to know it also integrates well with Emacs. The main benefit of integrating it into find-src-path is it takes less time to rebuild the database from scratch when you have a lot of build directories under your source tree. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210114165730.31607-3-alex.bennee@linaro.org>
* tests/docker: Remove Debian 9 remnant linesPhilippe Mathieu-Daudé2021-01-181-1/+0Star
| | | | | | | | | | | | | Debian 9 base container has been removed in commits e3755276d1f and c9d78b06c06. Remove the last remnants. Fixes: e3755276d1f ("tests/docker: Remove old Debian 9 containers") Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Message-Id: <20210107072933.3828450-1-f4bug@amsat.org> Message-Id: <20210114165730.31607-2-alex.bennee@linaro.org>
* Merge remote-tracking branch ↵Peter Maydell2021-01-1517-236/+472
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/kraxel/tags/audio-20210115-pull-request' into staging audio: improvements for sdl, pulse, fsound. audio: cleanups & codestyle fixes. # gpg: Signature made Fri 15 Jan 2021 13:20:56 GMT # gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/audio-20210115-pull-request: (30 commits) audio: space prohibited between function name and parenthesis'(' audio: Suspect code indent for conditional statements audio: Don't use '%#' in format strings audio: Fix lines over 90 characters audio: foo* bar" should be "foo *bar". audio: Add spaces around operator/delete redundant spaces audio: Add braces for statements/fix braces' position dsoundaudio: fix log message dsoundaudio: enable f32 audio sample format dsoundaudio: rename dsound_open() dsoundaudio: replace GetForegroundWindow() paaudio: send recorded data in smaller chunks paaudio: limit minreq to 75% of audio timer_rate paaudio: comment bugs in functions qpa_init_* paaudio: remove unneeded code paaudio: wait until the playback stream is ready paaudio: wait for PA_STREAM_READY in qpa_write() paaudio: avoid to clip samples multiple times audio: remove remaining unused plive code sdlaudio: enable (in|out).mixing-engine=off ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * audio: space prohibited between function name and parenthesis'('Zhang Han2021-01-151-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>
| * audio: Suspect code indent for conditional statementsZhang Han2021-01-151-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>
| * audio: Don't use '%#' in format stringsZhang Han2021-01-151-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>
| * audio: Fix lines over 90 charactersZhang Han2021-01-151-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>
| * audio: foo* bar" should be "foo *bar".Zhang Han2021-01-151-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>
| * audio: Add spaces around operator/delete redundant spacesZhang Han2021-01-154-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>
| * audio: Add braces for statements/fix braces' positionZhang Han2021-01-156-48/+29Star
| | | | | | | | | | | | | | | | | | | | | | 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>
| * dsoundaudio: fix log messageVolker Rümelin2021-01-151-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>
| * dsoundaudio: enable f32 audio sample formatVolker Rümelin2021-01-151-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>
| * dsoundaudio: rename dsound_open()Volker Rümelin2021-01-151-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>
| * dsoundaudio: replace GetForegroundWindow()Volker Rümelin2021-01-152-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>
| * paaudio: send recorded data in smaller chunksVolker Rümelin2021-01-151-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>
| * paaudio: limit minreq to 75% of audio timer_rateVolker Rümelin2021-01-151-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>
| * paaudio: comment bugs in functions qpa_init_*Volker Rümelin2021-01-151-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>
| * paaudio: remove unneeded codeVolker Rümelin2021-01-151-8/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * paaudio: wait until the playback stream is readyVolker Rümelin2021-01-151-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>
| * paaudio: wait for PA_STREAM_READY in qpa_write()Volker Rümelin2021-01-151-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>
| * paaudio: avoid to clip samples multiple timesVolker Rümelin2021-01-151-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>
| * audio: remove remaining unused plive codeVolker Rümelin2021-01-151-16/+1Star
| | | | | | | | | | | | | | | | | | 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>
| * sdlaudio: enable (in|out).mixing-engine=offVolker Rümelin2021-01-151-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>
| * audio: break generic buffer dependency on mixing-engineVolker Rümelin2021-01-151-7/+4Star
| | | | | | | | | | | | | | | | | | | | 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>
| * sdlaudio: add recording functionsVolker Rümelin2021-01-151-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>
| * audio: split pcm_ops function get_buffer_inVolker Rümelin2021-01-157-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>
| * sdlaudio: replace legacy functions with modern onesVolker Rümelin2021-01-151-57/+50Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sdlaudio: fill remaining sample buffer with silenceVolker Rümelin2021-01-151-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>
| * sdlaudio: always clear the sample bufferVolker Rümelin2021-01-151-17/+16Star
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sdlaudio: don't start playback in init routineVolker Rümelin2021-01-151-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sdlaudio: add -audiodev sdl,out.buffer-count optionVolker Rümelin2021-01-156-7/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * audio: fix bit-rotted codeVolker Rümelin2021-01-152-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>
| * sdlaudio: remove leftover SDL1.2 codeVolker Rümelin2021-01-151-17/+13Star
| | | | | | | | | | | | | | | | 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>