Bug 8648 - Holding down front buttons repeats improperly
: Holding down front buttons repeats improperly
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Player UI
: unspecified
: All Other
: -- normal (vote)
: ---
Assigned To: Felix Mueller
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-04 06:57 UTC by Bryan Alton
Modified: 2008-12-15 11:58 UTC (History)
6 users (show)

See Also:
Category: ---


Attachments
generate hold_release correctly for front panel (763 bytes, patch)
2008-08-08 03:39 UTC, Adrian Smith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Alton 2008-07-04 06:57:06 UTC
After pressing and holding FFWD or REW button - Boom goes into songscanner mode but continued holding down of FFW/REW buttons do not change position.  

Position in song can be changed by rotating knob or using remote but to be consistent with usage of remote (incl SB3) holding down FFW or REW should change song position
Comment 1 Adrian Smith 2008-07-05 09:31:25 UTC
This is due to there being no repeat codes from the boom front panel buttons.

We could simulate these evens in the server by generating .repeat on a timer, but this probably leaves it open to missing an up code and not cancelling the timer as it is hard state.  What do you think?
Comment 2 Adrian Smith 2008-07-06 14:10:13 UTC
Thinking about this - I think it would be safer if the firmware created repeat codes for these rather than emulating this in the server and creating the possibility that we miss the up code and so continue creating repeats for ever..

Felix - would this be easy for fwd/rew?  I'm not sure it is necessary for other buttons?  I assume you keep sending .down codes without sending an intermediate .up as done for vol*_front.
Comment 3 Bryan Alton 2008-07-06 15:30:58 UTC
My own feeling is that if repeat is not supported in firmware, then nothing needs to be done except document the difference so that users are aware it is a hardware restriction.  

I reckon emulating repeat in software will not be 100% successful and so may be storing up problems for the future.  
Comment 4 Chris Owens 2008-07-07 11:01:01 UTC
Andy thinks this is an SC bug, but I don't think he has looked at it like you did, Triode :).

Alan as always if you don't have time for this one, let me know and I'll get Dean to reassign it.  :)
Comment 5 Adrian Smith 2008-07-07 12:06:34 UTC
Its an architectural decision - not a bug...

At present front panel buttons send an a down and an up code, but unlike the IR remotes they don't continuously send codes when they are pressed.  The exception to this is the boom volup_front voldown_front buttons.

Now we can emulate repeat in the server for either all buttons, or just in song scanner (though this is hard as song scanner won't see the original key press unless we do something special).  However this assumes we run a timer in SC which keeps repeating until we see the button up code and is therefore susceptable to missing this code and continuing to repeat.

Safest option for me is to extend the boom volume mechanism of having the firmware generate repeats - in which case the server needs no changes.
Comment 6 Andy Grundman 2008-07-07 12:12:09 UTC
What about Transporter's front panel?  Does it work the same way?
Comment 7 Felix Mueller 2008-07-07 12:21:41 UTC
Triode is absolutely right. I already forgot that I only implemented repeat functionality in firmware for the volume buttons. Let me know if I should extend that for fwd and rev buttons too.
Comment 8 Adrian Smith 2008-07-07 12:59:52 UTC
I'm tempted to say that we should do it for all front panel buttons on boom and transporter - this will allow the server to generate *.repeat events for all of them as if they are IR buttons.

The only use case at preset is this, but the front panel and ir work differently at present...
Comment 9 Andy Grundman 2008-07-31 11:52:00 UTC
Felix is this your bug now?
Comment 10 Felix Mueller 2008-08-05 08:51:05 UTC
I've enabled repeating for fwd and rew so you can see if it works as expected. I have not looked into the SC side of this.

I did not enable repeating for all buttons at this time since it breaks 'stop' functionality when holding pause.

The change is in rev 4685 and will be in fw 23.
Comment 11 Blackketter Dean 2008-08-06 13:03:41 UTC
Felix:  Will you be looking into the SC side of this or should this get reassigned?  (I can confirm that with the current boom branch and fw23 it doesn't work).
Comment 12 Adrian Smith 2008-08-06 13:25:18 UTC
Felix - yes the server code will need a tweek if you enable it for all buttons, but I think this is the right thing to do for the longer term.

For the moment I can make this work with fw23 in song scanner - is this the best option?
Comment 13 Adrian Smith 2008-08-06 14:21:14 UTC
SC change 22430 adds support for .repeat events from the front panel and should enable this work work.

This is a more significant change than I proposed above as the old ir code would not generate .hold events when a stream of .down codes were sent (needed to switch into song scanner).  Please make sure other use of the front panel is tested...

Felix - with this code, you should be able to send repeat codes for other buttons such as stop as it should not mask the .hold event.  I suggest this is added at some point in the future.
Comment 14 Felix Mueller 2008-08-08 02:08:44 UTC
Triode: I've tried to add it for all buttons, but in case of the pause / stop button it does not quite work yet. Pressing and holding pause does stop the music _but_ upon release of the pause button the music resumes.
Comment 15 Adrian Smith 2008-08-08 02:40:11 UTC
could you send me a firmware image which does this?

is this worth fixing for 7.2 though?
Comment 16 Felix Mueller 2008-08-08 02:47:58 UTC
I don't think it is worth fixing for 7.2 as the buttons that currently need repeating (fwd/rew and volume up/down) work as they should.

I can certainly send you a fw doing this, but I was wondering if you could just remap let's say fwd button simulating it is pause to see the effect. Let me know if that would work for you or if you prefer a fw doing the repeat for all buttons?
Comment 17 Adrian Smith 2008-08-08 03:05:55 UTC
good idea - I'll try with the remapped buttons.

My main reason for fixing is to make the front panel work like IR buttons so that everyone's plugins work.  It sounds like we create one more event at present - I'll look at how easy it is to fix this.
Comment 18 Adrian Smith 2008-08-08 03:39:46 UTC
Created attachment 3761 [details]
generate hold_release correctly for front panel

We are currently generating .single events at the end of a hold period rather than hold_release.  This should fix it.

I think this should go in 7.2 - any views?
Comment 19 Andy Grundman 2008-08-08 08:58:16 UTC
OK by me.
Comment 20 Adrian Smith 2008-08-08 10:15:53 UTC
patch committed as change 22480.  You should be able to make all buttons repeat now Felix.
Comment 21 Adrian Smith 2008-08-08 17:33:07 UTC
change 22499 fixes the issue seen by Bryan on the forums - jumping caused by acceleration kicking in for the first event and using the time since a button was previously pressed...
Comment 22 Felix Mueller 2008-08-11 02:42:45 UTC
Enabled repeat for all front panel buttons on Boom. (rev 4715)

Added repeat for all front panel buttons on TR. (rev 4716)

Will be in Boom fw 27 and TR fw 60.
Comment 23 Ross Levine 2008-08-14 13:27:12 UTC
Press and hold power, now playing, search, browse, or size on Transporter front panel and you'll see the repeat isn't quite right. 
Comment 24 Adrian Smith 2008-08-14 14:35:21 UTC
Ross what's the symptoms of the problem?

Felix - I noticed once with TP that I got a .up with the same timecode as the preceeding .down  The server discards the second code if it has a repeat timestamp - could you check in the player that you don't generate ir codes with the same timestamp?

[I don't know why the server does this check - perhaps Dean can comment]

Also given the discussion on rate limiting the knob, do we want to slow down the repeat rate from the front panel - we are currently repeating ~3 times as fast as the IR remote does - one update every 30ms?  This is likely to create the same problems seen my Matt on his slow server...
Comment 25 Ross Levine 2008-08-14 14:47:46 UTC
(In reply to comment #24)
> Ross what's the symptoms of the problem?

Sorry, holding power turns the Transporter on and off very rapidly. Holding size toggles the font size very rapidly, etc. 
Comment 26 Adrian Smith 2008-08-14 14:52:07 UTC
And boom is different for the cases where the same buttons exist, for fw 27?  (I don't have this yet!)
Comment 27 Ross Levine 2008-08-14 14:57:02 UTC
Yes, very sorry to not be clear. Steven tried this with Boom fw27 and it is not an issue. 
Comment 28 Felix Mueller 2008-08-15 03:10:28 UTC
Triode: Every button event (up/down) sent to SC is using the same function which uses timer_get_ticks() as timestamp. I don't see how a down and up event could have ended up with the same time.

I see the same behavior on both Boom and Transporter. When pressing and holding let's say 'back' while connected and on and in the top menu I see a animated bump and after a short while another.

I don't see the rapidly turning on and off when pressing and holding power though. After a while I see the normal rebooting.

Is there anything I am missing here? I've tested with TR fw 61.
Comment 29 Spies Steven 2008-08-15 09:01:20 UTC
The rapid action described by Ross was using an older version of SqueezeCenter.
Comment 30 Adrian Smith 2008-08-15 10:18:10 UTC
Sounds like the main issue is not a problem.

Felix - I only saw it once - specifically the debug line said it was dropping the .up code.  It stuck out as there is a typo on the debug message "ignoringo"
Lets keep an eye out for it if people see any problems.
Comment 31 Ross Levine 2008-08-15 11:27:01 UTC
Works in 7.2 - 22623. 
Comment 32 Ross Levine 2008-08-15 11:29:00 UTC
Sorry, still seeing this but it's not rapid any more. Pardon me!
Comment 33 Adrian Smith 2008-08-15 13:02:29 UTC
So can you confirm again the difference between boom and transporter and which buttons you see a problem with.  Its not clear from this report where the problem is.
Comment 34 Ross Levine 2008-08-15 13:10:37 UTC
Front panel buttons that double-press during hold, for Boom:

Power, back, and play. 

Transporter:

Power, now playing, search, browse, size, back, volume, visual. 
Comment 35 Adrian Smith 2008-08-15 13:31:21 UTC
ok - this is a server problem - will look at it
Comment 36 Adrian Smith 2008-08-15 13:46:22 UTC
I think this is fixed in server change 22669.

Felix - I've removed a safety check on repeat which didn't classify a it as a repeat if the irtimestamp was > 0.5 sec.  However the firmware appeared to wait 0.5 sec for the first repeat - can you confirm this is the case.  I think it is safe without this check as the previous button press should normally be a up from another button, but just wanted to understand the timers in the firmware.
Comment 37 Felix Mueller 2008-08-17 03:47:33 UTC
Triode: I can confirm that firmware waits for 500ms for the first repeat.
Comment 38 Adrian Smith 2008-08-17 03:56:42 UTC
Ok - that explains the issue.  I think it is safe to leave without an extra check in the server so will close this and ask Ross to retest.
Comment 39 Ross Levine 2008-08-26 15:34:52 UTC
Verified to be fixed in 7.2 - 22900
Comment 40 James Richardson 2008-12-15 11:58:48 UTC
This bug has been fixed in the latest release of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.