Repository metrics
- Stars
- (1,200 stars)
- PR merge metrics
- (PR metrics pending)
Description
We finally have OffscreenCanvas support for v86 VMs, so we have a "Monitor" VS Code editor/tab that can be attached to a VM. You can run "Open VM" command to open it for the default system VM or run open /vm/1. This tab/editor is like a KVM. It also captures input and sends it to the v86 worker. And it should also play audio from the VM.
Btw, all this work involves making changes to Wanix as well. For example, to enable this audio playing with the Monitor editor tab, you have to rebuild after uncommenting this in Wanix:
https://github.com/tractordev/wanix/blob/main/vm/v86/v86.worker.js#L80-L90
I've been testing audio using Doom (chocolate-doom). This audio set up works but has a tremolo effect. Could be the WebAudio wrapper that runs in the Monitor tab: https://github.com/tractordev/apptron/blob/main/assets/lib/apptron.js#L342
Or it could be the messages from the emulator itself. Right now disable_speaker is true for v86. This prevents v86 from setting up its WebAudio system and virtual DAC. This is useless when running in a Web Worker. So we register emulator bus events for the data and send it to the monitor/frontend. We use dac-send-data and dac-tell-sampling-rate which are self explanatory. But in order to get the emulator to send them you have to send dac-request-data messages on the bus. In our commented out code, we call this on an interval at 20ms. The v86 audio stack calls this on "pump" but not sure how often that is.
Anyway, for now, we just assume no audio from VMs, but if we fix this tremolo effect we can have optional audio for VMs.