MPRIS Play/Pause stops audio but spotatui keeps showing and reporting playing

オープン
#985 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@Radhik-Amp がすでに取り組んでいます。

2026年11月6日 から。

  • #986 @Radhik-Amp による — オープン

評価

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

調査の方向性

Read pause_playback() in src/infra/network/playback.rs, the MPRIS handlers in src/runtime/startup.rs, and PlayerEvent::Paused in src/infra/player/events.rs. Trace which state and pending playback actions each path updates, then run the relevant playback and MPRIS tests. Done when pausing through MPRIS updates the TUI and reported PlaybackStatus to Paused and does not trigger the reported recovery error.

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

説明

bug
What happened

When I pause from outside spotatui (playerctl, Quickshell's media widget, media keys), the audio stops, but spotatui still thinks it's playing. Its own playbar shows Playing, and over MPRIS it keeps reporting PlaybackStatus as Playing, so desktop widgets show the wrong icon and a frozen position. Shortly after, the TUI shows Failed to start native playback.

Pausing with spotatui's own key works: the TUI, playerctl status and Quickshell all switch to Paused.

playerctl -p spotatui pause and playerctl -p spotatui play-pause both trigger it.

The two pause paths do different amounts of work. The TUI key goes through pause_playback() in src/infra/network/playback.rs, which pauses the player and also clears pending_start_playback and native_load_watchdog, cancels play-after-transfer, and sets native_is_playing and current_playback_context.is_playing to false. The MPRIS handlers in src/runtime/startup.rs (MprisEvent::Pause, PlayPause, Stop) only call player.pause() and set_native_playback_intent(false), so the app state still says playing.

The Failed to start native playback error may come from the play-after-transfer flag the MPRIS path doesn't cancel. The PlayerEvent::Paused handler in src/infra/player/events.rs checks take_play_after_transfer() first. If the flag is set, it calls player.play() and skips mpris.set_playback_status(false). I haven't confirmed this.

Expected: pausing over MPRIS behaves the same as pausing in the TUI. One shared App method for the pause bookkeeping, called from both paths, would cover it.

Steps to reproduce
  1. Start spotatui with native streaming and play a song.
  2. Run playerctl -p spotatui pause (or play-pause).
  3. The audio stops, but the TUI still shows Playing and playerctl -p spotatui status prints Playing.
  4. Shortly after, Failed to start native playback appears.
Frontend

Terminal app

Source

Spotify

spotatui version

0.47.0

OS

Fedora 44

How you installed spotatui

cargo install / cargo binstall

Terminal

Kitty

Debug log

The MPRIS Pause/PlayPause path writes nothing to the log, so the pause itself
doesn't appear. In-app toggles do log ("toggling playback: ..."). This is the snippet from
a run where the error appeared:

[01:17:10][spotatui::core::app::transport][INFO] toggling playback: paused
[01:17:36][spotatui::core::app::transport][INFO] toggling playback: playing
[01:17:49][spotatui::infra::network::playback][INFO] starting native playback via direct load route
[01:17:49][spotatui_librespot_connect::spirc][WARN] SpircCommand::Activate will be ignored while already active
[01:17:54][spotatui::core::app::tick][WARN] no player event within 5s of native load; forcing recovery attempt 1
[01:17:54][spotatui::infra::player::events][INFO] attempting native streaming recovery
[01:17:54][spotatui::infra::player::events][INFO] recovery route: replay parked StartPlayback
[01:17:55][spotatui::infra::network::playback][INFO] recovery replay: starting native playback via Spotify context route on device <device>
[01:17:58][spotatui_librespot_connect::spirc][ERROR] failed to handle request: Invalid state { context is not available. type: Default }
[01:17:58][spotatui::infra::network::requests][WARN] Spotify API PUT /v1/me/player/play?device_id=<device> failed in 3043ms: Spotify API 404 Not Found failed: Requested entity was not found
[01:17:58][spotatui::core::app::status][INFO] error occurred: Failed to start native playback: Spotify API 404 Not Found ... { Response status code: 410 Gone }
主要言語
Rust
スター
1.4k
フォーク
238
平均マージ
10時間 1分
マージ済み PR(30日)
171

環境構築

はじめの一歩

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

LargeModGames/spotatui のほかの issue

LargeModGames/spotatui の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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