Help Wizard

Step 1

NEXT STEP

Linux desktop client creates a lot of sinks

Linux desktop client creates a lot of sinks

Plan

Premium

Country

Germany

Device & Operating System

 

$ flatpak list | grep -i spot
Spotify com.spotify.Client      1.2.11.916.geb595a67    stable  system

 

 

**bleep**+`                   ---------------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: Z590M-ITX/ax 
               `+oooooo:                 Kernel: 6.4.12-arch1-1 
               -+oooooo+:                Uptime: 2 hours, 48 mins 
             `/:-:++oooo+:               Packages: 1065 (pacman), 30 (flatpak) 
            `/++++/+++++++:              Shell: zsh 5.9 
           `/++++++++++++++:             Resolution: 1920x1080, 2560x1440 
          `/+++ooooooooooooo/`           DE: Plasma 5.27.7 
         ./ooosssso++osssssso+`          WM: KWin 
        .oossssso-````/ossssss+`         Theme: [Plasma], Breeze [GTK2/3] 
       -osssssso.      :ssssssso.        Icons: [Plasma], breeze-dark [GTK2/3] 
      :osssssss/        osssso+++.       Terminal: konsole 
     /ossssssss/        +ssssooo/-       Terminal Font: Hack 13 
   `/ossssso+/:-        -:/+osssso+-     CPU: 11th Gen Intel i9-11900K (16) @ 5.100GHz 
  `+sso+:-`                 `.-/+oso:    GPU: NVIDIA GeForce RTX 3070 Ti 
 `++:.                           `-/+/   GPU: Intel RocketLake-S GT1 [UHD Graphics 750] 
 .`                                 `/   Memory: 5262MiB / 31915MiB

 

 

 

 

 

My Question or Issue

 

The Spotify desktop clients spawns a lot of orphaned audio sinks, which are not garbage collected. I haven't paid strong attention, but I think a new sink is created with every track played.

 

 

 

 

$ pw-cli ls Node | grep -B5 "spotify"
        id 76, type PipeWire:Interface:Node/3
                object.serial = "1386"
                factory.id = "6"
                client.id = "139"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 86, type PipeWire:Interface:Node/3
                object.serial = "1401"
                factory.id = "6"
                client.id = "138"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 117, type PipeWire:Interface:Node/3
                object.serial = "1712"
                factory.id = "6"
                client.id = "115"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 118, type PipeWire:Interface:Node/3
                object.serial = "1416"
                factory.id = "6"
                client.id = "120"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 140, type PipeWire:Interface:Node/3
                object.serial = "1747"
                factory.id = "6"
                client.id = "197"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 152, type PipeWire:Interface:Node/3
                object.serial = "1573"
                factory.id = "6"
                client.id = "206"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 155, type PipeWire:Interface:Node/3
                object.serial = "1537"
                factory.id = "6"
                client.id = "193"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 156, type PipeWire:Interface:Node/3
                object.serial = "1554"
                factory.id = "6"
                client.id = "71"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 158, type PipeWire:Interface:Node/3
                object.serial = "1631"
                factory.id = "6"
                client.id = "161"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 167, type PipeWire:Interface:Node/3
                object.serial = "1522"
                factory.id = "6"
                client.id = "180"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 168, type PipeWire:Interface:Node/3
                object.serial = "1588"
                factory.id = "6"
                client.id = "198"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 189, type PipeWire:Interface:Node/3
                object.serial = "1263"
                factory.id = "6"
                client.id = "190"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"
--
        id 209, type PipeWire:Interface:Node/3
                object.serial = "1371"
                factory.id = "6"
                client.id = "207"
                client.api = "pipewire-pulse"
                application.name = "spotify"
                node.name = "spotify"

 

 

 

2023-09-05_19-33.png
Reply
8 Replies

I'm seeing the same thing! I'm using the Spotify as a flatpak from Flathub (app/com.spotify.Client/x86_64/stable) in Fedora 39 (GNOME). I'm using the *free* edition of Spotify, and for me, it only spawns a new node whenever a round of ads starts playing. If you're running the premium version of Spotify, and it's happening between *every* song for you, could it be the DRM checks that are the root cause of the issue?

In the example shown below (from qpwgraph), the newest node (i.e., spotify-5 [Spotify]) is the only one that actually plays anything; the rest have basically been orphaned off and are no longer producing sound.

Spotify_PipeWire.png

Hey, Flatpak is not developed by Spotify. This is someone else's package

We only release it for Snap and Deb at the moment. Do you have the same issue there?

I don't use Snap, so I can't tell.

I'm on Fedora, which doesn't use DEB packages. I reported the issue to the Flatpak folks, but they insisted I report this upstream, as it has nothing to do with Flatpak. I will install Snap on my system and start testing for the issue there, but could you please look into this for the DEB?

To test for this, run Spotify for a while--at least long enough for a couple rounds of ads--and then run the `qpwgraph` utility.

I have been running a Spotify client (version 1.2.26 - DEB package) for 9h now. During this time I played several tracks and podcasts, and switched between desktop and mobile playing (via Spotify Connect). The output of qpwgraph is attached. As you can see, there's nothing strange. I might try to reproduce it later with ads, if you think this is case.

But one possibility is that the Flatpak version is outdated. Can you ask the package responsible to create a new one, based on the latest stable client (currently 1.2.26)?

pipewire_spotify.png

I installed the Snap version of Spotify, and I'm also showing that everything is looking as it should.

For the record, it looks like the Flatpak is running version 1.2.26.1187--the same version used in the "latest/stable" channel from "snapcraft.io":

flatpak run com.spotify.Client --version
/app/extra/bin/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/bin/spotify)
[spotifywm] attached to spotify
Spotify version 1.2.26.1187.g36b715a1, Copyright (c) 2023, Spotify Ltd

 

I don't want to speak for @jan491, but in my case, it seems that an additional "Spotify" audio sink only gets created after a video ad plays, which also plays in its own "Chromium" audio sink (see attached).

With Chromium Video Ad.png
After Chromium Video Ad.png

I will take a look at this as soon as possible. But in the meantime, can any test if the same happens with the Web players inside a recent Chrome/Chromium?

This still happens on 1.2.31.1205. I installed Spotify via AUR on Archlinux which extracts files from deb package. I can reproduce this issue with 100% accuracy:

1. Play last song on your current playlist. Let it finish. Make sure that nothing plays.

2. Wait half a minute (or whole minute just to be sure).

3. Play anything. At this point you'll have 2 Spotify connections to the pipewire/pulseaudio.

Suggested posts