tml3nr
Moderator
Sorry anh hôm quá em té sớm. Vậy hôm nay khi nào anh rãnh mình xà quần tiếp ạid : 1 254 653 123
pass : gv6m86
Sorry anh hôm quá em té sớm. Vậy hôm nay khi nào anh rãnh mình xà quần tiếp ạid : 1 254 653 123
pass : gv6m86
root@runeaudio(rw):~# spotifyd --help
Usage: spotifyd [options]
Options:
-c, --config CONFIG Path to a config file.
-u, --username USERNAME
Spotify user name.
-p, --password PASSWORD
Spotify password.
--device DEVICE Audio device, given by aplay -L.
--mixer DEVICE Audio mixer
--bitrate DEVICE
Any of 96, 160, and 320.
--pid PID-FILE Path to PID file.
--device_name DEVICE
Name of this Spotify device.
--backend BACKEND
Audio backend.
--cache_path PATH
Path to cache location.
--volume-normalisation
Apply volume normalisation per track.
--normalisation-pregain PREGAIN
dB of pregain for volume normalisation
--onevent COMMAND
Run a command on events. Environment variables
PLAYER_EVENT, TRACK_ID,OLD_TRACK_ID are passed to the
command.
--volume-control CONTROLLER
Possible values are alsa, alsa_linear, and softvol.
-v, --verbose Add debug information to log.
--no-daemon Don't detach from console.
--backends List available audio backends.
-h, --help Print this help text.
#!/bin/bash
case "$PLAYER_EVENT" in
start)
# Stop mpd
systemctl stop mpd
exit
;;
stop)
# Start mpd
systemctl start mpd
exit
;;
esac
exit 0
[Unit]
Description=A spotify playing daemon
Documentation=https://github.com/Spotifyd/spotifyd
Wants=sound.target
After=sound.target
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=/usr/bin/spotifyd --no-daemon --onevent /home/root/spotifyd_event.sh
Restart=always
RestartSec=12
[Install]
WantedBy=default.target
systemctl daemon-reload
systemctl stop spotifyd
systemctl start spotifyd
Cũng set vậy mà chỉnh volume trên Spotify ngó sang Moode ko thấy nó nhúc nhắc volumeSpotifyd của em đồng bộ tốt volume với boss dac ạ. Em dùng:
mixer = Digital
Dạ đúng như vậy ạ. moode từ tước tới giờ không cập nhật volume trên webui khi alsa thay đổi.Cũng set vậy mà chỉnh volume trên Spotify ngó sang Moode ko thấy nó nhúc nhắc volume
P/S: Xem lại alsa volume thấy đồng bộ rùi. Tại trên giao diện player nó cứ trơ ra làm e nghĩ nhầm
Anh đang vướng chổ nào ạ? Anh xem kỹ bài này:@tml3nr : Xà quần 2 ngày mà chưa cài được Spotifyd, bạn giúp hướng dẫn chi tiết từng lệnh và cách cài để copy và paste. Cài trên pi3B - allo digione - moodeaudio 3.8.4
Thanks.
Cảm ơn anh @tml3nr hôm qua xà quần mãi mới thanh công anh ạ', cái chỗ Mixer của em phải thay bằng Mixer_type = none thì mới được.... Cảm ơn anh nghe hay hơn bản spotify của moOde gốc anh ạ...
Éc éc, hình như anh lộn sang tuồng khác rồi@tml3nr : Mình làm theo http://www.hdvietnam.com/posts/10019230/, đã kết nối và nghe OK nhưng chạy mấy lệnh ở Bước 4 không được, chỉ chạy được lệnh "systemctl --user start spotifyd.service" còn 2 lệnh này: "sudo loginctl enable-linger <username>" và "systemctl --user enable spotifyd.service" báo lỗi nên khi thoát màn hình Putty là ngắt luôn Spotìyd. mình cài Spotifyd bản mới nhất.
Nhờ anh tây dynobot chỉ đường. Em mò ra được thêm một cách tạo SC rất đơn giản. Âm thanh theo em là hay nhất trong tất cả các loại SC từ trước đến giờ. Đồng bộ được với volume của alsa.
Em chỉ mới test trên Rune. Chắc là sẽ OK trên các OS khác.
Bước 1:
https://github.com/Spotifyd/spotifyd/releases/
Download file spotifyd-2019-xx-xx-armv6.zip. Extract file spotifyd vào /usr/bin. Rồi set:
chmod +x /usr/bin/spotifyd
Bước 2 - Tạo file config:
nano /etc/spotifyd.conf
Mã:[global] username = your_account password = your_password backend = alsa device = xxx # Given by `aplay -L` mixer = xxx volume-control = alsa # or alsa_linear, or softvol #onevent = command_run_on_playback_event device_name = RuneAudio bitrate = 320 #cache_path = /tmp/spotifyd volume-normalisation = false #normalisation-pregain = -10
Ghi chú:
device = xxx # Lấy theo device của alsa. Thí dụ: hw:0
mixer = xxx # Lấy theo PCM, hay Digital của alsa
device_name = Tùy chọn. Không được có khoảng trắng.
Bước 3 - Tạo file service:
- Rune:
nano /usr/lib/systemd/system/spotifyd.service
- moode / volumio:
nano /lib/systemd/system/spotifyd.service
Mã:[Unit] Description=A spotify playing daemon Documentation=https://github.com/Spotifyd/spotifyd Wants=sound.target After=sound.target Wants=network-online.target After=network-online.target [Service] ExecStart=/usr/bin/spotifyd --no-daemon Restart=always RestartSec=12 [Install] WantedBy=default.target
Bước 4:
Mã:systemctl start spotifyd
Mã:systemctl enable spotifyd
Xem thông tin hoạt động của Spotifyd:
Mã:systemctl status spotifyd
Ghi chú: Trước khi edit ta cần phải stop service:
Mã:systemctl stop spotifyd
Vậy là xong ạ!
More information:
https://github.com/Spotifyd/spotifyd/wiki/Installing-on-a-Raspberry-Pi
Làm đúng như trên thì không được, hay do dùng Spotify V0.2.24Éc éc, hình như anh lộn sang tuồng khác rồi
Anh xem bài này ạ:@tml3nr : Được rồi bạn, cài bản V0.2.12 bạn chỉ đã OK (Tạo file service: thay "
sudo nano /lib/systemd/system/spotifyd.service" bằng "sudo nano /etc/systemd/user/spotifyd.service"; các lệnh khác thêm "Sudo" vào trước). Bạn hướng dẫn thêm về tắt các servicer khác khi nghe Spotify với Moode 3.8.4
Là tắt MPD khi nghe Spotìy phải không? 1. tạo file "spotifyd_even.sh" ; 2. Set chmod 755 cho file vừa tạo; 3. Sửa lại file spotifyd.service; 4. systemctl daemon-reload; systemctl stop spotifyd; systemctl start spotifyd.