Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB: Move to Qt (with *significant* refactoring) #7534

Merged
merged 10 commits into from
Dec 18, 2022
Merged

USB: Move to Qt (with *significant* refactoring) #7534

merged 10 commits into from
Dec 18, 2022

Conversation

stenzek
Copy link
Contributor

@stenzek stenzek commented Dec 4, 2022

Description of Changes

Still a work in progress. WX no longer has USB, it's silly to keep two versions in the tree when it won't be around much longer, and I changed the interface anyway.

New USB has:

  • Actually working save states.
  • Mac compatibility (less eyetoy).
  • A consistent UI with the rest of the application.
  • Correct binding listing based on the controller type.
  • GunCon2 support.

TODO:

  • Fix incorrect lightgun positioning when there's borders around the display.
  • Eyetoy/usb mic.
  • Add bindings for remaining pad types.
  • Attempt to add force feedback via SDL (but I can't test it..)
  • Fix USB keyboards.
  • Add USB device configuration to Fullscreen UI. (deferred for after merge)
  • Add USB device bindings to input overlay.
  • Add multiple mouse support for USB mouse and lightgun. (deferred for after merge)
  • Fix saving state for USB printer.
  • Support binding no device to USB mic.
  • Access e.g. HCCA directly instead of copying (and skip with no devices connected).
  • Add OSD message for printer files being saved.

Rationale behind Changes

Be gone wx you disgusting horribly written overengineered turd sandwich. The USB code I ripped out and had to rewrite was just as bad, full of undefined behaviour and memory leaks.

Suggested Testing Steps

Test new functionality.

Closes #4041.

@seta-san
Copy link
Contributor

seta-san commented Dec 4, 2022

as soon as it's ready i'll be here to go nuts testing this. one note on the microphone; this #4167 has the descriptors for the konami microphone for japanese karaoke revolution games and i would like to see if it can be more universally used

@refractionpcsx2
Copy link
Member

Well once Sten has finished this, you're free to implement them :)

@lightningterror lightningterror added this to the Release 2.0 milestone Dec 5, 2022
@TheComputerGuy96
Copy link

We do a bit of trolling :trollface:

EyeToy Play game running inside the Qt build of PCSX2 on Linux (with Xbox One S controller shown in the image)

@refractionpcsx2
Copy link
Member

Is that an xbox??

@TheComputerGuy96
Copy link

@refractionpcsx2 I showed a Xbox One S wireless controller in the camera feed

@TheComputerGuy96
Copy link

I recently tried this at my kid's birthday and it was fine 🐸

@github-actions github-actions bot removed Documentation Dependencies Pull requests that update a dependency file labels Dec 12, 2022
@stenzek stenzek marked this pull request as ready for review December 14, 2022 15:49
@seta-san
Copy link
Contributor

eyetoy crashes immediately. the console log says it was unable to open the device. singstar boots and gets in game but no actual audio from a device makes it into the game.

@refractionpcsx2
Copy link
Member

eyetoy crashes immediately. the console log says it was unable to open the device. singstar boots and gets in game but no actual audio from a device makes it into the game.

Can you provide backtraces/.dmp files, please.

@seta-san
Copy link
Contributor

pcsx2/USB/USB.cpp Outdated Show resolved Hide resolved
@seta-san
Copy link
Contributor

Camera works. Microphone games still aren’t getting their input.

@MarcoEstevez
Copy link
Contributor

I'm not sure whether Force Feedback works, on the old GUI there was an option to test it, I'm missing it on the new GUI

image

@stenzek
Copy link
Contributor Author

stenzek commented Dec 16, 2022

No, there's not going to be a test option in the new design. The UI is mostly unaware of the inner workings of USB, including FFB.

@MarcoEstevez
Copy link
Contributor

Ok what about the other 4 options, will be eventually added

@github-actions github-actions bot removed the SPU2 label Dec 16, 2022
@stenzek
Copy link
Contributor Author

stenzek commented Dec 16, 2022

Ok what about the other 4 options, will be eventually added

What's there now is what you're getting. Rewriting all this stuff has been mental torture for me, especially since it's not something I care about in the slightest apart from lightguns. If someone wants to add more extensive options after it's merged, they're free to do so.

@MarcoEstevez
Copy link
Contributor

What's there now is what you're getting. Rewriting all this stuff has been mental torture for me, especially since it's not something I care about in the slightest apart from lightguns. If someone wants to add more extensive options after it's merged, they're free to do so.

@stenzek thanks for your quick answer, and also for all the great work you have done, I hope someone else picks it up and eventually add all the awesome features that will be left over

@stenzek
Copy link
Contributor Author

stenzek commented Dec 16, 2022

All done. There's some stuff I listed above which I'm going to do post-merge, but definitely taking a break from USB for a while, so over it.

I've added SDL joystick handling to the input source, so in theory wheels should all work, including FFB, but again, no way of testing it.

@seta-san
Copy link
Contributor

something else i noticed is that if you switch to the Logitech microphone the game doesn't recognize that the singstar device was disconnected.... but it does if i switch it to the eyetoy or something else non-microphone related.

@seta-san
Copy link
Contributor

seaman 2 doesn't recognize the seamic controller plugged in

@Mrlinkwii
Copy link
Contributor

@seta-san it dose
image

@seta-san
Copy link
Contributor

i think my problem is that i tried to bind it to the same controller as the normal pad

@stenzek
Copy link
Contributor Author

stenzek commented Dec 17, 2022

something else i noticed is that if you switch to the Logitech microphone the game doesn't recognize that the singstar device was disconnected.... but it does if i switch it to the eyetoy or something else non-microphone related.

No, worked fine for me. The replug logic doesn't care what kind of device it is, they all behave the same.

Crash when quickly switching between mic types should be fixed though.


// this is *assuming* the config is correct... there's no reason it shouldn't be.
if (sw.HasError() ||
EmuConfig.USB.Ports[port].DeviceType != state_devtype ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ROBYER1
Copy link

ROBYER1 commented Dec 19, 2022

This is great stuff, does this PR carry across to the Retroarch core? I started work on this a while ago too but got stuck at fathoming out USB support.

Was interested in seeing if this could be hooked up to the Lightgun support in Retroarch so that PCSX2 Core can run in Emu VR to play PS2 lightgun games in VR 🥳

@refractionpcsx2
Copy link
Member

refractionpcsx2 commented Dec 19, 2022

We're nothing to do with retroarch. I doubt this will ever appear there

@stenzek
Copy link
Contributor Author

stenzek commented Dec 19, 2022

That hack of a thing really shouldn't be called PCSX2 anymore, we've rewritten so much in the last couple of years that it's nothing alike, not in performance, features, nor compatibility.

Besides, I don't understand why you're asking us that question. Shouldn't you be asking the "maintainers" of said core?

@ROBYER1
Copy link

ROBYER1 commented Dec 19, 2022

Hey, I get that I've probably trodden on someone's toes here, I'm just a hobbyist developer interested in using PS2 games in VR for the lightgun games which happens through EmuVR who only support Retroarch.

I actually couldn't find the GitHub repo for their PCSX2 core although I'm on my phone atm as I'm out and about. I'll have a look later where I can raise that with them, if you do happen to have a link feel free to send me it. I didn't realise the PCSX2 Retroarch core was frowned upon by the PCSX2 team 😂

@TheComputerGuy96
Copy link

@ROBYER1 I actually found it on my phone: https://github.com/libretro/pcsx2

@ROBYER1
Copy link

ROBYER1 commented Dec 19, 2022

Besides, I don't understand why you're asking us that question. Shouldn't you be asking the "maintainers" of said core?

Why does the PCSX2 Retroarch core share the same name if it is so different and clearly frowned upon by the developers of the main PCSX2 emulator? Smh.

@legend800

This comment was marked as off-topic.

@PCSX2 PCSX2 locked as resolved and limited conversation to collaborators Dec 19, 2022
@F0bes
Copy link
Member

F0bes commented Dec 19, 2022

Why does the PCSX2 Retroarch core share the same name if it is so different and clearly frowned upon by the developers of the main PCSX2 emulator? Smh.

Unfortunately it is out of the (actual) PCSX2 team's control.

Stop spamming the thread with unrelated conversation. Take it to the forums

Who are you?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] USB - Sega Seamic Custom Controller Setup Screen
10 participants