qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* USB-audio sound issues with qemu-system-ppc in Linux and Windows.
@ 2019-10-25 13:28 Howard Spoelstra
  2019-10-26  7:40 ` Howard Spoelstra
  0 siblings, 1 reply; 5+ messages in thread
From: Howard Spoelstra @ 2019-10-25 13:28 UTC (permalink / raw)
  To: qemu-devel qemu-devel

[-- Attachment #1: Type: text/plain, Size: 5587 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

ps: thanks to Zoltan for pointing out I sent the original message into an
earlier thread ;-)

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: USB-audio sound issues with qemu-system-ppc in Linux and Windows.
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Howard Spoelstra @ 2019-10-26  7:40 UTC (permalink / raw)
  To: qemu-devel qemu-devel

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

Hi,

I'd like to add to the previous report that similar issues are present in
OSX (Sierra) builds of qemu-system-ppc.

In Mac OS 9.2 and OS X 10.3 guests, sound through the usb-audio device is
unrecognisable.
After forcibly shutting down Mac OS 9.2 after it becomes unresponsive, qemu
crashes. The OS X crash reporter says this:
Thread 2 Crashed:
0   qemu-system-ppc               0x000000010999c4bd timer_del + 13
(qemu-timer.c:429)
1   qemu-system-ppc               0x00000001096d543f audio_reset_timer +
319 (audio.c:811)
2   qemu-system-ppc               0x00000001096ca2a6 vm_state_notify + 262
(vl.c:1433)
3   qemu-system-ppc               0x000000010953642f do_vm_stop + 47
(cpus.c:1104)
4   qemu-system-ppc               0x00000001096ceed7 qemu_main + 17239
(vl.c:4477)
5   qemu-system-ppc               0x000000010988a526 call_qemu_main + 38
(cocoa.m:1769)
6   qemu-system-ppc               0x00000001099a11ee qemu_thread_start +
126 (qemu-thread-posix.c:519)
7   libsystem_pthread.dylib       0x00007fffb864a93b _pthread_body + 180
8   libsystem_pthread.dylib       0x00007fffb864a887 _pthread_start + 286
9   libsystem_pthread.dylib       0x00007fffb864a08d thread_start + 13

Best,
Howard

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: USB-audio sound issues with qemu-system-ppc in Linux and Windows.
  2019-10-26  7:40 ` Howard Spoelstra
@ 2019-10-26  9:38   ` BALATON Zoltan
  2019-10-26  9:45     ` BALATON Zoltan
  0 siblings, 1 reply; 5+ messages in thread
From: BALATON Zoltan @ 2019-10-26  9:38 UTC (permalink / raw)
  To: Howard Spoelstra; +Cc: qemu-devel qemu-devel

Hello,

On Sat, 26 Oct 2019, Howard Spoelstra wrote:
> I'd like to add to the previous report that similar issues are present in
> OSX (Sierra) builds of qemu-system-ppc.

I think the problem is not specific to host OS so instead of giving 
debugging info for all hosts which would just confuse anyone trying to 
reproduce it, it may be better to just concentrate on Linux (as that's 
what most developers would have) and ignore Windows and OSX hosts for now.

It's probably also not specific to MacOS guests because I get similar 
crackling sound on sam460ex with the ES1370 device with AmigaOS4 and can 
reproduce the usb-audio shows up but does not make sound problem on 
mac99,via=pmu with MorphOS so maybe either it's something with the sound 
backend (like a buffer underflow in case of crackling that may be improved 
by tweaking some parameters but I don't know what parameters are available 
or how to set them) or maybe a problem with irqs (in case of no sound or 
crashing MacOS guest but I don't know how to debug that either). Or I may 
be completely wrong with my guesses so any advice from people knowing 
sound and USB emulation in QEMU better is very welcome. (Also likely there 
are more than one problem here so reporting them at once is also 
confusing, these may need to be debugged separately.)

So to most likely get useful feedback you should find a simple way to 
reproduce it with Linux host and guest and describe that in the shortest 
way to make it easy for interested developers to reproduce it then also cc 
your Gerd who is the audio and USB maintainer. Otherwise it's likely these 
will get ignored because nobody can reproduce it who would able to attempt 
debugging it.

Regards,
BALATON Zoltan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: USB-audio sound issues with qemu-system-ppc in Linux and Windows.
  2019-10-26  9:38   ` BALATON Zoltan
@ 2019-10-26  9:45     ` BALATON Zoltan
  0 siblings, 0 replies; 5+ messages in thread
From: BALATON Zoltan @ 2019-10-26  9:45 UTC (permalink / raw)
  To: Howard Spoelstra; +Cc: qemu-devel qemu-devel

On Sat, 26 Oct 2019, BALATON Zoltan wrote:
> On Sat, 26 Oct 2019, Howard Spoelstra wrote:
>> I'd like to add to the previous report that similar issues are present in
>> OSX (Sierra) builds of qemu-system-ppc.
>
> I think the problem is not specific to host OS so instead of giving debugging 
> info for all hosts which would just confuse anyone trying to reproduce it, it 
> may be better to just concentrate on Linux (as that's what most developers 
> would have) and ignore Windows and OSX hosts for now.
>
> It's probably also not specific to MacOS guests because I get similar 
> crackling sound on sam460ex with the ES1370 device with AmigaOS4 and can 
> reproduce the usb-audio shows up but does not make sound problem on 
> mac99,via=pmu with MorphOS so maybe either it's something with the sound 
> backend (like a buffer underflow in case of crackling that may be improved by 
> tweaking some parameters but I don't know what parameters are available or 
> how to set them) or maybe a problem with irqs (in case of no sound or 
> crashing MacOS guest but I don't know how to debug that either). Or I may be 
> completely wrong with my guesses so any advice from people knowing sound and 
> USB emulation in QEMU better is very welcome. (Also likely there are more 
> than one problem here so reporting them at once is also confusing, these may 
> need to be debugged separately.)
>
> So to most likely get useful feedback you should find a simple way to 
> reproduce it with Linux host and guest and describe that in the shortest way 
> to make it easy for interested developers to reproduce it then also cc your 
> Gerd who is the audio and USB maintainer. Otherwise it's likely these will

correction: cc your message to Gerd

> get ignored because nobody can reproduce it who would able to attempt 
> debugging it.
>
> Regards,
> BALATON Zoltan
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* USB-audio sound issues with qemu-system-ppc in Linux and Windows.
  2019-10-25  6:36 ` [PULL v2 46/73] target/alpha: fetch code with translator_ld Alex Bennée
@ 2019-10-25  7:40   ` Howard Spoelstra
  0 siblings, 0 replies; 5+ messages in thread
From: Howard Spoelstra @ 2019-10-25  7:40 UTC (permalink / raw)
  To: qemu-devel qemu-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-26  9:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2019-10-25  6:36 [PULL v2 00/73] tcg plugins and testing updates Alex Bennée
2019-10-25  6:36 ` [PULL v2 46/73] target/alpha: fetch code with translator_ld Alex Bennée
2019-10-25  7:40   ` USB-audio sound issues with qemu-system-ppc in Linux and Windows Howard Spoelstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).