VOGONS


First post, by javispedro1

User metadata
Rank Newbie
Rank
Newbie

Hello!
I am making a extension pack for VirtualBox that adds emulation for some "popular" music devices.
Specifically, OPL3/Adlib (using Nuked's), EMU8K/AWE (using the emu from PCem) , and MPU-401 "dumb" (host MIDI input/output).

As you can guess from the choice of devices, the goal is to emulate a quasi- Sound Blaster AWE32.
I say "quasi" because in truth the devices are completely separate.
E.g. AWE effects are not applied to OPL3 output, and I still use the SB16 emu from VirtualBox so it will report an old DSP version and the mixer controls will not change OPL3/EMU8K volumes.
This confuses some software, but mostly works.

Sadly this is Linux hosts only for now.
Not only I do not have much experience with MIDI IO on Windows, but on Windows VirtualBox requires kernel code signatures for all extpacks, even if they don't run in the kernel. That's way too much effort to obtain...

Extpack download: https://depot.javispedro.com/vbox/VMusic-0.3. … 32.vbox-extpack
Instructions & sources : https://git.javispedro.com/cgit/vmusic.git/about/
(You at least need to read the https://git.javispedro.com/cgit/vmusic.git/about/#using Using part).

Obviously, this is not going to make VirtualBox that much better for retro-gaming, it's still a VM with the myriad of compatibility and timing problems that come with it (oh god).
However, VirtualBox has a nice GUI, easy snapshots, is reasonably fast, and is not only gaming-focused.

Besides, it's fun to try these things.

Things I've tried:
Games:

  • Monkey Island 1/2. You can connect MPU-401 to Munt to have something nice. Monkey1's Adlib driver has well-known "Overflow" error, but after slowing down virtual CPU works OK. Monkey2's Adlib/Soundblaster driver works nicely with full CPU speed.
  • Duke Nukem 3D. Adlib/SB16 works. Setup fails to detect AWE32, however it can be manually set and then game works with it.
  • Warcraft II: Adlib & AWE32 work. Some noise at start/end of sampled audio (SB16-emu DMA issue?).
  • Theme Hospital: Miles sound system. While SB16 FM driver fails, "Generic OPL3 device" works. SBAWE32 also works flawlessly. PCM output also works with SB16 driver, albeit voice volume is low.

Operating systems:

  • Windows 3.x: Stock Adlib driver works. Stock MPU-401 driver works (for output). Creative driver from AWE32 CD works.
  • Windows 9x: Stock SoundBlaster AWE32 driver works. All 3 MIDI outputs work (OPL, MPU, AWE).
    Creative driver from AWE32 CD seems to hang when trying to play wave/PCM data, however after installing it I can boot to safe mode and replace PCM driver with stock Windows driver. All Creative tools can still be used including AWE32 setings/ SF2 loading.
    EMU8K timing issues can also result in Windows freezing during boot (hopefully fixed in latest version).
  • Windows XP: for fun I tried XP's builtin MPU-401 driver and it works. Even MIDI input works. However in UART mode there's no timestamping MIDI input -- results may vary.

Random DOS programs:

  • Impulse Tracker. Autodetect sees a SB16 only. SB16/PCM output sounds really bad, lots of glitches. "IT S6" (force AWE32) works much better, but I didn't try anything other than playing demos. No idea how to get MPU-401 MIDI input to work.
  • Adlib Composer. Works. MIDI input does not work (expects intelligent mode).
  • AWEUTIL/DIAGNOSE don't work, aweutil TSR emulation mode complains about "Feedback path error", and diagnose complains about the low DMA channel. They are not required, and no point to using aweutil TSR anyway since you can connect emulated MPU-401 to a synthesizer on the host.
  • DOSMid works (/mpu, /awe and /opl)

Reply 2 of 25, by javispedro1

User metadata
Rank Newbie
Rank
Newbie

Glad to hear! Let me know if it works. I had a chat in the VirtualBox forums regarding opening the door for Extension Packs like this one for Windows hosts, and they'd say they'd look into it , but no promises.

In the meanwhile I use it in all my VMs, but I don't really have a lot of games either, mostly office and MIDI stuff.

Currently working on more VirtualBox niceties for DOS -- a mouse driver and shared folders support.

Reply 3 of 25, by tauro

User metadata
Rank Newbie
Rank
Newbie

It's working flawlessly for me.
Adlib works both on Win and DOS.
MPU401 works perfectly on DOS with softmpu and host munt. I couldn't get it to work on windows, I get no MPU401 option on "Multimedia properties > MIDI". No new MPU device. Maybe this is because I didn't enable emu8000?

There's a thing when you use aconnect, every time I power cycled the VM I needed to disconnect and reconnect to get sound working again.

Currently working on more VirtualBox niceties for DOS -- a mouse driver and shared folders support.

Man, you read my mind! The only thing left that sucks on Virtualbox (especially on DOS) is mouse support. It would be nice to have it running well. On Win sometimes it gets stuck or acts dumb, but eventually it fixes itself if you keep trying. On DOS ctmouse sometimes works well, sometimes doesn't. I think maybe there was an improvement on the mouse functioning when I enabled munt through softmpu. Maybe I'm wrong.

Transferring files with WinSCP is a breeze, but shared folders would be even better.

What video drivers are you using on Win98?
I'm using the VBEMP 9x, which work really well. But installation is a bit problematic if you don't know how to do it (only works if you choose the 32mb drivers).
One thing that would be cool is 16:9 support, but it doesn't work.
There's a way to set it manually editing the registry but it doesn't work.
After all you've done I'm sure you could tweak that driver to get it working 😃

I had a chat in the VirtualBox forums regarding opening the door for Extension Packs like this one for Windows hosts, and they'd say they'd look into it , but no promises.

You are taking it to the next level. Excellent. I don't use windows other than for retro purposes anyway but many a folk would benefit from this. Merging your code into the main source code would also be cool.

For productivity tasks Win98 on Virtualbox is the way to go IMHO. It's blazing fast and good overall. Much better than VMware.

Just for the record, USB 2.0 also works, but when it's enabled sometimes I get the "Windows protection error" after shutting down, hangs some 15 seconds, and then powers off. Harmless error, but it's better to stick to USB 1.1.

Overall fantastic job. Kudos to you!

Reply 4 of 25, by javispedro1

User metadata
Rank Newbie
Rank
Newbie

Nice! Thanks for trying it!

tauro wrote on 2022-04-20, 20:10:

I couldn't get it to work on windows, I get no MPU401 option on "Multimedia properties > MIDI". No new MPU device. Maybe this is because I didn't enable emu8000?

If you use the Sound Blaster 16 driver (even the Windows one), you will not see a separate MPU401 since the Sound Blaster driver will take over it.
Rather you will see a "SB16 MIDI Out [0x330]" or similar.
If you don't see that either (it is possible), then you need to remove the SB 16 device from Device Manager, and then re-run Add New Hardware detection so that it "re-detects" which type of SB you have.

tauro wrote on 2022-04-20, 20:10:

There's a thing when you use aconnect, every time I power cycled the VM I needed to disconnect and reconnect to get sound working again.

True 🙁 I guess the easiest option is to just add some option in the VM "extradata" to write the name/address of an ALSA port to automatically connect to, like what other emulators do.
Also, Munt does not have this option, but Qsynth can be configured so that everything automatically connects to it .

tauro wrote on 2022-04-20, 20:10:

Man, you read my mind! The only thing left that sucks on Virtualbox (especially on DOS) is mouse support. It would be nice to have it running well. On Win sometimes it gets stuck or acts dumb, but eventually it fixes itself if you keep trying. On DOS ctmouse sometimes works well, sometimes doesn't. I think maybe there was an improvement on the mouse functioning when I enabled munt through softmpu. Maybe I'm wrong.

Made another thread for it -- New DOS mouse driver for VirtualBox/VMware/ PS/2 mice
It is more for DOS & Win 3.x than Win9x . Actually the shared folders support does work under win9x if you load it during autoexec.bat before windows starts, but it has lots of limitations (like 8.3 filenames).

I think there's a bug with the "captured" mouse in VirtualBox, I have also seen it sometimes getting stuck like if there was an invisible wall in the middle of the screen. It's one of the reasons I started the new driver.
Starting from Win98, I can use the USB tablet emulation, which works OK (even the scroll wheel 😀 ), so I don't feel any need for a 9x driver.

tauro wrote on 2022-04-20, 20:10:

What video drivers are you using on Win98?
I'm using the VBEMP 9x, which work really well. But installation is a bit problematic if you don't know how to do it (only works if you choose the 32mb drivers).

VBEMP too. I am still not sure I fully mastered installing it. I still get some strange errors (like forced 16 colors mode) that disappear after installing the driver a 2nd time, and things like that. Most of the time I just start from a snapshot.

I'd really wish to make a new video driver for 9x (even accelerated), but it's waaaaay too much time & effort.
One thing I'd like to try is to use the VMware 9x driver. Apparently VirtualBox 6.1 supports emulating the Vmware SVGA (it's called "vmsvga" in the VM options). I suppose it will not work as is, but I wonder how much patching would be required to let it work.

tauro wrote on 2022-04-20, 20:10:

Merging your code into the main source code would also be cool.

Sadly not possible due to licensing -- Oracle doesn't want any more 3rd party GPL code in VirtualBox 😒 They either want copyright assignment or BSD/MIT. And I'm using Nuked for OPL3 emulation, which I doubt would want his code relicensed.

tauro wrote on 2022-04-20, 20:10:

For productivity tasks Win98 on Virtualbox is the way to go IMHO. It's blazing fast and good overall. Much better than VMware.

Heh. In my experience VMware seems to have noticeable faster video with DOS/3.x/9x, but I really hate the VMware interface anyway (and besides, being 100% closed, I just can't debug it or extend it).

Reply 5 of 25, by tauro

User metadata
Rank Newbie
Rank
Newbie

There's one thing that you should consider that I recently noticed.
Beginning with version 6.1.0, Virtualbox removed the option to disable virtualization.
This makes installing/running Win98 impossible if you have a Ryzen CPU. Intel still works fine though.
Maybe you could produce a patch to fix this or reorient your efforts toward a more long-term viable solution, perhaps qemu.
Just my two cents, I really appreciate your work.

Reply 6 of 25, by javispedro1

User metadata
Rank Newbie
Rank
Newbie
tauro wrote on 2022-05-31, 10:20:

This makes installing/running Win98 impossible if you have a Ryzen CPU. Intel still works fine though.

What do you mean? As far as I am aware, Windows98 should work just fine if you disable nested paging , which you can still disable in VirtualBox (see acceleration tab). Someone even diagnosed the issue -- https://blog.stuffedcow.net/2015/08/pagewalk-coherence/ . Do you still have issues with nested paging disabled ? I do not have any recent AMD systems to play with (nor plan to buy).

In any case, VirtualBox's (CPU) emulation was terrible and I do not miss it at all. Qemu's overall not much better for these older OSes.

Ironically, they might need to resurrect the emulation in order for it to work under Apple platforms again. I have seen a recent flurry of activity, fixes, refactors, etc. in the emulator code.

Reply 7 of 25, by tauro

User metadata
Rank Newbie
Rank
Newbie
javispedro1 wrote on 2022-05-31, 10:51:

What do you mean? As far as I am aware, Windows98 should work just fine if you disable nested paging , which you can still disable in VirtualBox (see acceleration tab). Someone even diagnosed the issue -- https://blog.stuffedcow.net/2015/08/pagewalk-coherence/ . Do you still have issues with nested paging disabled ? I do not have any recent AMD systems to play with (nor plan to buy).

Virtualbox decided to remove the option to disable VT-x/AMD-V starting with version 6.1.0. That's the crucial bit to get a Ryzen processor working well with Windows 98, according to the guides that I've read. Basically you can't disable hardware-assisted virtualization anymore. Here's a link explaining the version differences https://forums.virtualbox.org/viewtopic.php?t=97284
Running an older version is not an option since the dkms module can't be compiled with newer kernels.

Luckily I found a workaround that works 100% fine (so far).
Starting the system in safe mode and then disabling the 32-bit disk drivers.
The system works fine so far, but you don't get the CD drive. To solve this, I loaded the MSCDEX driver, and that's it.
So far, it's working well.

I find the local area network speeds and performance to be the best out there with VirtualBox. I couldn't replicate such LAN performance with DOSBOX-x or 86box installations.
Transferring files this way is a breeze, plus you also have the snapshots.

Take my testimony with a grain of salt as it seems these Ryzen processors are full of bugs and problems when it comes to running old software.

WinXP 32-bit is working well so far for me, others have reported problems virtualizing this system too. It seems Ryzen can't execute 16-bit code properly.

Regarding disabling nested paging... I can assure you it's a bloody mess to get anything working with the 32-bit disk drivers. You get lots of errors when you try to install drivers.
Sometimes I manage to get the 32-bit disk drivers working. I couldn't document what makes them work and what makes them stop working.
For example, according to my experience, I can't install the system at all if I disable nested paging. So it's still a mystery but I'm unfolding it slowly. Painful trial and error. Maybe I'll write a tutorial some day if I figure everything out. Most errors are related to the drivers I think msgsrv/setupx, SHLWAPI.DLL :tFileAttributesA, and others. So far disabling the 32-bit disk drivers overall gives a good performance.

There are some other workarounds for Windows 98, but I can't confirm if they do any good or bad with my processor (Zen3)
I tried disabling VME which is bugged in the Ryzen processors.

Here's how it's done:
VBoxManage modifyvm <vm> --cpuidset 1 00800f11 00000800 56d8220b 078bfbfd

Some sources about this:
http://www.os2museum.com/wp/vme-broken-on-amd-ryzen/
https://forums.virtualbox.org/viewtopic.php?f … =82323&start=15

Installing the latest hard drive drivers ESDI_506.PDR didn't make any difference as far as I can tell but I'm not sure yet.

Anyway, I hope this helped anybody!

Reply 8 of 25, by Stretch

User metadata
Rank Member
Rank
Member

Tauro, you shouldn't need any workarounds to run Windows 98SE on Ryzen, if you use JH64's patcher9x program Patch for Windows 98/98 SE/Me to run on newest CPUs

Win 11 - Intel Core i7-8809G - 8 GB - Radeon RX Vega M GH - Sound Blaster X4
WinXP - ASRock 775i65G R3.0 - Celeron 2.2 GHz - 2 GB - GeForce FX5700 - XtremeSound DDL
Win98SE - Via Apollo Pro Mobo - Pentium II 233 - 256 MB - Voodoo 3 1000 - ESS Solo-1 1938

Reply 9 of 25, by crazii

User metadata
Rank Member
Rank
Member

Good! I was dreaming this years ago, and finally!
VBox 6.1.34 failed to install the ext package, saying "VMusicMain" not found. I'd try the older version.

OK I finally noticed that it only works for Linux host. aaah! my dreams! 😁

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 10 of 25, by retrogamerguy1997

User metadata
Rank Member
Rank
Member

I'm going to have to try this out. No point in running my pentium 4 in the middle of summer, even assuming prescott is able to use pci sound cards under dos mode.

Reply 11 of 25, by javispedro1

User metadata
Rank Newbie
Rank
Newbie
crazii wrote on 2022-07-13, 20:44:

Good! I was dreaming this years ago, and finally!
VBox 6.1.34 failed to install the ext package, saying "VMusicMain" not found. I'd try the older version.

OK I finally noticed that it only works for Linux host. aaah! my dreams! 😁

Yes, Linux only 😀 .
(For the record I'm using 6.1.34 myself, and the 6.1.32 binaries definitely work without changes on .34 -- likely they will break only once VB 7.0 is released).

Reply 12 of 25, by crazii

User metadata
Rank Member
Rank
Member

I actually bought a Lenovo T540p 6 years ago in which I installed Manjaro, but I it's not with me right now. I use Windows in my daily life so the linux partition is barely loaded.
One good thing to note about VBox is that it uses HW emu which is way faster than PCem or 86box. the mouse cursor moves fluently.
I tried retro-programming earlier in a i845m laptop and it was really slow like disaster, the compilation takes tens of minutes, while in VBox it takes less than 1 min. Well, not really retro programming because I was using modern C++ (11 or newer) via DJGPP and RHIIDE, the IDE is retro like Borland C++ or Turbo C++, but the programming language is not that retro 🤣. A Borland compiler will do much faster on a 2000s machine. That is a case when you do real retro programming and don't need VBox. 😁

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 13 of 25, by tauro

User metadata
Rank Newbie
Rank
Newbie
Stretch wrote on 2022-06-19, 12:56:

Tauro, you shouldn't need any workarounds to run Windows 98SE on Ryzen, if you use JH64's patcher9x program Patch for Windows 98/98 SE/Me to run on newest CPUs

Thank you very much for bringing it up, Stretch! I'll definitely check it out.

I'm not sure whether the Ryzen ZEN3 cpus are buggy in general, or if it's Virtualbox's fault, since I've had problems with other CPUs and other VMs too (i.e. aggressive disk corruption out of the blue on a Win98 VM, running on a Core 2 Duo; random Host mouse lock ups running a GNU/Linux 32-bit VM with the Ryzen ZEN3; and many more).

Anyway a new update just came out.

I just tried vmusic on FreeDOS running on VirtualBox Version 6.1.36 r152435, on a Core 2 Duo, and adlib runs like a charm.

Reply 14 of 25, by digger

User metadata
Rank Oldbie
Rank
Oldbie

@javispedro1 DUDE, how did you pull this off? Years ago I wanted to start a similar project, but I got lost just trying to figure out how to build an extension pack as a stand-alone project, without having to check out the entire huge VirtualBox code base. I remember hardly finding any information on this. Curious to know how you figured that stuff out.

Great job, though!

Would you consider adding support for forwarding emulated Adlib and OPL3 ports to an OPL2LPT or OPL3LPT device connected to a parallel port on the host computer? I know the Nuked OPL3 emulator is already so good that it can't really be distinguished from actual hardware, but it would still be cool to have it work with actual hardware like that. 🙂

Thanks for this project, regardless.

Reply 15 of 25, by javispedro1

User metadata
Rank Newbie
Rank
Newbie
digger wrote on 2022-08-02, 23:07:

@javispedro1 DUDE, how did you pull this off? Years ago I wanted to start a similar project, but I got lost just trying to figure out how to build an extension pack as a stand-alone project, without having to check out the entire huge VirtualBox code base. I remember hardly finding any information on this. Curious to know how you figured that stuff out.

I'm in fact checking out the entire VirtualBox codebase 😀 To build VMusic from source, you do need to download the Virtualbox source tarball and put it in a subdirectory, since during build I'm using some of the private headers. There is no way to build an extension by using only the public SDK, sadly. I am however using my own Makefiles instead of VBox's since VBox's "kBuild" makefiles were quite difficult to untangle.
Inside VBox's source code there are a couple of examples of extension packs, including a module for some older MS serial mouse.
And also I was asking on the official forums from time to time 😀

The biggest problem however is that extensions are only workable on Linux hosts. Under Windows, extension packs have to be signed by Oracle which makes it kind of pointless.

digger wrote on 2022-08-02, 23:07:

Would you consider adding support for forwarding emulated Adlib and OPL3 ports to an OPL2LPT or OPL3LPT device connected to a parallel port on the host computer? I know the Nuked OPL3 emulator is already so good that it can't really be distinguished from actual hardware, but it would still be cool to have it work with actual hardware like that.

I suppose it would not be very hard, assuming you can already use the OPL*LPT from Linux. May buy one of them for experiments..
By the way, VBox has a LPT emulator, so another option is to just redirect the OPL2LPT itself inside the VM, and then use the OPL2LPT TSR/patches as if on real hardware. I don't know if the timing will be better that way.

The biggest limitation of VMusic is not audio quality I think (Nuked is superb), but timing -- i.e. missing/repeated effects/notes, because the "emulation"/VM thread was faster than the Nuked thread or viceversa. I can still hear that e.g. in MI 2's "raspy" music sequences in the intro. I had a hard time tuning that and balancing with CPU usage (I am using very slow CPUs, Atoms). I think it would be interesting to check with OPL2LPT.

Reply 16 of 25, by digger

User metadata
Rank Oldbie
Rank
Oldbie
javispedro1 wrote on 2022-08-03, 13:56:
digger wrote on 2022-08-02, 23:07:

@javispedro1 DUDE, how did you pull this off? Years ago I wanted to start a similar project, but I got lost just trying to figure out how to build an extension pack as a stand-alone project, without having to check out the entire huge VirtualBox code base. I remember hardly finding any information on this. Curious to know how you figured that stuff out.

I'm in fact checking out the entire VirtualBox codebase 😀 To build VMusic from source, you do need to download the Virtualbox source tarball and put it in a subdirectory, since during build I'm using some of the private headers. There is no way to build an extension by using only the public SDK, sadly.

Ah, that's unfortunate. One thing I was working on back then was a Docker project to ease and hopefully automate the building of extension packs using the VirtualBox code base. I haven't worked on it in years, but I could dust it off, if it would be useful to you. It might be possible to use it as part of a CI/CD pipeline that automatically (re)builds your extension pack with specific releases of VirtualBox. Let me know if you think that would help.

I am however using my own Makefiles instead of VBox's since VBox's "kBuild" makefiles were quite difficult to untangle.

Indeed! I have no idea why the VirtualBox developers need to make things so complicated and reinvent the wheel by insisting on using such an obscure and non-standard build system.

Inside VBox's source code there are a couple of examples of extension packs, including a module for some older MS serial mouse.
And also I was asking on the official forums from time to time 😀

Yeah, I managed to build that extension pack in Linux too, I believe. But if I remember correctly, the build takes a long time if the rest of the code base hasn't been built yet. Docker could perhaps help there as well, by building the rest of the code base before building the extension pack with it.

The biggest problem however is that extensions are only workable on Linux hosts. Under Windows, extension packs have to be signed by Oracle which makes it kind of pointless.

Well, if you are going to dabble with virtualization and emulation anyway, you might as well run the most superior OS on the bare metal host, right? If you need Windows for anything, just run it in (another) VM. 😁

Even in terms of Windows games, Linux solutions such as Proton have come a long way in reducing the need to run Windows as one's daily driver OS. But of course I'm biased, having switched to Linux as my daily driver OS years ago.

By the way, VBox has a LPT emulator, so another option is to just redirect the OPL2LPT itself inside the VM, and then use the OPL2LPT TSR/patches as if on real hardware. I don't know if the timing will be better that way.

Yeah, that works, but the downside of that is that it requires either game-specific patches, or loading an emulator in DOS inside the VM, which means that it would not work with protected mode games that don't have any patches available. You don't have that problem when the emulation is done at the hypervisor level.

The biggest limitation of VMusic is not audio quality I think (Nuked is superb), but timing -- i.e. missing/repeated effects/notes, because the "emulation"/VM thread was faster than the Nuked thread or viceversa. I can still hear that e.g. in MI 2's "raspy" music sequences in the intro. I had a hard time tuning that and balancing with CPU usage (I am using very slow CPUs, Atoms). I think it would be interesting to check with OPL2LPT.

This is where my expertise falls short, I'm afraid. Would the Adlib emulation code in the QEMU sources provide any clues there, perhaps?

Speaking of QEMU, I've grown a bit disillusioned about VirtualBox over the years, with Oracle being in control of its development and keeping some premium bits (such as USB 2.0 and NVMe support) closed source with restricted use. When you think about it, QEMU replaces VirtualBox quite well, at least with a practical frontend such as Quickemu. The only advantage that VirtualBox still has over QEMU at this point is that it has some level of 3D-accelerated graphics support for modern Windows guests. It would nice to finally have a VirGL guest driver for Windows guests released, to fill that last gap. Or alternatively, having support for 3D-accelerated VirtuaBox and VMWare guest video drivers backported to QEMU.

QEMU isn't perfect, but at least it isn't controlled by Oracle, and is a much more open project with more volunteers working on it and offering patches.

QEMU already has Adlib emulation support, and it would be nice to have it replaced or complimented with the Nuked OPL3 emulation code.

Oh, and another thing about the lack of documentation on extension packs for VirtualBox: it is completely undocumented how Oracle managed to build a single cross-platform "fat" extension pack, like they do for their closed-source restricted PUEL extension pack. I didn't find any script in the code base that could package multiple extension pack builds from different operating systems into a single extpack file like that. And nobody was able (or willing?) to provide me with that information in the VirtualBox Developers mailing list either. 🤷🏻

Reply 17 of 25, by crazii

User metadata
Rank Member
Rank
Member

I've tested the extpack in Linux and its working good, good job dude. I test one DOS/4GW game with Miles Sound and it occasionally a note missing in OPL3. but it doesn't hurt.
I read your post in the vbox forum, https://forums.virtualbox.org/viewtopic.php?f=7&t=105144
I don't know much about the extpack, guess it works in kernel mode? that would explain the kernel mode signature problem on Windows.
i wonder if the windows extpack can work in user mode so that i could use the normal sound api 😁, it might be less efficient but at least it'll work.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 18 of 25, by javispedro1

User metadata
Rank Newbie
Rank
Newbie
digger wrote on 2022-08-03, 15:55:

Ah, that's unfortunate. One thing I was working on back then was a Docker project to ease and hopefully automate the building of extension packs using the VirtualBox code base. I haven't worked on it in years, but I could dust it off, if it would be useful to you. It might be possible to use it as part of a CI/CD pipeline that automatically (re)builds your extension pack with specific releases of VirtualBox. Let me know if you think that would help.

I currently have that in the OpenSuse Build Service.

digger wrote on 2022-08-03, 15:55:

Yeah, I managed to build that extension pack in Linux too, I believe. But if I remember correctly, the build takes a long time if the rest of the code base hasn't been built yet. Docker could perhaps help there as well, by building the rest of the code base before building the extension pack with it.

Yeah, I think it would be great if the VBox SDK would also include the generated .h files, libraries, etc. required for building a extension. It doesn't, so the only way right now is to build a significant chunk of VirtualBox before trying to build the extension, or "just hack it" it (which is what I'm doing, by faking some of the auto-generated headers).

digger wrote on 2022-08-03, 15:55:

QEMU isn't perfect, but at least it isn't controlled by Oracle, and is a much more open project with more volunteers working on it and offering patches.
QEMU already has Adlib emulation support, and it would be nice to have it replaced or complimented with the Nuked OPL3 emulation code.

Every time I have tried using Qemu (or Xen for the matter) I ended up having to back down. Either the poor UIs, the constant regressions (e.g. even Win98 regresses frequently), etc.
VirtualBox has a lot of quirks (e.g. with KVM, HypervisorKit, HyperV, etc. being a thing, it should no longer require a kernel module), and Oracle is quite the devil, but at least if you don't use PUEL stuff, VirtualBox's a GPL2 program underneath.
Also, qemu doesn't allow plugins...

digger wrote on 2022-08-03, 15:55:

Oh, and another thing about the lack of documentation on extension packs for VirtualBox: it is completely undocumented how Oracle managed to build a single cross-platform "fat" extension pack, like they do for their closed-source restricted PUEL extension pack. I didn't find any script in the code base that could package multiple extension pack builds from different operating systems into a single extpack file like that. And nobody was able (or willing?) to provide me with that information in the VirtualBox Developers mailing list either. 🤷🏻

All packs just have a directory for each platform. E.g. Even on VMusic you can see directory linux.amd64 ; for a windows host, you'd use directory win.amd64; etc.
The Oracle makefiles seem to assume you have a VM for each of Windows, Linux, macOS, etc. and that each VM will build the binaries for the respective OS.
Obviously , this is way too complicated for my hackish needs. In the VMusic makefile, you can see commented out code for building out Windows binaries from Linux host using mingw. I never got it working due to the signature requirement, but it did build successfully at least.

Also it looks like it is impossible to source a real OPL device in the summer for a reasonable price (LPT or USB), so that will have to wait 😀

Last edited by javispedro1 on 2022-08-21, 20:53. Edited 2 times in total.

Reply 19 of 25, by javispedro1

User metadata
Rank Newbie
Rank
Newbie
crazii wrote on 2022-08-21, 16:34:
I've tested the extpack in Linux and its working good, good job dude. I test one DOS/4GW game with Miles Sound and it occasional […]
Show full quote

I've tested the extpack in Linux and its working good, good job dude. I test one DOS/4GW game with Miles Sound and it occasionally a note missing in OPL3. but it doesn't hurt.
I read your post in the vbox forum, https://forums.virtualbox.org/viewtopic.php?f=7&t=105144
I don't know much about the extpack, guess it works in kernel mode? that would explain the kernel mode signature problem on Windows.
i wonder if the windows extpack can work in user mode so that i could use the normal sound api 😁, it might be less efficient but at least it'll work.

No, all VirtualBox extensions on Windows have to be kernel-signed even if they don't use any kernel API whatsoever. This is even more restrictive than Windows itself, since on windows you _can_ disable the signature requirement or even enroll your own CA (at the cost of some watermarks). The reasoning, as I understand it, is because the VirtualBox process is "privileged" in the sense that it can actually send abritrary code to be run in kernel mode, and thus all the VBox user space code should be treated for all intents and purposes as if it was kernel code. Only a few modules other than Oracle-signed are allowed in.