Raspberry Pi + Rune Audio ::: Một trải nghiệm nghe nhạc mới

rndce

Well-Known Member
HifiberryOS TC Pi 2 đã hot, âm thanh Ok, các bác download test thử.

- Pi 2, Pi 3 nghe Ok
- Pi 4 nghe Ok (Pi 4 cài thêm Asset, BubbleUpnp, Aprenderer).
https://drive.google.com/drive/folders/1TfxiSkOYkOrCUu5NdG6IVdLSsQArFaPJ?usp=sharing
---
HAT DAC Taobao, âm thanh OK.
driver HifiBerry DAC HiFi pcm5102a-hifi

Pi 4 đang dùng DAC: RPi-DAC HiFi pcm1794a-codec-0 nhưng nó tự nhận thành HifiBerry DAC, mà nghe TC cũng Ok luôn.

Copy từ diyaudio:
1/ fully-directly compatible:
- all HifiBerry cards
- IQaudIO Digi+ (recognised as HB digi)
- Audiophonics Digipi+ AES
Most of the cards with WM8804 or PCM5122 onboard chip should work with HBOS


------------------------------------------------------------------------
Tích hợp TC vào docker HiFiBerry OS - HBOS

#1. Bung IMG HiFiBerryOS vào thẻ, SSH user:root, pass: hifiberry

#2. Làm theo hướng dẫn: bước 1 và 3 bỏ qua bước 2.

#3. Điều chỉnh: đường dẫn WorkingDirectory
File này: /root/tidal-connect-docker/install-hifiberry/systemd/tidal.service
Cho khớp với thư mục giải nén ở bước 1
VD: WorkingDirectory=/root/tidal-connect-docker-master/Docker/

#4 Start TC:
Mã:
cd /root/tidal-connect-docker-master/install-hifiberry
./install.sh

Vậy là xong.

PS: Mình nghe sơ sơ âm thanh chưa có vấn đề gì. Với Docker có vẻ ổn. Các bác test chất âm xem sao.
Mình test DAC dùng driver khác xem sao.
Hifiberry OS có phải là thuần Linux ko bác, mình check thì nó ra như vầy:
Mã:
login as: root
[email protected]'s password:
# uname -a
Linux hifi4 5.4.83-v7l #1 SMP Wed Feb 3 11:58:50 UTC 2021 armv7l GNU/Linux
# hostnamectl
   Static hostname: hifi4
         Icon name: computer
        Machine ID: bac98229b3b14ac2954
           Boot ID: 86afe219261245d5ae13d
  Operating System: Buildroot 2020.11
            Kernel: Linux 5.4.83-v7l
      Architecture: arm
#
Minh ko biết cách mở rộng thẻ nhớ có 3 phân vùng như thế này thẻ mình 32Gbs. Hồi truóc giờ chỉ quen mở rộng thẻ nhớ 2 phân vùng.
Mã:
# fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/mmcblk0: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc4ab85d9

Device         Boot   Start      End Sectors  Size Id Type
/dev/mmcblk0p1 *          1   131072  131072   64M  c W95 FAT32 (LBA)
/dev/mmcblk0p2       131073  6129663 5998591  2.9G 83 Linux
/dev/mmcblk0p4      6131712 15523839 9392128  4.5G 83 Linux

Command (m for help):
Tidal connect đã hót trên Pi4 rồi bác quạt ah.
Bản này quá trời món ăn chơi: Aprenderer, Bubble Upnp server, Openhome có sẵn với Upmpdcli, Roon Brigde, Asset UPNP...
Chỉ còn mở rộng thẻ nhớ, và mount NAS là thưởng thức thôi. (Mình chưa thấy chổ mount NAS vào Hifibery OS)
Many thanks bác đã dày công build OS nhiều món ăn chơi cho anh em.
 
Chỉnh sửa lần cuối:

tml3nr

Moderator
Hix mấy cái aplay-rt, rtalsa, xsink khó quá đi. Không biết ông @paparius dùng source code gì nữa. Symphonic-mpd 1.0.10 ổng bỏ bớt xsink rồi. Em suy đoán aplay-rt có thể là cái alsa aplay rồi ổng chế cháo thành aplay-rt; cái rtalsa thì chưa rõ. :):mad:
Em build librespot hơn 4 tiếng trên pi2. Nhưng vẫn không chạy được với smpd 0.9.6 alsa. Chưa nói gì tới aplay-rt.

Buồn quá em mò lại đống đồ cổ, may quá thấy bản smpd 0.6GA đã có sẵn librespot output pipe aplay-rt.

Test thử SC chạy luôn, không cần phải khai báo user password.

SC out ra pipe aplay-rt tiếng hay hết hồn các anh ạ. Anh nào muốn test smpd 0.6GA vui lòng PM cho em để em gửi link. Ông dev không muốn public mấy cái này.

Mã:
pi@smpd:~ $ uname -a
Linux smpd 4.14.52-smpd #41 SMP PREEMPT Thu Aug 16 07:48:07 JST 2018 armv7l GNU/Linux

pi@smpd:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

spotify-connect.service

Mã:
[Unit]
Description=Spotify Connect
After=network-online.target

[Service]
Type=idle

ExecStart=/usr/local/bin/librespot --name symphonic-mpd --initial-volume 100 --onevent /home/pi/configs/spotify_event.sh --cache /run --bitrate 320 --zeroconf-port 4000 --backend pipe --device /run/pipeout  &

Restart=always
RestartSec=10
StartLimitInterval=30
StartLimitBurst=20

LimitRTPRIO=99
LimitMEMLOCK=infinity
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=99
CPUAffinity=2

# none, realtime, best-effort, idle
IOSchedulingClass=realtime

# 0(highest) - 7(lowest)
IOSchedulingPriority=0

[Install]
WantedBy=multi-user.target

pipe.service

Mã:
[Unit]
Description=symphonic-mpd pipe service
Wants=network-online.target
After=sound.target
After=network.target network-online.target

[Service]
Type=simple
#PIDFile=/run/pipe.pid
LimitRTPRIO=99
LimitMEMLOCK=infinity
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=99
CPUAffinity=1
KillMode=mixed
KillSignal=SIGHUP
User=root
Group=root

# none, realtime, best-effort, idle
IOSchedulingClass=realtime

# 0(highest) - 7(lowest)
IOSchedulingPriority=0

#ExecStartPre=/home/pi/configs/pipe.sh pre
ExecStart=/home/pi/configs/pipe.sh exec
#ExecStartPost=/home/pi/configs/pipe.sh post

Restart=always
StartLimitInterval=5

[Install]
WantedBy=multi-user.target

pipe.sh

Mã:
#!/bin/bash

device="hw:0,0" # default

# for Sabreberry32 (DAC MASTER)
if [ $(aplay -l|grep "SabreBerry32 DAC sabre9018q2c"|wc -l) = 1 ];then
  device="APLAY_S32_LE"
fi

#prealloc=512
prealloc=1024
period_time=5772
buffer_time=1486940

pipeout=/run/pipeout
pcminfo=/run/pcminfo

timer_calibration="/home/pi/configs/timer_calibration.sh"
opt_aplay="--device=${device} -q -M -F ${period_time} -B ${buffer_time} -p ${pcminfo}"

case "$1" in
  exec)
  if [ ! -e $pipeout ]; then
  mkfifo --mode=666 $pipeout
  fi
  if [ ! -e $pcminfo ]; then
  touch $pcminfo
  chmod 666 $pcminfo
  echo "S16_LE 44100 2" > $pcminfo
  fi

  echo $prealloc > /proc/asound/card0/pcm0p/sub0/prealloc
  $timer_calibration
  exec /usr/local/bin/aplay-rt $opt_aplay $pipeout
  ;;
esac
 
Chỉnh sửa lần cuối:

TuanQuynhAudio

Well-Known Member
Em build librespot hơn 4 tiếng trên pi2. Nhưng vẫn không chạy được với smpd 0.9.6 alsa. Chưa nói gì tới aplay-rt.

Buồn quá em mò lại đống đồ cổ, may quá thấy bản smpd 0.6GA đã có sẵn librespot output pipe aplay-rt.

Test thử SC chạy luôn, không cần phải khai báo user password.

SC out ra pipe aplay-rt tiếng hay hết hồn các anh ạ. Em sẽ úp bản này cho các anh nghiên kiú.

Mã:
pi@smpd:~ $ uname -a
Linux smpd 4.14.52-smpd #41 SMP PREEMPT Thu Aug 16 07:48:07 JST 2018 armv7l GNU/Linux

pi@smpd:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

spotify-connect.service

Mã:
[Unit]
Description=Spotify Connect
After=network-online.target

[Service]
Type=idle

ExecStart=/usr/local/bin/librespot --name symphonic-mpd --initial-volume 100 --onevent /home/pi/configs/spotify_event.sh --cache /run --bitrate 320 --zeroconf-port 4000 --backend pipe --device /run/pipeout  &

Restart=always
RestartSec=10
StartLimitInterval=30
StartLimitBurst=20

LimitRTPRIO=99
LimitMEMLOCK=infinity
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=99
CPUAffinity=2

# none, realtime, best-effort, idle
IOSchedulingClass=realtime

# 0(highest) - 7(lowest)
IOSchedulingPriority=0

[Install]
WantedBy=multi-user.target

pipe.service

Mã:
[Unit]
Description=symphonic-mpd pipe service
Wants=network-online.target
After=sound.target
After=network.target network-online.target

[Service]
Type=simple
#PIDFile=/run/pipe.pid
LimitRTPRIO=99
LimitMEMLOCK=infinity
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=99
CPUAffinity=1
KillMode=mixed
KillSignal=SIGHUP
User=root
Group=root

# none, realtime, best-effort, idle
IOSchedulingClass=realtime

# 0(highest) - 7(lowest)
IOSchedulingPriority=0

#ExecStartPre=/home/pi/configs/pipe.sh pre
ExecStart=/home/pi/configs/pipe.sh exec
#ExecStartPost=/home/pi/configs/pipe.sh post

Restart=always
StartLimitInterval=5

[Install]
WantedBy=multi-user.target

pipe.sh

Mã:
#!/bin/bash

device="hw:0,0" # default

# for Sabreberry32 (DAC MASTER)
if [ $(aplay -l|grep "SabreBerry32 DAC sabre9018q2c"|wc -l) = 1 ];then
  device="APLAY_S32_LE"
fi

#prealloc=512
prealloc=1024
period_time=5772
buffer_time=1486940

pipeout=/run/pipeout
pcminfo=/run/pcminfo

timer_calibration="/home/pi/configs/timer_calibration.sh"
opt_aplay="--device=${device} -q -M -F ${period_time} -B ${buffer_time} -p ${pcminfo}"

case "$1" in
  exec)
  if [ ! -e $pipeout ]; then
  mkfifo --mode=666 $pipeout
  fi
  if [ ! -e $pcminfo ]; then
  touch $pcminfo
  chmod 666 $pcminfo
  echo "S16_LE 44100 2" > $pcminfo
  fi

  echo $prealloc > /proc/asound/card0/pcm0p/sub0/prealloc
  $timer_calibration
  exec /usr/local/bin/aplay-rt $opt_aplay $pipeout
  ;;
esac
Em mò chuyển librespot từ smpd 0.6 sang 0.9.6 xem sao! Hix anh build librespot trên pi2 sao mà lâu thế. Em nghĩ sẽ nhanh thôi mà. Thường build cùng hệ arm 32 bit sẽ chạy được anh à. Vì thế anh build trên pi 2 rồi instal sang pi 2 sẽ nhanh hơn. Lưu ý cùng version raspbian/debian thì độ tương thíc sẽ cao, khác version raspbian/debian có caí vẫn chạy bình thường anh à.
 

tml3nr

Moderator
Em mò chuyển librespot từ smpd 0.6 sang 0.9.6 xem sao! Hix anh build librespot trên pi2 sao mà lâu thế. Em nghĩ sẽ nhanh thôi mà. Thường build cùng hệ arm 32 bit sẽ chạy được anh à. Vì thế anh build trên pi 2 rồi instal sang pi 2 sẽ nhanh hơn. Lưu ý cùng version raspbian/debian thì độ tương thíc sẽ cao, khác version raspbian/debian có caí vẫn chạy bình thường anh à.
Em build bằng cargo anh ạ. Nó chạy gần 4h30p :confused:

https://github.com/librespot-org/librespot
 

chautranthanh

Well-Known Member
CF02A171-C98C-4DD8-882D-07E2DDF3A640.png

Bo này có tác dụng gì vậy các bác ?

7685D01D-64AC-4DDD-9576-A0CAD4CABEB8.jpg

Cái này dành kết nối IPhone,iPad to DAC
 

quatmo

Well-Known Member
Hifiberry OS có phải là thuần Linux ko bác, mình check thì nó ra như vầy:
Mã:
login as: root
[email protected]'s password:
# uname -a
Linux hifi4 5.4.83-v7l #1 SMP Wed Feb 3 11:58:50 UTC 2021 armv7l GNU/Linux
# hostnamectl
   Static hostname: hifi4
         Icon name: computer
        Machine ID: bac98229b3b14ac2954
           Boot ID: 86afe219261245d5ae13d
  Operating System: Buildroot 2020.11
            Kernel: Linux 5.4.83-v7l
      Architecture: arm
#
Minh ko biết cách mở rộng thẻ nhớ có 3 phân vùng như thế này thẻ mình 32Gbs. Hồi truóc giờ chỉ quen mở rộng thẻ nhớ 2 phân vùng.
Mã:
# fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/mmcblk0: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc4ab85d9

Device         Boot   Start      End Sectors  Size Id Type
/dev/mmcblk0p1 *          1   131072  131072   64M  c W95 FAT32 (LBA)
/dev/mmcblk0p2       131073  6129663 5998591  2.9G 83 Linux
/dev/mmcblk0p4      6131712 15523839 9392128  4.5G 83 Linux

Command (m for help):
Tidal coneect đã hót trên Pi4 rồi bác quạt ah.
Bản này quá trời món ăn chơi: Aprenderer, Bubble Upnp server, Openhome có sẵn với Upmpdcli, Roon Brigde, Asset UPNP...
Chỉ còn mở rộng thẻ nhớ, và mount NAS là thưởng thức thôi. (Mình chưa thấy chổ mount NAS vào Hifibery OS)
Many thanks bác đã dày công build OS nhiều món ăn chơi cho anh em.
Copy github
HiFiBerryOS is our version of a minimal Linux distribution optimized for audio playback. The goal isn't to add as much functionality as possible, but to keep it small. Therefore, it is based on Buildroot and it's not possible to use package managers to add more software.

HBOS Resize-partitions, bác thử gõ rồi reboot hoặc xem packegae này:
cd ~
touch /resize-me
systemctl start resize-partitions.service

touch/resize-me.2
systemctl start resize-partitions.service


Không có dày công đâu bác, với Pi 4 cần build TC bước 2 tuy nhiên Pi 4 chạy khá nhanh.
Những thứ còn lại AP, Asset, Bub, Java thì đơn giản là dùng trong gói Ropi Addon bung vào là chạy.
Asset trong bản Pi 4 chưa ke*, các bác bung file db.tar.gz trong gói Ropi addon vào.
@binna

Update: Mount NAS, bác xem thêm ở đâyở đây.
Lúc Add server HBOS có ghi chú USB hoặc IP.
 
Chỉnh sửa lần cuối:

rndce

Well-Known Member
Copy github
HiFiBerryOS is our version of a minimal Linux distribution optimized for audio playback. The goal isn't to add as much functionality as possible, but to keep it small. Therefore, it is based on Buildroot and it's not possible to use package managers to add more software.

HBOS Resize-partitions, bác thử gõ rồi reboot hoặc xem packegae này:
cd ~
touch /resize-me
systemctl start resize-partitions.service

touch/resize-me.2
systemctl start resize-partitions.service


Những thứ còn lại AP, Asset, Bub, Java thì đơn giản là dùng trong gói Ropi Addon bung vào là chạy.
Asset trong bản Pi 4 chưa ke*, các bác bung file db.tar.gz trong gói Ropi addon vào.
@binna
Không có dày công đâu bác, với Pi 4 cần build TC bước 2 tuy nhiên Pi 4 chạy khá nhanh.
Mình tìm được cách mount NAS trên web Hifiberry OS như sau:
SMB SHARES
Mặc dù truy cập nhạc trên NAS thông qua Smaba đã được hỗ trợ, nhưng không thể cấu hình từ WebUI. Để mount NAS, đăng nhập SSH (user: root , pass: hifiberry) và tạo file /etc/smbmounts.conf:
Mã:
nano /etc/smbmounts.conf
có nội dung:
Mã:
name;share;username;password[;options]
name: tuỳ mình chọn, ví dụ như sau:
Mã:
NASLossless;//192.168.0.10/music;myuser;mypassword
Có thể thêm các tùy chọn mount bổ sung:
Mã:
NASLossless;//192.168.0.10/music;myuser;mypassword;vers=1.0
Lưu lại và thoát file /etc/smbmounts.conf.
Sau đó chạy lệnh:
Mã:
/opt/hifiberry/bin/mount-smb.sh
Sau khi mount xong, HiFiBerryOS sẽ scan library. Tùy thuộc vào kích thước, quá trình này có thể mất từ vài phút đến vài giờ (đối với các thư viện rất lớn). Quá trình này là bắt buộc. Bạn cần phải có một số kiên nhẫn. Nếu quá trình này kết thúc, các bản cập nhật tiếp theo của cơ sở dữ liệu sẽ chỉ quét các tệp mới. Điều này sẽ nhanh hơn nhiều. (google dịch)
 

quatmo

Well-Known Member
Mình tìm được cách mount NAS trên web Hifiberry OS như sau:
SMB SHARES
Mặc dù truy cập nhạc trên NAS thông qua Smaba đã được hỗ trợ, nhưng không thể cấu hình từ WebUI. Để mount NAS, đăng nhập SSH (user: root , pass: hifiberry) và tạo file /etc/smbmounts.conf:
Mã:
nano /etc/smbmounts.conf
có nội dung:
Mã:
name;share;username;password[;options]
name: tuỳ mình chọn, ví dụ như sau:
Mã:
NASLossless;//192.168.0.10/music;myuser;mypassword
Có thể thêm các tùy chọn mount bổ sung:
Mã:
NASLossless;//192.168.0.10/music;myuser;mypassword;vers=1.0
Lưu lại và thoát file /etc/smbmounts.conf.
Sau đó chạy lệnh:
Mã:
/opt/hifiberry/bin/mount-smb.sh
Sau khi mount xong, HiFiBerryOS sẽ scan library. Tùy thuộc vào kích thước, quá trình này có thể mất từ vài phút đến vài giờ (đối với các thư viện rất lớn). Quá trình này là bắt buộc. Bạn cần phải có một số kiên nhẫn. Nếu quá trình này kết thúc, các bản cập nhật tiếp theo của cơ sở dữ liệu sẽ chỉ quét các tệp mới. Điều này sẽ nhanh hơn nhiều. (google dịch)

Bác add Nas vậy không add được hả?

2021-04-13-11_08_40-hifi2.png
 

rndce

Well-Known Member
Bác add Nas vậy không add được hả?

2021-04-13-11_08_40-hifi2.png
Ko được bác ah,
mình add : 192.168.100.14/Lossless thì nó báo ko được (nhạc mình để ở đây)
làm lại add: 192.168.100.14 thì nó nhảy tới bước nhập user và pass đăng nhập pass -> xong thì nó báo ko thấy thư mục shared music.
 

TuanQuynhAudio

Well-Known Member
@tml3nr Em thử build librespot hết 6 phút 30 ' trên pi4 raspbian 64 bit.
Mã:
time cargo build -j4 -q --no-default-features --features "alsa-backend"

real    6m30.538s
user    11m55.652s
sys     0m23.695s
Mã:
time cargo build --release -j4 -q --no-default-features --features "alsa-backend"

real    12m39.111s
user    46m10.876s
sys     0m50.135s
 
Chỉnh sửa lần cuối:

quatmo

Well-Known Member
Pin vào (+ -) tụ nguồn, bỏ qua phần chỉnh lưu AC trên bo, điện áp ổn định ngay.

Cảm ơn anh Minh @mtminh câu dây, còn nhiệt tình đi mua đồng hồ đo áp lắp vào giùm.

Em về chỉnh lại:
Pin đi ra cầu chì -> công tắc 6 chân (3 nấc) bật sang trái OFF/SẠC, bật giữa OFF, bật phải ON.
Công tắc đi ra 3 cặp dây:
- 1 cấp nguồn bo LT3045x2 1A vào HAT DAC
- 1 cấp nguồn bo LT1764 3A vào Pi, Pi bẻ cong 2 chân 5V ra ngoài không cho nguồn lên HAT DAC.
- 1 cấp nguồn bo LT3042 sang USB Wifi (chưa làm tới Wifi)

Pin mua Nhật Tảo là hàng mới loại không dùng vít, nghe vài hôm mới đánh giá được vụ dung lượng/chất lượng.

Lâu đài Pi 2 Pin LiFePO4 đã hót Ok, cảm ơn các bác nhiệt tình tư vấn và hỗ trợ!

Sau nhiều ngày sử dụng với Pi 2 + HAT DAC + USB WIFI (nguồn rời 5v cho cả 3).

- Pin 32650 LiFePO4 6700mAh x4 sạc tầm 2 tiếng ra 6.5v, 4.5 tiếng 6.6v dung lượng tầm trên 10.000mAh.
- Chạy liên tục 12 tiếng hết pin, áp còn 5.5v. Tự tắt. (đã test qua 2 lượt dùng).
- Chạy Ropi, nhiệt độ CPU luôn bảo trì tầm 40 độ C, có lẽ rất khó đạt như vậy với xài điện thông thường.

Chất lượng/dung lượng Pin Ok đối với mình. Làm thêm một cục để sẵn thay thế là xài thoải mái.
 
Chỉnh sửa lần cuối:

chautranthanh

Well-Known Member
Sau nhiều ngày sử dụng với Pi 2 + HAT DAC + USB WIFI (nguồn rời 5v cho cả 3).

- Pin 32650 LiFePO4 6700mAh x4 sạc 4 tiếng ra 6.5v dung lượng tầm trên 10.000mAh.
- Chạy liên tục 12 tiếng hết pin, áp còn 5.5v. Tự tắt. (đã test qua 2 lượt dùng).
- Chạy Ropi, nhiệt độ CPU luôn bảo trì tầm 40 độ C, có lẽ rất khó đạt như vậy với xài điện thông thường.

Chất lượng/dung lượng Pin Ok đối với mình. Làm thêm một cục để sẵn thay thế là xài thoải mái.
Chúc mừng bác nhé , giờ mà mod clock cho bộ của bác nữa là hết bài !
 

binna

Well-Known Member
Sau nhiều ngày sử dụng với Pi 2 + HAT DAC + USB WIFI (nguồn rời 5v cho cả 3).

- Pin 32650 LiFePO4 6700mAh x4 sạc 4 tiếng ra 6.5v dung lượng tầm trên 10.000mAh.
- Chạy liên tục 12 tiếng hết pin, áp còn 5.5v. Tự tắt. (đã test qua 2 lượt dùng).
- Chạy Ropi, nhiệt độ CPU luôn bảo trì tầm 40 độ C, có lẽ rất khó đạt như vậy với xài điện thông thường.

Chất lượng/dung lượng Pin Ok đối với mình. Làm thêm một cục để sẵn thay thế là xài thoải mái.
bộ pin này dùng cho Pi 4 được không ta ??
thấy bác review ngon quá ....muốn đu theo ... hihi
 

quatmo

Well-Known Member
Thêm vài thứ cho nó sinh động
SSH: root/dastereO

Asset port 45537, cài từ Addon RopiAddon,


MiniDLNA, port 8200
Mã:
cd /tmp
wget https://raw.githubusercontent.com/lovehifi/minidlna-dastereo/main/etc.minidlna.tar.gz
tar -zxf etc.minidlna.tar.gz --overwrite -C /
wget https://raw.githubusercontent.com/lovehifi/minidlna-dastereo/main/minidlna.service.tar.gz
tar -zxf minidlna.service.tar.gz --overwrite -C /
pacman -Syy
pacman -S glibc
pacman -S minidlna
Edit đường dẫn thư mục nhạc trong file /etc/minidlna.conf


Thêm nút Asset và MiniDLNA
Mã:
cd ~
wget https://raw.githubusercontent.com/lovehifi/minidlna-dastereo/main/web.tar.gz
cp -rf /root/web.tar.gz /opt/utils/
reboot


Mod TC
Mình không thích nghe cái này lại phải vào Web Control tắt/bật cái kia. Chỉnh luôn cho dễ xài.
Mã:
cd /tmp
wget https://raw.githubusercontent.com/lovehifi/minidlna-dastereo/main/opt.tidal.lib.tar.gz
tar -zxf opt.tidal.lib.tar.gz --overwrite -C /
wget https://raw.githubusercontent.com/lovehifi/minidlna-dastereo/main/service.tidal.tar.gz
tar -zxf service.tidal.tar.gz --overwrite -C /
wget https://raw.githubusercontent.com/lovehifi/minidlna-dastereo/main/mpdcheck.tar.gz
tar -zxf mpdcheck.tar.gz --overwrite -C /

Như vậy với chú này có thể Add NAS/USB, sau đó add đường dẫn vào Asset hoặc MiniDLNA chứa database nhạc, play sang AP hay MPD. Đủ bộ ăn chơi Online/Offline.

2021-04-14-17_10_42-RPi3.png
 
Chỉnh sửa lần cuối:
Nhờ anh em tư vấn hộ nguồn linear cho pi 4, mình dùng 2 con chạy Fontend - backend. Sau khi chọn lựa vừa túi tiền mình đang nghía một số cái sau
1.//
hinh1.md.jpg


https://www.ebay.com/itm/Hifi-Ultra...198398?hash=item5238ad477e:g:aTkAAOSwHslfDFPq

2.//

hinh-2.md.jpg


https://www.ebay.com/itm/50VA-HIFI-...483418?hash=item25fd7af3da:g:1hkAAOSwAV5bZS4s

3.//

hinh3f7bf1f054534da34.md.jpg


https://www.ebay.com/itm/LT3042-Ult...601811?hash=item1ed214de13:g:xqMAAOSwWZpZ7q7q

4.///

hinh4.md.jpg


https://www.ebay.com/itm/LT1963-LT3...704363?hash=item48d6948aab:g:sucAAOSw3vpdxZf8

Chân thành cảm ơn.
 
Chỉnh sửa lần cuối:

quatmo

Well-Known Member
Giá ebay cao, bác tham khảo taobao.

Ví dụ bo số 3, ebay 23 đồng, taobao cũng bo này 14 đồng.
Cũng trong link này, mình đang dùng cái có hộp/bo xanh liền biến áp đúc (hình dưới cùng). Chạy rất ngon với Pi2/3 (đo đồng hồ biểu đồ điện áp ổn định/thẳng tắp, chạy Pi 4 + HAT DAC khá nóng.

Mấy cái bác đưa ra coi qua 1A - 1.5A e là không đủ tải cho Pi 4 nếu có thêm HAT DAC.
 

quatmo

Well-Known Member
Em build librespot hơn 4 tiếng trên pi2. Nhưng vẫn không chạy được với smpd 0.9.6 alsa. Chưa nói gì tới aplay-rt.

Buồn quá em mò lại đống đồ cổ, may quá thấy bản smpd 0.6GA đã có sẵn librespot output pipe aplay-rt.

Test thử SC chạy luôn, không cần phải khai báo user password.

SC out ra pipe aplay-rt tiếng hay hết hồn các anh ạ. Anh nào muốn test smpd 0.6GA vui lòng PM cho em để em gửi link. Ông dev không muốn public mấy cái này.

Mã:
pi@smpd:~ $ uname -a
Linux smpd 4.14.52-smpd #41 SMP PREEMPT Thu Aug 16 07:48:07 JST 2018 armv7l GNU/Linux

pi@smpd:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

spotify-connect.service

Mã:
[Unit]
Description=Spotify Connect
After=network-online.target

[Service]
Type=idle

ExecStart=/usr/local/bin/librespot --name symphonic-mpd --initial-volume 100 --onevent /home/pi/configs/spotify_event.sh --cache /run --bitrate 320 --zeroconf-port 4000 --backend pipe --device /run/pipeout  &

Restart=always
RestartSec=10
StartLimitInterval=30
StartLimitBurst=20

LimitRTPRIO=99
LimitMEMLOCK=infinity
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=99
CPUAffinity=2

# none, realtime, best-effort, idle
IOSchedulingClass=realtime

# 0(highest) - 7(lowest)
IOSchedulingPriority=0

[Install]
WantedBy=multi-user.target

pipe.service

Mã:
[Unit]
Description=symphonic-mpd pipe service
Wants=network-online.target
After=sound.target
After=network.target network-online.target

[Service]
Type=simple
#PIDFile=/run/pipe.pid
LimitRTPRIO=99
LimitMEMLOCK=infinity
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=99
CPUAffinity=1
KillMode=mixed
KillSignal=SIGHUP
User=root
Group=root

# none, realtime, best-effort, idle
IOSchedulingClass=realtime

# 0(highest) - 7(lowest)
IOSchedulingPriority=0

#ExecStartPre=/home/pi/configs/pipe.sh pre
ExecStart=/home/pi/configs/pipe.sh exec
#ExecStartPost=/home/pi/configs/pipe.sh post

Restart=always
StartLimitInterval=5

[Install]
WantedBy=multi-user.target

pipe.sh

Mã:
#!/bin/bash

device="hw:0,0" # default

# for Sabreberry32 (DAC MASTER)
if [ $(aplay -l|grep "SabreBerry32 DAC sabre9018q2c"|wc -l) = 1 ];then
  device="APLAY_S32_LE"
fi

#prealloc=512
prealloc=1024
period_time=5772
buffer_time=1486940

pipeout=/run/pipeout
pcminfo=/run/pcminfo

timer_calibration="/home/pi/configs/timer_calibration.sh"
opt_aplay="--device=${device} -q -M -F ${period_time} -B ${buffer_time} -p ${pcminfo}"

case "$1" in
  exec)
  if [ ! -e $pipeout ]; then
  mkfifo --mode=666 $pipeout
  fi
  if [ ! -e $pcminfo ]; then
  touch $pcminfo
  chmod 666 $pcminfo
  echo "S16_LE 44100 2" > $pcminfo
  fi

  echo $prealloc > /proc/asound/card0/pcm0p/sub0/prealloc
  $timer_calibration
  exec /usr/local/bin/aplay-rt $opt_aplay $pipeout
  ;;
esac
Em add TC vào bản này không được, lỗi gì đó mà không nhận ra DAC.

Khi đang nghe album này mà chuyển album khác nó tự mất kết nối Pi, phải tắt bật lại. Máy khác không biết có bị vậy hay không?

Nghe Spotify Connect hay lắm!
 
Chỉnh sửa lần cuối:
Bên trên