Skip to main content
Topic: SpotifyD not working (Read 2090 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

SpotifyD not working

I installed the required packages
Code: [Select]
spotifyd-openrc spotify
Started the service, but it isnt shown on the devices list.
What else can i try to start the spotifyd service in the background? Or are there any fixes that i can do?

Re: SpotifyD not working

Reply #1
First thing to note is spotifyd-openrc would be paired with spotifyd, not spotify, but that may just be a typo ? And should not matter as spotifyd-openrc 'depends' on spotifyd and will pull it in anyway.

I just installed spotifyd-openrc and spotifyd and then
Code: [Select]
sudo rc-service -v spotifyd start
produced this output
Quote
spotifyd          |spotifyd          | * Executing: /usr/lib/openrc/sh/openrc-run.sh /usr/lib/openrc/sh/openrc-run.sh /etc/init.d/spotifyd start
spotifyd          | * Starting spotifyd ...
spotifyd          | * supervise-daemon: fopen `/run/spotifyd.pid': No such file or directory
spotifyd          | * Detaching to start `/usr/bin/spotifyd'
Confirmed it was running with
Code: [Select]
pgrep -al spotifyd
Quote
12618 /usr/bin/spotifyd --no-daemon
To enable at boot
Code: [Select]
sudo rc-update add spotifyd default

What output do you get when you run
Code: [Select]
sudo rc-service -v spotifyd start
?


Re: SpotifyD not working

Reply #2
What output do you get when you run
Code: [Select]
sudo rc-service -v spotifyd start
?


Code: [Select]
 * Executing: /usr/lib/openrc/sh/openrc-run.sh /usr/lib/openrc/sh/openrc-run.sh /etc/init.d/spotifyd start
 * Starting spotifyd ...
 * supervise-daemon: fopen `/run/spotifyd.pid': No such file or directory
 * Detaching to start `/usr/bin/spotifyd'                                                                                                                                                                                                             [ ok ]



Re: SpotifyD not working

Reply #3
That's the same as mine.
So does
Code: [Select]
pgrep -al spotifyd
show it running ?

Re: SpotifyD not working

Reply #4
no it does not show it

Re: SpotifyD not working

Reply #5
What's the output of
Code: [Select]
sudo /usr/bin/spotifyd --no-daemon --verbose
?

Re: SpotifyD not working

Reply #6
Code: [Select]
Loading config from "/etc/xdg/spotifyd/spotifyd.conf"
CliConfig { config_path: None, no_daemon: true, verbose: true, pid: None, shared_config: SharedConfigValues { username: Some("taken out for privacy"), username_cmd: None, password: Some("taken out for privacy"), password_cmd: None, use_keyring: false, use_mpris: None, on_song_change_hook: None, cache_path: None, no-audio-cache: false, backend: None, volume_controller: None, device: None, control: None, mixer: None, device_name: Some("@desktop"), bitrate: None, initial_volume: None, volume_normalisation: false, normalisation_pregain: None, zeroconf_port: None, proxy: None, device_type: None } }
Found user shell: Some("/bin/bash")
No proxy specified
registering event source with poller: token=Token(0), interests=READABLE | WRITABLE
Using software volume controller.
registering event source with poller: token=Token(1), interests=READABLE | WRITABLE
Zeroconf server listening on 0.0.0.0:38433
registering event source with poller: token=Token(2), interests=READABLE | WRITABLE
registering event source with poller: token=Token(3), interests=READABLE | WRITABLE
Connecting to AP "ap.spotify.com:443"
found interface Interface { name: "eth0", addr: V4(Ifv4Addr { ip: 192.168.0.24, netmask: 255.255.255.0, broadcast: Some(192.168.0.255) }) }
found interface Interface { name: "wg-mullvad", addr: V4(Ifv4Addr { ip: 10.105.250.206, netmask: 255.255.255.255, broadcast: None }) }
found interface Interface { name: "eth0", addr: V6(Ifv6Addr { ip: 2a02:8071:91ac:fe00::49a3, netmask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff, broadcast: None }) }
found interface Interface { name: "eth0", addr: V6(Ifv6Addr { ip: 2a02:8071:91ac:fe00:4bd8:2c9:9c5e:51ea, netmask: ffff:ffff:ffff:ffff::, broadcast: None }) }
found interface Interface { name: "wg-mullvad", addr: V6(Ifv6Addr { ip: fc00:bbbb:bbbb:bb01::2a:facd, netmask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff, broadcast: None }) }
sending packet to 224.0.0.251:5353
found interface Interface { name: "eth0", addr: V4(Ifv4Addr { ip: 192.168.0.24, netmask: 255.255.255.0, broadcast: Some(192.168.0.255) }) }
found interface Interface { name: "wg-mullvad", addr: V4(Ifv4Addr { ip: 10.105.250.206, netmask: 255.255.255.255, broadcast: None }) }
found interface Interface { name: "eth0", addr: V6(Ifv6Addr { ip: 2a02:8071:91ac:fe00::49a3, netmask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff, broadcast: None }) }
found interface Interface { name: "eth0", addr: V6(Ifv6Addr { ip: 2a02:8071:91ac:fe00:4bd8:2c9:9c5e:51ea, netmask: ffff:ffff:ffff:ffff::, broadcast: None }) }
found interface Interface { name: "wg-mullvad", addr: V6(Ifv6Addr { ip: fc00:bbbb:bbbb:bb01::2a:facd, netmask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff, broadcast: None }) }
sending packet to [ff02::fb]:5353
received packet from 10.105.250.206:5353
received packet from 10.105.250.206:5353 with no query
received packet from [fe80::ed10:5d4a:fa8:9117%2]:5353
received packet from [fe80::ed10:5d4a:fa8:9117%2]:5353 with no query
registering event source with poller: token=Token(4), interests=READABLE | WRITABLE
flushing framed transport
writing; remaining=157
framed transport flushed
attempting to decode a frame
frame decoded from buffer
Authenticated as "f433v6ztw1v7p312co7tyrsy9" !
new Session[0]
flushing framed transport
framed transport flushed
attempting to decode a frame
frame decoded from buffer
Session[0] strong=3 weak=1
attempting to decode a frame
frame decoded from buffer
attempting to decode a frame
frame decoded from buffer
attempting to decode a frame
frame decoded from buffer
Country: "DE"
attempting to decode a frame
attempting to decode a frame
flushing framed transport
writing; remaining=11
new Spirc[0]
canonical_username: f433v6ztw1v7p312co7tyrsy9
framed transport flushed
attempting to decode a frame
new MercuryManager
new Player[0]
frame decoded from buffer
attempting to decode a frame
frame decoded from buffer
attempting to decode a frame
Using Alsa sink with format: S16
flushing framed transport
writing; remaining=72
framed transport flushed
input volume:65535 to mixer: 65535
command=AddEventSender
command=VolumeSet(65535)
flushing framed transport
writing; remaining=367
framed transport flushed
flushing framed transport
writing; remaining=438
framed transport flushed
flushing framed transport
framed transport flushed
attempting to decode a frame
frame decoded from buffer
attempting to decode a frame
flushing framed transport
framed transport flushed
attempting to decode a frame
frame decoded from buffer
attempting to decode a frame
flushing framed transport
framed transport flushed
attempting to decode a frame
frame decoded from buffer
attempting to decode a frame
frame decoded from buffer
attempting to decode a frame
subscribed uri=hm://remote/user/f433v6ztw1v7p312co7tyrsy9/ count=0
flushing framed transport
framed transport flushed
attempting to decode a frame
frame decoded from buffer
attempting to decode a frame
PANIC: Shutting down spotifyd. Error message: Failed to initialize DBus connection: D-Bus error: Failed to connect to socket /tmp/dbus-J41HLHl336: Connection refused (org.freedesktop.DBus.Error.NoServer)
drop Spirc[0]
Shutting down player thread ...
drop PlayerInternal[0]
PlayerInternal thread finished.
drop Session[0]
drop MercuryManager
deregistering event source from poller
Shutting down discovery server
deregistering event source from poller
deregistering event source from poller
flushing framed transport
framed transport flushed
drop Dispatch
deregistering event source from poller

Re: SpotifyD not working

Reply #7
Quote
PANIC: Shutting down spotifyd. Error message: Failed to initialize DBus connection: D-Bus error: Failed to connect to socket /tmp/dbus-J41HLHl336: Connection refused (org.freedesktop.DBus.Error.NoServer)

That's your problem I think.
DBus does not seem to running? Or spotifyd can't connect if it is running?

On my system it runs twice. Once started as a service and running as user dbus.

If running
Code: [Select]
rc-update show | grep dbus
has no output then you need to
Code: [Select]
sudo rc-update add dbus default

and reboot or
Code: [Select]
sudo rc-service dbus start

I also have dbus running as my user. For me this is started by the line
Code: [Select]
exec dbus-launch --exit-with-session startplasma-x11
in ~/.xinirc
This would / may be different for you depending on how start X or wayland.
But as starting spotifyd as a service I'm fairly sure it's the system service dbus that spotifyd needs to communicate with.

Check the system dbus is running.


Re: SpotifyD not working

Reply #8
DBus is running for me.
The command produces the following output:
Code: [Select]
                 dbus |      default     

Re: SpotifyD not working

Reply #9
Not sure then ?
Maybe a permissions thing ?
Quote
PANIC: Shutting down spotifyd. Error message: Failed to initialize DBus connection: D-Bus error: Failed to connect to socket /tmp/dbus-J41HLHl336: Connection refused (org.freedesktop.DBus.Error.NoServer)
And then spotifyd closes.

I don't get that PANIC line.
In my case spotifyd runs. I can't actually test it as I don't have a premium spotify account.

searching 'panic: Shutting down spotifyd. Error message: Failed to initialize DBus connection' throws up some results from the spotifyd github. I'd start there.


Re: SpotifyD not working

Reply #10
Maybe the init script / service should be updated to start after dbus service ?

PS: just a thought.

The resulting init script could look like this:

Code: [Select]
#!/usr/bin/openrc-run
#Copyright by Artix team under GPLv2
supervisor=supervise-daemon
command="/usr/bin/spotifyd"
command_args=" --no-daemon"
pidfile=/run/spotifyd.pid

depend() {
    need dbus
}

Re: SpotifyD not working

Reply #11
weird. now it works, even without
Code: [Select]
depend() {
    need dbus
}

I noticed that when I connect to spotifyd it now crashes.
I started it without an open-rc service to see what it outputs:

Code: [Select]
Loading config from "/etc/xdg/spotifyd/spotifyd.conf"
No proxy specified
Using software volume controller.
Connecting to AP "ap.spotify.com:443"
Authenticated as "*****" !
Country: "**"
Using Alsa sink with format: S16
Loading <******> with Spotify URI <spotify:track:******>
<******> (177618 ms) loaded
Alsa error PCM open ALSA function 'snd_pcm_open' failed with error 'EHOSTDOWN: Host is down'
Could not start audio: Alsa error: PCM open failed
Alsa error PCM open ALSA function 'snd_pcm_open' failed with error 'EHOSTDOWN: Host is down'
Could not start audio: Alsa error: PCM open failed
PANIC: Shutting down spotifyd. Error message: called `Option::unwrap()` on a `None` value
<******> (185777 ms) loaded

It probably does not have to do with open-rc.