GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

I tried working on the screamer sound card by changing the size of its buffer. The result was not very good. Too big of a buffer makes the audio not play. A smaller buffer doesn't help things either.

I'm wondering if the problem is my computer's processor. It is a 6 year old Core 2 Duo. Maybe we need faster processors.

Is there anyone who has tried the screamer sound card and has really good sound output? Please let us know what your host processor is.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

As said when I first provided the screamer builds based on Marks source: only 9.2 has some reasonable stable sound output. Even that worked better when starting e.g., mp3 play a second time.
All others crackle and pause. We tested various settings for buffers etc during development, but nothing made real differences.

My processor is a 3.5 Ghz I7.

Best,
Cat_7
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

Cat_7 wrote:As said when I first provided the screamer builds based on Marks source: only 9.2 has some reasonable stable sound output. Even that worked better when starting e.g., mp3 play a second time.
All others crackle and pause. We tested various settings for buffers etc during development, but nothing made real differences.

My processor is a 3.5 Ghz I7.

Best,
Cat_7
Your using a much faster processor than mine and you still have playback issues. This could mean that host processor speed is not the main issue. I think investigating the screamer driver for Mac OS X is what I should do next. There probably is missing functionality in the sound card that needs to be added. Anyone else have any theories?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

I don't know in what loop the audio runs, but I guess it doesn't get enough time. There is some talk on the development list about supporting sdl2 audio playback as you probably have seen. Perhaps that is a route.
Or threading. It seems there are some issues with SDL and threading.

Best,
Cat_7
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

To be optimistic,I would say that screamer sound is better than usb and it works in MOS 9 which we didn't have at all (in fact) with usb-audio.So thanks very much to mcayland for his work.
In fact,where the sound is really needed in emulatad systems is gaming.I think the most our users care about are games for Mac OS 9.At present just in OS 9 sound works best.
And generally,code improvement is a work-forever.At present floating-point emulation in qemu is slow and qemu as a whole is much slower than PearPC and SheepShaver.The disrupting sound may be due just to this.
How to make qemu faster?One way is a JIT compiler that PeaPC and SheepShaver both have. Writing a jitc for qemu is a task for a well-skilled programmer.Porting jitc from SS or PPC is (maybe?) easier.
A second way I think is parallelization.AFAIK, at present qemu uses only 1 processor core for all tasks.Using autovectoristion and GCD (available in Xcode),maybe OpenMP and OpenACC pragmas and directives(available in PGI compilers and,partly,in latest GCC) could optimize using hardware.Using these pragmas seems relatively easy but knowing WHERE they can be used is not trivial.
But anyway, all these tasks are too theoretical (for me).With my skills I cannot do much right now.Only thinking and learning :smile: .
Last edited by alex195812 on Sun Feb 05, 2017 2:54 am, edited 1 time in total.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

Having troubles with DP4, (Post above) please help!
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Your command line seems right.What exactly happens? You type boot hd:9,\\:tbxi?
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

Yes
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

What happens next?
Oh I noticed that your command line includes -boot d.It shouldn't be there.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

get rid of it? and replace it with what?
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Just take it away and try again.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

ok
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

closed out on me again. Same screen
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

Meow_2004 wrote:get rid of it? and replace it with what?
Lets try simplifying the command-line. Could you try this instead:

qemu-system-ppc.exe -bios openbios-ppc -boot d -m 256 -M mac99 -prom-env "boot-args=-v" -g 800x600x32 -cpu G3 -cdrom MacOSX_developer_preview_4.iso -hda DP4.raw

I'm using "-boot d" because I think you want to boot from the iso file. If that isn't the case, replace it with "-boot c".
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

can't find nvram, frozen at that screen at openbios
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

alex195812 wrote:To be optimistic,I would say that screamer sound is better than usb and it works in MOS 9 which we didn't have at all (in fact) with usb-audio.So thanks very much to mcayland for his work.
In fact,where the sound is really needed in emulatad systems is gaming.I think the most our users care about are games for Mac OS 9.At present just in OS 9 sound works best.
And generally,code improvement is a work-forever.At present floating-point emulation in qemu is slow and qemu as a whole is much slower than PearPC and SheepShaver.The disrupting sound may be due just to this.
How to make qemu faster?One way is a JIT compiler that PeaPC and SheepShaver both have. Writing a jitc for qemu is a task for a well-skilled programmer.Porting jitc from SS or PPC is (maybe?) easier.
A second way I think is parallelization.AFAIK, at present qemu uses only 1 processor core for all tasks.Using autovectoristion and GCD (available in Xcode),maybe OpenMP and OpenACC pragmas and directives(available in PGI compilers and,partly,in latest GCC) could optimize using hardware.Using these pragmas seems relatively easy but knowing WHERE they can be used is not trivial.
But anyway, all these tasks are too theoretical (for me).With my skills I cannot do much right now.Only thinking and learning :smile: .
We are all thankful for the work Mark did with Screamer.

I did try changing the floating point code so that it used the host CPU to speed things up. This did not work. Just changing the optimization level of GCC was enough to break the floating point code. The floating point unit in QEMU is slow, but I think it might be fast enough handle sound playback.

There is someone who is currently working on making a multithreaded Tiny Code Generator. This will hopefully make QEMU run faster by using more processors available on the host.

You might like this video. It talks about PowerPC emulation and Tiny Code Generator: https://www.youtube.com/watch?v=lOOcCiGzpOY
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

For 10.1, i type boot, and it freezes on trying to find cd,\\:tbxi
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

For DP4 don't use -boot d,t's a special case.What happens when you do like I told you?
The command line for 10.1?
Last edited by alex195812 on Sun Feb 05, 2017 3:32 am, edited 1 time in total.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

closes down at the same spot
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

What spot?Could you post a screenshot?
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

Command line for 10.1:

Code: Select all

qemu-system-ppc.exe -bios openbios-ppc -L pc-bios -boot d -m 512 -M mac99 -prom-env "auto-boot?=false" -prom-env "boot-args=-v" -cpu G4 -drive file=10.1,format=raw,media=cdrom -drive file=10-1.raw,format=raw,media=disk
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

Image
Closes out here
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

It should work."Cannot find nvram partition" is not a fatal error,it's OK.How long do you wait after it?I sometimes have to wait up to 5 min.And note that qemu in Windows is slower than in MacOS.
The screenshot is DP4?Looks OK.I think you should simply wait some more.
Last edited by alex195812 on Sun Feb 05, 2017 3:48 am, edited 1 time in total.
User avatar
Meow_2004
Granny Smith
Posts: 108
Joined: Thu Jan 05, 2017 6:24 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Meow_2004 »

Switched commands, and got up to this:
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

To what?Nothing is seen.
Post Reply