Problems when using a remote to select ‘previous’

When using a remote to select the previous track, two button presses are required, the first to restart the playing track and then a second (within a second or so) to actually move to the previous track. The same as using the U.I.

If, however, the ‘previous’ button is pressed too many times in quick succession, the remote ceases to have any effect - a wait of a minute or so is needed before it works again. The U.I. still works during this time.

Has anyone had this problem?
Has anyone found a solution?
Do I simply have to train my remote users to be more patient?

Added question…
Has anyone a technique to make a single press of the ‘previous’ button repeat the instruction twice, thus actually selecting the previous track.
I have tried adding ‘repeat = 2’ in lircrc but to no avail.

Out of curiosity, does this happen for all sources?

Sorry for the delay in replying, hectic weekend!

The only source I use is a local usb drive. I have just made a playlist of ten radio stations and the same happens with that.

simple one press is begin of the song and twice a song back

Yes but if the presses are in too quick succession the remote is ‘tied up’ for a minute or two. The UI is fine.

it would be smart if those buttons / commands where splitted in 2 buttons that would solve this issue

That would just be confusing for most users, it works with 2 successive presses on almost every mediaplayer i know, and that’s how I expect it to work when i try new one.

It’s a proplem with the remote or the receiving software if it hangs when buttons are pressed too fast and should be fixed in there.

or a short is back and long press is prev song…

I don’t believe the Volumio API is doing any debouncing, so that could be the issue.
One could test with a simple bash loop and curl to the API point while looking at the state…

Most streaming (well Spotify) API’s distinguish what “Prev” means depending on the current track position. If it’s more than a certain threshold, it goes to the beginning of the track, else it skips to the previous track .

1 Like

that would work too :stuck_out_tongue:

Half sorted. Using…

button = prev
config = volumio seek 0
config = volumio previous
end

…in lircrc at least stops the remote from hanging when presses are too rapid.

It just means that twice as many key presses are need to work back up the queue than were needed to work down it.
Not a great solution for the radio stations playlist, still hanging.
Not perfect…yet.

Should anyone else want their remote control to skip to the previous track rather than to the beginning of the current track, here’s how I’ve done it.

//truePrevious

var io = require('socket.io-client');
var socket = io.connect('http://localhost:3000');

var position = 0;
socket.emit('getState', '');
socket.on('pushState', function (data) {
  if (data.position >= 1)
  {
     position = (data.position);
     position --;
     socket.on('pushState', function () {
     });
     socket.emit("play",{"value":position});
  }
  socket.disconnect();
});

Place the above script (I called it ‘truePrevious’) into a folder of your choice (e.g. /home/volumio)
The folder will also need node_modules installed - so from within the folder, issue the command;

npm install socket.io-client@^1.7.4

Now edit your lircrc file and assign a button. For me it was;

prog = irexec
button = Left
config = node/home/volumio/truePrevious
end

Now I can skip backwards (admittedly not quite as quickly as skipping forwards) without the remote hanging for a minute or two. This also works with a playlist of radio stations. Apart from the slight time delay, I’m quite happy with the result. Anyone with a way to speed things up please feel free to adapt and inform…

Other audio players (such as the one in my car) operate the same way: one press to get back to the beginning of a track and, quickly, another press to get to previous track. Actually, that’s preferable behavior (for me) since I more often want to get back to the beginning of the current track than to get back to the previous track.

I’ve nothing against the way that the players use the previous button. I was more concerned that the remote could be ‘confused’ by too many presses.
I’ve now got the best of both worlds, one button for Volumio previous and another for mine. Happy days!

I can actually confirm that the hanging can be reproduced with websocket API easily as spamming the previous/next command, perhaps the issue should be resolved in common code area for both websocket and ir remote, probably the issue is there also for rest API and any other method of issuing commands.

Does JavaScript provide any kind of Queue data type?(something that is safe to write by multiple producers, and then let volumio be single consumer in first come first serve manner for the commands for example)

your solution of the real previous
is there a way to make this a plugin ?

i don’t see volumio picking this up in any new releases yet.
@volumio

Sorry for the late reply. I have got a plugin working, many school boy errors had to be sorted! Now I’ll see what I can do with my sub zero knowledge of git hub. I think it could win the prize for ‘least necessary plugin ever developed’ but if it actually helps anyone then so much the better.
I’ll post the git location when I can.

1 Like

Tnx Old Duffer let me know when your done.

it’s the best option for now maybe we could add the full controle with socket.io
do you know if the option for Notifications is in socket.io perhaps ?

volumio.local/api/v1/pushNotificationUrls?url=http://192.168.1.33/volumiostatus

If you just want to skip backwards, can’t you play directly?

//truePrevious

var io = require('socket.io-client');
var socket = io.connect('http://localhost:3000');

var position = 0;
socket.emit('getState', '');
socket.on('pushState', function (data) {
  if (data.position >= 1)
  {
     socket.emit("play",{"value": data.position - 1});
  }  
  socket.disconnect();
});