hrkfdn / ncspot

Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes.
BSD 2-Clause "Simplified" License
4.99k stars 208 forks source link

Instant crash on playback (NixOS 22.11.20220811.964d60f) #906

Open dustinlyons opened 2 years ago

dustinlyons commented 2 years ago

Describe the bug Playing any song results in a crash without any error message using NixOS default audio configuration.

To Reproduce Steps to reproduce the behavior:

  1. Open ncspot and login
  2. Select any song and hit Enter (play)
  3. User is returned to the command line

Expected behavior The song plays.

System (please complete the following information):

Backtrace/Debug log [2022-08-12][10:08:58] [ureq::stream] [DEBUG] connecting to api.spotify.com:443 at 35.186.224.25:443 [2022-08-12][10:08:58] [librespot_playback::player] [ERROR] Audio Sink Error Connection Refused: Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'ENOENT: No such file or directory'

hrkfdn commented 2 years ago

It looks like your build is trying to playback via ALSA which is not set up correctly?

gromeron commented 2 years ago

I have the same behavior in Ubuntu 22.04, how can I fix the ALSA issue, I miss my ncspot...

szaffarano commented 1 year ago

I've got a similar alsa-related issue installing ncspot using home-manager, as a workaround, if I set ALSA_PLUGIN_DIR env variable pointing to $[pkgs.alsa-plugins}/lib/alsa-lib it works, but I wonder whether is possible to force ncspot to use pulse instead of alsa.

I'm using v0.12.0 and --help shows it has support for Audio backends: alsa, pulseaudio, pipe, subprocess

Building the same version from sources works as expected using pulse: Audio backends: pulseaudio, pipe, subprocess