aome510 / spotify-player

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

No playback found. ALSA function 'snd_pcm_sw_params' failed #299

Closed FromWau closed 10 months ago

FromWau commented 10 months ago

Hi, I am not sure if this a bug at alsa or this repo.

Describe the bug The player is not able to find a playback device. Using SwitchToDevices (^D) I can see the local player (spotify-player) but after selecting the device. The player is still saying he is unable to find a device.

The player is able to control the client running on my phone when selecting the phone.

To Reproduce

  1. Install via yay -S spotify-player
  2. Login

Also tried the not-require-playback-for-start-playback Branch via cargo run same behavior.

Expected behavior Start hearing music.

Log and backtrace

Log

2023-11-26T03:42:25.430912Z  INFO spotify_player: General configurations: AppConfig { theme: "dracula", client_id: "ccdf631650f34665a56bd2fcc63ef933", client_port: 8888, copy_command: Command { command: "wl-copy", args: [] }, playback_format: "{track} • {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, track_table_item_max_len: 32, play_icon: "▶", pause_icon: "▌▌", liked_icon: "♥", border_type: Plain, progress_bar_type: Rectangle, playback_window_position: Top, playback_window_width: 6, enable_media_control: true, enable_streaming: true, enable_cover_image_cache: true, default_device: "spotify-player", device: DeviceConfig { name: "spotify-player", device_type: "speaker", volume: 50, bitrate: 160, audio_cache: false } }
2023-11-26T03:42:25.430986Z  INFO spotify_player: Theme configurations: ThemeConfig { themes: [Theme { name: "default", palette: Palette { background: None, foreground: None, black: Color { color: Black }, blue: Color { color: LightBlue }, cyan: Color { color: LightCyan }, green: Color { color: LightGreen }, magenta: Color { color: LightMagenta }, red: Color { color: LightRed }, white: Color { color: Gray }, yellow: Color { color: LightYellow }, bright_black: Color { color: DarkGray }, bright_white: Color { color: White }, bright_red: Color { color: Red }, bright_magenta: Color { color: Magenta }, bright_green: Color { color: Green }, bright_cyan: Color { color: Cyan }, bright_blue: Color { color: Blue }, bright_yellow: Color { color: Yellow } }, 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, table_header: None, selection: None } }] }
2023-11-26T03:42:25.431023Z  INFO spotify_player: Keymap configurations: 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: [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: 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: [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: 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('?'))] }, 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 }] }
2023-11-26T03:42:25.434886Z  INFO spotify_player::auth: Creating a new session with new authentication credentials
2023-11-26T03:42:32.213556Z  INFO spotify_player::token: Getting new authentication token...
2023-11-26T03:42:32.676917Z  INFO spotify_player::token: Got new token: Token { access_token: "BQBny14DA0vO_m2VEZVVoCU6XVFwm76ZGCk2y4jpEXNhH-IC4X3_wYLVx7wy6blpdT-_NGWANttnCxZm3R-QBSZ-VQ1IuQBAc5E4aFhMWnRK2JTYj6XlN5jHaKj47Z1mHwFFxmHTkfy6cGcDWUrf8wth9UIrgY2sO3l5IwGUpgCzISsrkFmdwg2Kc32cCevksyGPNOe_LnqiA-Sno-1-5_yk8vcZE8NpoUcCVNVTf5mHjfT6qB7569-3435dmsfP25Q8ujWHsLsZnmwQ5uRt8-Yis2pntUNh7gKv6mI", expires_in: Duration { secs: 3600, nanos: 0 }, expires_at: Some(2023-11-26T04:42:32.676910240Z), refresh_token: None, scopes: {} }
2023-11-26T03:42:32.676978Z  INFO spotify_player::streaming: Application's connect configurations: ConnectConfig { name: "spotify-player", device_type: Speaker, initial_volume: Some(32768), has_volume_ctrl: true, autoplay: false }
2023-11-26T03:42:32.677014Z  INFO spotify_player::streaming: Initializing a new integrated player with device_id=cbd0d21f-a607-4590-86f5-becdbf901ec2
2023-11-26T03:42:32.677151Z  INFO spotify_player::streaming: Starting an integrated Spotify player using librespot's spirc protocol
2023-11-26T03:42:32.809160Z  INFO spotify_player: No playback found on startup, trying to connect to an available device...
2023-11-26T03:42:32.809325Z  INFO spotify_player::cli::client: Starting a client socket at 127.0.0.1:8888
2023-11-26T03:42:32.809411Z  WARN spotify_player: Failed to run client socket for CLI: Address already in use (os error 98)
2023-11-26T03:42:32.810124Z  INFO spotify_player::media_control: Initializing application's media control event watcher...
2023-11-26T03:42:32.935148Z  INFO client_request{request=GetCurrentUser}: spotify_player::client: successfully handled the client request, took: 125ms
2023-11-26T03:42:32.980777Z  INFO client_request{request=GetUserSavedAlbums}: spotify_player::client: successfully handled the client request, took: 171ms
2023-11-26T03:42:33.105307Z  INFO client_request{request=GetUserFollowedArtists}: spotify_player::client: successfully handled the client request, took: 295ms
2023-11-26T03:42:33.233507Z  INFO client_request{request=GetUserPlaylists}: spotify_player::client: successfully handled the client request, took: 423ms
2023-11-26T03:42:33.869789Z  INFO client_request{request=ConnectDevice(None)}: spotify_player::client: Available devices: [Device { id: Some("a5817342-cbce-488a-844e-477215ac5ebd"), is_active: false, is_private_session: false, is_restricted: false, name: "spotify-player", _type: Speaker, volume_percent: Some(50) }, Device { id: Some("cbd0d21f-a607-4590-86f5-becdbf901ec2"), is_active: false, is_private_session: false, is_restricted: false, name: "spotify-player", _type: Speaker, volume_percent: Some(50) }]
2023-11-26T03:42:33.869833Z  INFO client_request{request=ConnectDevice(None)}: spotify_player::client: Trying to connect to device (id=a5817342-cbce-488a-844e-477215ac5ebd)
2023-11-26T03:42:34.076862Z  INFO client_request{request=ConnectDevice(None)}: spotify_player::client: Connection succeeded (device_id=a5817342-cbce-488a-844e-477215ac5ebd)!
2023-11-26T03:42:34.076900Z  INFO client_request{request=ConnectDevice(None)}: spotify_player::client: successfully handled the client request, took: 1267ms

Backtrace

Got a panic: PanicInfo {
    payload: Any { .. },
    message: Some(
        called `Result::unwrap()` on an `Err` value: StreamError(BuildStreamError(BackendSpecific { err: BackendSpecificError { description: "ALSA function 'snd_pcm_sw_params' failed with error 'EINVAL: Invalid argument'" } })),
    ),
    location: Location {
        file: "/home/fromml/.local/share/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: <unknown>
  12: <unknown>

Screenshots If applicable, add screenshots to help explain your problem. image

Environment

Additional context First time install. Just found out about this repo.

FromWau commented 10 months ago

Just found out I lived the whole time without pipewire-alsa. Closing.