Closed KSaiAkshit closed 1 year ago
Okay, I think there might be several things wrong here, but we'll start small.
You can check by doing journalctl -u spotifyd.service -e
, but my guess is that spotifyd
can't find the --config-file
, since systemd
doesn't expand the ~
properly. You'll have to write that out.
(Currently the session you run from your terminal uses your credentials while the other enables discovery. It's a different question, why you can't see that from your phone, but that might a firewall problem or other network issue.)
If it recognizes the config file, the next problem might be that you are starting spotifyd
as a system service so it won't be able to find a session d-bus to connect to for keyring and MPRIS functionality, but that are just wild guesses and predictions.
So I hope this gets you a bit futher.
The ~
expansion seemed to be the problem, thanks for the input!
Description
I cannot find spotifyd in my spotify Connect(neither in spotify-tui or in my phone, which is on the same Wi-Fi) when it is run as a systemd service and the only way it shows up is when i run it from the terminal using
spotifyd --config-file /home/user/.config/spotifyd/spotifyd.conf --no-daemon
. I have the same line in my .service file. To ReproduceExpected behavior
Spotifyd shows up on Spotify Connect as a device.
Logs
Click to show logs
``` ● spotifyd.service - A spotify playing daemon Loaded: loaded (/etc/systemd/system/spotifyd.service; enabled; preset: disabled) Active: active (running) since Mon 2023-10-16 15:51:53 IST; 4s ago Docs: https://github.com/Spotifyd/spotifyd Main PID: 51539 (spotifyd) Tasks: 17 (limit: 18340) Memory: 2.2M CPU: 7ms CGroup: /system.slice/spotifyd.service └─51539 /usr/bin/spotifyd --config-path ~/.config/spotifyd/spotifyd.conf --no-daemon --verbose Oct 16 15:51:53 akshit-eos spotifyd[51539]: no usable credentials found, enabling discovery Oct 16 15:51:53 akshit-eos spotifyd[51539]: Using device id '9b9361752c9462822fe97fc7ff7752af67c35f4a' Oct 16 15:51:53 akshit-eos spotifyd[51539]: registering event source with poller: token=Token(0), interests=READABLE | WRITABLE Oct 16 15:51:53 akshit-eos spotifyd[51539]: Zeroconf server listening on 0.0.0.0:38935 Oct 16 15:51:53 akshit-eos spotifyd[51539]: registering event source with poller: token=Token(1), interests=READABLE | WRITABLE Oct 16 15:51:53 akshit-eos spotifyd[51539]: registering event source with poller: token=Token(2), interests=READABLE | WRITABLE Oct 16 15:51:53 akshit-eos spotifyd[51539]: found interface Interface { name: "wlan0", addr: V4(Ifv4Addr { ip: 10.30.6.47, netmask: 255.255.0.0, broadcast: Some(10.30.255.255) }) } Oct 16 15:51:53 akshit-eos spotifyd[51539]: sending packet to 224.0.0.251:5353 Oct 16 15:51:53 akshit-eos spotifyd[51539]: found interface Interface { name: "wlan0", addr: V4(Ifv4Addr { ip: 10.30.6.47, netmask: 255.255.0.0, broadcast: Some(10.30.255.255) }) } Oct 16 15:51:53 akshit-eos spotifyd[51539]: sending packet to [ff02::fb]:5353 ``` ---- From terminal ``` ❯ spotifyd --config-path ~/.config/spotifyd/spotifyd.conf --no-daemon --verbose Loading config from "/home/akshit/.config/spotifyd/spotifyd.conf" CliConfig { config_path: Some("/home/akshit/.config/spotifyd/spotifyd.conf"), no_daemon: true, verbose: true, pid: None, shared_config: SharedConfigValues { username: Some("taken out for privacy"), username_cmd: None, password: Some("ta ken out for privacy"), password_cmd: None, use_keyring: true, use_mpris: Some(true), dbus_type: Some(Session), on_song_change_hook: Some("command_to_run_on_playback_events"), cache_path: Some("cache_directory"), no-audio-cache: true, ba ckend: Some(Alsa), volume_controller: Some(Alsa), device: Some("pipewire"), control: Some("alsa_audio_device"), mixer: Some("PCM"), device_name: Some("eos_spotify"), bitrate: Some(Bitrate160), audio_format: Some(S16), initial_volume: So me("90"), volume_normalisation: true, normalisation_pregain: Some(-10.0), zeroconf_port: Some(1234), proxy: None, device_type: Some(Speaker), autoplay: true, max_cache_size: Some(1000000000) } } Found user shell: Some("/usr/local/bin/zsh") No proxy specified registering event source with poller: token=Token(2147483649), interests=READABLE Using alsa volume controller. Keyring is ignored, since you already configured a password registering event source with poller: token=Token(0), interests=READABLE | WRITABLE signal: Want signal found waiting giver, notifying poll_want: taker wants! signal: Want signal: Want poll_want: taker wants! deregistering event source from poller Ignoring blacklisted access point ap-gue1.spotify.com:443 Connecting to AP "ap-gae2.spotify.com:443" signal: Closed registering event source with poller: token=Token(16777216), interests=READABLE | WRITABLE Authenticated as "ksaiakshit" ! new Session[0] Normalisation Type: Auto Normalisation Pregain: -10.0 dB Normalisation Threshold: -2.0 dBFS Normalisation Method: Dynamic Session[0] strong=3 weak=1 Normalisation Attack: 5 ms Normalisation Release: 100 ms Normalisation Knee: 5 dB Country: "IN" new Spirc[0] canonical_username: ksaiakshit new MercuryManager new Player[0] Converting with ditherer: tpdf Using AlsaSink with format: S16 command=AddEventSender ALSA lib control.c:1570:(snd_ctl_open_noupdate) Invalid CTL alsa_audio_device Couldn't set volume: Error("snd_mixer_attach", ENOENT) command=VolumeSet(58981) Running "command_to_run_on_playback_events" using "/usr/local/bin/zsh" with environment variables {"PLAYER_EVENT": "volumeset", "VOLUME": "58981"} registering event source with poller: token=Token(1), interests=READABLE | WRITABLE registering event source with poller: token=Token(2), interests=READABLE | WRITABLE registering event source with poller: token=Token(3), interests=READABLE | WRITABLE deregistering event source from poller deregistering event source from poller deregistering event source from poller Failed to execute "command_to_run_on_playback_events" using "/usr/local/bin/zsh". Error: zsh:1: command not found: command_to_run_on_playback_events registering event source with poller: token=Token(16777219), interests=READABLE subscribed uri=hm://remote/user/ksaiakshit/ count=0 kMessageTypeLoad "" webapi-4cce58d263984150a5955ff25219d81a 939699477 1697451772850 kPlayStatusPlay State: index: 0 position_ms: 421 status: kPlayStatusPlay position_measured_at: 1697451780635 context_description: "" shuffle: false repeat: true playing_from_fallback: true row: 0 playing_track_index: 0 track {gid: "\211\245oK\210kJ\004 Frame has 41 tracks Fetching autoplay context uri Sending status to server: [kPlayStatusPlay] command=SetAutoNormaliseAsAlbum(false) command=Load(SpotifyId { id: 182963221735989580991480002660140810720, audio_type: Track }, true, 421) Sending status to server: [kPlayStatusPlay] Running "command_to_run_on_playback_events" using "/usr/local/bin/zsh" with environment variables {"TRACK_ID": "4bJygwUKrRgq1stlNXcgMg", "POSITION_MS": "421", "PLAYER_EVENT": "start", "PLAY_REQUEST_ID": "0"} registering event source with poller: token=Token(16777218), interests=READABLE | WRITABLE registering event source with poller: token=Token(16777217), interests=READABLE | WRITABLE registering event source with poller: token=Token(4), interests=READABLE | WRITABLE deregistering event source from poller deregistering event source from poller deregistering event source from poller Failed to execute "command_to_run_on_playback_events" using "/usr/local/bin/zsh". Error: zsh:1: command not found: command_to_run_on_playback_events Running "command_to_run_on_playback_events" using "/usr/local/bin/zsh" with environment variables {"TRACK_ID": "4bJygwUKrRgq1stlNXcgMg", "PLAY_REQUEST_ID": "0", "POSITION_MS": "421", "PLAYER_EVENT": "load"} registering event source with poller: token=Token(16777220), interests=READABLE | WRITABLE registering event source with poller: token=Token(33554433), interests=READABLE | WRITABLE registering event source with poller: token=Token(33554434), interests=READABLE | WRITABLE deregistering event source from poller deregistering event source from poller deregistering event source from poller Failed to execute "command_to_run_on_playback_events" using "/usr/local/bin/zsh". Error: zsh:1: command not found: command_to_run_on_playback_events error 400 for uri hm://autoplay-enabled/query?uri= AutoplayError: MercuryError LoadingVersions (please complete the following information):
My spotifyd.conf:
This is my spotifyd.service file, stored at /etc/systemd/system/spotifyd.service: