[GH-ISSUE #974] No audio output over gstreamer pipe after some time #471

Closed
opened 2026-02-27 19:30:47 +03:00 by kerem · 27 comments
Owner

Originally created by @sqozz on GitHub (Mar 4, 2022).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/974

Hello!

I have 3 instances of librespot running (each for one account) and configured it to output into a gstreamer pipeline.
After some time (I cannot really make out a pattern and be more precise) this pipeline seems to break and I receive no audio output despite everything else looking to work fine (librespot shows up as spotify connect device, I can start playback, no error from spotify). This is what is getting logged:

[2022-03-02T17:18:03Z INFO  librespot_playback::player] Loading <Blooming (In C Minor) - Hannes Kretzer Remix> with Spotify URI <spotify:track:3mYW95cFCfuWgZxpiK4qzI>
[2022-03-02T17:18:04Z INFO  librespot_playback::player] <Blooming (In C Minor) - Hannes Kretzer Remix> (222728 ms) loaded
[2022-03-04T13:39:59Z INFO  librespot_playback::player] Loading <Baby's Dreamride> with Spotify URI <spotify:track:5tGeM9HV7gavSLFNltWnRg>
[2022-03-04T13:40:00Z INFO  librespot_playback::player] <Baby's Dreamride> (472868 ms) loaded
[2022-03-04T13:40:08Z INFO  librespot_playback::player] Loading <Oishigetta> with Spotify URI <spotify:track:5kTsjPKiF62JrFeRYqqqjz>
[2022-03-04T13:40:08Z INFO  librespot_playback::player] <Oishigetta> (451365 ms) loaded
[2022-03-04T13:40:22Z INFO  librespot_playback::player] Loading <Chrome> with Spotify URI <spotify:track:40NqF7IWo6v7TxIFfMOtc1>
[2022-03-04T13:40:22Z INFO  librespot_playback::player] <Chrome> (209217 ms) loaded
[2022-03-04T13:40:28Z INFO  librespot_playback::player] Loading <Karoshi> with Spotify URI <spotify:track:06xY7quIg2kW9wscNSubjV>
[2022-03-04T13:40:28Z INFO  librespot_playback::player] <Karoshi> (306359 ms) loaded
[2022-03-04T13:40:37Z INFO  librespot_playback::player] Loading <Rotmilan> with Spotify URI <spotify:track:74kt8o5ynHzDCdeyGlIVuy>
[2022-03-04T13:40:38Z INFO  librespot_playback::player] <Rotmilan> (497053 ms) loaded
[2022-03-04T13:40:52Z INFO  librespot_playback::player] Loading <Tacken> with Spotify URI <spotify:track:66KXSLfCiAoZkcjyF3Uujm>
[2022-03-04T13:40:52Z INFO  librespot_playback::player] <Tacken> (200389 ms) loaded
[2022-03-04T13:40:58Z INFO  librespot_playback::player] Loading <Blóð> with Spotify URI <spotify:track:5XLPGis2GkyXNtTRzpFuWQ>
[2022-03-04T13:40:58Z INFO  librespot_playback::player] <Blóð> (295000 ms) loaded
[2022-03-04T13:41:06Z INFO  librespot_playback::player] Loading <Meertraum> with Spotify URI <spotify:track:3J2Emoq0BdKHQQZVJdViUY>
[2022-03-04T13:41:06Z INFO  librespot_playback::player] <Meertraum> (394418 ms) loaded
[2022-03-04T13:41:17Z INFO  librespot_playback::player] Loading <All the Unknown> with Spotify URI <spotify:track:7wMVPi0m22F8fFSCOxs3jK>
[2022-03-04T13:41:17Z INFO  librespot_playback::player] <All the Unknown> (331346 ms) loaded
[2022-03-04T13:41:27Z INFO  librespot_playback::player] Loading <25 Hours - Schwarzbass Remix> with Spotify URI <spotify:track:5vybEBoaXan7kt0TbgkXGZ>
[2022-03-04T13:41:28Z INFO  librespot_playback::player] <25 Hours - Schwarzbass Remix> (221333 ms) loaded
[2022-03-04T13:41:33Z INFO  librespot_playback::player] Loading <Riverside - Rey&Kjavik Version> with Spotify URI <spotify:track:2WyCaMVuqfVmTiISsPQPxw>
[2022-03-04T13:41:33Z INFO  librespot_playback::player] <Riverside - Rey&Kjavik Version> (551538 ms) loaded
[2022-03-04T13:41:48Z INFO  librespot_playback::player] Loading <Aufwärts> with Spotify URI <spotify:track:0Wew9ZnvCnsJtSKgm8tGb2>
[2022-03-04T13:41:48Z INFO  librespot_playback::player] <Aufwärts> (218880 ms) loaded
[2022-03-04T13:41:54Z INFO  librespot_playback::player] Loading <Golden - Radio Edit> with Spotify URI <spotify:track:2B9Y42CQ480M8dW03WhPsb>
[2022-03-04T13:41:54Z INFO  librespot_playback::player] <Golden - Radio Edit> (207997 ms) loaded
[2022-03-04T13:42:00Z INFO  librespot_playback::player] Loading <Too Far Away feat. MARIA Die RUHE - Original Mix> with Spotify URI <spotify:track:53aNZvTG5rgpcdTVMzlw8h>
[2022-03-04T13:42:00Z INFO  librespot_playback::player] <Too Far Away feat. MARIA Die RUHE - Original Mix> (296000 ms) loaded
[2022-03-04T13:42:09Z INFO  librespot_playback::player] Loading <Harp Enough> with Spotify URI <spotify:track:0ywB0utZGAHl0tpTOTnp1v>
[2022-03-04T13:42:09Z INFO  librespot_playback::player] <Harp Enough> (263733 ms) loaded
[2022-03-04T13:42:16Z INFO  librespot_playback::player] Loading <Organism> with Spotify URI <spotify:track:1wcqR0dowbRycl04kSovJG>
[2022-03-04T13:42:16Z INFO  librespot_playback::player] <Organism> (255360 ms) loaded
[2022-03-04T13:42:25Z INFO  librespot_playback::player] Loading <Silver Line> with Spotify URI <spotify:track:1pVQZDkl3sulagEGzAB9Uf>
[2022-03-04T13:42:25Z INFO  librespot_playback::player] <Silver Line> (178509 ms) loaded
[2022-03-04T13:42:29Z INFO  librespot_playback::player] Loading <Eyes Alive> with Spotify URI <spotify:track:4MA5ZAVcGUzomiE4uJSPUb>
[2022-03-04T13:42:29Z INFO  librespot_playback::player] <Eyes Alive> (365069 ms) loaded
[2022-03-04T13:42:39Z INFO  librespot_playback::player] Loading <Love> with Spotify URI <spotify:track:4Tni0eZOEBwZ7Dd1Q4izKL>
[2022-03-04T13:42:40Z INFO  librespot_playback::player] <Love> (378117 ms) loaded
[2022-03-04T13:42:50Z INFO  librespot_playback::player] Loading <Bosque> with Spotify URI <spotify:track:0ZNZu14IJ7gFmWeKo4B7pv>
[2022-03-04T13:42:50Z INFO  librespot_playback::player] <Bosque> (393428 ms) loaded
[2022-03-04T13:43:02Z INFO  librespot_playback::player] Loading <Earth - Rey&Kjavik Version> with Spotify URI <spotify:track:53cIijXH54OMvUzj7qQL4v>
[2022-03-04T13:43:02Z INFO  librespot_playback::player] <Earth - Rey&Kjavik Version> (443105 ms) loaded
[2022-03-04T13:43:13Z INFO  librespot_playback::player] Loading <In Spite Of Everything> with Spotify URI <spotify:track:6pJ7aIum1zU5MsrC5GI0JK>
[2022-03-04T13:43:14Z INFO  librespot_playback::player] <In Spite Of Everything> (332320 ms) loaded
[2022-03-04T13:43:22Z INFO  librespot_playback::player] Loading <Moldau> with Spotify URI <spotify:track:0jJgyhhY0xE7lgAUotflrp>
[2022-03-04T13:43:22Z INFO  librespot_playback::player] <Moldau> (440737 ms) loaded
[2022-03-04T13:43:35Z INFO  librespot_playback::player] Loading <Gnossienne No. 1 - Monolink Nostalgia Remix (FRAGMENTS / Erik Satie)> with Spotify URI <spotify:track:27DGCVaE1yetd85bbWWrDA>
[2022-03-04T13:43:35Z INFO  librespot_playback::player] <Gnossienne No. 1 - Monolink Nostalgia Remix (FRAGMENTS / Erik Satie)> (336886 ms) loaded
[2022-03-04T13:43:46Z INFO  librespot_playback::player] Loading <The Water> with Spotify URI <spotify:track:0lTH9SwH78rFMuAFsg0VX8>
[2022-03-04T13:43:46Z INFO  librespot_playback::player] <The Water> (354262 ms) loaded
[2022-03-04T13:43:55Z INFO  librespot] librespot 0.3.1 a605444 (Built on 2022-01-09, Build ID: ljDVAehf, Profile: release)
[2022-03-04T13:43:55Z INFO  librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070"
[2022-03-04T13:43:55Z INFO  librespot_core::session] Authenticated as "<redacted>" !
[2022-03-04T13:43:55Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2022-03-04T13:43:55Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2022-03-04T13:43:55Z INFO  librespot_playback::audio_backend::gstreamer] Using GStreamer sink with format: S16
[2022-03-04T13:43:55Z INFO  librespot_core::session] Country: "DE"
[2022-03-04T13:43:55Z INFO  librespot_playback::audio_backend::gstreamer] Pipeline: appsrc caps="audio/x-raw,format=S16LE,layout=interleaved,channels=2,rate=44100" block=true max-bytes=4096 name=appsrc0 ! pulsesink client-name=spotify_sqozz
[2022-03-04T13:43:58Z INFO  librespot_playback::player] Loading <The Water> with Spotify URI <spotify:track:0lTH9SwH78rFMuAFsg0VX8>
[2022-03-04T13:43:59Z INFO  librespot_playback::player] <The Water> (354262 ms) loaded

At 2022-03-02T17:18:04Z everything worked. At 2022-03-04T13:39:59Z I started a new session where audio output was missing until I restarted librespot at 2022-03-04T13:43:55Z. After that the audio was working perfectly fine again.

I use the gstreamer backend instead of the native pulseaudio one because this way I can distinguish between the different instances of librespot (by adding a client-name).

The command I use to run librespot is: /opt/librespot/target/release/librespot spotifyd --disable-discovery --enable-volume-normalisation --name Catcave (sqozz) --device-type avr --bitrate 320 --backend gstreamer --device ! pulsesink client-name=spotify_sqozz --username my@user.name --password password

I know that the log doesn't really provide much more information but maybe somebody can help me to further dig down what maybe could cause my problems here.

Some system information:

OS: gentoo
gstreamer version: 1.18.4
gstreamer plugins: base, good, bad, ugly (all 1.18.4)
pulseaudio version: 15.0
librespot version: 0.3.1 a605444 (Built on 2022-01-09, Build ID: ljDVAehf, Profile: release)

Thanks in advance!

Originally created by @sqozz on GitHub (Mar 4, 2022). Original GitHub issue: https://github.com/librespot-org/librespot/issues/974 Hello! I have 3 instances of librespot running (each for one account) and configured it to output into a gstreamer pipeline. After some time (I cannot really make out a pattern and be more precise) this pipeline seems to break and I receive no audio output despite everything else looking to work fine (librespot shows up as spotify connect device, I can start playback, no error from spotify). This is what is getting logged: ``` [2022-03-02T17:18:03Z INFO librespot_playback::player] Loading <Blooming (In C Minor) - Hannes Kretzer Remix> with Spotify URI <spotify:track:3mYW95cFCfuWgZxpiK4qzI> [2022-03-02T17:18:04Z INFO librespot_playback::player] <Blooming (In C Minor) - Hannes Kretzer Remix> (222728 ms) loaded [2022-03-04T13:39:59Z INFO librespot_playback::player] Loading <Baby's Dreamride> with Spotify URI <spotify:track:5tGeM9HV7gavSLFNltWnRg> [2022-03-04T13:40:00Z INFO librespot_playback::player] <Baby's Dreamride> (472868 ms) loaded [2022-03-04T13:40:08Z INFO librespot_playback::player] Loading <Oishigetta> with Spotify URI <spotify:track:5kTsjPKiF62JrFeRYqqqjz> [2022-03-04T13:40:08Z INFO librespot_playback::player] <Oishigetta> (451365 ms) loaded [2022-03-04T13:40:22Z INFO librespot_playback::player] Loading <Chrome> with Spotify URI <spotify:track:40NqF7IWo6v7TxIFfMOtc1> [2022-03-04T13:40:22Z INFO librespot_playback::player] <Chrome> (209217 ms) loaded [2022-03-04T13:40:28Z INFO librespot_playback::player] Loading <Karoshi> with Spotify URI <spotify:track:06xY7quIg2kW9wscNSubjV> [2022-03-04T13:40:28Z INFO librespot_playback::player] <Karoshi> (306359 ms) loaded [2022-03-04T13:40:37Z INFO librespot_playback::player] Loading <Rotmilan> with Spotify URI <spotify:track:74kt8o5ynHzDCdeyGlIVuy> [2022-03-04T13:40:38Z INFO librespot_playback::player] <Rotmilan> (497053 ms) loaded [2022-03-04T13:40:52Z INFO librespot_playback::player] Loading <Tacken> with Spotify URI <spotify:track:66KXSLfCiAoZkcjyF3Uujm> [2022-03-04T13:40:52Z INFO librespot_playback::player] <Tacken> (200389 ms) loaded [2022-03-04T13:40:58Z INFO librespot_playback::player] Loading <Blóð> with Spotify URI <spotify:track:5XLPGis2GkyXNtTRzpFuWQ> [2022-03-04T13:40:58Z INFO librespot_playback::player] <Blóð> (295000 ms) loaded [2022-03-04T13:41:06Z INFO librespot_playback::player] Loading <Meertraum> with Spotify URI <spotify:track:3J2Emoq0BdKHQQZVJdViUY> [2022-03-04T13:41:06Z INFO librespot_playback::player] <Meertraum> (394418 ms) loaded [2022-03-04T13:41:17Z INFO librespot_playback::player] Loading <All the Unknown> with Spotify URI <spotify:track:7wMVPi0m22F8fFSCOxs3jK> [2022-03-04T13:41:17Z INFO librespot_playback::player] <All the Unknown> (331346 ms) loaded [2022-03-04T13:41:27Z INFO librespot_playback::player] Loading <25 Hours - Schwarzbass Remix> with Spotify URI <spotify:track:5vybEBoaXan7kt0TbgkXGZ> [2022-03-04T13:41:28Z INFO librespot_playback::player] <25 Hours - Schwarzbass Remix> (221333 ms) loaded [2022-03-04T13:41:33Z INFO librespot_playback::player] Loading <Riverside - Rey&Kjavik Version> with Spotify URI <spotify:track:2WyCaMVuqfVmTiISsPQPxw> [2022-03-04T13:41:33Z INFO librespot_playback::player] <Riverside - Rey&Kjavik Version> (551538 ms) loaded [2022-03-04T13:41:48Z INFO librespot_playback::player] Loading <Aufwärts> with Spotify URI <spotify:track:0Wew9ZnvCnsJtSKgm8tGb2> [2022-03-04T13:41:48Z INFO librespot_playback::player] <Aufwärts> (218880 ms) loaded [2022-03-04T13:41:54Z INFO librespot_playback::player] Loading <Golden - Radio Edit> with Spotify URI <spotify:track:2B9Y42CQ480M8dW03WhPsb> [2022-03-04T13:41:54Z INFO librespot_playback::player] <Golden - Radio Edit> (207997 ms) loaded [2022-03-04T13:42:00Z INFO librespot_playback::player] Loading <Too Far Away feat. MARIA Die RUHE - Original Mix> with Spotify URI <spotify:track:53aNZvTG5rgpcdTVMzlw8h> [2022-03-04T13:42:00Z INFO librespot_playback::player] <Too Far Away feat. MARIA Die RUHE - Original Mix> (296000 ms) loaded [2022-03-04T13:42:09Z INFO librespot_playback::player] Loading <Harp Enough> with Spotify URI <spotify:track:0ywB0utZGAHl0tpTOTnp1v> [2022-03-04T13:42:09Z INFO librespot_playback::player] <Harp Enough> (263733 ms) loaded [2022-03-04T13:42:16Z INFO librespot_playback::player] Loading <Organism> with Spotify URI <spotify:track:1wcqR0dowbRycl04kSovJG> [2022-03-04T13:42:16Z INFO librespot_playback::player] <Organism> (255360 ms) loaded [2022-03-04T13:42:25Z INFO librespot_playback::player] Loading <Silver Line> with Spotify URI <spotify:track:1pVQZDkl3sulagEGzAB9Uf> [2022-03-04T13:42:25Z INFO librespot_playback::player] <Silver Line> (178509 ms) loaded [2022-03-04T13:42:29Z INFO librespot_playback::player] Loading <Eyes Alive> with Spotify URI <spotify:track:4MA5ZAVcGUzomiE4uJSPUb> [2022-03-04T13:42:29Z INFO librespot_playback::player] <Eyes Alive> (365069 ms) loaded [2022-03-04T13:42:39Z INFO librespot_playback::player] Loading <Love> with Spotify URI <spotify:track:4Tni0eZOEBwZ7Dd1Q4izKL> [2022-03-04T13:42:40Z INFO librespot_playback::player] <Love> (378117 ms) loaded [2022-03-04T13:42:50Z INFO librespot_playback::player] Loading <Bosque> with Spotify URI <spotify:track:0ZNZu14IJ7gFmWeKo4B7pv> [2022-03-04T13:42:50Z INFO librespot_playback::player] <Bosque> (393428 ms) loaded [2022-03-04T13:43:02Z INFO librespot_playback::player] Loading <Earth - Rey&Kjavik Version> with Spotify URI <spotify:track:53cIijXH54OMvUzj7qQL4v> [2022-03-04T13:43:02Z INFO librespot_playback::player] <Earth - Rey&Kjavik Version> (443105 ms) loaded [2022-03-04T13:43:13Z INFO librespot_playback::player] Loading <In Spite Of Everything> with Spotify URI <spotify:track:6pJ7aIum1zU5MsrC5GI0JK> [2022-03-04T13:43:14Z INFO librespot_playback::player] <In Spite Of Everything> (332320 ms) loaded [2022-03-04T13:43:22Z INFO librespot_playback::player] Loading <Moldau> with Spotify URI <spotify:track:0jJgyhhY0xE7lgAUotflrp> [2022-03-04T13:43:22Z INFO librespot_playback::player] <Moldau> (440737 ms) loaded [2022-03-04T13:43:35Z INFO librespot_playback::player] Loading <Gnossienne No. 1 - Monolink Nostalgia Remix (FRAGMENTS / Erik Satie)> with Spotify URI <spotify:track:27DGCVaE1yetd85bbWWrDA> [2022-03-04T13:43:35Z INFO librespot_playback::player] <Gnossienne No. 1 - Monolink Nostalgia Remix (FRAGMENTS / Erik Satie)> (336886 ms) loaded [2022-03-04T13:43:46Z INFO librespot_playback::player] Loading <The Water> with Spotify URI <spotify:track:0lTH9SwH78rFMuAFsg0VX8> [2022-03-04T13:43:46Z INFO librespot_playback::player] <The Water> (354262 ms) loaded [2022-03-04T13:43:55Z INFO librespot] librespot 0.3.1 a605444 (Built on 2022-01-09, Build ID: ljDVAehf, Profile: release) [2022-03-04T13:43:55Z INFO librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070" [2022-03-04T13:43:55Z INFO librespot_core::session] Authenticated as "<redacted>" ! [2022-03-04T13:43:55Z INFO librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0) [2022-03-04T13:43:55Z INFO librespot_playback::convert] Converting with ditherer: tpdf [2022-03-04T13:43:55Z INFO librespot_playback::audio_backend::gstreamer] Using GStreamer sink with format: S16 [2022-03-04T13:43:55Z INFO librespot_core::session] Country: "DE" [2022-03-04T13:43:55Z INFO librespot_playback::audio_backend::gstreamer] Pipeline: appsrc caps="audio/x-raw,format=S16LE,layout=interleaved,channels=2,rate=44100" block=true max-bytes=4096 name=appsrc0 ! pulsesink client-name=spotify_sqozz [2022-03-04T13:43:58Z INFO librespot_playback::player] Loading <The Water> with Spotify URI <spotify:track:0lTH9SwH78rFMuAFsg0VX8> [2022-03-04T13:43:59Z INFO librespot_playback::player] <The Water> (354262 ms) loaded ``` At 2022-03-02T17:18:04Z everything worked. At 2022-03-04T13:39:59Z I started a new session where audio output was missing until I restarted librespot at 2022-03-04T13:43:55Z. After that the audio was working perfectly fine again. I use the gstreamer backend instead of the native pulseaudio one because this way I can distinguish between the different instances of librespot (by adding a `client-name`). The command I use to run librespot is: `/opt/librespot/target/release/librespot spotifyd --disable-discovery --enable-volume-normalisation --name Catcave (sqozz) --device-type avr --bitrate 320 --backend gstreamer --device ! pulsesink client-name=spotify_sqozz --username my@user.name --password password` I know that the log doesn't really provide much more information but maybe somebody can help me to further dig down what maybe could cause my problems here. Some system information: **OS:** gentoo **gstreamer version:** 1.18.4 **gstreamer plugins:** base, good, bad, ugly (all 1.18.4) **pulseaudio version:** 15.0 **librespot version:** 0.3.1 a605444 (Built on 2022-01-09, Build ID: ljDVAehf, Profile: release) Thanks in advance!
kerem 2026-02-27 19:30:47 +03:00
  • closed this issue
  • added the
    bug
    audio
    labels
Author
Owner

@sqozz commented on GitHub (Mar 4, 2022):

I also just checked my PA logs and can see a lot of these errors being logged from "Mar 4 14:40:06" till "Mar 4 14:43:51":

pulseaudio[543]: [pipe-sink] protocol-native.c: Failed to push data into queue

This looks rather suspicious to me

<!-- gh-comment-id:1059194410 --> @sqozz commented on GitHub (Mar 4, 2022): I also just checked my PA logs and can see a lot of these errors being logged from "Mar 4 14:40:06" till "Mar 4 14:43:51": ``` pulseaudio[543]: [pipe-sink] protocol-native.c: Failed to push data into queue ``` This looks rather suspicious to me
Author
Owner

@sqozz commented on GitHub (Mar 5, 2022):

I also just checked my PA logs and can see a lot of these errors being logged from "Mar 4 14:40:06" till "Mar 4 14:43:51":

pulseaudio[543]: [pipe-sink] protocol-native.c: Failed to push data into queue

This looks rather suspicious to me

I just hit the same issue again today so it definitely seems to be related. However restarting librespot seems to solve it despite pulseaudio complaining in the "pipe-sink" component (which hints to an issue in the output and not the input). I'm still puzzled how this can be linked to librespot

<!-- gh-comment-id:1059757545 --> @sqozz commented on GitHub (Mar 5, 2022): > I also just checked my PA logs and can see a lot of these errors being logged from "Mar 4 14:40:06" till "Mar 4 14:43:51": > > ``` > pulseaudio[543]: [pipe-sink] protocol-native.c: Failed to push data into queue > ``` > > This looks rather suspicious to me I just hit the same issue again today so it definitely seems to be related. However restarting librespot seems to solve it despite pulseaudio complaining in the "pipe-sink" component (which hints to an issue in the output and not the input). I'm still puzzled how this can be linked to librespot
Author
Owner

@JasonLG1979 commented on GitHub (Mar 6, 2022):

The Gsreamer backend in v0.3.1 is a mess. It was rewritten by a legit gstreamer expert in the soon to be merged new-api branch. You could give that branch a try and see if it helps?

<!-- gh-comment-id:1060006533 --> @JasonLG1979 commented on GitHub (Mar 6, 2022): The Gsreamer backend in v0.3.1 is a mess. It was [rewritten](https://github.com/librespot-org/librespot/commit/ab562cc8d873fb9704782b337471ac5544fe7627) by a legit gstreamer expert in the soon to be merged `new-api` branch. You could give that branch a try and see if it helps?
Author
Owner

@sqozz commented on GitHub (Mar 7, 2022):

Thanks! I switched my setup over to new-api and give it a try. Please expect me to test this for one or two days as the issue isn't that easy to reproduce :)

<!-- gh-comment-id:1060396953 --> @sqozz commented on GitHub (Mar 7, 2022): Thanks! I switched my setup over to `new-api` and give it a try. Please expect me to test this for one or two days as the issue isn't that easy to reproduce :)
Author
Owner

@JasonLG1979 commented on GitHub (Mar 7, 2022):

You might also look into just setting environment variables to tell pulseaudio what you want instead.

<!-- gh-comment-id:1060926084 --> @JasonLG1979 commented on GitHub (Mar 7, 2022): You might also look into just setting environment variables to tell pulseaudio what you want instead.
Author
Owner

@sqozz commented on GitHub (Mar 7, 2022):

You might also look into just setting environment variables to tell pulseaudio what you want instead.

Yeah I thought about something like this too but didn't find any reference in the librespot docs. Would you mind pointing me into the right direction here? Or are you talking about pulseaudio env variables?

Until now the gstreamer backend seems more stable on the new-api-branch but it might need some more time testing.

<!-- gh-comment-id:1060984327 --> @sqozz commented on GitHub (Mar 7, 2022): > You might also look into just setting environment variables to tell pulseaudio what you want instead. Yeah I thought about something like this too but didn't find any reference in the librespot docs. Would you mind pointing me into the right direction here? Or are you talking about pulseaudio env variables? Until now the gstreamer backend seems more stable on the `new-api`-branch but it might need some more time testing.
Author
Owner

@kingosticks commented on GitHub (Mar 7, 2022):

We should probably back-port it in the meantime.

<!-- gh-comment-id:1060998955 --> @kingosticks commented on GitHub (Mar 7, 2022): We should probably back-port it in the meantime.
Author
Owner

@roderickvd commented on GitHub (Mar 7, 2022):

We can't easily without bumping MSRV from 1.48 to 1.56.

<!-- gh-comment-id:1061000488 --> @roderickvd commented on GitHub (Mar 7, 2022): We can't easily without bumping MSRV from 1.48 to 1.56.
Author
Owner

@kingosticks commented on GitHub (Mar 7, 2022):

Ahhh, yeh. Shame. I personally can't be bothered to decouple that and the other improvements (start & stop implementations, thread simplifications) but someone keen could..!

<!-- gh-comment-id:1061050420 --> @kingosticks commented on GitHub (Mar 7, 2022): Ahhh, yeh. Shame. I personally can't be bothered to decouple that and the other improvements (start & stop implementations, thread simplifications) but someone keen could..!
Author
Owner

@roderickvd commented on GitHub (Mar 7, 2022):

Certainly true, that doesn't need the new bindings (and so the MSRV bump) perse. But for those who can wait or live with the bleeding new-api edge, I don't think we're too ar off from a 0.5 release somewhere later this year.

Edit: venturing contributors, don't let this hold you from back-porting this!

<!-- gh-comment-id:1061056761 --> @roderickvd commented on GitHub (Mar 7, 2022): Certainly true, that doesn't need the new bindings (and so the MSRV bump) perse. But for those who can wait or live with the bleeding `new-api` edge, I don't think we're too ar off from a 0.5 release somewhere later this year. Edit: venturing contributors, don't let this hold you from back-porting this!
Author
Owner

@JasonLG1979 commented on GitHub (Mar 8, 2022):

@sqozz Would something like this work?:

https://github.com/JasonLG1979/librespot/tree/pulseaudio-name

It makes the name arg show up as the app name in the PulseAudio Volume controls like so:

Screenshot from 2022-03-07 20-18-00

For bonus points it also sets PULSE_PROP_application.icon_name to audio-x-generic.

<!-- gh-comment-id:1061339366 --> @JasonLG1979 commented on GitHub (Mar 8, 2022): @sqozz Would something like this work?: https://github.com/JasonLG1979/librespot/tree/pulseaudio-name It makes the name arg show up as the app name in the PulseAudio Volume controls like so: ![Screenshot from 2022-03-07 20-18-00](https://user-images.githubusercontent.com/6667703/157153120-c73564c1-b926-4af4-ace9-80939e86c721.png) For bonus points it also sets `PULSE_PROP_application.icon_name` to `audio-x-generic`.
Author
Owner

@sqozz commented on GitHub (Mar 8, 2022):

@sqozz Would something like this work?:

https://github.com/JasonLG1979/librespot/tree/pulseaudio-name

It makes the name arg show up as the app name in the PulseAudio Volume controls like so:

Screenshot from 2022-03-07 20-18-00

For bonus points it also sets PULSE_PROP_application.icon_name to audio-x-generic.

I just quickly tried it locally and it seems to work. The stream shows up with the name of the --name parameter. I was expecting I could set the stream-name with the LIBRESPOT_NAME environment variable but it shouldn't make a big difference for my use-case.

edit: with your changes the application.name property in PA is changed. This is exactly the one I'm changing with my gstreamer pipeline - so it works fine!

<!-- gh-comment-id:1061559024 --> @sqozz commented on GitHub (Mar 8, 2022): > @sqozz Would something like this work?: > > https://github.com/JasonLG1979/librespot/tree/pulseaudio-name > > It makes the name arg show up as the app name in the PulseAudio Volume controls like so: > > ![Screenshot from 2022-03-07 20-18-00](https://user-images.githubusercontent.com/6667703/157153120-c73564c1-b926-4af4-ace9-80939e86c721.png) > > For bonus points it also sets `PULSE_PROP_application.icon_name` to `audio-x-generic`. I just quickly tried it locally and it seems to work. The stream shows up with the name of the `--name` parameter. I was expecting I could set the stream-name with the `LIBRESPOT_NAME` environment variable but it shouldn't make a big difference for my use-case. **edit:** with your changes the `application.name` property in PA is changed. This is exactly the one I'm changing with my gstreamer pipeline - so it works fine!
Author
Owner

@JasonLG1979 commented on GitHub (Mar 8, 2022):

It should also work with the LIBRESPOT_NAME env var.

<!-- gh-comment-id:1061906879 --> @JasonLG1979 commented on GitHub (Mar 8, 2022): It should also work with the LIBRESPOT_NAME env var.
Author
Owner

@JasonLG1979 commented on GitHub (Mar 8, 2022):

@roderickvd and @kingosticks I see the value of being able to set the name displayed by PulseAudio to differentiate instances but I'd like your thoughts.

Normally I'd say that just reading the PULSE_PROP_application.name env var and using it if present would suffice but being as though it has a . in it it's not actually a valid env var and shells like bash will throw an error saying as much if you try to set it. So that makes that a non-starter. I honestly don't think it's really meant to be able to be set in a shell I think it's more meant to be used programmatically? Otherwise why would you purposely make a env var you can't set from a shell?

I really do not want to add another command line arg to set it but I'm also not sure if always using --name is correct? Do you think that having the --name show up in the PulseAudio sound setting instead of Librespot would be "expected" (or at least welcomed) behavior? Maybe just Librespot if no name is given but Librespot - Instance Name if a name is given?

<!-- gh-comment-id:1062338892 --> @JasonLG1979 commented on GitHub (Mar 8, 2022): @roderickvd and @kingosticks I see the value of being able to set the name displayed by PulseAudio to differentiate instances but I'd like your thoughts. Normally I'd say that just reading the `PULSE_PROP_application.name` env var and using it if present would suffice but being as though it has a `.` in it it's not actually a valid env var and shells like bash will throw an error saying as much if you try to set it. So that makes that a non-starter. I honestly don't think it's really meant to be able to be set in a shell I think it's more meant to be used programmatically? Otherwise why would you purposely make a env var you can't set from a shell? I really do not want to add another command line arg to set it but I'm also not sure if *always* using `--name` is correct? Do you think that having the `--name` show up in the PulseAudio sound setting instead of `Librespot` would be "expected" (or at least welcomed) behavior? Maybe just `Librespot` if no name is given but `Librespot - Instance Name` if a name is given?
Author
Owner

@kingosticks commented on GitHub (Mar 8, 2022):

Maybe just Librespot if no name is given but Librespot - Instance Name if a name is given?

I think this sounds sensible.

<!-- gh-comment-id:1062357343 --> @kingosticks commented on GitHub (Mar 8, 2022): > Maybe just Librespot if no name is given but Librespot - Instance Name if a name is given? I think this sounds sensible.
Author
Owner

@JasonLG1979 commented on GitHub (Mar 8, 2022):

@kingosticks It's still a bit of a bodge. To avoid changing the backend API I slightly abuse the LIBRESPOT_NAME env var.

<!-- gh-comment-id:1062381609 --> @JasonLG1979 commented on GitHub (Mar 8, 2022): @kingosticks It's still a bit of a bodge. To avoid changing the backend API I slightly abuse the `LIBRESPOT_NAME` env var.
Author
Owner

@JasonLG1979 commented on GitHub (Mar 8, 2022):

@kingosticks I put in a PR https://github.com/librespot-org/librespot/pull/976 we can continue there if you'd like.

@sqozz what are your thoughts?

<!-- gh-comment-id:1062402813 --> @JasonLG1979 commented on GitHub (Mar 8, 2022): @kingosticks I put in a PR https://github.com/librespot-org/librespot/pull/976 we can continue there if you'd like. @sqozz what are your thoughts?
Author
Owner

@sqozz commented on GitHub (Mar 9, 2022):

I'm a little bit torn between both solutions. I can understand that you might not want to introduce yet another option and for my use-case it should be a working solution. On the other hand you now couple the possibilities of naming the spotify-connect client to the capabilities of pulseaudio and might need more logic to avoid invalid chars (I don't know if PA supports every possible name which spotify would accept).
Then again if somebody really has special needs one could always fall back to the gstreamer pipeline to set these special attributes manually and you wouldn't need to duplicate the whole logic in librespot again.

<!-- gh-comment-id:1062722672 --> @sqozz commented on GitHub (Mar 9, 2022): I'm a little bit torn between both solutions. I can understand that you might not want to introduce yet another option and for my use-case it should be a working solution. On the other hand you now couple the possibilities of naming the spotify-connect client to the capabilities of pulseaudio and might need more logic to avoid invalid chars (I don't know if PA supports every possible name which spotify would accept). Then again if somebody really has special needs one could always fall back to the gstreamer pipeline to set these special attributes manually and you wouldn't need to duplicate the whole logic in librespot again.
Author
Owner

@JasonLG1979 commented on GitHub (Mar 9, 2022):

Invalid chars is not really a concern. The input is already checked to make sure it's valid. The pulse prop is only used for display purposes. How the UI in the DE's sound settings decides to represent it is an implementation detail in that UI.

<!-- gh-comment-id:1063057446 --> @JasonLG1979 commented on GitHub (Mar 9, 2022): Invalid chars is not really a concern. The input is already checked to make sure it's valid. The pulse prop is only used for display purposes. How the UI in the DE's sound settings decides to represent it is an implementation detail in that UI.
Author
Owner

@sqozz commented on GitHub (Mar 9, 2022):

sure. I wasn't really concerned about UIs showing it but PA not supporting some chars. It might be a edge case and not worth considering too much - just my two cents :)

<!-- gh-comment-id:1063083215 --> @sqozz commented on GitHub (Mar 9, 2022): sure. I wasn't really concerned about UIs showing it but PA not supporting some chars. It might be a edge case and not worth considering too much - just my two cents :)
Author
Owner

@JasonLG1979 commented on GitHub (Mar 9, 2022):

Rust and C both use the same string spec AFAIK? A valid Rust string would be a valid C string I would think?

<!-- gh-comment-id:1063228591 --> @JasonLG1979 commented on GitHub (Mar 9, 2022): Rust and C both use the same string spec AFAIK? A valid Rust string would be a valid C string I would think?
Author
Owner

@roderickvd commented on GitHub (Mar 9, 2022):

I don't think the distinction matters in this case, but if you want to get really technical in terms of FFI then you could read about CString on a rainy afternoon.

<!-- gh-comment-id:1063243446 --> @roderickvd commented on GitHub (Mar 9, 2022): I don't think the distinction matters in this case, but if you want to get really technical in terms of FFI then you could read about `CString` on a rainy afternoon.
Author
Owner

@JasonLG1979 commented on GitHub (Mar 9, 2022):

I can't imagine it mattering at all. Worst case a user tries to set a name with unicode emojis in it and it's not displayed properly.

<!-- gh-comment-id:1063297214 --> @JasonLG1979 commented on GitHub (Mar 9, 2022): I can't imagine it mattering at all. Worst case a user tries to set a name with unicode emojis in it and it's not displayed properly.
Author
Owner

@JasonLG1979 commented on GitHub (Mar 9, 2022):

Plus pulseaudio parses the string from an env so one would hope that it's reasonably robust in checking it.

<!-- gh-comment-id:1063311581 --> @JasonLG1979 commented on GitHub (Mar 9, 2022): Plus pulseaudio parses the string from an env so one would hope that it's reasonably robust in checking it.
Author
Owner

@allquixotic commented on GitHub (Mar 15, 2022):

I submitted a PR to backport the gstreamer cleanup to dev: https://github.com/librespot-org/librespot/pull/979

<!-- gh-comment-id:1068542490 --> @allquixotic commented on GitHub (Mar 15, 2022): I submitted a PR to backport the gstreamer cleanup to dev: https://github.com/librespot-org/librespot/pull/979
Author
Owner

@roderickvd commented on GitHub (Apr 7, 2022):

@sqozz has your initial issue been fixed? Can we close this issue?

<!-- gh-comment-id:1092133767 --> @roderickvd commented on GitHub (Apr 7, 2022): @sqozz has your initial issue been fixed? Can we close this issue?
Author
Owner

@sqozz commented on GitHub (Apr 29, 2022):

@sqozz has your initial issue been fixed? Can we close this issue?

Yes. I'm running librespot 0.3.1 dd8155b since the 7th of March now and didn't observe the problem once. Thanks all for your great help and fast responses - appreciated!

<!-- gh-comment-id:1113257461 --> @sqozz commented on GitHub (Apr 29, 2022): > @sqozz has your initial issue been fixed? Can we close this issue? Yes. I'm running `librespot 0.3.1 dd8155b` since the 7th of March now and didn't observe the problem once. Thanks all for your great help and fast responses - appreciated!
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/librespot#471
No description provided.