madmicio / LG-WebOS-Remote-Control

Remote Control for LG TV WebOS
392 stars 74 forks source link

Volume buttons step in multiples of 3 #118

Closed jeremysherriff closed 8 months ago

jeremysherriff commented 9 months ago

When I use the LG Remote card to change the volume, the volume steps 3 levels up/down - eg volume is 10, press Up button -> goes to 14.

This is new behaviour introduced in v1.1 today. Reverting to v1.0 returns volume stepping to 1.

I assume this is connected to the new display of the volume numbers in place of the OK button.

jeremysherriff commented 9 months ago

As of v1.1.2 the volume step is now 2 instead of 3. The desired step is 1. Note I did not try v1.1.1.

madmicio commented 9 months ago

This is very strange. with the latest version I go back to the old "volume_up" and "volume_down" commands. on mousedown the service is called (the volume is varied by one step, 1 in the case of LG TVs) and if the click is longer than 200 milliseconds the service is called every 200 milliseconds until the mouseup event. theoretically the only way to advance by 2 is to hold down the mouse between 200 and 400 milliseconds. it might make sense since with the new version I went from 100 to 200 milliseconds and you went from 3 to 2 steps. Let me know if reducing the click time changes anything. at least to identify the problem and look for a solution

jeremysherriff commented 9 months ago

I've done a little more testing different devices and browsers. The result is very inconsistent:

I don't normally use the phone or desktop with the LG remote card, so I'm not sure of previous behaviour. If it works fine for you and others, I'm happy to ignore it and use the media player card for volume.

madmicio commented 9 months ago

Obviously it's a problem I'd like to solve. only problem is that it's hard to solve a problem I don't have. for the moment you can solve it by installing version 1.0. the initial version that always worked. and then if you have the desire and time we can make some attempts to understand the problem. for example, it already occurs to me that yes the service is the same but before I called it with the click event and now I listen to the mousedown event

madmicio commented 9 months ago

I already know that it can't be otherwise, but try calling the media_player.volume_up service and check that it actually increases by 1. I'm already sure that this is the case but at least let's raise a possibility

jeremysherriff commented 9 months ago

I have reverted to v1.0 and am happy to help with testing.

I already know that it can't be otherwise, but try calling the media_player.volume_up service and check that it actually increases by 1. I'm already sure that this is the case but at least let's raise a possibility

Calling the volume_up and _down services correctly change the volume by one - which tracks with the various media_player cards (built-in media-control card, custom:mini-media-player, and custom:mushroom-media-player-card) all working fine with a single step.

before I called it with the click event and now I listen to the mousedown event

OK that makes sense, and also explains why the different browsers/clients are behaving differently.

My own research on the matter indicates that it is common to have a delay of 300ms before registering a "long-press" event, then repeat events at 100ms. I'm not sure how they register a really short press, perhaps they are handling a combination of both onclick and onmousedown?

madmicio commented 9 months ago

please update and let me know

jeremysherriff commented 8 months ago

@madmicio sorry I got caught up with some late nights at work.

v1.1.3 works perfectly. Thanks for your help!