QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Howard Spoelstra <hsp.cat7@gmail.com>
To: qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: USB-audio sound issues with qemu-system-ppc in Linux and Windows.
Date: Fri, 25 Oct 2019 09:40:00 +0200
Message-ID: <CABLmASH=xHu+JZT34kX0cC3N6YsYqan3mzT7b7g1RgWz8nFrYw@mail.gmail.com> (raw)
In-Reply-To: <20191025063713.23374-47-alex.bennee@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 5492 bytes --]

Hi,

I'm  experiencing several issues related to sound using usb-audio when
running qemu-system-ppc in Linux and Windows. Guests tried are Mac OS 9.2
and Mac OS X 10.0, 10.1, 10.2 and 10.3.
(10.4 and 10.5 never have the usb-audio device available for audio
playback, even though the device is recognised in the OS X system profiler.)
It is hit and miss whether the audio device is actually available upon boot
in 9.2 and the other versions of OS X.

Qemu version tried is current master (Oct 25th), Windows version is
cross-compiled from Fedora 30. I do not think there is any regression going
on here, these are just issues that have been present for a long time.

General issue: when audio is played, it almost always sounds crackling.

For reasons of size, I uploaded 3 logs obtained in Linux running Mac OS X
10.3 with -trace "usb*" to:
https://surfdrive.surf.nl/files/index.php/s/YfVVxEE3cHXkFPf/download
1. Log_no_audio_available.txt
2. Log_audio_available_2_sounds_played.txt
3. Log_audio_available_multi_sounds_played_untill_hangup.txt

General issue in Linux (fedora 30)(which seems related to bug
https://bugs.launchpad.net/qemu/+bug/1623998):
[hsp@fedora30 qemu-master]$ ./startqemu.sh
pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument

General issue in Windows 10: I always get to a point where this is logged:
dsound: Could not lock playback buffer
dsound: Reason: An invalid parameter was passed to the returning function
dsound: Failed to lock buffer

Linux specific.
Qemu invocation for Mac OS 9.2:
./qemu-system-ppc -L pc-bios -boot c -M mac99 -m 512 \
-drive file=~/Mac-disks/9.2.img,format=raw,media=disk \
-serial stdio -sdl -device usb-audio -trace "*aud*"

This immediately starts logging:
7380@1571817102.833929:audio_timer_start interval 10 ms
7380@1571817125.207880:audio_timer_delayed interval 16 ms
7380@1571817129.046816:audio_timer_delayed interval 16 ms

Any movement of a window on the Linux desktop results in additional
audio_timer_delayed logging.
The audio_timer_delayed never stops.
In Mac OS 9.2, the desktop icons disappear after some seconds of running,
so the system cannot be stopped normally.
Running the GTK GUI, only this is logged (no additional logging when moving
windows).
14130@1571988483.402017:audio_timer_start interval 10 ms
But the icons on the desktop also disappear.

When running Mac OS X 10.X and clicking some system sounds, I see:
12134@1571818709.446031:audio_timer_start interval 10 ms
12134@1571818710.195023:audio_timer_stop
12134@1571818714.951030:audio_timer_start interval 10 ms
12134@1571818715.432959:audio_timer_stop
12134@1571818717.171045:audio_timer_start interval 10 ms
12134@1571818717.714323:audio_timer_stop
12134@1571818718.072381:audio_timer_start interval 10 ms
12134@1571818719.114544:audio_timer_stop

After randomly clicking some system sounds more, the timer starts delaying
and no longer stops:
12134@1571818893.564793:audio_timer_stop
12134@1571818895.698040:audio_timer_start interval 10 ms
12134@1571818899.961673:audio_timer_delayed interval 15 ms
12134@1571818900.472716:audio_timer_delayed interval 15 ms
12134@1571818902.759007:audio_timer_delayed interval 15 ms
12134@1571818905.803400:audio_timer_delayed interval 15 ms
But the systems stays responsive, so can be shut down.

Windows specific.
Invocation:
qemu-system-ppc.exe -L pc-bios -boot c -M mac99 -m 512 ^
-drive file=C:\Mac-disks\9.2.img,format=raw,media=disk ^
-serial stdio -sdl -device usb-audio -trace "*aud*"

This immediately starts logging the audio_timer_start interval and never
stops.
Icons disappear from the desktop after some seconds.

When running Mac OS X 10.X, playing just two system sounds results in:
2380@1571822566.040790:audio_timer_start interval 10 ms
2380@1571822566.108279:audio_timer_delayed interval 22 ms
2380@1571822566.128820:audio_timer_delayed interval 20 ms
2380@1571822566.150509:audio_timer_delayed interval 22 ms
2380@1571822566.172112:audio_timer_delayed interval 21 ms
......
2380@1571822566.561345:audio_timer_delayed interval 21 ms
2380@1571822566.583846:audio_timer_delayed interval 22 ms
2380@1571822566.600482:audio_timer_delayed interval 15 ms
2380@1571822566.610111:audio_timer_stop
2380@1571822572.226433:audio_timer_start interval 10 ms
2380@1571822572.250866:audio_timer_delayed interval 24 ms
2380@1571822572.269819:audio_timer_delayed interval 18 ms
......
2380@1571822572.452403:audio_timer_delayed interval 20 ms
2380@1571822572.474190:audio_timer_delayed interval 21 ms
2380@1571822572.509474:audio_timer_delayed interval 35 ms
dsound: Could not lock playback buffer
dsound: Reason: An invalid parameter was passed to the returning function
dsound: Failed to lock buffer
2380@1571822572.560505:audio_timer_delayed interval 51 ms
2380@1571822572.581102:audio_timer_delayed interval 19 ms
2380@1571822572.600912:audio_timer_delayed interval 19 ms

There is no saying when audio_timer_delayed will start displaying
constantly.
Only when one set of:
2260@1571823472.652244:audio_timer_start interval 10 ms
2260@1571823473.198349:audio_timer_stop
Is following directly after each other, sound is played somewhat correctly.
After randomly clicking several system sounds, the audio_timer_delayed
message never stops.

Thanks for looking into this.
If there is any additional information needed, or disk images of Mac OS 9.2
or OS X 10.3 are required, please let me know.

Best,
Howard

[-- Attachment #2: Type: text/html, Size: 6050 bytes --]

<div dir="ltr"><div dir="ltr">Hi,<br><br>I&#39;m  experiencing several issues related to sound using usb-audio when running qemu-system-ppc in Linux and Windows. Guests tried are Mac OS 9.2 and Mac OS X 10.0, 10.1, 10.2 and 10.3. <br>(10.4 and 10.5 never have the usb-audio device available for audio playback, even though the device is recognised in the OS X system profiler.)<br>It is hit and miss whether the audio device is actually available upon boot in 9.2 and the other versions of OS X.<br><br>Qemu version tried is current master (Oct 25th), Windows version is cross-compiled from Fedora 30. I do not think there is any regression going on here, these are just issues that have been present for a long time.<br><br>General issue: when audio is played, it almost always sounds crackling.<br><br>For reasons of size, I uploaded 3 logs obtained in Linux running Mac OS X 10.3 with -trace &quot;usb*&quot; to: <a href="https://surfdrive.surf.nl/files/index.php/s/YfVVxEE3cHXkFPf/download">https://surfdrive.surf.nl/files/index.php/s/YfVVxEE3cHXkFPf/download</a><br>1. Log_no_audio_available.txt<br>2. Log_audio_available_2_sounds_played.txt<br>3. Log_audio_available_multi_sounds_played_untill_hangup.txt<br><br>General issue in Linux (fedora 30)(which seems related to bug <a href="https://bugs.launchpad.net/qemu/+bug/1623998">https://bugs.launchpad.net/qemu/+bug/1623998</a>):<br>[hsp@fedora30 qemu-master]$ ./startqemu.sh<br>pulseaudio: set_sink_input_volume() failed<br>pulseaudio: Reason: Invalid argument<br>pulseaudio: set_sink_input_mute() failed<br>pulseaudio: Reason: Invalid argument<br><br>General issue in Windows 10: I always get to a point where this is logged:<br>dsound: Could not lock playback buffer<br>dsound: Reason: An invalid parameter was passed to the returning function<br>dsound: Failed to lock buffer<br><br>Linux specific.<br>Qemu invocation for Mac OS 9.2:<br>./qemu-system-ppc -L pc-bios -boot c -M mac99 -m 512 \<br>-drive file=~/Mac-disks/9.2.img,format=raw,media=disk \<br>-serial stdio -sdl -device usb-audio -trace &quot;*aud*&quot;<br><br>This immediately starts logging:<br>7380@1571817102.833929:audio_timer_start interval 10 ms<br>7380@1571817125.207880:audio_timer_delayed interval 16 ms<br>7380@1571817129.046816:audio_timer_delayed interval 16 ms<br><br>Any movement of a window on the Linux desktop results in additional audio_timer_delayed logging. <br>The audio_timer_delayed never stops.<br>In Mac OS 9.2, the desktop icons disappear after some seconds of running, so the system cannot be stopped normally.<br>Running the GTK GUI, only this is logged (no additional logging when moving windows).<br>14130@1571988483.402017:audio_timer_start interval 10 ms<br>But the icons on the desktop also disappear.<br><br>When running Mac OS X 10.X and clicking some system sounds, I see: <br>12134@1571818709.446031:audio_timer_start interval 10 ms<br>12134@1571818710.195023:audio_timer_stop <br>12134@1571818714.951030:audio_timer_start interval 10 ms<br>12134@1571818715.432959:audio_timer_stop <br>12134@1571818717.171045:audio_timer_start interval 10 ms<br>12134@1571818717.714323:audio_timer_stop <br>12134@1571818718.072381:audio_timer_start interval 10 ms<br>12134@1571818719.114544:audio_timer_stop <br><br>After randomly clicking some system sounds more, the timer starts delaying and no longer stops:<br>12134@1571818893.564793:audio_timer_stop <br>12134@1571818895.698040:audio_timer_start interval 10 ms<br>12134@1571818899.961673:audio_timer_delayed interval 15 ms<br>12134@1571818900.472716:audio_timer_delayed interval 15 ms<br>12134@1571818902.759007:audio_timer_delayed interval 15 ms<br>12134@1571818905.803400:audio_timer_delayed interval 15 ms<br>But the systems stays responsive, so can be shut down.<br><br>Windows specific.<br>Invocation:<br>qemu-system-ppc.exe -L pc-bios -boot c -M mac99 -m 512 ^<br>-drive file=C:\Mac-disks\9.2.img,format=raw,media=disk ^<br>-serial stdio -sdl -device usb-audio -trace &quot;*aud*&quot;<br><br>This immediately starts logging the audio_timer_start interval and never stops.<br>Icons disappear from the desktop after some seconds.<br><br>When running Mac OS X 10.X, playing just two system sounds results in:<br>2380@1571822566.040790:audio_timer_start interval 10 ms<br>2380@1571822566.108279:audio_timer_delayed interval 22 ms<br>2380@1571822566.128820:audio_timer_delayed interval 20 ms<br>2380@1571822566.150509:audio_timer_delayed interval 22 ms<br>2380@1571822566.172112:audio_timer_delayed interval 21 ms<br>......<br>2380@1571822566.561345:audio_timer_delayed interval 21 ms<br>2380@1571822566.583846:audio_timer_delayed interval 22 ms<br>2380@1571822566.600482:audio_timer_delayed interval 15 ms<br>2380@1571822566.610111:audio_timer_stop<br>2380@1571822572.226433:audio_timer_start interval 10 ms<br>2380@1571822572.250866:audio_timer_delayed interval 24 ms<br>2380@1571822572.269819:audio_timer_delayed interval 18 ms<br>......<br>2380@1571822572.452403:audio_timer_delayed interval 20 ms<br>2380@1571822572.474190:audio_timer_delayed interval 21 ms<br>2380@1571822572.509474:audio_timer_delayed interval 35 ms<br>dsound: Could not lock playback buffer<br>dsound: Reason: An invalid parameter was passed to the returning function<br>dsound: Failed to lock buffer<br>2380@1571822572.560505:audio_timer_delayed interval 51 ms<br>2380@1571822572.581102:audio_timer_delayed interval 19 ms<br>2380@1571822572.600912:audio_timer_delayed interval 19 ms<br><br>There is no saying when audio_timer_delayed will start displaying constantly. <br>Only when one set of: <br>2260@1571823472.652244:audio_timer_start interval 10 ms<br>2260@1571823473.198349:audio_timer_stop<br>Is following directly after each other, sound is played somewhat correctly.<br>After randomly clicking several system sounds, the audio_timer_delayed message never stops.<br><br>Thanks for looking into this. <br>If there is any additional information needed, or disk images of Mac OS 9.2 or OS X 10.3 are required, please let me know.<br><br>Best,<br>Howard</div></div>

  reply index

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  6:36 [PULL v2 00/73] tcg plugins and testing updates Alex Bennée
2019-10-25  6:36 ` [PULL v2 01/73] travis.yml: reduce scope of the --enable-debug build Alex Bennée
2019-10-25  6:36 ` [PULL v2 02/73] travis.yml: Add libvdeplug-dev to compile-test net/vde.c Alex Bennée
2019-10-25  6:36 ` [PULL v2 03/73] travis.yml: Use libsdl2 instead of libsdl1.2, and install libsdl2-image Alex Bennée
2019-10-25  6:36 ` [PULL v2 04/73] travis.yml: Use newer version of libgnutls and libpng Alex Bennée
2019-10-25  6:36 ` [PULL v2 05/73] travis.yml: Fix the ccache lines Alex Bennée
2019-10-25  6:36 ` [PULL v2 06/73] travis.yml: Test the release tarball Alex Bennée
2019-10-25  6:36 ` [PULL v2 07/73] travis.yml: bump Xcode 10 to latest dot release Alex Bennée
2019-10-25  6:36 ` [PULL v2 08/73] cirrus.yml: add latest Xcode build target Alex Bennée
2019-10-25  6:36 ` [PULL v2 09/73] tests/vm: netbsd autoinstall, using serial console Alex Bennée
2019-10-25  6:36 ` [PULL v2 10/73] tests/vm: Let subclasses disable IPv6 Alex Bennée
2019-10-25  6:36 ` [PULL v2 11/73] tests/vm/netbsd: Disable IPv6 Alex Bennée
2019-10-25  6:36 ` [PULL v2 12/73] travis.yml: cache the clang sanitizer build Alex Bennée
2019-10-25  6:36 ` [PULL v2 13/73] gitlab-ci.yml: Use libvdeplug-dev to compile-test the VDE network backend Alex Bennée
2019-10-25  6:36 ` [PULL v2 14/73] travis.yml: --enable-debug-tcg to check-tcg Alex Bennée
2019-10-25  6:36 ` [PULL v2 15/73] tests/docker: set HOST_ARCH if we don't have ARCH Alex Bennée
2019-10-25  6:36 ` [PULL v2 16/73] tests/docker: update Travis image to a more current version Alex Bennée
2019-10-25  6:36 ` [PULL v2 17/73] trace: expand mem_info:size_shift to 4 bits Alex Bennée
2019-10-25  6:36 ` [PULL v2 18/73] trace: add mmu_index to mem_info Alex Bennée
2019-10-25  6:36 ` [PULL v2 19/73] cpu: introduce cpu_in_exclusive_context() Alex Bennée
2019-10-25  6:36 ` [PULL v2 20/73] translate-all: use cpu_in_exclusive_work_context() in tb_flush Alex Bennée
2019-10-25  6:36 ` [PULL v2 21/73] docs/devel: add plugins.rst design document Alex Bennée
2019-10-25  6:36 ` [PULL v2 22/73] plugin: add user-facing API Alex Bennée
2019-10-25  6:36 ` [PULL v2 23/73] plugin: add core code Alex Bennée
2019-10-25  6:36 ` [PULL v2 24/73] plugin: add implementation of the api Alex Bennée
2019-10-25  6:36 ` [PULL v2 25/73] queue: add QTAILQ_REMOVE_SEVERAL Alex Bennée
2019-10-25  6:36 ` [PULL v2 26/73] cputlb: document get_page_addr_code Alex Bennée
2019-10-25  6:36 ` [PULL v2 27/73] cputlb: introduce get_page_addr_code_hostp Alex Bennée
2019-10-25  6:36 ` [PULL v2 28/73] tcg: add tcg_gen_st_ptr Alex Bennée
2019-10-25  6:36 ` [PULL v2 29/73] plugin-gen: add module for TCG-related code Alex Bennée
2019-10-25  6:36 ` [PULL v2 30/73] atomic_template: add inline trace/plugin helpers Alex Bennée
2019-10-25  6:36 ` [PULL v2 31/73] tcg: let plugins instrument virtual memory accesses Alex Bennée
2019-10-25  6:36 ` [PULL v2 32/73] plugins: implement helpers for resolving hwaddr Alex Bennée
2019-10-25  6:36 ` [PULL v2 33/73] translate-all: notify plugin code of tb_flush Alex Bennée
2019-10-25  6:36 ` [PULL v2 34/73] *-user: notify plugin of exit Alex Bennée
2019-10-25  6:36 ` [PULL v2 35/73] *-user: plugin syscalls Alex Bennée
2019-10-25  6:36 ` [PULL v2 36/73] cpu: hook plugin vcpu events Alex Bennée
2019-10-25  6:36 ` [PULL v2 37/73] plugin-gen: add plugin_insn_append Alex Bennée
2019-10-25  6:36 ` [PULL v2 38/73] cputlb: ensure _cmmu helper functions follow the naming standard Alex Bennée
2019-10-25  6:36 ` [PULL v2 39/73] translator: add translator_ld{ub,sw,uw,l,q} Alex Bennée
2019-10-25  6:36 ` [PULL v2 40/73] target/arm: fetch code with translator_ld Alex Bennée
2019-10-25  6:36 ` [PULL v2 41/73] target/ppc: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 42/73] target/sh4: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 43/73] target/i386: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 44/73] target/hppa: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 45/73] target/m68k: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 46/73] target/alpha: " Alex Bennée
2019-10-25  7:40   ` Howard Spoelstra [this message]
2019-10-25  6:36 ` [PULL v2 47/73] target/riscv: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 48/73] target/sparc: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 49/73] target/xtensa: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 50/73] target/openrisc: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 51/73] translator: inject instrumentation from plugins Alex Bennée
2019-10-25  6:36 ` [PULL v2 52/73] configure: add --enable-plugins Alex Bennée
2019-10-25  6:36 ` [PULL v2 53/73] plugin: add API symbols to qemu-plugins.symbols Alex Bennée
2019-10-25  6:36 ` [PULL v2 54/73] plugin: expand the plugin_init function to include an info block Alex Bennée
2019-10-25  6:36 ` [PULL v2 55/73] plugin: add qemu_plugin_insn_disas helper Alex Bennée
2019-10-25  6:36 ` [PULL v2 56/73] plugin: add qemu_plugin_outs helper Alex Bennée
2019-10-25  6:36 ` [PULL v2 57/73] vl: support -plugin option Alex Bennée
2019-10-25  6:36 ` [PULL v2 58/73] linux-user: " Alex Bennée
2019-10-25  6:36 ` [PULL v2 59/73] tests/plugin: add sample plugins Alex Bennée
2019-10-25  6:37 ` [PULL v2 60/73] tests/tcg/Makefile.target: fix path to config-host.mak Alex Bennée
2019-10-25  6:37 ` [PULL v2 61/73] tests/tcg: set QEMU_OPTS for all cris runs Alex Bennée
2019-10-25  6:37 ` [PULL v2 62/73] tests/tcg: move "virtual" tests to EXTRA_TESTS Alex Bennée
2019-10-25  6:37 ` [PULL v2 63/73] tests/tcg: drop test-i386-fprem from TESTS when not SLOW Alex Bennée
2019-10-25  6:37 ` [PULL v2 64/73] tests/tcg: enable plugin testing Alex Bennée
2019-10-25  6:37 ` [PULL v2 65/73] tests/plugin: add a hotblocks plugin Alex Bennée
2019-10-25  6:37 ` [PULL v2 66/73] tests/plugin: add instruction execution breakdown Alex Bennée
2019-10-25  6:37 ` [PULL v2 67/73] tests/plugin: add hotpages to analyse memory access patterns Alex Bennée
2019-10-25  6:37 ` [PULL v2 68/73] accel/stubs: reduce headers from tcg-stub Alex Bennée
2019-10-25  6:37 ` [PULL v2 69/73] include/exec: wrap cpu_ldst.h in CONFIG_TCG Alex Bennée
2019-10-25  6:37 ` [PULL v2 70/73] .travis.yml: add --enable-plugins tests Alex Bennée
2019-10-25  6:37 ` [PULL v2 71/73] scripts/checkpatch.pl: don't complain about (foo, /* empty */) Alex Bennée
2019-10-25  6:37 ` [PULL v2 72/73] MAINTAINERS: add me for the TCG plugins code Alex Bennée
2019-10-25  6:37 ` [PULL v2 73/73] travis.yml: enable linux-gcc-debug-tcg cache Alex Bennée
2019-10-25 12:59 ` [PULL v2 00/73] tcg plugins and testing updates Markus Armbruster
2019-10-25 15:04   ` Alex Bennée
2019-10-25 20:23     ` Markus Armbruster
2019-10-27 19:44       ` Peter Maydell
2019-10-28  9:07         ` Alex Bennée
2019-11-06 12:42       ` Markus Armbruster
2019-11-08 17:23         ` Peter Maydell
2019-10-25 16:53 ` Peter Maydell
2019-10-25 19:38   ` Alex Bennée
2019-10-25 13:28 USB-audio sound issues with qemu-system-ppc in Linux and Windows Howard Spoelstra
2019-10-26  7:40 ` Howard Spoelstra
2019-10-26  9:38   ` BALATON Zoltan
2019-10-26  9:45     ` BALATON Zoltan

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABLmASH=xHu+JZT34kX0cC3N6YsYqan3mzT7b7g1RgWz8nFrYw@mail.gmail.com' \
    --to=hsp.cat7@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git