VOGONS


Reply 221 of 334, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

The latest QEMU 4.2.0 has an updated audio engine with new APIs. All the existing audio backends have to be ported for the new audio APIs. The only common backend between Windows and Linux is SDL audio, but it only works for SDL1.2 and has been broken for SDL2 due to the preference of float32 audio format default in SDL2. QEMU currently does not support any kind of AUDIO_F32 flavors and failed with unknown audio format for QEMU_AUDIO_DRV=sdl.

The Windows native DirectSound backend was broken since the new audio API. Again sigh..., it just proved that Windows build is largely ignored by the developers community. QEMU version >= 4.0.0 dropped SDL1.2, leaving dsound the only usable backend for Windows. And then, dsound was broken after the new rewrite of audio APIs, so leaving audio on Windows totally busted.

Attach the patch to fix both issues. The SDL patch applies for any QEMU versions that linked against SDL2, but I tested only QEMU version >= 4.0.0. The dsound patch fixes QEMU 4.2.0.

Update: QEMU dsoundaudio fix from upstream.

Attachments

Last edited by kjliew on 2020-02-07, 01:08. Edited 1 time in total.

Reply 222 of 334, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

Thanks, but if someone is not friendly with build such stuff, some text diff files are.. less say unless in good way of thing about it.

Why these changes arent committed to master or why is not possible just to provide whole Windows binaries for download? I think that such things really making Qemu more obscure than that needs to be in comparision with more user friendly things like Vmware, Virtualbox, even Hyper-V.

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 225 of 334, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

QEMU threaded its internal workloads very much. There is one UI main process, each CPU has its own thread, block I/O on its own thread, each screen has its own rendering thread and audio also on its own thread. So at minimum, there will be 1 process and 4 threads running. I think it depends on the OS to spread the workload to different cores. Glide pass-through runs on the main process which runs the host wrappers. Games on Glide API are known to be CPU light and GPU heavy, so typically we will see one heavy-loaded CPU (UI main process running host wrapper), one half-loaded CPU (40%~60% running the CPU assuming the game is also somewhere CPU loaded, such as Unreal fly-by at 1024x768) and several lightly-loaded CPUs. QEMU screen rendering threads simply discard their screen updates when Glide pass-through is active.

Reply 227 of 334, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie
wadrasil wrote on 2020-03-03, 08:13:

Many thanks for the sound patches! It makes a huge difference.

From your message it seems that you testem them, could you share repaired build?

I tried to build Qemu on Linux (Mint) for Linux, its fine because tutorial is fine.

Later i tried to build Qemu on Linux for Windows - https://wiki.qemu.org/Hosts/W32#Building_QEMU_for_W64 , tutorial is not really such quality, Win64 part seems to be incomplete, there is something about to downloading
additional files, but not info, where place them, some links are dead etc..

I have would also how to build Windows version on Windows - https://stackoverflow.com/questions/53084815/ … ndows-10-64-bit with MSYS, but i download 3 GB of files.. and once i tried i get not cc find message ( ./configure --enable-gtk --enable-sdl --target-list=x86_64-softmmu --disable-werror --disable-stack-protector => ERROR: "cc" either does not exist or does not work )- i found that other people had same problem, but in tutorial is some mistake - and that i probably problem with some pathes , second time is not able to find git.. i double checked that git package is installed. Its not realible.. is just some Linux tool chain on Windows. I will try it for 3rd time, but im sure that i paste commands fine..

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 228 of 334, by wadrasil

User metadata
Rank Newbie
Rank
Newbie

@ruthan
I have only used the sound patches so far, but I did compile a build of qemu-system-i386.exe from qemu 4.2.0 with SDL2 and WHPX support for windows using msys64 in windows. I followed this guide to install the prerequisites, I did not follow the whole guide just links for msys and how to get whpx headers:

https://github.com/RceNinja/notes/blob/ ... windows.md
I did have to install the Windows 10 sdk to get the correct headers only a minimal install seems necessary.

From that guide you need to also run this pacman -S mingw-w64-x86_64-capstone or disable capstone when configuring qemu.

From there you can use the commands on the authors github: https://github.com/kjliew/qemu-3dfx

For the sound patches I ran patch.exe -i the-patch.diff to install each one within C:\msys64\home\username\qemu-4.2.0\audio.

You want to install the patches then go on to configure and make. You can either run ./configure or try to be more specific like:

./configure --target-list=i386-softmmu --enable-sdl --enable-tcg-interpreter --enable-whpx --audio-drv-list="sdl dsound"
That's an example:
Use ./configure --help for all the options.

I did not have to use " --disable-werror --disable-stack-protector" to complete a build no idea if that caused any issues.

I do use make -j *=number of cores. To speed things up a bit , this works in linux and msys.

I have not been able get the cross compiler for windows on linux as per qemu's instructions or others. I have only been able to build successfully on each target system OS (Linux or Windows) so far. It seems like you are not far off, hopefully the link I posted helps get the right prerequisites. https://packages.msys2.org has a search function if something is missing.

Also try these to set sound to SDL and set SDL Samples, export in msys or linux, or set in batch script:

export/set QEMU_AUDIO_DRV=sdl
export/set QEMU_SDL_SAMPLES=2048

It's well worth the effort to learn how to do this in my opinion. But just because I can build qemu does not mean I know how to package software for redistribution or want to. I feel like the author does a great job of explaining things so please read through the forum and the github page.

Reply 229 of 334, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie
wadrasil wrote:

I have only used the sound patches so far, but I did compile a build of qemu-system-i386.exe from qemu 4.2.0 with SDL2 and WHPX support for windows using msys64 in windows. I followed this guide to install the prerequisites, I did not follow the whole guide just links for msys and how to get whpx headers:

Thanks. i simply hoped that you have some already built files to share and info how to it. kjliew described it as easy thing, but it dont seems to be.
At the start im not really sure, if i need whole that WHPX and 3dfx stuff, its optimal and i can run build without it ok, otherwise when i installed WHPX to test state of 3dfx, i had after issue with not working Vmware thing i need more. I know that Vmware has also similar issue with Hyper-V and they are working on to make it working together, already is some preview..
What i really need its vanilla Qemu + sound patches, so i probably dont need whole that Win10 SDK..

Problem could be right on start of https://github.com/RceNinja/notes/blob/master … 9_on_windows.md - i executed just MSYS2 MSYS not MinGW 64bit.. from my start menu..

It's well worth the effort to learn how to do this in my opinion. But just because I can build qemu does not mean I know how to package software for redistribution or want to. I feel like the author does a great job of explaining things so please read through the forum and the github page.

It depends, im just user and qemu setup is already PITA from users perspective, if you are developer which are using this or similar tool chain it could be fun and good..

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 230 of 334, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

Ok i your tutorial this:
https://github.com/RceNinja/notes/blob/master … 9_on_windows.md
Im not sure maybe i already had that Win10 SDK installed, because of Visual Studio. I got some WHPX error as expected, because i had to uninstall it to make Vmware great again.

Configured it without that i thing problematic acceleration modules --enable-whpx\ --enable-hax\, maybe im wrong and i should at least keep one of them.
In last part where are *.dll copied, i had to remove 2 dll, probably because i removed that 2 paramers.
I got nice folder with Qemu executables which seems to be working..

So if did not something wrong, only thing which i need is apply sound patches.. Because i tried at first vanilla Qemu from git hub.

Patches i copied diff files to audio subdirectory and run:
patch.exe -i dsound.diff
can't find file to patch at input line 23.. or similar for both files, i guess that problems is that i downloaded lastest Qemu from Git hub.. at least one patch you work with 4.2.0 exactl, So i have to download right version?

Ok i tried 4.2.0 is this ok?
C:\Progamy\msys64\qemu-4.2.0\audio>patch.exe -i sdlaudio_c.diff
patching file `sdlaudio.c'
Assertion failed: hunk, file patch.c, line 321

C:\Progamy\msys64\qemu-4.2.0\audio>patch.exe -i dsound.diff
patching file `dsound_template.h'
Assertion failed: hunk, file patch.c, line 321

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 231 of 334, by wadrasil

User metadata
Rank Newbie
Rank
Newbie

The newest version of qemu's source seems to have some work one that affects the audio patches, I did use 4.20 to get the patches installed without the errors you mentioned, you should be able to build with haxm and whpx even though you can only use one at a time, you may want to disable xen and kvm but it should autodetect that. Otherwise it looks like you are almost there, it did take a few tries for me to get everything going.

Starsiege and Odium/Gorky17 working very well with just software rendering with whpx, I recommend using the usb-audio option as it has drivers that are on the win98se cd and it seems to work fine up to dx9. Also doskey.com and dosidle.exe help with the HLT issue in dos in qemu.

Reply 232 of 334, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

So that patch assert fail is ok? I built it but, im not sure if patches were applied how they should be.
vhpx is Hyper-V its not working with Vmware yet (except maybe some preview version and not wanted to mess with it yet, because im not if Vmware Uncloker would play nice with it, Unlocker is hack to get Mac OS machines working). But im not really sure about haxm i have to check it.

Update: Still getting that dsound spamm into console so probably sound patches application failed.
I found out that HAXM is already installed so it should be problems, btw are somewhere some benchmarks with it and without and even some whpx comparison ?

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 233 of 334, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

Ok, i have tried to apply diff to 4.2.0 through git apply:
git apply sdlaudio_c.diff // it working (at least i got not error message) i has to be run from root(/) folder where qemu is in qemu-4.2.0 folder.

second is not working:
git apply dsound.diff // Its seems that it has to be run from qemu-4.2.0 folder (downloaded from official repository - https://www.qemu.org/download/#source ) ..
but i have got these errors:
error: patch failed: audio/dsound_template.h:244
error: audio/dsound_template.h: patch does not apply
error: patch failed: audio/audio.c:1076
error: audio/audio.c: patch does not apply
error: patch failed: audio/dsoundaudio.c:53
error: audio/dsoundaudio.c: patch does not apply

If i did it right, Make sense use first one standalone?

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 235 of 334, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

This easy building getting better and better 🙁 Now i would have to learn that diff files syntax.
This is clear proof that just sharing binary is much better way.
If its easy for someone pleas do it for everyone else.

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 237 of 334, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

Can someone at least confirm that these paches are working fine with vanilla Qemu 4.2.0? Id manual edits, i could make error, i no more getting errors in terminal with dsound, but within Win98 i getting some stuck sound and in Dos have trying Quake and Doom2 - and here sound is playing but graphics is stuck on game start screen. Without sound games are running fine.

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.

Reply 239 of 334, by ruthan

User metadata
Rank Oldbie
Rank
Oldbie

Sorry i dont fully understand how to not use dsound? How i should adjust my starting script?

Spoiler

qemu-system-x86_64 ^
-m 512 ^
-vga cirrus ^
-soundhw sb16,pcspk ^
-rtc clock=host,base=localtime ^
-boot d ^
-hda HDDs\Win98System2-8GB-440.vmdk ^
-hdb HDDs\Win-Data-28G.vmdk ^
-drive file=Isos\Win98SE-ENG.iso,index=2,media=cdrom ^
-drive file=Isos\Win98-Data-and-Drivers-CD2.iso,index=3,media=cdrom ^
-netdev tap,id=mynet0,ifname=TAP -device rtl8139,netdev=mynet0 ^
-usb ^
-k en-us

Im old goal oriented goatman, i care about facts and freedom, not about egos+prejudices. Hoarding=sickness. If you want respect, gain it by your behavior. I hate stupid SW limits, SW=virtual world, everything should be possible if you have enough raw HW.