Yep, I can confirm this information.

Info I get from my Empeg is as follows:

Stalk /Tuner is on /dev/ttyS0, at 19200 - the Player needs to send some command(s) to the Tuner before this becomes active, don't know what the 'enable' command is.

Each Stalk button sends a 4 byte packet in the format as per Hugos post.

Format is [in hex] 02 XX YY XX+YY where 02 means Stalk command I guess, XX is the Stalks 'Shift Value' either 00 for 'unshifted' buttons [i.e. Volume knob NOT pushed in] and 01 for Shifted buttons [i.e. Volume knob pushed in].

YY is the ADC value for the button being read and it does hover around the number a little [you need to test for the ADC value being between YY +/-F where F is the Fudge factor [around 5-10 for F is I think ok to cater for most Stalk variations].

The last byte is the Sum of XX+YY.

The Stalk Interface sends two command packets per button, once for Key Down and once for Key Released.
It doesn't send any timing info but you could determine if its a 'long' press by timing how long the down packet arrives before the up packet.

Key Release has FF as the YY value in all cases.

You also get a seperate 'key' release packet whenever the shift key is released [with XX being 01 rather than 00 , but YY is still FF].

You can grab Stalk commands from the Interface once the player has been running by stopping the player, then a
od -t x1 -v -w4 (redirect stdin from /dev/ttyS0)
will dump the 4 byte packets to the console as you fiddle with the Stalk buttons.

For the record heres the dump of the packets my Stalk makes the Tuner send to the empeg
:
[with comments about each button just pressed preceding each bunch of packets]

Note: Stalk is mounted on Steering wheel RHS on this installation [i.e. setting in emplode says RHS Stalk].

Off Button is to the Front [facing driver] and ATT button is behind [facing the dashboard]. The 3 buttons I called Front, Rear and Underneath are facing the Driver, the Dashboard and pointing to the floor of the vehicle respectively.

These 3 buttons are un-named by Sony as their exact Function depends on the Sony head unit the Stalk is plugs into.

On the Empeg these 3 buttons perform the Menu, Cancel and Shuffle on/off toggle in that order [i.e. Front button does Menu, Rear does Cancel and underneath button does Shuffle in my setup].

Note: for LHS of Steering wheel Stalk installations - Menu and Cancel are swapped, Off and ATT stay with the button of the same name and the meaning of Vol+/Seek+ etc is reversed [i.e. Seek+ becomes Seek- and v/v when in the LHS Stalk config].

Heres the dump of each button press then release on od format, ignore the address part at the front of each packet thats od showing the current offset in the stream [shows no packets are missing and little else :-) ]

Source button pressed (& released)
0000000 02 00 17 17
0000004 02 00 ff ff

Vol+ pressed (& released) etc
0000010 02 00 85 85
0000014 02 00 ff ff

Vol- Pressed
0000020 02 00 6f 6f
0000024 02 00 ff ff

Seek+
0000030 02 00 5b 5b
0000034 02 00 ff ff

Seek- [RHS stalk]
0000040 02 00 49 49
0000044 02 00 ff ff

Off
0000050 02 00 01 01
0000054 02 00 ff ff

ATT
0000060 02 00 2c 2c
0000064 02 00 ff ff

Front Button [menu in RHS config]
0000070 02 00 3b 3b
0000074 02 00 ff ff

Rear button [cancel in RHS config]
0000100 02 00 9b 9b
0000104 02 00 ff ff

Underneath button [Shuffle in RHS config]
0000110 02 00 b0 b0
0000114 02 00 ff ff

Shift pressed and released [no other buttons used]
0000120 02 01 ff 00
0000124 02 00 ff ff

Shift+Vol+ (i.e. shifted Vol+)
0000130 02 01 ff 00
0000134 02 01 5b 5c
0000140 02 01 ff 00
0000144 02 00 ff ff

Shift+Vol-
0000150 02 01 ff 00
0000154 02 01 49 4a
0000160 02 01 ff 00
0000164 02 00 ff ff

Shift+Off
0000170 02 01 ff 00
0000174 02 01 02 03
0000200 02 01 ff 00
0000204 02 00 ff ff

Shift+ATT
0000210 02 01 ff 00
0000214 02 01 2b 2c
0000220 02 01 ff 00
0000224 02 00 ff ff

Shift+Front button
0000230 02 01 ff 00
0000234 02 01 3b 3c
0000240 02 01 ff 00
0000244 02 00 ff ff

Shift+Rear Button
0000250 02 01 ff 00
0000254 02 01 9b 9c
0000260 02 01 ff 00
0000264 02 00 ff ff

Shift+underneath button
0000270 02 01 ff 00
0000274 02 01 b0 b1
0000300 02 01 ff 00
0000304 02 00 ff ff

Shift+Source Button
0000310 02 01 ff 00
0000314 02 01 17 18
0000320 02 01 ff 00
0000324 02 00 ff ff


Note: there is no shifted Seek+/Seek- as due to the way the Stalk is made Shifted Vol+ is the same as Shifted Seek+ [when the volume knob is pushed in to the shift position it physically locks against the inner ring that has the Seek+/- buttons on it so that the two buttons become one and turn together while shift is held in so it can only report it as one button].

Note that the Shifted buttons produce 4 packets, one for the shift, one for the Button pressed, one for the button release and one for the shift release.

The order of these 4 packets could vary, e.g. if you did the following:
Front button press,shift press,release Front button, release shift you would get 4 packets like this:


0000330 02 00 3b 3b
0000334 02 01 3b 3c
0000340 02 01 ff 00
0000344 02 00 ff ff


So any mapping in hijack needs to handle this situation.
You can also get the situation where the key is pressed [and held] then the shift key is pressed and held, then one key is released then the other - so the order the packets can vary depending on how the shift and other button is pressed and released.

I also think that the shift push then shift release [ie no other key shifted just the shift key is pushed then release] could be used as another button in its own right as its dead easy to do on the stalk and could logically act like a modifier key and be used to modify the behaviour of keystrokes that follow.
Its also easy to detect as the shift pressed and shift released packets arrive adjacently.

If you press two keys [and one of them is not shift] then the button with the lower ADC (YY) value blocks the other button until the lower ADC value key is released and it generates a key release packet for the lower ADC value button just released, then you get the key press packet for the higher key.

So, hopefully all this will lets us do some real hacking/mapping of the Stalk IF when Mark gets a chance.


BTW: I think we need to make the fudge factor (F) for the YY +/- range values configurable as previous stalk users have posted about problems with stalk commands not being picked up by the player in all cases and this has been suggested is due to the variations in resistance that each stalk button naturally has - its a analogue device after all!
Some users may find they need larger values of F.
I would think that only one value of F is needed i.e. the same value is applied to all Stalk ADC values.