Playback stops when the next track fails to resolve

オープン
#1,738 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
perl

調査の方向性

Start in Slim::Player::StreamingController::_NextIfMore (around line 1012) and _RetryOrNext, the two places counting songqueue entries, then read _getNextTrack and _nextTrackError to see how a song becomes STATUS_FAILED. Reproduce with the playlist add sequence above and player.source at INFO, watching for "streaming track not started yet". Done means entry 2 is skipped and entry 3 plays, and the large-buffer and sync-group cases the suggested grep change leaves untested are checked too.

索引モデルが issue の本文から書いたものです。

説明

Disclaimer:

Analysis and reproduction have been made with Claude-code.

Playback stops when the next track fails to resolve

If the next track fails while the current one plays, LMS does not skip to the track after it. It logs "streaming track not started yet" and playback stops when the current track ends. Starting the failing track directly works: LMS skips it as expected.

Steps to reproduce (no plugins needed)
  1. On one player, queue a local file, an unreachable URL and another local file, then start the first:
    playlist add file:///music/1.wav
    playlist add http://127.0.0.1:1/unreachable.mp3
    playlist add file:///music/3.wav
    playlist index 0
    
  2. Let the first track play to its end.

Expected: LMS skips entry 2 and plays entry 3.
Actual: playback stops at entry 2. server.log with player.source at INFO:

Slim::Player::Song::getNextSong (246) scanning URL http://127.0.0.1:1/unreachable.mp3
Slim::Player::StreamingController::_NextIfMore (1012) streaming track not started yet, will wait until then to try next track

A missing local file as entry 2 is skipped correctly, because it fails later, in _Stream, which removes failed songs from the queue. We hit the bug with Deezer tracks that have no streaming rights (plugin getNextTrack calls the fail callback): themmm/lms-deezer#11.

Root cause
  • _getNextTrack puts the next song at the head of songqueue before calling getNextSong (Bug 10841). Its cleanup only pops failed or finished songs from the tail.
  • When getNextSong fails, _nextTrackError marks the song STATUS_FAILED and fires NextTrackError → _NextIfMore. The failed song is still at songqueue[0], next to the playing song.
  • _NextIfMore counts 2 songs and waits for the streaming song to start. That song never starts, so nothing fetches the next track, and the player stops at the end of the current track. _RetryOrNext has the same check.

The check came with a0a62d354 (PR #985). From reading the code: until 6fea62b22f (the fix for #1214), _NextIfMore still called _getNextTrack unconditionally after the check, so this case did not stop playback; since then the check is the only path.

Affected: reproduced on 9.1.2 (Docker lmscommunity/lyrionmusicserver:stable), 4 of 4 runs. StreamingController.pm is identical in 9.1.0 and public/9.2.

Possible fix

Leave failed songs out of the count in _NextIfMore and _RetryOrNext:

-	if (scalar @{$self->{'songqueue'}} < 2) {
+	if (scalar(grep { $_->status() != Slim::Player::Song::STATUS_FAILED } @{$self->{'songqueue'}}) < 2) {

With this change on 9.1.2, LMS skips entry 2 and plays entry 3 (2 of 2 runs); the existing cleanup in _Stream (bug 12653) then drops the failed song. A song that is still streaming is not STATUS_FAILED, so the large-buffer case the check was added for should keep waiting. Not tested: that case, and sync groups.

主要言語
Perl
スター
1.8k
フォーク
389
平均マージ
1日 4時間
マージ済み PR(30日)
10

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

LMS-Community/slimserver のほかの issue

LMS-Community/slimserver の issue をすべて見る

似ている issue

Perl の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。