nanosyzygy / ShuttlePRO

User program for interpreting key, shuttle, and jog events from a Contour Design ShuttlePRO v2
GNU General Public License v3.0
25 stars 23 forks source link

jogshuttle(11, -120) invalid code #6

Open videosmith opened 3 years ago

videosmith commented 3 years ago

The app began displaying these error codes when I ran all software from an external ssd. (see attached pic) Does not display when everything runs from internal sd card. Raspberry pi 4, all upgrades
Screenshot from 2021-11-04 12-11-59

videosmith commented 3 years ago

edit: I was incorrect. It occurs on the internal sd card as well. Scroll functions correctly regardless.

Only recent changes were system updates and altering boot order to USB first.

Cuperino commented 3 years ago

I took a look at ShuttlePRO's code @videosmith. What is the exact model of Shuttle that you have?

It seems to me that like your Shuttle is sending a command that ShuttlePRO doesn't know how to handle yet. I can think of three reasons why this might be the case:

  1. You have a different model than the program's author, which sends slightly different commands.
  2. You performed a firmware upgrade on your ShuttlePro, which resulted in commands that ShuttlePRO doesn't know how to handle.
  3. There is a fault in your Shuttle hardware, which causes it to constantly send the same erroneous output.

The number 11 refers to the type of input being received from the shuttle which, based on the code, could be either a jog or a shuttle event (see lines 265-287 and 170-184 of shuttlepro.c). Jog events are identified with the number 7, shuttle events are identified with the number 8 (see lines 46 and 47 of shuttle.h). In ShuttlePRO's code nothing is tied to the number 11 and codes end at 8, which leads me to believe code 11 doesn't exist. The number -120 is the value being sent by the device as part of a jog/shuttle event. The fact that this value never changes again leads me to think there might be something wrong with the hardware.

-120 suggests this is coming from an analogue input that could move in two directions of an axis. The values for these inputs could go from -127 to 127. If no analogue input is fixed at a position that's close to one of its two most extreme positions, it may be a broken analogue input. If all inputs continue to work fine, there might be something wrong with the Shuttle's circuit. These problems are usually caused by long term use, hard falls and water damage.

f4exb commented 2 years ago

Code 11 is for ShuttleXpress shuttle events. The present code only supports Shuttle PRO but there is not much to do to support ShuttleXpress as well. Also the value is in multiple of 120 for the ShuttleXpress. That is it must be divided by 120 to get the same value as the PRO in the [-7, 7] range.

f4exb commented 2 years ago

In fact in the ShuttleXpress when the shuttle moves two events one first with code 8 and value between -7 and 7 and a second with code 11 and value multiple of 120. Thus in fact the event with code 11 can just be ignored.

f4exb commented 2 years ago

By installing the ShuttleXpress on Windows I noticed that the key assignment program also lists transitions between the shuttle positions. Maybe that code 11 is for transitions then?

videosmith commented 2 years ago

@f4exb Thank you for the code 11 update. Although I can get the shuttle ring to send XK events, apparently the mechanics work differently than the jog disk. Whereas the jog disk sends a single mapped XK event per 'click' in either direction, which is desirable, the shuttle ring XK events are limited to each hemisphere of the ring, resulting multiplying undesirable XK events when reversing the ring until reaching its null position. So as you see, the following simple approach won't perform correctly in a .shuttlerc script:

-works as expected

Jog scroll forward

JL XK_Up

Jog scroll backward

JR XK_Down

Shuttle ring will not work same as above Jog commands

S-3 XK_Up S-2 XK_Up S-1 XK_Up S0 XK_space S1 XK_Down S2 XK_Down S3 XK_Down

Some form of logic may be necessary.

This may be the purpose of the transitions section in the Windows app from Contour. Perhaps a code approach such as: S-1>S-2 XK_Up S-2>S-1 XK_Down

Other applications have used specific XK bindings for each speed, however than would tend to result in jerky speed transitions, imo