Linux Question

5 years 11 months ago #1367 by DanielKirk2
Linux Question was created by DanielKirk2
Hi all,

I'm trying to create a setup with a Pedal-Pi attached to a 3-button usb footpad so I can send signals to the pi during songs. I also have a program called FX that I want to boot at startup and be able to accept input from the footpad.
The footpad seems to work like a keyboard with its 3 buttons mapping to the letters a, b, and c.

As an aside I'm using the CSound API which is running synchronously inside my code. CSound has opcodes for reading keyboard input and I'm hoping to use these to detect button presses.

The problem I'm having is getting CSound to recognise the input, I think this is a Linux problem rather than a CSound problem as in some configurations it seems to work, but the ones I need it doesn't.

I've tried the usual ways of starting my program at bootup (rc.local, init.d, and crontab) as well as using ssh, I'll sumarise the results:

- In rc.local I add the line "sudo path-to-FX &" which does load it at boot up but there is no button detection. I think this is because programs loaded in rc.local are not attached to any terminal so don't receive input.

- I got the same results when I put "@reboot sudo path-to-FX &" in crontab.

- I tried creating an init.d script but couldn't get it to load.

- In an ssh session I can load FX from the CLI and it does detect keypresses from my (remote) keyboard, and in fact responds to button presses from my footpad (when it's plugged in to my remote computer).

- When I attach my HDMI cable and a keyboard directly to the PI I can load the program from the CLI, switch the keyboard and footpad around and it successfully detects button presses, though not when I autoload FX using rc.local.

Ideally I want FX to load at startup without any HDMI or ssh connection, but to do so in a way that keyboard input is fed into its stdin channel.

I'm not a wizard with Linux and I hope I've been able to describe the problem clearly. If anyone can diagnose the problem or suggest a solution I'd be so very happy. Let me know if you need more information.

Thanks in advance!

Daniel.

Please Log in to join the conversation.

5 years 11 months ago #1378 by Ray
Replied by Ray on topic Linux Question
Hi Daniel, I am quite overwhelmed with your post :oops:
I understand what are you trying to do, which is veery cool by the way but dont know a solution for that off the top of my head... maybe some good computer engineer around has more experience on it.

Please Log in to join the conversation.

5 years 7 months ago #1507 by yojimbo
Replied by yojimbo on topic Linux Question

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Please Log in to join the conversation.

Time to create page: 0.072 seconds