j-holub / Node-MPV

A NodeJs Module for MPV Player
https://www.npmjs.com/package/node-mpv
MIT License
116 stars 73 forks source link

errcode: 5, verbose: 'Timeout', method: 'forEach()' #99

Closed dimzeta closed 2 years ago

dimzeta commented 2 years ago

Hey guys, first of all I'm not sure this is a bug from node-mpv, mpv itslef or just me.

I'm using node-mpv for a blindtest game, on a RPi. So I play a bunch of WAV/MP3 one after another. To sum up I play a file, and when the time is expired I stop the file, display the results and then I go to the next file.

But sometimes, for no reason, this error appears (see below). MPV is still playing the last file in loop, but my app crashes. It could be after 10 songs, or 150 songs.

Here are my logs:

2021-09-28 17:08:48:551 info: MPV: loop: 6.wav
[Node-MPV]: Event: status
[Node-MPV]: Property change: duration - null
[Node-MPV]: Event: status
[Node-MPV]: Property change: filename - null
[Node-MPV]: Event: status
[Node-MPV]: Property change: path - null
[Node-MPV]: Event: status
[Node-MPV]: Property change: media-title - null
[Node-MPV]: Event: status
[Node-MPV]: Property change: playlist-pos - null
...

[Node-MPV]: Event: status
[Node-MPV]: Property change: playlist-pos - 0
[Node-MPV]: Event: status
[Node-MPV]: Property change: filename - 6.wav
[Node-MPV]: Event: status
[Node-MPV]: Property change: path - /home/app/public/uploads/sounds/6.wav
[Node-MPV]: Event: status
[Node-MPV]: Property change: media-title - 6.wav
[Node-MPV]: Event: status
[Node-MPV]: Property change: duration - 0.993719
Event: start
Event: stopped
2021-09-28 17:08:49:687 info: MPV: stopped method finished.
[Node-MPV]: Event: status
[Node-MPV]: Property change: duration - null
[Node-MPV]: Event: status
[Node-MPV]: Property change: filename - null
[Node-MPV]: Event: status
[Node-MPV]: Property change: path - null
[Node-MPV]: Event: status
[Node-MPV]: Property change: media-title - null
[Node-MPV]: Event: status
[Node-MPV]: Property change: playlist-pos - null
[Node-MPV]: Event: status
[Node-MPV]: Property change: playlist-count - 0

2021-09-28 17:08:50:706 info: MPV: play: 7.wav
2021-09-28 17:08:50:717 error: MPV Player: Load error
{
  errcode: 5,
  verbose: 'Timeout',
  method: 'forEach()',
  arguments: [
    '/home/app/public/uploads/sounds/6.wav'
  ],
  stackTrace: 'Error\n' +
    '    at ErrorHandler.errorMessage (/snapshot/backend/node_modules/node-mpv/lib/error.js:79:18)\n' +
    '    at Socket.<anonymous> (/snapshot/backend/node_modules/node-mpv/lib/mpv/mpv.js:163:32)\n' +
    '    at Socket.emit (events.js:376:20)\n' +
    '    at addChunk (internal/streams/readable.js:309:12)\n' +
    '    at readableAddChunk (internal/streams/readable.js:284:9)\n' +
    '    at Socket.Readable.push (internal/streams/readable.js:223:10)\n' +
    '    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)'
}
[Node-MPV]: Event: status
[Node-MPV]: Property change: filename - 7.wav
[Node-MPV]: Event: status
[Node-MPV]: Property change: path - /home/app/public/uploads/sounds/7.wav
[Node-MPV]: Event: status
[Node-MPV]: Property change: media-title - 7.wav
[Node-MPV]: Event: status
[Node-MPV]: Property change: playlist-pos - 0
[Node-MPV]: Event: status
[Node-MPV]: Property change: playlist-count - 1
[Node-MPV]: Event: status
[Node-MPV]: Property change: loop - true
[Node-MPV]: Event: status
[Node-MPV]: Property change: duration - 0.480136
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start
Event: seek
Event: start

Thanks for this package, and your help!

Software Versions
dimzeta commented 2 years ago

Nevermind, I simply upgraded MPV to the latest version and everything is working well.

j-holub commented 2 years ago

Glad the issue resolved itself. Sorry I didn't get back to you in time, I had a look at it but didn't really know where to look for the issue.

dimzeta commented 2 years ago

No worries, having created this package is already huge, it helped me a lot and saved a lot of time, so thanks to you!