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

do_long_khach

Well-Known Member
Ôi trời, bác nói mình mới biết cái vụ Ngan Pham này, mình không hề khoe nó lên Roon forum, mình biết thông qua một bạn Tây khác đưa cho @spockfish (RoPieee) xem link 2 tuần trước.



Vụ bản quyền, ở đây là chỉ hướng dẫn tích hợp vào Ropi nên nó hoàn toàn hợp pháp cho cá nhân (người tự tích hợp). Nó được tách ra từ nhà SX, đúng vậy, nhưng no trademark.

Mình xóa Github đó rồi các bác.
Settup lại Ropi rất lâu, tốn time. Vậy nên em làm đồ chơi này cho tiện dùng.

Anh Phước và các bác trữ đồ chơi này về, muốn xài cái nào thì copy file bên trong vào /root rồi chạy dòng lệnh ghi trong đó (bỏ qua các dòng wget ... và dòng có dấu#). https://drive.google.com/file/d/1mTUhwlhEvDd11dgLduti5oCUcravwg7A/view?usp=sharing

Gồm có TC, Aprenderer, Asset, BubbleUpnp, MiniDLNA.
Bản TC này có chỉnh tách thư viện để tránh bị tình trạng update mất UPnP như anh Phước.

Làm 1 bản Ropi update full, rồi ghi ra IMG lưu backup. Sau đó cài các thứ trên sau.

Update#1: Phần bung Java đề chạy BubbleUpnp, cần có lệnh tạo folder trước khi bung java.
mkdir /opt/jvm
Bác cho xin Access của GG drive với.
 

rndce

Well-Known Member
@TuanQuynhAudio , @quatmo

OS này khá chuyên nghiệp, có cách nào mod add thêm card vào không chứ nó support hàng hãng thôi.
https://support.hifiberry.com/hc/en...output-from-HiFiBerryOS-to-non-HiFiBerry-DACs
Can I use HiFiBerryOS to simply output an I2S signal through the relevant pins? Will it work if it doesn't detect a HiFiBerry DAC HAT?

HiFiBerry team February 18, 2021 15:06
No, you need a HiFiBerry board.
Ko biết mấy cái bo Pifi nó có hỗ trợ ko, mấy bo này dùng driver của Hifiberry.
 

binna

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. Chẳng hiểu sao nữa.

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

#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.
Tin vui cuối tuần... có phiên bản cho Pi4
 

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.
Duong nhu con thieu mon upmdpcli Upnp phai ko bac quatmo.
 

binna

Well-Known Member
Settup lại Ropi rất lâu, tốn time. Vậy nên em làm đồ chơi này cho tiện dùng.

Anh Phước và các bác trữ đồ chơi này về, muốn xài cái nào thì copy file bên trong vào /root rồi chạy dòng lệnh ghi trong đó (bỏ qua các dòng wget ... và dòng có dấu#). https://drive.google.com/file/d/1mTUhwlhEvDd11dgLduti5oCUcravwg7A/view?usp=sharing

Gồm có TC, Aprenderer, Asset, BubbleUpnp, MiniDLNA.
Bản TC này có chỉnh tách thư viện để tránh bị tình trạng update mất UPnP như anh Phước.

Làm 1 bản Ropi update full, rồi ghi ra IMG lưu backup. Sau đó cài các thứ trên sau.

Update#1: Phần bung Java đề chạy BubbleUpnp, cần có lệnh tạo folder trước khi bung java.
mkdir /opt/jvm
sao em down cái file share này được không được bác @quatmo ui
 

rndce

Well-Known Member
@quatmo
Nhờ bác bắt bệnh giúp, mình dùng RopieeeXL trên Pi4,
dùng câu sau trong /etc/fstab để mount NAS:
Mã:
//192.168.100.14/Lossless /mnt/NAS cifs _netdev,username=admin,password=123456,vers=1.0,uid=1000,gid=1000,sec=ntlm,auto,x-systemd.automount,iocharset=utf8 0 0
//192.168.100.14/Torrents /mnt/Torrents cifs _netdev,username=admin,password=123456,vers=1.0,uid=1000,gid=1000,sec=ntlm,auto,x-systemd.automount,iocharset=utf8 0 0
Không hiểu sao cách này ko tự động mount NAS mỗi lân khởi động RopieeeXL, muốn mount NAS phải SSH vào terminal và gõ thêm câu: mount -av thì lúc đó nó mói mount NAS được.
Mình ko biết sửa bằng cách nào để auto mount NAS mỗi khi khởi động RopieeeXL.
 
Chỉnh sửa lần cuối:

chautranthanh

Well-Known Member
1FC7E4DF-1034-479D-89F0-BA8D772662BB.jpg

Cấp nguồn cho adapter lightning to hdmi bằng em này nghe thua cả Bluetooth !
 

ac_vna

Active Member
Settup lại Ropi rất lâu, tốn time. Vậy nên em làm đồ chơi này cho tiện dùng.

Anh Phước và các bác trữ đồ chơi này về, muốn xài cái nào thì copy file bên trong vào /root rồi chạy dòng lệnh ghi trong đó (bỏ qua các dòng wget ... và dòng có dấu#). https://drive.google.com/file/d/1mTUhwlhEvDd11dgLduti5oCUcravwg7A/view?usp=sharing

Gồm có TC, Aprenderer, Asset, BubbleUpnp, MiniDLNA.
Bản TC này có chỉnh tách thư viện để tránh bị tình trạng update mất UPnP như anh Phước.

Làm 1 bản Ropi update full, rồi ghi ra IMG lưu backup. Sau đó cài các thứ trên sau.

Update#1: Phần bung Java đề chạy BubbleUpnp, cần có lệnh tạo folder trước khi bung java.
mkdir /opt/jvm
em chào bác ạ, em muốn vào download mà ko được ạ, bác xem giúp em ạ. thanks bác ạ.
 

TuanQuynhAudio

Well-Known Member
Hi anh @TuanQuynhAudio @quatmo và cả nhà.

Vậy anh em mình sẽ tìm hiểu thêm về aplay-rt / rtalsa / xsink để áp dụng vào MPD và các loại renderer khác ạ o_O

Trong smpd 0.96 đường đi của output em thấy như sau:

asound.conf:

Mã:
pcm.!default{
  type plug
  slave.pcm{
   @func getenv
   vars [ DEFAULT_SAMPLE_FORMAT ]
   default "PIPE"
  }
}

pcm.S16{
  type plug
  slave{
   pcm "PIPE"
  }
}

pcm.S24{
  type plug
  slave{
   pcm "PIPE"
   format S24
  }
}

pcm.S32{
  type plug
  slave{
   pcm "PIPE"
   format S32
  }
}

pcm.PIPE{
  type file
  slave.pcm null
  file "|exec /home/pi/misc/pcminfo.sh %f %r %c DEFAULT"
  format raw
}

mpd.conf:

Mã:
audio_output {
   dop "yes"
   type "pipe"
   name "pipe"
   command "exec /home/pi/misc/pcminfo.sh"

pcminfo.sh:

Mã:
#!/bin/sh

sync

pcminfo=/run/pcminfo
pipeout=/dev/xsink
APP=MPD

if [ ! "$4" = "" ];then
  APP=$4
fi

if [ ! "`cat $pcminfo`" = "$1 $2 $3 $APP" ];then
  echo "$1 $2 $3 $APP"> $pcminfo
  sudo systemctl restart pipe
fi

exec cat - > $pipeout

exit

pipe.service:

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

[Service]
EnvironmentFile=/etc/environment
Type=simple
CPUAffinity=1
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=99
LimitRTPRIO=99
LimitMEMLOCK=infinity
StartLimitBurst=0
User=root
Group=root

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

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

ExecStart=/home/pi/configs/pipe.sh exec

Restart=always
StartLimitInterval=5

[Install]
WantedBy=multi-user.target

pipe.sh:

Mã:
#!/bin/bash

device="hw:0,0"
pcminfo=/run/pcminfo

opt_aplay="--device=${device} -i ${pcminfo}"

case "$1" in
  exec)
  if [ ! -e $pcminfo ]; then
  touch $pcminfo
  chmod 666 $pcminfo
  echo "$DEFAULT_SAMPLE_FORMAT 44100 2 DEFAULT" > $pcminfo
  fi

  read format rate ch < $pcminfo
  gravity='$GRAVITY_'$rate
  eval echo "$gravity" > /proc/xenomai/clock/coreclk
  exec /usr/local/bin/aplay-rt $opt_aplay
  ;;
esac
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:
 

quatmo

Well-Known Member
Settup lại Ropi rất lâu, tốn time. Vậy nên em làm đồ chơi này cho tiện dùng.
Gồm có TC, Aprenderer, Asset, BubbleUpnp, MiniDLNA.
...
Update#1: Phần cài bung Java đề chạy BubbleUpnp, cần có lệnh tạo folder trước khi bung java.
Mã:
mkdir /opt/jvm

Update#2: Trong file aprenderer.service cần thêm dòng này vào để restart lại nó không bị stop.
Mã:
ExecStartPre=/bin/sleep 30

Update#1: Phần cài bung Java đề chạy BubbleUpnp, cần có lệnh tạo folder trước khi bung java.
Mã:
mkdir /opt/jvm

Update#2: Trong file aprenderer.service cần thêm dòng này vào để restart lại nó không bị stop.
Mã:
ExecStartPre=/bin/sleep 30

Phần mount NAS, tối mình thử mount xem.
 

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
 
Bên trên