Trying to build spotifyd

I’m getting an error when building spotifyd. I’ve tried manually building it and also using cargo install spotifyd --locked but to no avail. I’ve downloaded the binary but I am unsure on how to use it… any help is greatly appreciated :cowboy_hat_face:

error: failed to run custom build command for `alsa-sys v0.1.2`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installtlhkH8/release/build/alsa-sys-ce8b1689098727b5/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "`\"pkg-config\" \"--libs\" \"--cflags\" \"alsa\"` did not exit successfully: exit code: 1\n--- stderr\nPackage alsa was not found in the pkg-config search path.\nPerhaps you should add the directory containing `alsa.pc\'\nto the PKG_CONFIG_PATH environment variable\nPackage \'alsa\', required by \'virtual:world\', not found\n"', /home/zeno/.cargo/registry/src/github.com-1ecc6299db9ec823/alsa-sys-0.1.2/build.rs:4:38
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `spotifyd v0.2.24`, intermediate artifacts can be found at `/tmp/cargo-installtlhkH8`

Caused by:
  build failed

Hi,

Just built this with no issue. It looks to me from your error that the alsa libs are missing, make sure all the dependencies are installed:

sudo dnf install alsa-lib-devel make gcc 

Then try building again.

Thanks Tom.

4 Likes

Thanks for the reply, Tom. Apparently, I was missing the i686 libraries of both openssl and alsa-lib-devel… kinda annoying. Do you know if there’s an easy way to install both the i686 and x86_64 of a given package instead of explicitly typing both of them?

I now got this message, though: warning: be sure to add /home/zeno/.cargo/bin to your PATH to be able to run the installed binaries

Any idea what this means?

Thanks again :slight_smile:

Hi,

No sorry, x84_64 are default packages for installing libraries and .i686 needs to be specified to install the 32bit libs.

I’ve only got the x84_64 libs for both these packages, so I’m not sure why you needed the i686 libs. Did you specify any flags for the build?

unless when you run cargo you need to specify the full path i.e:

/home/zeno/.cargo/bin/cargo build

you can ignore this message. The install should have taken care of this.

Thanks Tom.

2 Likes

Thanks for the thorough explanation :blush:

No, I didn’t.

Alright, thanks. I’m trying to run spotifyd using the terminal but it doesn’t find the command and if I open ~/.cargo/bin/cargo and run ./spotifyd nothing happens… I don’t know what I’m doing wrong? :sweat:

Hi,

The build is installed to $HOME/spotifyd/target/release/. Should be ok to copy spotifyd to:

/usr/local/bin/

Thanks Tom.

3 Likes

I copied it and ran it, but it doesn’t activate :roll_eyes:
Oh, well. I’ve managed to live without it until now, so it can’t be that important - right? :laughing:

Thanks for your help, Tom :v:

Hi,

Have you updated:

~/.config/spotifyd/spotifyd.conf

with your spotify username and password?

Thanks Tom.

1 Like

Hmmm… I don’t have this in my .config folder, so I’m guessing that something must’ve gone wrong while building it :thinking:

Hi,

.config is a fedora/linux system folder its created when the user is created. The ‘.’ means it hidden. If you are looking for it using the file manager you will need to enable view hidden files. Via the terminal you can confirm it exists with:

ll -d ~/.config

then check the spotifyd folder exists:

ll -d ~/.config/spotifyd

One you have confirmed it exists, issue the following to edit it:

nano ~/.config/spotifyd/spotifyd.conf

if ~/.config really doesn’t exist, then something is really broken on your system. I would create a new user and double check if .config is created, if it isn’t I would conisder a reinstall.

Thanks Tom.

1 Like

Yes, sorry, should have made it clearer that I don’t have spotifyd in the .config folder.

Hi,

Try this:

mkdir ~/.config/spotifyd

nano ~/.config/spotifyd/spotifyd.conf

Copy the contents of Configuration file from:

and update with your username and password.

Thanks Tom.

❯ spotifyd
thread ‘main’ panicked at ‘called Result::unwrap() on an Err value: Custom("unknown variant \"alsa\", expected one of alsa, portaudio, pulseaudio, rodio")’, /home/zeno/.cargo/registry/src/github.com-1ecc6299db9ec823/spotifyd-0.2.24/src/config.rs:415:85
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

❯ RUST_BACKTRACE=1 spotifyd
thread ‘main’ panicked at ‘called Result::unwrap() on an Err value: Custom("unknown variant \"alsa\", expected one of alsa, portaudio, pulseaudio, rodio")’, /home/zeno/.cargo/registry/src/github.com-1ecc6299db9ec823/spotifyd-0.2.24/src/config.rs:415:85
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::option::expect_none_failed
3: spotifyd::config::CliConfig::load_config_file_values
4: spotifyd::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

iirc, fedora updated to PipeWire… could this be the reason why it fails?

Hi,

Possibly. I think at this point you best bet would be to contact the developer for support.

Thanks Tom.