Node-MPV icon indicating copy to clipboard operation
Node-MPV copied to clipboard

Playback instantly stops

Open depuits opened this issue 2 years ago • 0 comments

Bug Description

When starting a song I immediately get the stopped event and the player stops playing. This only happens on my debian install but it is working on manjaro. I'm using the same versions and script on both installs and yet it gives a different result. I've added the log of both instances what else can I try?

Log:

[Node-MPV]: Connected to socket '/tmp/node-mpv.sock'
[Node-MPV] sending stimulus
[Node-MPV] stimulus received true
[Node-MPV]: Event: status
[Node-MPV]: Property change: mute - false
[Node-MPV]: Event: status
[Node-MPV]: Property change: pause - false
[Node-MPV]: Event: status
[Node-MPV]: Property change: duration - undefined
[Node-MPV]: Event: status
[Node-MPV]: Property change: volume - 100
[Node-MPV]: Event: status
[Node-MPV]: Property change: filename - 15 Iederen Is Gek [Behalve Jij].mp3
[Node-MPV]: Event: status
[Node-MPV]: Property change: path - /music/Heideroosjes/Schizo/15 Iederen Is Gek [Behalve Jij].mp3
[Node-MPV]: Event: status
[Node-MPV]: Property change: media-title - 15 Iederen Is Gek [Behalve Jij].mp3
[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 - false
[Node-MPV]: Event: status
[Node-MPV]: Property change: duration - 165.17865
[Node-MPV]: Event: status
[Node-MPV]: Property change: media-title - Iederen Is Gek [Behalve Jij]
Event: start
Event: stopped                                                <-- this event is fired immediately so no song actually plays
[Node-MPV]: Event: status
[Node-MPV]: Property change: duration - undefined
[Node-MPV]: Event: status
[Node-MPV]: Property change: filename - undefined
[Node-MPV]: Event: status
[Node-MPV]: Property change: path - undefined
[Node-MPV]: Event: status
[Node-MPV]: Property change: media-title - undefined
[Node-MPV]: Event: status
[Node-MPV]: Property change: playlist-pos - -1

How To Reproduce

'use strict';

var mpv = require('node-mpv');
var config = require('config').get('player');

var options = {
	audio_only: true,
	debug: true,
	verbose: true,
};
var playerArgs = [
	'--audio-display=no',
	'--audio-channels=stereo',
	'--audio-samplerate=48000',
	'--audio-format=s16',
	'--ao=pcm',
	'--ao-pcm-file=/tmp/web-mplayer'
];

var player = new mpv(options, playerArgs);

async function play() {
	await player.start();
	await player.load('/music/Heideroosjes/Schizo/15 Iederen Is Gek [Behalve Jij].mp3');
}

play().catch((err) => {
	console.log(err);
	process.exit();
});

Expected behavior

Log of working instance:

[Node-MPV]: Connected to socket '/tmp/node-mpv.sock'
[Node-MPV] sending stimulus
[Node-MPV] stimulus received true
[Node-MPV]: Event: status
[Node-MPV]: Property change: mute - false
[Node-MPV]: Event: status
[Node-MPV]: Property change: pause - false
[Node-MPV]: Event: status
[Node-MPV]: Property change: duration - undefined
[Node-MPV]: Event: status
[Node-MPV]: Property change: volume - 100
[Node-MPV]: Event: status
[Node-MPV]: Property change: filename - 15 Iederen Is Gek [Behalve Jij].mp3
[Node-MPV]: Event: status
[Node-MPV]: Property change: path - /music/Heideroosjes/Schizo/15 Iederen Is Gek [Behalve Jij].mp3
[Node-MPV]: Event: status
[Node-MPV]: Property change: media-title - 15 Iederen Is Gek [Behalve Jij].mp3
[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 - false
[Node-MPV]: Event: status
[Node-MPV]: Property change: duration - 165.17865
[Node-MPV]: Event: status
[Node-MPV]: Property change: media-title - Iederen Is Gek [Behalve Jij]
Event: start

Actually playing music here
Software Versions
  • Node-Mpv: version 2
  • MPV: 0.33.1
  • OS: debian bullseye
Additional context

I'm using a snapcast pipe to stream the audio. Snapcast version is v0.25.0

depuits avatar Sep 08 '21 11:09 depuits