xemu icon indicating copy to clipboard operation
xemu copied to clipboard

Add Xbox Live Communicator Support

Open Ryzee119 opened this issue 3 years ago • 12 comments
trafficstars

This adds support for the Xbox Live Communicator peripheral. As there's no GUI element yet, you connect this within the xemu monitor:

stop
device_add usb-xblc,port=1.x.2
cont
where x = 3,4,1,2 for player 1,2,3,4 respectively.

See https://github.com/mborgerson/xemu/issues/1126 for details regarding the device's protocol.

It uses qemu's audios backend (AUD_*) API to read, resample and playback audio. It will just get microphone audio from the default input device. I reenabled audiodev for windows builds. I didnt notice log spam in current xemu master.

The game N.U.D.E has this simple loopback test screen in the options menu. I also tested in Rainbow Six 3 (voice commands) and Phantasy Star Online (loopback test in character creation screen). Ive tested all the supported sample rates.

basic

Currently in draft due to a couple issues:

  • Main issue is that there's some backend timing issue that causing schedule overruns in OHCI. Falls over here: https://github.com/mborgerson/xemu/blob/8d274e5f9a9dbe777ffba6a8b3d269adbf682690/hw/usb/hcd-ohci.c#L689 If we hit this overrun ~3 USB frames in a row, XDK seems to just stop polling the USB endpoints so the device will stop working and needs to be re-connected. Its unclear why this should happen as all the clocks should be in sync? It is worse if you pause the emulation and resume it or drag the xemu window around etc.
  • Should be able to set different audio outputs for headset and normal game output.
  • Not tested, but it will likely break if using VM savestates. We would need to remember atleast the currently set sample rate.

Ryzee119 avatar Jul 17 '22 06:07 Ryzee119

Could this be added as a page on the website as well?

MasonT8198 avatar Jul 17 '22 13:07 MasonT8198

There a few potentially related commits in upstream qemu. Not sure if this will fix the issues or not but some are atleast specific to OHCI isochronous transfers which is promising. I tried cherry picking these but hit alot of merge conflicts so may take some time to digest

Ryzee119 avatar Aug 25 '22 21:08 Ryzee119

There a few potentially related commits in upstream qemu. Not sure if this will fix the issues or not but some are atleast specific to OHCI isochronous transfers which is promising. I tried cherry picking these but hit alot of merge conflicts so may take some time to digest

We are overdue for a merge if you want to take a stab at it

mborgerson avatar Aug 25 '22 23:08 mborgerson

When it is confirmed that this feature works without issues please notify me, i would like to integrate a UI for those monitor commands.

Fabxx avatar Dec 25 '22 18:12 Fabxx

@Ryzee119 I've merged latest QEMU release updates in #1366, if you were interested in seeing if that resolves your issues

mborgerson avatar Jan 23 '23 22:01 mborgerson

Decided to play around with this. In Manhunt the narrator speaks through the headset speakers when it's attached, however it's not doing that with this PR.

GXTX avatar Jan 26 '23 14:01 GXTX

And using the microphone in Karaoke Revolution Party is not functional at all although it does detect it.

GXTX avatar Jan 26 '23 23:01 GXTX

@Ryzee119 I've merged latest QEMU release updates in #1366, if you were interested in seeing if that resolves your issues

Unfortunately seems like the issue is still present. Will try work out whats happening

Ryzee119 avatar Jan 28 '23 02:01 Ryzee119

@Ryzee119 I've merged latest QEMU release updates in #1366, if you were interested in seeing if that resolves your issues

Unfortunately seems like the issue is still present. Will try work out whats happening

Could you provide some steps for what to look for? I was able to play about 45-60 minutes of PSO with a player using the PR and it worked the entire time until he had to go. My copy of N.U.D.E. got here today too so I have a better test game to use. I was able to loop Audio through the test screen for that for about 30 minutes, and also play some of the opening but I had to stop to work on something else.

HadetTheUndying avatar Feb 05 '23 02:02 HadetTheUndying

What OS? It basically just stops working for me. it can be encouraged to fail by dragging the window in short quick bursts to make it pauses/resume alot

Ryzee119 avatar Feb 05 '23 03:02 Ryzee119

What OS? It basically just stops working for me. it can be encouraged to fail by dragging the window in short quick bursts to make it pauses/resume alot

Linux. I'll try dragging the window around a bunch.

HadetTheUndying avatar Feb 05 '23 03:02 HadetTheUndying

Maybe a windows thing. I'll try repeat it on Linux soon

Ryzee119 avatar Feb 05 '23 04:02 Ryzee119