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

Add Linux PacDrive + Libusb Drivers #69

Closed
wants to merge 3 commits into from
Closed

Add Linux PacDrive + Libusb Drivers #69

wants to merge 3 commits into from

Conversation

teejusb
Copy link
Collaborator

@teejusb teejusb commented Nov 28, 2022

Largely originates from stepmania/stepmania#1479 so see that thread for context.

@teejusb teejusb requested a review from natano November 28, 2022 05:48
"archutils/Unix/arch_setup.h"
"archutils/Unix/AssertionHandler.h"
"archutils/Unix/EmergencyShutdown.h"
"archutils/Unix/GetSysInfo.h"
"archutils/Unix/RunningUnderValgrind.h"
"archutils/Unix/SignalHandler.h"
"archutils/Unix/SpecialDirs.h"
"archutils/Common/gcc_byte_swaps.h")
"archutils/Common/gcc_byte_swaps.h"
"io/USBDriver.h")
Copy link
Contributor

Choose a reason for hiding this comment

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

libusb-dev needs to be added to the build pipeline

{
#if defined(HAS_USBDRIVER_IMPL_LIBUSB)
return new USBDriver_Impl_Libusb;
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could just always use libusb for all platforms. That way we could get rid of the dispatch mechanism and remove two of the files.

list(APPEND SMDATA_ARCH_LIGHTS_HPP
"arch/Lights/LightsDriver_Linux_Leds.h"
"arch/Lights/LightsDriver_Linux_PIUIO.h"
"arch/Lights/LightsDriver_Linux_PIUIO_Leds.h"
"arch/Lights/LightsDriver_Linux_PIUIOBTN_Leds.h"
"arch/Lights/LightsDriver_Linux_ITGIO.h"
"arch/Lights/LightsDriver_Linux_stac.h"
"arch/Lights/LightsDriver_LinuxWeedTech.h")
"arch/Lights/LightsDriver_LinuxPacDrive.cpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

.h

@jsirex
Copy link

jsirex commented Dec 8, 2022

Maybe you'll be interested in simplified linux pacdrive backport. I tested it on stepmania: 5_1 branch.
https://github.com/jsirex/stepmania/tree/linux-pacdrive-5.1

Also, udev rule so no root required:

cat /etc/udev/rules.d/75-linux-pacdrive.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1505", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="1500", MODE="0666"

idProduct sometimes changes. I have couple devices.

@teejusb
Copy link
Collaborator Author

teejusb commented Dec 17, 2022

I think I might delegate to @DinsFire64 and see if they have a preference on the implementation used for the Linux PacDrive

@jsirex
Copy link

jsirex commented Dec 19, 2022

I often have to backport this, so decided to simplify the implementation, because whole job had to be done here is just write a couple bytes to device via usb_control_msg. No need that complecated Driver -> UBSDriver -> PacDrive.

Also I made it optional via CMAKE.

However there aren't wire mapping configuration.

So feel free to use any approach, copy-paste/merge solutions.
I also tested this patch on stepmania 5.1 branch and confirm it works

@teejusb teejusb mentioned this pull request Feb 17, 2023
@teejusb
Copy link
Collaborator Author

teejusb commented Mar 10, 2023

Superseded by #77

@teejusb teejusb closed this Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants