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

Successfully compiled and ran under Linux after debugging, here's the steps I followed #11

Open
smerkley opened this issue Jan 31, 2024 · 2 comments

Comments

@smerkley
Copy link

Hey, I'm pretty new to github and pretty inexperienced at programming in general but with the help of ChatGPT and some troubleshooting I was able to get this to work in my install of Fedora 39. I successfully ran this project years ago in Windows so I thought I'd give it a shot.

First thing I had to do was alter the makefile because it wasn't finding libusb.h (probably something wrong with my setup), this is what mine now looks like:

CFLAGS += -I/usr/include/libusb-1.0
LDLIBS += -lusb-1.0 -lportmidi

all: rb3_driver

rb3_driver: rb3_driver.o myusb_utils.o myusb_atexit.o my_atexit.o
	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS)

Next I found that libusb was running into permissions errors trying to get devices, so I had to run it as root. Then finally the last thing that fixed it was doing libusb_detatch_kernel_driver() before trying to claim the interface, and that solved it! So, on line 236 right before the interface is claimed I added this line:

libusb_detach_kernel_driver(h, interface_number);

And it works great! (though the program could be checking if it needs to detach the kernel driver programmatically but whatever it works!)

Thanks!

@sphaero
Copy link

sphaero commented Mar 11, 2024

Same for me, created a PR #13

I had to run as root as well.

To succesfully compile on Debian trixie:

CFLAGS=-I/usr/include/libusb-1.0/ make

@sphaero
Copy link

sphaero commented Mar 11, 2024

To set permissions so you don't need to run as root:

Create a udev rule: /etc/udev/rules.d/11-rb3.rules

SUBSYSTEMS=="usb", ATTRS{product}=="Harmonix RB3 Keyboard for Nintendo Wii", GROUP="users"

Now unplug and re-plug. You now should not need root but just a member of the users group

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

No branches or pull requests

2 participants