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

allow addressing of multiple independent footswitch devices #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taladar
Copy link

@taladar taladar commented Aug 9, 2021

Adds a new parameter -d with an integer argument, 0 for first device, 1 for second device,...

@kannes
Copy link

kannes commented Jan 27, 2023

Thank you! At least for me this does not seem to work fully though:

I have four 1a86:e026 footswitches ("QinHeng Electronics FootSwitch") connected via a USB hub 1a40:0101 ("Terminus Technology Inc. Hub (branded "hama")). I can program the first three devices just fine using:

sudo footswitch -d 1 -k a
sudo footswitch -d 2 -k b
sudo footswitch -d 3 -k c

The fourth device fails though:

$ sudo footswitch -d 4 -k d
Cannot find footswitch with one of the supported VID:PID.
Check that the device is connected and that you have the correct permissions to access it. [init(), footswitch.c:121]

They are all connected and they all send a key when I press them (the fourth device sends a "3" currently because I programmed it independently.

footswitch -r is incomplete as well, I am not sure if this is the root cause:

$ sudo footswitch -r
[switch 1]: unconfigured
[switch 2]: 3
[switch 3]: unconfigured

@taladar
Copy link
Author

taladar commented Jan 27, 2023

@kannes As you can see in my comment the addressing starts at 0 so your four devices are 0 to 3, not 1 to 4.

@kannes
Copy link

kannes commented Jan 27, 2023

Oh wow, how did I not read that :D

Thank you, it works flawlessly now:

$ sudo footswitch -d 0 -k 1
$ sudo footswitch -d 1 -k 2
$ sudo footswitch -d 2 -k 3
$ sudo footswitch -d 3 -k 4

Hitting all the devices gives me
$ 4132

Yay!

@MRigal
Copy link

MRigal commented Nov 10, 2023

@rgerganov @taladar I've rebase the branch on actual master to support latest devices and I've also removed the OSX marker to support multiple devices on OSX on this branch: https://github.com/MRigal/footswitch/tree/multiple_devices
I'm keen to make a pull request to this PR or to open another one if that helps.

Note that the actual code is a bit buggy, one should initialize the addressing in crescent -d order, in descent it creates problems... But still useful

@taladar
Copy link
Author

taladar commented Nov 10, 2023

@MRigal Since i haven't used this in a while feel free to create an updated pull request and adjust the code as required to fix the issues you mentioned. Next time I use it I will just adjust my usage to whatever you come up with.

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.

3 participants