psst
psst copied to clipboard
audio_output thread panicks on startup without pulseaudio-alsa
Describe the bug The audio_output thread panicks on start up, which leads to no sound and an error log message every time a new song is started. Tested with self-compiled AUR version as well as the current nightly.
To Reproduce
[2021-12-09T10:41:02Z INFO psst_gui::data::config] loading config: "/home/danieln/.config/Psst/config.json"
[2021-12-09T10:41:02Z INFO psst_gui::webapi::local] parsing local tracks: "/home/danieln/.config/spotify/Users/<spotifyusername>-user/local-files.bnk"
[2021-12-09T10:41:02Z INFO psst_core::audio::output] using audio device: "default"
[2021-12-09T10:41:02Z INFO psst_core::cache] using cache: "/home/danieln/.cache/Psst"
[2021-12-09T10:41:02Z INFO psst_core::audio::output] opening output stream: StreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Default }
[2021-12-09T10:41:02Z INFO psst_gui::data::config] saved config: "/home/danieln/.config/Psst/config.json"
[2021-12-09T10:41:02Z INFO psst_core::session::access_token] access token expired, requesting
thread 'audio_output' panicked at 'called `Result::unwrap()` on an `Err` value: AudioOutputError(BackendSpecific { err: BackendSpecificError { description: "ALSA function 'snd_pcm_sw_params' failed with error 'EINVAL: Invalid argument'" } })', psst-core/src/audio/output.rs:37:75
stack backtrace:
0: rust_begin_unwind
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:101:14
2: core::result::unwrap_failed
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/result.rs:1617:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[2021-12-09T10:41:06Z INFO psst_core::session::access_token] access token expired, requesting
[2021-12-09T10:41:07Z INFO symphonia_format_ogg::demuxer] starting new physical stream
[2021-12-09T10:41:07Z INFO symphonia_format_ogg::demuxer] selected vorbis mapper for stream with serial=0x0
[2021-12-09T10:41:07Z INFO psst_core::player::file] blocked at 4399249
[2021-12-09T10:41:07Z INFO psst_core::player::file] blocked at 4411812
[2021-12-09T10:41:07Z INFO psst_core::player::file] blocked at 4428196
[2021-12-09T10:41:07Z INFO psst_core::player::file] blocked at 4444580
[2021-12-09T10:41:07Z INFO psst_core::player::file] blocked at 4460964
[2021-12-09T10:41:07Z INFO psst_core::player] starting playback
[2021-12-09T10:41:07Z ERROR psst_core::audio::output] output stream actor is dead
[2021-12-09T10:41:07Z ERROR psst_core::audio::output] output stream actor is dead
[2021-12-09T10:41:07Z ERROR psst_core::audio::output] output stream actor is dead
[2021-12-09T10:41:07Z INFO psst_gui::controller::playback] playing
Expected behavior Not seeing errors on startup.
Environment
- OS: Archlinux, latest
- Version:
Linux waystone 5.15.6-arch2-1 #1 SMP PREEMPT Thu, 02 Dec 2021 15:47:09 +0000 x86_64 GNU/Linuxpulseaudio 15.0
Hmm, that's strange, is your audio setup somehow unusual? We always pick either from the supported configs, or just use the default one when opening the output stream. Seems like an issue in CPAL then?
Not that I know of, my audio setup chiefly consists of having run pacman -S pulseaudio years ago. I have pipewire installed for screensharing under wayland, but as far as I can tell all audio is managed by pulseaudio only.
Regularly I use HDMI audio wired through an USB-C dock, testing using AUX headphones from said dock yields the same result. I can try using the builtin AUX jack while undocked, but I'm not hopeful. (edit: using them as default device, I mean)
I can't reproduce this issue anymore on latest master, the error message changed to something involving ALSA, which prompted me to install pulseaudio-alsa which immediately fixes psst for me. To get rid of it again I'll keep an eye on #245.
@debugloop , just wanted to say, I had the same issue on Arch and got it solved by installing pulseaudio-alsa. Thanks for the hint!
Could this be added as dependency?
I'm going to reopen this to track the issue since it seems to be the first report.