1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

raspiでspotifyを聴く

Last updated at Posted at 2021-12-07

定番のアプリ(raspotify)

raspiでspotifyを聴く時多分検索でヒットするのはraspotifyだと思います.
しかしカメラ触るためにcui版からdesktop版に変えた結果raspotifyではbluetoothのスピーカが使えなくなってしまいました.
オーディオ関係の大型アップデートがあったからみたいなのですがいまいち解決策がわからず,困ってしまったのですが,raspotifyの公式に

For desktop versions of Raspberry Pi OS (and/or systems with PulseAudio installed) spotifyd offers similar functionality, much better PulseAudio compatibility and is a better choice.

と書いてあったためspotifydを入れたところうまくいきました.

導入手順

最新版が欲しい場合はwgetのリンクを書き換える

wget https://github.com/Spotifyd/spotifyd/releases/download/v0.3.2/spotifyd-linux-armhf-default.tar.gz
tar -xf spotifyd-linux-armhf-default.tar.gz 
./spotifyd --no-daemon

これで一応できる.

settings

https://raw.githubusercontent.com/Spotifyd/spotifyd/master/contrib/spotifyd.service
を書き込む

mkdir -p ~/.config/systemd/user/
nvim ~/.config/systemd/user/spotifyd.service
systemctl --user daemon-reload

次にconfig fileを作成.

mkdir ~/.config/spotifyd/
nvim ~/.config/spotifyd/spotifyd.conf

(私のやつはこんなです.)

[global]
username = "spotifyのusername"
password = "spotifyのパスワード"
backend = "alsa"
device = "default" # Given by `aplay -L`
mixer = "PCM"
volume-controller = "alsa" # or alsa_linear, or softvol
#onevent = command_run_on_playback_event
device_name = "hello_spotifyd"
bitrate = 320
cache_path = "/home/pi/.cache/spotifyd"
volume-normalisation = false
normalisation-pregain = -10

その後

systemctl --user start spotifyd.service

で起動.
起動時にも立ち上げたい場合は,

sudo loginctl enable-linger pi
systemctl --user enable spotifyd.service
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?