aome510 / spotify-player

A Spotify player in the terminal with full feature parity
MIT License
3.63k stars 166 forks source link

`spotify-player` crashes on launch with `rodio-backend` #610

Closed thoughtpatterns closed 2 days ago

thoughtpatterns commented 2 days ago

Describe the bug Immediately on launch, spotify-player prints its gui and the error message "Aborted", then crashes. Occurs either with or without dbus-launch.

To Reproduce Launch spotify-player. I believe the rodio-backend feature is the culprit, see below.

Expected behaviour The player should not crash on launch.

Log and backtrace

2024-11-23T14:35:51.875908Z  INFO spotify_player: Configurations: Configs { app_config: AppConfig { theme: "default", client_id: "0157ccd61a3a4370bdf81566433e5495", client_port: 8080, player_event_hook_command: None, playback_format: "{status} {track}\n {artists}\n {album}\n {metadata}", tracks_playback_limit: 50, proxy: None, ap_port: None, app_refresh_duration_in_ms: 32, playback_refresh_duration_in_ms: 0, page_size_in_rows: 20, play_icon: "|>", pause_icon: "||", liked_icon: "<3", border_type: Hidden, progress_bar_type: Rectangle, playback_window_position: Top, cover_img_length: 6, cover_img_width: 3, cover_img_scale: 1.0, playback_window_width: 6, enable_media_control: true, enable_streaming: Always, enable_cover_image_cache: true, default_device: "x230", device: DeviceConfig { name: "x230", device_type: "computer", volume: 70, bitrate: 320, audio_cache: true, normalization: false } }, keymap_config: KeymapConfig { keymaps: [Keymap { key_sequence: KeySequence { keys: [None(Char('n'))] }, command: NextTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('p'))] }, command: PreviousTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('.'))] }, command: PlayRandom }, Keymap { key_sequence: KeySequence { keys: [None(Char(' '))] }, command: ResumePause }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('r'))] }, command: Repeat }, Keymap { key_sequence: KeySequence { keys: [Alt(Char('r'))] }, command: ToggleFakeTrackRepeatMode }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('s'))] }, command: Shuffle }, Keymap { key_sequence: KeySequence { keys: [None(Char('+'))] }, command: VolumeUp }, Keymap { key_sequence: KeySequence { keys: [None(Char('-'))] }, command: VolumeDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('_'))] }, command: Mute }, Keymap { key_sequence: KeySequence { keys: [None(Char('>'))] }, command: SeekForward }, Keymap { key_sequence: KeySequence { keys: [None(Char('<'))] }, command: SeekBackward }, Keymap { key_sequence: KeySequence { keys: [None(Enter)] }, command: ChooseSelected }, Keymap { key_sequence: KeySequence { keys: [None(Char('r'))] }, command: RefreshPlayback }, Keymap { key_sequence: KeySequence { keys: [None(Char('/'))] }, command: Search }, Keymap { key_sequence: KeySequence { keys: [None(Char('z'))] }, command: Queue }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('z'))] }, command: AddSelectedItemToQueue }, Keymap { key_sequence: KeySequence { keys: [None(Char('Z'))] }, command: AddSelectedItemToQueue }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char(' '))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('a'))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('a'))] }, command: ShowActionsOnCurrentTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('R'))] }, command: RestartIntegratedClient }, Keymap { key_sequence: KeySequence { keys: [None(Tab)] }, command: FocusNextWindow }, Keymap { key_sequence: KeySequence { keys: [None(BackTab)] }, command: FocusPreviousWindow }, Keymap { key_sequence: KeySequence { keys: [None(Char('T'))] }, command: SwitchTheme }, Keymap { key_sequence: KeySequence { keys: [None(Char('D'))] }, command: SwitchDevice }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('p'))] }, command: BrowseUserPlaylists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('a'))] }, command: BrowseUserFollowedArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('A'))] }, command: BrowseUserSavedAlbums }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char(' '))] }, command: CurrentlyPlayingContextPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('t'))] }, command: TopTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('r'))] }, command: RecentlyPlayedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('y'))] }, command: LikedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('L'))] }, command: LyricPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('l'))] }, command: LyricPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('l'))] }, command: LibraryPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('s'))] }, command: SearchPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('b'))] }, command: BrowsePage }, Keymap { key_sequence: KeySequence { keys: [None(Backspace)] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('q'))] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('O'))] }, command: OpenSpotifyLinkFromClipboard }, Keymap { key_sequence: KeySequence { keys: [None(Char('?'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('h'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [None(Char('q'))] }, command: Quit }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('c'))] }, command: Quit }, Keymap { key_sequence: KeySequence { keys: [None(Esc)] }, command: ClosePopup }, Keymap { key_sequence: KeySequence { keys: [None(Char('j'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('n'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Down)] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('k'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('p'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(Up)] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageUp)] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('b'))] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageDown)] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('f'))] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('g'))] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(Home)] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(Char('G'))] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(End)] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('t'))] }, command: SortTrackByTitle }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('a'))] }, command: SortTrackByArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('A'))] }, command: SortTrackByAlbum }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('d'))] }, command: SortTrackByDuration }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('D'))] }, command: SortTrackByAddedDate }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('r'))] }, command: ReverseTrackOrder }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('k'))] }, command: MovePlaylistItemUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('j'))] }, command: MovePlaylistItemDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('N'))] }, command: CreatePlaylist }] }, theme_config: ThemeConfig { themes: [Theme { name: "default", palette: Palette { background: None, foreground: None, black: Color { color: Black }, blue: Color { color: Blue }, cyan: Color { color: Cyan }, green: Color { color: Green }, magenta: Color { color: Magenta }, red: Color { color: Red }, white: Color { color: Gray }, yellow: Color { color: Yellow }, bright_black: Color { color: DarkGray }, bright_white: Color { color: White }, bright_red: Color { color: LightRed }, bright_magenta: Color { color: LightMagenta }, bright_green: Color { color: LightGreen }, bright_cyan: Color { color: LightCyan }, bright_blue: Color { color: LightBlue }, bright_yellow: Color { color: LightYellow } }, component_style: ComponentStyle { block_title: None, border: None, playback_track: None, playback_artists: None, playback_album: None, playback_metadata: None, playback_progress_bar: None, current_playing: None, page_desc: None, playlist_desc: None, table_header: None, selection: None } }] }, cache_folder: "/home/moe/.cache/spotify-player" }
2024-11-23T14:35:51.876140Z  INFO spotify_player::state::data: Loading Playlists data from /home/moe/.cache/spotify-player/Playlists_cache.json...
2024-11-23T14:35:51.877490Z  INFO spotify_player::state::data: Successfully loaded Playlists data!
2024-11-23T14:35:51.877500Z  INFO spotify_player::state::data: Loading FollowedArtists data from /home/moe/.cache/spotify-player/FollowedArtists_cache.json...
2024-11-23T14:35:51.877521Z  INFO spotify_player::state::data: Successfully loaded FollowedArtists data!
2024-11-23T14:35:51.877529Z  INFO spotify_player::state::data: Loading SavedAlbums data from /home/moe/.cache/spotify-player/SavedAlbums_cache.json...
2024-11-23T14:35:51.891698Z  INFO spotify_player::state::data: Successfully loaded SavedAlbums data!
2024-11-23T14:35:51.891713Z  INFO spotify_player::state::data: Loading SavedTracks data from /home/moe/.cache/spotify-player/SavedTracks_cache.json...
2024-11-23T14:35:51.891729Z  INFO spotify_player::state::data: Successfully loaded SavedTracks data!
2024-11-23T14:35:52.210000Z  INFO spotify_player::auth: Successfully used the cached credentials to create a new session!
2024-11-23T14:35:52.289606Z  INFO spotify_player::token: Getting new authentication token...
2024-11-23T14:35:52.338980Z  INFO spotify_player::token: Got new token: Token { access_token: "BQBStDLFCu6Vp9_UXUi3zX7qmuHkj53B6RxlGirv_pmVfQzdB0z6rX8_yOkAmWecH1wlv30n4u_CSziX8AAddVMRRB82VPmQOPEUH3uPqRlDAIbwqqOmkwFpV__0g5GhDOdKyhiE24EZuKwJjA8R_jIm4KDUr3iou9QDZUB26ETL3L9IoG0qO45K5DjA7HEbl7Z2lkCyaT14DucwHoQ62fI59UnvDNVCK57DV9lw3ZgKPLfYhGD4ls4wCC8a-XHWpwuAr2krV-N82RBhBMERszwQCTxwf2fcRMfXJcFNGWCIJy0oAEDvCXVA5x8pUPPNgH4VX_gDZ20", expires_in: TimeDelta { secs: 3600, nanos: 0 }, expires_at: Some(2024-11-23T15:35:52.338973741Z), refresh_token: None, scopes: {} }
2024-11-23T14:35:52.339047Z  INFO spotify_player::streaming: Application's connect configurations: ConnectConfig { name: "x230", device_type: Computer, initial_volume: Some(45875), has_volume_ctrl: true, autoplay: false }
2024-11-23T14:35:52.339076Z  INFO spotify_player::streaming: Initializing a new integrated player with device_id=523a39cd-98b8-45b5-8546-efe6238d677e
2024-11-23T14:35:52.339224Z  INFO spotify_player::streaming: Starting an integrated Spotify player using librespot's spirc protocol
2024-11-23T14:35:52.506922Z  INFO spotify_player: No playback found on startup, trying to connect to an available device...
2024-11-23T14:35:52.506986Z  INFO spotify_player: Starting a client socket at 127.0.0.1:8080
2024-11-23T14:35:52.507644Z  INFO spotify_player::media_control: Initializing application's media control event watcher...
2024-11-23T14:35:52.510699Z ERROR spotify_player: Failed to start the application's media control event watcher: err=DbusError(
    D-Bus error: /usr/bin/dbus-launch terminated abnormally without any error message (org.freedesktop.DBus.Error.Spawn.ExecFailed),
)
2024-11-23T14:35:52.605917Z  INFO client_request{request=GetUserFollowedArtists}: spotify_player::client: Successfully handled the client request, took: 98ms
2024-11-23T14:35:52.668047Z  INFO client_request{request=GetCurrentUser}: spotify_player::client: Successfully handled the client request, took: 160ms
2024-11-23T14:35:52.678395Z  INFO client_request{request=GetUserSavedTracks}: spotify_player::client: Successfully handled the client request, took: 171ms
Got a panic: PanicHookInfo {
    payload: Any { .. },
    location: Location {
        file: "/home/moe/.cargo/registry/src/index.crates.io-6f17d22bba15001f/librespot-playback-0.4.2/src/audio_backend/rodio.rs",
        line: 178,
        col: 53,
    },
    can_unwind: true,
    force_no_backtrace: false,
}

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: start
             at /home/buildozer/aports/main/musl/src/musl-1.2.5/src/thread/pthread_create.c:207:2

Environment

Linux x230 6.6.61-0-lts #1-Alpine SMP PREEMPT_DYNAMIC 2024-11-14 19:34:11 x86_64 Linux spotify_player 0.18.1 lyric-finder,media-control,rodio-backend,sixel,streaming

Additional context The panic in the backtrace is caused by the unwrap on the following line:

let (sink, stream) = create_sink(&host, device).unwrap();

I'll update this issue after retrying with the pulseaudio backend (via pipewire).

thoughtpatterns commented 2 days ago

apologies lol, i haven't updated my apkbuild for this in a while. i'll delete if it isn't broken on v0.20.1.

thoughtpatterns commented 2 days ago

closing as i can no longer rebuild, opening a new issue for that