[GH-ISSUE #230] audio_output thread panicks on startup without pulseaudio-alsa #169

Open
opened 2026-02-28 14:31:07 +03:00 by kerem · 7 comments
Owner

Originally created by @debugloop on GitHub (Dec 9, 2021).
Original GitHub issue: https://github.com/jpochyla/psst/issues/230

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/Linux
    • pulseaudio 15.0
Originally created by @debugloop on GitHub (Dec 9, 2021). Original GitHub issue: https://github.com/jpochyla/psst/issues/230 **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/Linux` - `pulseaudio 15.0`
Author
Owner

@jpochyla commented on GitHub (Dec 9, 2021):

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?

<!-- gh-comment-id:989863583 --> @jpochyla commented on GitHub (Dec 9, 2021): 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?
Author
Owner

@debugloop commented on GitHub (Dec 9, 2021):

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)

<!-- gh-comment-id:990215081 --> @debugloop commented on GitHub (Dec 9, 2021): 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)
Author
Owner

@debugloop commented on GitHub (Jan 3, 2022):

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.

<!-- gh-comment-id:1004397390 --> @debugloop commented on GitHub (Jan 3, 2022): 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.
Author
Owner

@rklasen commented on GitHub (Jul 11, 2022):

@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?

<!-- gh-comment-id:1180002642 --> @rklasen commented on GitHub (Jul 11, 2022): @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?
Author
Owner

@Insprill commented on GitHub (Jan 9, 2023):

I'm going to reopen this to track the issue since it seems to be the first report.

<!-- gh-comment-id:1376296749 --> @Insprill commented on GitHub (Jan 9, 2023): I'm going to reopen this to track the issue since it seems to be the first report.
Author
Owner

@RensOliemans commented on GitHub (Sep 26, 2024):

kepi already mentioned it in https://github.com/jpochyla/psst/issues/353#issuecomment-2015419193, but since this seems like the designated issue for this problem: If you are using pipewire, install pipewire-alsa.

Is it a possibility that this is done automatically on install? I'm not too familiar with PKGBUILD, but perhaps it's a possibility to either install pipewire-alsa or pulseaudio-alsa, depending on what the user uses for their audio.

<!-- gh-comment-id:2376178565 --> @RensOliemans commented on GitHub (Sep 26, 2024): kepi already mentioned it in https://github.com/jpochyla/psst/issues/353#issuecomment-2015419193, but since this seems like the designated issue for this problem: If you are using `pipewire`, install [pipewire-alsa](https://archlinux.org/packages/?name=pipewire-alsa). Is it a possibility that this is done automatically on install? I'm not too familiar with PKGBUILD, but perhaps it's a possibility to either install `pipewire-alsa` or `pulseaudio-alsa`, depending on what the user uses for their audio.
Author
Owner

@heeen commented on GitHub (Nov 29, 2024):

can you add native support for pipewire and /or make the backend selectable?

<!-- gh-comment-id:2507531153 --> @heeen commented on GitHub (Nov 29, 2024): can you add native support for pipewire and /or make the backend selectable?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#169
No description provided.