VOGONS


Reply 20 of 25, by crazii

User metadata
Rank Oldbie
Rank
Oldbie
javispedro1 wrote on 2022-08-21, 16:52:

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.

Very interesting. I have no argument with it. At least it looks more safer that way. 🤣

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 22 of 25, by javispedro1

User metadata
Rank Member
Rank
Member
tauro wrote on 2022-09-03, 21:43:

javispedro1 have you thought about emulating the PC speaker too?

it seems to be complicated, since the PC speaker is already "emulated" (i.e. ignored) by virtualbox and is intertwined with the PIT which I don't want to replace..
However I found that VirtualBox on Linux can already passthru the speaker to a real PC speaker device : https://www.virtualbox.org/manual/UserManual. … ker_passthrough

For devices which don't have any type of "real" PC speaker , it may be possible to do some type of emulation at the Linux-level , e.g. by using CUSE/FUSE to create a fake PC speaker device and letting virtualbox open it.
I have a quick prototype which just prints the frequencies of the tones as received from VirtualBox so this looks like a feasible approach.
Maybe extend https://github.com/OpenMandrivaSoftware/ossp which is already a similar idea (it uses CUSE to emulate OSS devices).

Reply 23 of 25, by tauro

User metadata
Rank Member
Rank
Member
javispedro1 wrote on 2022-09-04, 15:22:

However I found that VirtualBox on Linux can already passthru the speaker to a real PC speaker device : https://www.virtualbox.org/manual/UserManual. … ker_passthrough

That's pretty amazing, I wasn't expecting it. It does indeed work fine.

javispedro1 wrote on 2022-09-04, 15:22:

For devices which don't have any type of "real" PC speaker , it may be possible to do some type of emulation at the Linux-level , e.g. by using CUSE/FUSE to create a fake PC speaker device and letting virtualbox open it.
I have a quick prototype which just prints the frequencies of the tones as received from VirtualBox so this looks like a feasible approach.
Maybe extend https://github.com/OpenMandrivaSoftware/ossp which is already a similar idea (it uses CUSE to emulate OSS devices).

It sounds like you're on the right track 😉

I don't know how you would play back the captured frequencies, but I hope it's different from how the pc-speaker is emulated on DOSBox, because to my ears it's different, a bit distorted. It doesn't matter how good/fast the computer is, it never sounds like the real thing.

Reply 24 of 25, by digger

User metadata
Rank Oldbie
Rank
Oldbie

Hi javispedro,

Back on the topic of supporting devices like OPL2LPT, RetroWave OPL3 (USB), etc:

The ScummVM project uses a kind of abstraction layer for OPL2 and OPL3 support that has multiple "backends", some of them emulators such as Nuked OPL3, others actual hardware devices, such as the aforementioned external OPL3 devices, or even an actual sound card with native OPL3 compatibility installed in the host machine. The key parts of this interface appear to be in audio/fmopl.h and in audio/fmopl.cpp.

Would this be a convenient way to extend the OPL3 emulation support in your `vmusic` extension pack to support both software emulation and "passthrough" support for hardware devices on the host machine, such as OPLxLPT, RetroWave and sound cards with actual OPL3 compatibility?

This code also offers alternative software emulators in addition to Nuked, namely the OPL3 emulation code from DOSBox, and that of the MAME project. But those aren't really interesting, since Nuked offers more accurate emulation than both of those. The really interesting part is the additional support for OPL3 hardware in the host computer.

Note however, that the ScummVM project switched their license from GPLv2 to GPLv3, almost exactly a year ago. Of course, if you don't want to migrate the vmusic project to GPLv3 (which is undestandable, since the VirtualBOX OSE project is itself GPLv2-licensed), you can still check out the older GPLv2-licensed versions of the sources. The ScummVM project appears to have been GPLv2-licensed right up until commit 9ae57ad4c131083d3c7277366fa1bc9a898aacbd. So you can copy code from the ScummVM project right up to that Git commit. Unfortunately, support for the RetroWave OPL3 USB device was added after the switch to GPLv3, so unless you we can convince the author of that code contribution to dual-license that code under GPLv2 as well, reusing the available GPLv2 code won't immediately add support for that device. But it might still be an easy way to add support for OPL2LPT, OPL3LPT, and OPL3-compatible sound cards installed in the host computer.

Or would it? How easily adaptable does the code seem to you? I'm not very experienced with C and C++ projects myself.

Anyway, a quick way to check out the most recent version of the ScummVM code base that is still GPLv2-licensed is as follows:

mkdir scummvm
cd scummvm
git init
git remote add origin https://github.com/scummvm/scummvm.git
git fetch --depth 1 origin 9ae57ad4c131083d3c7277366fa1bc9a898aacbd
git checkout FETCH_HEAD

(With thanks to https://stackoverflow.com/a/43136160)

Reply 25 of 25, by javispedro1

User metadata
Rank Member
Rank
Member
digger wrote on 2022-12-25, 19:54:

Or would it? How easily adaptable does the code seem to you? I'm not very experienced with C and C++ projects myself.

It's probably trivial to add support. But I have not yet found an excuse to buy one of these OPL USB chips myself 😀