utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
25.47k stars 1.29k forks source link

Screamer audio device for PPC mac99 machines not working #2548

Closed brunocastello closed 3 years ago

brunocastello commented 3 years ago

Describe the issue The Screamer audio device is not working. I am using both iOS and macOS versions of UTM 2.1.0 Beta, and there is no sound at all coming out in both builds.

Normally, MacOS 9.2 with QEMU Screamer fork produces a sound for any menu click (even in Sound control panel you can test sounds too). But this build is not producing any sound at all for MacOS 9.2. When I use a QEMU Screamer fork from e-maculation forms, there is sound.

Another unrelated issue is that on previous UTM builds, I was able to use 1280x960x32 resolution on MacOS 9.2. Now I cannot use it anymore, the resolution is not listed anymore, thus forcing me to run 1024x768x32, because other resolutions are either too big or too small for me.

Configuration

brunocastello commented 3 years ago

@conath - I can test for you if there is another build. Just let me know - I have an OS 9.2.2 VM for this.

conath commented 3 years ago

@conath - I can test for you if there is another build. Just let me know - I have an OS 9.2.2 VM for this.

Can you please share your QEMU arguments? You can get it by opening the UTM VM configuration, click on QEMU tab and then Export QEMU arguments. Can click e.g. on Notes and then copy the text and paste it here. Thanks

brunocastello commented 3 years ago

Sure! @conath there it is:

qemu-system-ppc -L /private/var/containers/Bundle/Application/825DB694-F3C5-49DF-B888-C838DE405E35/UTM.app/qemu -S -qmp tcp:127.0.0.1:4444,server,nowait -vga none -spice port=5930,addr=127.0.0.1,disable-ticketing,image-compression=off,playback-compression=off,streaming-video=off -device VGA -cpu g4 -smp cpus=1,sockets=1,cores=1,threads=1 -machine mac99,via=pmu -accel tcg,tb-size=128,split-wx=on -boot menu=on -m 512 -name "MacOS 9.2" -device ich9-usb-ehci1,id=usb-controller-0 -device ich9-usb-uhci1,masterbus=usb-controller-0.0,firstport=0,multifunction=on -device ich9-usb-uhci2,masterbus=usb-controller-0.0,firstport=2,multifunction=on -device ich9-usb-uhci3,masterbus=usb-controller-0.0,firstport=4,multifunction=on -chardev spicevmc,name=usbredir,id=usbredirchardev0 -device usb-redir,chardev=usbredirchardev0,id=usbredirdev0,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev2 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=usb-controller-0.0 -device ide-hd,bus=ide.0,drive=drive0,bootindex=0 -drive "if=none,media=disk,id=drive0,file=/var/mobile/Containers/Data/Application/6CC128D1-352F-4987-AC75-88E6C4B97618/Documents/MacOS 9.2.utm/Images/macOS9.img,cache=writethrough" -device ide-cd,bus=ide.1,drive=drive1,bootindex=1 -drive if=none,media=cdrom,id=drive1 -device sungem,mac=66:C2:26:89:5A:A9,netdev=net0 -netdev user,id=net0,hostfwd=tcp::80-:80,hostfwd=tcp::22-:22 -uuid 1AFED0DA-6802-43D7-A81E-4659EC2FED6B -rtc base=localtime -g 1280x960x32 -device usb-tablet

conath commented 3 years ago

Seems fine, not seeing an audio device in there but according to release notes that is not required. @osy did you test PPC audio works with https://github.com/utmapp/UTM/commit/17bc4ecaca322ec78e6f8fee4aadf83c44d47914 ?

osy commented 3 years ago

I actually don’t have anything to test with. Would be great if someone can send me a img.

brunocastello commented 3 years ago

Its actually pretty easy. I think you can use an ISO image from macos9lives.com to make an install.

But, I can test too. I have QEMU Screamer fork running on my mac to compare with UTM.

brunocastello commented 3 years ago

Seems fine, not seeing an audio device in there but according to release notes that is not required. @osy did you test PPC audio works with 17bc4ec ?

Yup its not required. The Screamer fork has no need to declare an audio device.

But there is a catch, your RAM cannot be higher than 1GB (including the virtual memory) or the sound will not work. My macos 9.2.2 has 512mb plus 512mb vram.

osy commented 3 years ago

Its actually pretty easy. I think you can use an ISO image from macos9lives.com to make an install.

But, I can test too. I have QEMU Screamer fork running on my mac to compare with UTM.

I can't find it on that site. To make things easy for me, can you send me a working .utm? That way we can have it fixed quickly.

brunocastello commented 3 years ago

I'll try to create a smaller image with an out of the box install

conath commented 3 years ago

@brunocastello No need, I've sent one.

brunocastello commented 3 years ago

Thanks, @conath !

@osy , just make sure you start with 512MB RAM for sound to work well, because macOS 9 adds up to 512MB virtual memory too. You can also disable virtual memory and allocate nearly 1GB RAM straight on. Above 1GB it just does crackling sounds (similar to the VirtualBox bug with SB16 years ago).

The same trick applies to all other PPC OS X versions after OS 9 as well, I had the same thing for OS X Leopard 10.5.8 too. Leopard works best with more RAM, but you'd have to give up on good sound emulation.

osy commented 3 years ago

So the problem is that screamer supports 44100 Hz while OPUS only supports 48000 Hz. This means the SPICE audio backend is incompatible and probably the reason why audio doesn't work in other configurations. I will add an option to force CoreAudio instead of SPICE.

brunocastello commented 3 years ago

Hi, thanks @osy! Errr.... I do not want to look like I'm picky, but I'm curious and while you're at it dealing with the patch, have you also found the reason why the extra video resolutions are no longer available for that VM?

osy commented 3 years ago

You should file a new ticket. You can leave out the details since it’s the same. This one will probably get closed soon.

brunocastello commented 3 years ago

You should file a new ticket. You can leave out the details since it’s the same. This one will probably get closed soon.

Sure, no problem. I thought I had done it, but I will do.

EDIT: done.

brunocastello commented 3 years ago

Fixed for macOS, but not for iOS