raphnet / mupen64plus-input-raphnetraw

Input plugin with direct N64 controller access for raphnet adapters
http://raphnet.net/programmation/mupen64plus-input-raphnetraw/index_en.php
GNU General Public License v2.0
14 stars 12 forks source link

PJ64 lowered performance using plugin #2

Open theboy181 opened 7 years ago

theboy181 commented 7 years ago

I noticed when testing LLE plugins that I was getting lowered performance from this plugin. I go from 160 Vi using raphnet input to 260 Vi using Nrage during a FPS limit mode off in Kirby64. Screen shot during the first in game level. untitled

This can make those titles that need LLE with AL RDP unplayable.

raphnet commented 7 years ago

This is most likely due to the time it takes to do a round trip with the controller. It's not as fast as on a real N64 and the emulator is blocked while waiting. But I have ideas on how to improve this.

What version of the plugin and raphnet adapter do you currently have? Also, how many ports on your model?

theboy181 commented 7 years ago

This is great news!

I bought two 2 port adapters both model number:ADAP-2XN64-USB

theboy181 commented 7 years ago

Should this PJ version of this plugin work on 1964?

raphnet commented 7 years ago

I don't know if it works with 1964, I have not yet tried. Let me know if it does.

What firmware version do you have on your adapters? You can use the adapter manager to find out: http://www.raphnet.net/programmation/gcn64tools/index_en.php

theboy181 commented 7 years ago

image The Plugin dos not work with 1964 btw. Should it?

raphnet commented 7 years ago

For a performance increase (I hope) please try plugin version 1.0.3, single player version (pj64raphnetraw_1player.dll)

For 1964, I finally tested. Yes, it was supposed to work, but I confirmed it does not due to a hack/optimization specific to Project64. However, using the net version (pj64raphnetraw_net.dll) works fine with 1964.

theboy181 commented 7 years ago

Won't be able to test until tomorrow or maybe later tonight. I'll let you know. And thank you for looking into this for me. Loving the adapter and have shared the Raphnet site with a few people already

theboy181 commented 7 years ago

Just tested, and at current Im gettgin 224 in Kirby with Nrage 2.5 and 160 with Raphnet 1P only, and only 145 with the 1.3 Raphnet plugin.

Is it safe to say that performance will take a hit using Raphnet because of its architecture ? This is too bad if thats the case .

theboy181 commented 7 years ago

I noted that Body Harvest performance is slow (3 VI's) with Raphent, and I tested with latest version. Is the performance issue with this plugin related to that issue?

Kirbys CPU usage with Raphnet is 14% but using Nrage its 2%

raphnet commented 1 year ago

TODO: Version of the plugin using a thread to poll the controller continuously, keeping a copy of the last received status so it can be returned immediately to the emulator instead of blocking the emulator for the time the controller round trip is taking place.

Related: https://github.com/simple64/simple64/issues/275

loganmc10 commented 1 year ago

@raphnet any progress on this? I tried changing hid_get_feature_report to hid_read, but it always returns 0 bytes. I assume interrupt-in transfers are something that needs to be enabled somehow in the firmware? It seems that all the time is spent on hid_get_feature_report, but I assume it's probably not that easy.

How would polling the controller continuously work? Doesn't it need to send the command, and then receive data back? How would it know what command to send? I'm interesting in getting this working but I'm not 100% clear on how the implementation would work.

loganmc10 commented 1 year ago

I attempted what I thought would be a simple fix: The emulator emulates a SI DMA, which takes time (about 26000 emulated cycles). Normally it runs the controller plugin, then waits for those cycles, and then signals the end of the DMA.

I modified the emulator so that it runs readController in its own thread, and then waits for it at the end of the DMA. Theoretically, this would give readController more time to run, since it can run in parallel to the emulator while the DMA is happening.

It did work: https://github.com/simple64/simple64/compare/main...raphnet_threaded, however, it didn't seem to improve performance at all, Body Harvest still runs at the same speed

HazNut commented 11 months ago

Also posting this here from a simple64 issue, as related but couldn't link the issues together...

I'm experiencing lag with the plugin as well, recently got my N64 to USB adapter (v3) and running F-Zero X on simple64, when my car is destroyed the game starts continuously stuttering, but this only happens while the Rumble Pak is connected, if I unplug it, it stops completely. It also seems to happen when I pause the game, as I can hear the audio stuttering when I pause (but again, only with the Rumble Pak).