linh0983
Well-Known Member
Quán cafe ChaPi bác @Thanhvo31 mở nhạc này cho khách nghe là tuyệt . Từ hôm đến giờ mình nghe nó miết a ko chán bác a hihi .Nghe là mê ngay a .
![]()
Quán cafe ChaPi bác @Thanhvo31 mở nhạc này cho khách nghe là tuyệt . Từ hôm đến giờ mình nghe nó miết a ko chán bác a hihi .Nghe là mê ngay a .
![]()
RoPieeeXL Pi 4 - ropi4.local
https://drive.google.com/file/d/1RSAWN4Jc4r4zk0o90UD8lhUlYccqBGMb/view?usp=sharing
- Tích hợp MinimServer
- Tích hợp mount 28k track (Cloud)
- Tích hơp Linux-Audio-Adjustments
----MinimServer đã scan-----------
Folder: /mnt/MUSIC/SELECTED
Cài MinimWatch vào Windows/MAC để add thêm các folder chứa nhạc sau, các bác add hết scan liên tục tầm 18h, add ít scan cho nhanh.
Chỉ muốn scan NAS local thì không cần add vô MinimWatch.
Lưu ý: add thêm folder vào, MinimWatch bấm ReStart để update, không bấm Rescan.
--- chưa scan--------------------
/mnt/MUSIC/DEEZER1
/mnt/MUSIC/DEEZER2
/mnt/MUSIC/DEEZER3
/mnt/MUSIC/TIDAL1
/mnt/MUSIC/TIDAL2
/mnt/MUSIC/TIDAL3
MinimServer lấy nhạc từ Cloud truyền đến RoPi, 2 trong 1 thiết bị, phone dùng BubbleUPnP điều khiển play, tắt wifi phone nó vẫn play hết list tiếp. Chạy nhẹ nhàng, CPU là 46 độ.
RoPieeeXL Pi 3 - ropi.local
https://drive.google.com/file/d/1W_Rt5EXUtM----MsctV9odiR5Bo4Bqku/view?usp=sharing
- MinimServer đã scan mớ folder trên
- Mình không nhớ scan xong chưa, nếu chưa xong thì icon MinimWatch sẽ hiện màu vàng, khi nào chuyển sang xanh các thiết bị khác mới nhìn thấy/play được.
Anh @mtminh, @linh0983, @quatmo, @TuanQuynhAudio, @Thanhvo31 ... và cả nhà..... Giờ đang test so sánh music server chạy trên ropiee, smpd, dietpi, raspbian_stretch9_xenomai3.0.8 theo chân anh Hải và anh quatmo mà tai loạn cào cào lên rồi.
#!/bin/bash
#####################################
# sysinfo v3
#####################################
# cpustatus
#
# Prints the current state of the CPU like temperature, voltage and speed.
# The temperature is reported in degrees Celsius (C) while
# the CPU speed is calculated in megahertz (MHz).
function convert_to_MHz {
let value=$1/1000
echo "$value"
}
function calculate_overvolts {
# We can safely ignore the integer
# part of the decimal argument
# since it's not realistic to run the Pi
# at voltages higher than 1.99 V
let overvolts=${1#*.}-20
echo "$overvolts"
}
temp=$(/opt/vc/bin/vcgencmd measure_temp)
temp=${temp:5:4}
volts=$(/opt/vc/bin/vcgencmd measure_volts)
volts=${volts:5:4}
if [ $volts != "1.20" ]; then
overvolts=$(calculate_overvolts $volts)
fi
freq=$(vcgencmd measure_clock arm)
freq=${freq:14:6}
freq=$(convert_to_MHz $freq)
rfreq=$(/opt/vc/bin/vcgencmd get_config int | grep -E "(sdram_freq)")
rfreq=${rfreq:11:3}
tv=$(/opt/vc/bin/tvservice -s)
tv=${tv:16:9}
#governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
echo "-- System info --"
system=$(uname -snrm)
printf "$system\n"
model=$(tr -d '\0' < /proc/device-tree/model)
printf "$model\n"
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "IP: %s\n" "$_IP"
fi
echo ""
echo "-- CPU info --"
echo "Temperature: $temp C"
echo -n "Voltage: $volts V"
[ $overvolts ] && echo " (+0.$overvolts overvolt)" || echo -e "\r"
echo "Current CPU: $freq MHz"
echo "Current SDRAM: $rfreq MHz"
echo ""
#echo "Governor: $governor"
echo "-- More info --"
echo "HDMI Status: $tv"
echo ""
# for mem in gpu arm ; do echo -e "$mem:\t$(/opt/vc/bin/vcgencmd get_mem $mem)" ; done
/opt/vc/bin/vcgencmd get_mem gpu
/opt/vc/bin/vcgencmd get_mem arm
echo ""
for id in sdram_c sdram_i sdram_p ; do echo -e "$id: $(/opt/vc/bin/vcgencmd measure_volts $id)" ; done
echo ""
for id in core h264 isp v3d ; do echo -e "$id:\t$(/opt/vc/bin/vcgencmd measure_clock $id)" ; done
echo ""
for id in uart pwm emmc pixel vec hdmi dpi ; do echo -e "$id:\t$(/opt/vc/bin/vcgencmd measure_clock $id)" ; done
echo ""
echo "-- System Latency --"
cat /sys/block/mmcblk0/queue/scheduler; cat /proc/sys/vm/swappiness; cat /proc/sys/kernel/sched_latency_ns; cat /proc/sys/kernel/sched_rt_period_us; cat /proc/sys/kernel/sched_rt_runtime_us; cat /proc/sys/kernel/sched_autogroup_enabled; cat /proc/sys/kernel/sched_rr_timeslice_ms; cat /proc/sys/kernel/sched_min_granularity_ns; cat /proc/sys/kernel/sched_wakeup_granularity_ns
echo ""
echo "-- Network Buffers Size --"
for nmem in rmem_max wmem_max ; do echo -e "$nmem:\t$(cat /proc/sys/net/core/$nmem)" ; done
exit 0
#!/bin/bash
echo ""
echo "-- Services Enabled --"
echo ""
systemctl list-unit-files --state=enabled
echo ""
echo "-- Services Running --"
echo ""
systemctl list-units --all --state=running
echo ""
exit
@tml3nr: Thằng SMPD cũng dùng xenomai trên bản Raspbian đó. Smpd thì chỉ có tập trung mpd, airplay và lược hết tất cả những thứ không cần thiết. Để kết hợp All-In-one vẫn phải đánh đổi chất lượng âm thanh.
Mình làm sẵn các service nhưng chỉ start những cái nào đang dùng thôi ạ. Nếu như không học được theo cách tắt tự động như smpd thì mình làm nút tắt trên giao diện web cũng được.@tml3nr: Thằng SMPD cũng dùng xenomai trên bản Raspbian đó. Smpd thì chỉ có tập trung mpd, airplay và lược hết tất cả những thứ không cần thiết. Để kết hợp All-In-one vẫn phải đánh đổi chất lượng âm thanh.
Với em rune của ngày xưa vẫn là huyền thoại anh ạ. Họ cầu toàn và chăm chút đến cực đoan ở tất cả các mặt.@tml3nr
Mời bác và anh em bình tiếp cho một OS END GAME
![]()
https://docs.google.com/spreadsheets/d/10HOD4nW27joehj6TbJMx4nJWK3KSaufY0jweKsbFfVo/edit?usp=sharing
#!/bin/bash
#
# Copyright (C) 2013-2014 RuneAudio Team
# http://www.runeaudio.com
#
# RuneUI
# copyright (C) 2013-2014 - Andrea Coiutti (aka ACX) & Simone De Gregori (aka Orion)
#
# RuneOS
# copyright (C) 2013-2014 - Carmelo San Giovanni (aka Um3ggh1U) & Simone De Gregori (aka Orion)
#
# RuneAudio website and logo
# copyright (C) 2013-2014 - ACX webdesign (Andrea Coiutti)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with RuneAudio; see the file COPYING. If not, see
# <http://www.gnu.org/licenses/gpl-3.0.txt>.
#
# file: command/orion_optimize.sh
# version: 1.2
#
#
#####################################
# Orion RuneAudio Optimize script v1.0 #
######################################
ver="1.0"
####################
# common functions #
####################
mpdprio_nice () {
count=1
for pid in $(pgrep -w mpd);
do
if ((count == 3))
then
echo "### Set priority for: mpd-player thread ###";
renice -15 $pid;
fi
if ((count == 4))
then
echo "### Set priority for: mpd-output thread ###";
renice -20 $pid;
fi
if ((count == 5))
then
echo "### Set priority for: mpd-decoder thread ###";
renice -18 $pid;
fi
count=$((count+1))
done
}
mpdprio_default () {
count=1
for pid in $(pgrep -w mpd);
do
if ((count == 3))
then
echo "### Set priority for: mpd-player thread ###";
renice 20 $pid;
fi
if ((count == 4))
then
echo "### Set priority for: mpd-output thread ###";
renice 20 $pid;
fi
if ((count == 5))
then
echo "### Set priority for: mpd-decoder thread ###";
renice 20 $pid;
fi
count=$((count+1))
done
}
# set cifsd priority
cifsprio () {
local "${@}"
if (( -n ${pid}))
then
echo "### Set priority for: cifsd ###"
renice ${prio} ${pid}
fi
}
# adjust Kernel scheduler latency based on Architecture
modKschedLatency () {
local "${@}"
# RaspberryPi
if ((${hw} == "01"))
then
echo ${s01} > /proc/sys/kernel/sched_latency_ns
echo "sched_latency_ns = "${s01}
sndusb_profile nrpacks=${u01}
echo "USB nrpacks="${u01}
echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
fi
# CuBox
if ((${hw} == "02"))
then
echo ${s02} > /proc/sys/kernel/sched_latency_ns
echo "sched_latency_ns = "${s02}
sndusb_profile nrpacks=${u02}
echo "USB nrpacks="${u02}
fi
# UDOO
if ((${hw} == "03"))
then
echo ${s03} > /proc/sys/kernel/sched_latency_ns
echo "sched_latency_ns = "${s03}
sndusb_profile nrpacks=${u03}
echo "USB nrpacks="${u03}
fi
# BeagleBoneBlack
if ((${hw} == "04"))
then
echo ${s04} > /proc/sys/kernel/sched_latency_ns
echo "sched_latency_ns = "${s04}
sndusb_profile nrpacks=${u04}
echo "USB nrpacks="${u04}
fi
}
sndusb_profile() {
local "${@}"
mpc pause > /dev/null 2>&1
sleep 0.3
modprobe -r snd-usb-audio
echo "options snd-usb-audio nrpacks=${nrpacks}" > /etc/modprobe.d/modprobe.conf
modprobe snd-usb-audio
sleep 0.5
mpc play > /dev/null 2>&1
mpc pause > /dev/null 2>&1
mpc play > /dev/null 2>&1
}
##################
# common startup #
##################
#if [ "$PID" != null ]; then
#echo "Set priority for: cifsd"
#renice -20 $PID
#fi
cifsprio pid=$(pidof cifsd)
echo "Set normal priority for: rune_SY_wrk.php"
renice 20 $(pgrep rune_SY_wrk.php)
echo "Set normal priority for: smbd"
renice 19 $(pidof smbd)
echo "Set normal priority for: nmbd"
renice 19 $(pidof nmbd)
##################
# sound profiles #
##################
# default
if [ "$1" == "default" ]; then
ifconfig eth0 mtu 1500
ifconfig eth0 txqueuelen 1000
echo 60 > /proc/sys/vm/swappiness
modKschedLatency hw=$2 s01=6000000 s02=6000000 s03=6000000 s04=6000000 u01=8 u02=8 u03=8 u04=8
mpdprio_defalut
echo "flush DEFAULT sound profile"
fi
# default
if [ "$1" == "RuneAudio" ]; then
ifconfig eth0 mtu 1500
ifconfig eth0 txqueuelen 1000
echo 0 > /proc/sys/vm/swappiness
modKschedLatency hw=$2 s01=1500000 s02=4500000 s03=4500000 s04=4500000 u01=3 u02=3 u03=3 u04=3
mpdprio_nice
echo "flush MOD1 RuneAudio sound profile"
fi
# mod1
if [ "$1" == "ACX" ]; then
ifconfig eth0 mtu 1500
ifconfig eth0 txqueuelen 4000
echo 0 > /proc/sys/vm/swappiness
modKschedLatency hw=$2 s01=850000 s02=3500075 s03=3500075 s04=3500075 u01=2 u02=2 u03=2 u04=2
mpdprio_default
echo "flush MOD2 (ACX)"
fi
# mod2
if [ "$1" == "Orion" ]; then
ifconfig eth0 mtu 1000
echo 20 > /proc/sys/vm/swappiness
modKschedLatency hw=$2 s01=500000 s02=500000 s03=500000 s04=1000000 u01=1 u02=1 u03=1 u04=1
sleep 2
mpdprio_default
echo "flush MOD3 (Orion)"
fi
# mod3
if [ "$1" == "OrionV2" ]; then
ifconfig eth0 mtu 1000
ifconfig eth0 txqueuelen 4000
echo 0 > /proc/sys/vm/swappiness
modKschedLatency hw=$2 s01=120000 s02=2000000 s03=2000000 s04=2000000 u01=2 u02=2 u03=2 u04=2
sleep 2
mpdprio_nice
echo "flush MOD4 (OrionV2)"
fi
# mod4
if [ "$1" == "Um3ggh1U" ]; then
ifconfig eth0 mtu 1500
ifconfig eth0 txqueuelen 1000
echo 0 > /proc/sys/vm/swappiness
modKschedLatency hw=$2 s01=500000 s02=3700000 s03=3700000 s04=3700000 u01=3 u02=3 u03=3 u04=3
mpdprio_default
echo "flush MOD5 (Um3ggh1U) sound profile "
fi
# dev
if [ "$1" == "dev" ]; then
echo "flush DEV sound profile 'fake'"
fi
if [ "$1" == "" ]; then
echo "Orion Optimize Script v$ver"
echo "Usage: $0 {default|RuneAudio|ACX|Orion|OrionV2|Um3ggh1U} {architectureID}"
exit 1
fi
Bản 0.9.6 ông papalius xác nhận là nền raspbian anh ạ. Bản 1.0.x mới built từ Linux From Scratch.Nó dùng Linux From Scratch bác ạ
Lại có bản 1.0.5
symphonic-mpd RPi4 Edition (64bit)
Download v1.0.4 Image ZIP (277MB)![]()
SD image for Raspberry Pi 4.
Please be careful about the voltage drop when diverting the power supply of Pi3.
symphonic-mpd RPi3 Edition (32bit)
- Version: 1.0.5
- Release date: 2020-06-26 (Online update is now available)
- Kernel version: 4.19.86 SMP PREEMPT (Xenomai 3.1.0)
- SHA1: 4905AA658DCCB7E698A091E943C0CDEC8A31CD06
Download v0.9.6 Image ZIP (293MB)・・・Installation procedure![]()
- Version: 0.9.6
- Release date: 2020-03-01
- Kernel version: 4.14.52 SMP PREEMPT (Xenomai 3.0.7)
- SHA1: 1C1E67ADD984892D34632B10E654796A2A965236
papalius đã viết:Hi chauphuong,
v0.9.6(RPi3) is based on Raspbian.
Try apt-get to install upnpdcli.
I don't know if any additional configuration is needed or not.
If it doesn't work, ask again.
I'll try to find out if any members are using UPnP with v0.9.6 (RPi3).
Anh @mtminh, @linh0983, @quatmo, @TuanQuynhAudio, @Thanhvo31 ... và cả nhà.
Em test sơ qua thấy bản raspbian_stretch9_xenomai3.0.8 này cực kỳ hấp dẫn. Latency thấp hơn bản smpd 0.9.6 và audio-linux rất nhiều.
Từ khi em dùng nó chạy upnp server âm thanh hay hơn nghe tidal online Chromecast. Âm thanh nhẹ nhàng và rất tinh tế .
Em nghĩ là bản này rất thích hợp để làm một OS all-in-one. Nó gốc raspbian nên mình dễ thêm thắt các thứ.
Giao diện web thì mình bám theo mympd là tốt đời đẹp đạo. Nếu cần thì thêm một tab cho các settings. Cái này anh @quatmo lo dư sức
Check sau khi dọn dẹp sơ bộ OS và tắt bớt một số services:
![]()
Check service status:
![]()
htop mod:
![]()
Latency test:
Mã:pi@raspberrypi:~ $ sudo cyclictest -l 10000 -m -Sp98 -i100 -d0 # /dev/cpu_dma_latency set to 0us policy: fifo: loadavg: 0.08 0.03 0.01 2/124 649 T: 0 ( 645) P:98 I:100 C: 9788 Min: 23 Act: 49 Avg: 53 Max: 421 T: 1 ( 646) P:98 I:100 C: 10000 Min: 24 Act: 41 Avg: 49 Max: 294 T: 2 ( 647) P:98 I:100 C: 9778 Min: 34 Act: 42 Avg: 41 Max: 172 T: 3 ( 648) P:98 I:100 C: 8920 Min: 22 Act: 49 Avg: 52 Max: 267
Em dựa trên ý tưởng của anh @mtminh, và cóp nhặt thêm một số script trên web để làm ra vài cái file để check thông số. Em xin up lên cho các anh góp ý và sử dụng.
Mình chỉ cần tạo file trong /usr/bin/ rồi set 755 là chạy được.
/urs/bin/sysinfo
Mã:#!/bin/bash # cpustatus # # Prints the current state of the CPU like temperature, voltage and speed. # The temperature is reported in degrees Celsius (C) while # the CPU speed is calculated in megahertz (MHz). function convert_to_MHz { let value=$1/1000 echo "$value" } function calculate_overvolts { # We can safely ignore the integer # part of the decimal argument # since it's not realistic to run the Pi # at voltages higher than 1.99 V let overvolts=${1#*.}-20 echo "$overvolts" } temp=$(/opt/vc/bin/vcgencmd measure_temp) temp=${temp:5:4} volts=$(/opt/vc/bin/vcgencmd measure_volts) volts=${volts:5:4} if [ $volts != "1.20" ]; then overvolts=$(calculate_overvolts $volts) fi freq=$(vcgencmd measure_clock arm) freq=${freq:14:6} freq=$(convert_to_MHz $freq) #governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) echo "-- System info --" system=$(uname -snrm) printf "$system\n" model=$(tr -d '\0' < /proc/device-tree/model) printf "$model\n" _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "IP: %s\n" "$_IP" fi echo "" echo "-- CPU info --" echo "Temperature: $temp C" echo -n "Voltage: $volts V" [ $overvolts ] && echo " (+0.$overvolts overvolt)" || echo -e "\r" echo "Current CPU: $freq MHz" #echo "Governor: $governor" echo "" echo "-- More info --" /opt/vc/bin/vcgencmd get_mem gpu /opt/vc/bin/vcgencmd get_mem arm /opt/vc/bin/vcgencmd get_config int | grep -E "(sdram_freq)" echo "" for id in sdram_c sdram_i sdram_p ; do echo -e "$id: $(/opt/vc/bin/vcgencmd measure_volts $id)" ; done echo "" for id in core h264 isp v3d ; do echo -e "$id:\t$(/opt/vc/bin/vcgencmd measure_clock $id)" ; done echo "" for id in uart pwm emmc pixel vec hdmi dpi ; do echo -e "$id:\t$(/opt/vc/bin/vcgencmd measure_clock $id)" ; done echo "" /opt/vc/bin/tvservice -s ; echo cat /sys/block/mmcblk0/queue/scheduler; cat /proc/sys/vm/swappiness; cat /proc/sys/kernel/sched_latency_ns; cat /proc/sys/kernel/sched_rt_period_us; cat /proc/sys/kernel/sched_rt_runtime_us; cat /proc/sys/kernel/sched_autogroup_enabled; cat /proc/sys/kernel/sched_rr_timeslice_ms; cat /proc/sys/kernel/sched_min_granularity_ns; cat /proc/sys/kernel/sched_wakeup_granularity_ns exit 0
/urs/bin/sstatus
Mã:#!/bin/bash echo "" echo "-- List Unit Files --" echo "" systemctl list-unit-files --state=enabled echo "" echo "-- Service Running --" echo "" systemctl list-units --all --state=running echo "" exit
Trong rclone có setting phần mount team drive, là nó. Mai mình test thử bác.
Với em rune của ngày xưa vẫn là huyền thoại anh ạ. Họ cầu toàn và chăm chút đến cực đoan ở tất cả các mặt.
File orion_optimize.sh là đỉnh cao của sự tinh tế trong setup.
Đa phần các ông dev thật ra không nghe kỹ lắm về âm thanh. Như ông dynobot lẫy lừng hay ông janui thâm sâu, khi em nói đến việc tắt bớt service cho tiếng hay hơn. Mấy ổng không tin
Nhờ anh @mtminh và anh @TuanQuynhAudio khai sáng. Em hiểu được 99% ý nghĩa file này, và gần như nắm được hết các cách optimize âm thanh trong các OS cho pi từ trước đến nay. Nhưng áp dụng vào một OS cụ thể như thế nào cho hợp lý là một việc rất khó, vì phải nghe ra được tác động và sự kết hợp của những settings.
Chỉ có anh @mtminh là có khả năng nghe ra và định được hướng đi
orion_optimize.sh
Mã:#!/bin/bash # # Copyright (C) 2013-2014 RuneAudio Team # http://www.runeaudio.com # # RuneUI # copyright (C) 2013-2014 - Andrea Coiutti (aka ACX) & Simone De Gregori (aka Orion) # # RuneOS # copyright (C) 2013-2014 - Carmelo San Giovanni (aka Um3ggh1U) & Simone De Gregori (aka Orion) # # RuneAudio website and logo # copyright (C) 2013-2014 - ACX webdesign (Andrea Coiutti) # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This Program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with RuneAudio; see the file COPYING. If not, see # <http://www.gnu.org/licenses/gpl-3.0.txt>. # # file: command/orion_optimize.sh # version: 1.2 # # ##################################### # Orion RuneAudio Optimize script v1.0 # ###################################### ver="1.0" #################### # common functions # #################### mpdprio_nice () { count=1 for pid in $(pgrep -w mpd); do if ((count == 3)) then echo "### Set priority for: mpd-player thread ###"; renice -15 $pid; fi if ((count == 4)) then echo "### Set priority for: mpd-output thread ###"; renice -20 $pid; fi if ((count == 5)) then echo "### Set priority for: mpd-decoder thread ###"; renice -18 $pid; fi count=$((count+1)) done } mpdprio_default () { count=1 for pid in $(pgrep -w mpd); do if ((count == 3)) then echo "### Set priority for: mpd-player thread ###"; renice 20 $pid; fi if ((count == 4)) then echo "### Set priority for: mpd-output thread ###"; renice 20 $pid; fi if ((count == 5)) then echo "### Set priority for: mpd-decoder thread ###"; renice 20 $pid; fi count=$((count+1)) done } # set cifsd priority cifsprio () { local "${@}" if (( -n ${pid})) then echo "### Set priority for: cifsd ###" renice ${prio} ${pid} fi } # adjust Kernel scheduler latency based on Architecture modKschedLatency () { local "${@}" # RaspberryPi if ((${hw} == "01")) then echo ${s01} > /proc/sys/kernel/sched_latency_ns echo "sched_latency_ns = "${s01} sndusb_profile nrpacks=${u01} echo "USB nrpacks="${u01} echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor fi # CuBox if ((${hw} == "02")) then echo ${s02} > /proc/sys/kernel/sched_latency_ns echo "sched_latency_ns = "${s02} sndusb_profile nrpacks=${u02} echo "USB nrpacks="${u02} fi # UDOO if ((${hw} == "03")) then echo ${s03} > /proc/sys/kernel/sched_latency_ns echo "sched_latency_ns = "${s03} sndusb_profile nrpacks=${u03} echo "USB nrpacks="${u03} fi # BeagleBoneBlack if ((${hw} == "04")) then echo ${s04} > /proc/sys/kernel/sched_latency_ns echo "sched_latency_ns = "${s04} sndusb_profile nrpacks=${u04} echo "USB nrpacks="${u04} fi } sndusb_profile() { local "${@}" mpc pause > /dev/null 2>&1 sleep 0.3 modprobe -r snd-usb-audio echo "options snd-usb-audio nrpacks=${nrpacks}" > /etc/modprobe.d/modprobe.conf modprobe snd-usb-audio sleep 0.5 mpc play > /dev/null 2>&1 mpc pause > /dev/null 2>&1 mpc play > /dev/null 2>&1 } ################## # common startup # ################## #if [ "$PID" != null ]; then #echo "Set priority for: cifsd" #renice -20 $PID #fi cifsprio pid=$(pidof cifsd) echo "Set normal priority for: rune_SY_wrk.php" renice 20 $(pgrep rune_SY_wrk.php) echo "Set normal priority for: smbd" renice 19 $(pidof smbd) echo "Set normal priority for: nmbd" renice 19 $(pidof nmbd) ################## # sound profiles # ################## # default if [ "$1" == "default" ]; then ifconfig eth0 mtu 1500 ifconfig eth0 txqueuelen 1000 echo 60 > /proc/sys/vm/swappiness modKschedLatency hw=$2 s01=6000000 s02=6000000 s03=6000000 s04=6000000 u01=8 u02=8 u03=8 u04=8 mpdprio_defalut echo "flush DEFAULT sound profile" fi # default if [ "$1" == "RuneAudio" ]; then ifconfig eth0 mtu 1500 ifconfig eth0 txqueuelen 1000 echo 0 > /proc/sys/vm/swappiness modKschedLatency hw=$2 s01=1500000 s02=4500000 s03=4500000 s04=4500000 u01=3 u02=3 u03=3 u04=3 mpdprio_nice echo "flush MOD1 RuneAudio sound profile" fi # mod1 if [ "$1" == "ACX" ]; then ifconfig eth0 mtu 1500 ifconfig eth0 txqueuelen 4000 echo 0 > /proc/sys/vm/swappiness modKschedLatency hw=$2 s01=850000 s02=3500075 s03=3500075 s04=3500075 u01=2 u02=2 u03=2 u04=2 mpdprio_default echo "flush MOD2 (ACX)" fi # mod2 if [ "$1" == "Orion" ]; then ifconfig eth0 mtu 1000 echo 20 > /proc/sys/vm/swappiness modKschedLatency hw=$2 s01=500000 s02=500000 s03=500000 s04=1000000 u01=1 u02=1 u03=1 u04=1 sleep 2 mpdprio_default echo "flush MOD3 (Orion)" fi # mod3 if [ "$1" == "OrionV2" ]; then ifconfig eth0 mtu 1000 ifconfig eth0 txqueuelen 4000 echo 0 > /proc/sys/vm/swappiness modKschedLatency hw=$2 s01=120000 s02=2000000 s03=2000000 s04=2000000 u01=2 u02=2 u03=2 u04=2 sleep 2 mpdprio_nice echo "flush MOD4 (OrionV2)" fi # mod4 if [ "$1" == "Um3ggh1U" ]; then ifconfig eth0 mtu 1500 ifconfig eth0 txqueuelen 1000 echo 0 > /proc/sys/vm/swappiness modKschedLatency hw=$2 s01=500000 s02=3700000 s03=3700000 s04=3700000 u01=3 u02=3 u03=3 u04=3 mpdprio_default echo "flush MOD5 (Um3ggh1U) sound profile " fi # dev if [ "$1" == "dev" ]; then echo "flush DEV sound profile 'fake'" fi if [ "$1" == "" ]; then echo "Orion Optimize Script v$ver" echo "Usage: $0 {default|RuneAudio|ACX|Orion|OrionV2|Um3ggh1U} {architectureID}" exit 1 fi
symphonic-mpd
version : smpd pi4 edition v1.0.5
model : Raspberry Pi 4 Model B Rev 1.1
kernel : Linux 4.19.86-v8 #105 SMP PREEMPT Fri Jun 26 15:21:25 JST 2020
temp : 52.4'C
root [ ~ ]# ps -eo pid,ppid,ni,comm
PID PPID NI COMMAND
1 0 0 systemd
2 0 0 kthreadd
3 2 -20 rcu_gp
4 2 -20 rcu_par_gp
5 2 0 kworker/0:0-mm_percpu_wq
6 2 -20 kworker/0:0H
8 2 -20 mm_percpu_wq
9 2 - ksoftirqd/0
10 2 0 rcu_preempt
11 2 0 rcu_sched
12 2 0 rcu_bh
13 2 - migration/0
14 2 - cpuhp/0
15 2 - cpuhp/1
16 2 - migration/1
17 2 0 ksoftirqd/1
18 2 0 kworker/1:0-mm_percpu_wq
19 2 -20 kworker/1:0H
20 2 - cpuhp/2
21 2 - migration/2
22 2 - ksoftirqd/2
23 2 0 kworker/2:0-mm_percpu_wq
24 2 -20 kworker/2:0H
25 2 - cpuhp/3
26 2 - migration/3
27 2 - ksoftirqd/3
30 2 0 kdevtmpfs
31 2 -20 netns
32 2 0 rcu_tasks_kthre
33 2 0 oom_reaper
34 2 -20 writeback
35 2 -20 crypto
36 2 -20 kblockd
37 2 - watchdogd
39 2 0 rtdm_fd
40 2 0 kswapd0
68 2 -20 DWC Notificatio
69 2 -19 vchiq-slot/0
70 2 -19 vchiq-recy/0
71 2 -20 vchiq-sync/0
73 2 - irq/21-brcmstb_
74 2 - irq/22-mmc0
75 2 -20 mmc_complete
76 2 -20 kworker/3:1H-mmc_complete
77 2 0 jbd2/mmcblk0p2-
78 2 -20 ext4-rsv-conver
79 2 0 kworker/0:1-mm_percpu_wq
80 2 0 kworker/1:1-mm_percpu_wq
81 2 0 kworker/2:1-mm_percpu_wq
93 2 -20 kworker/3:2H-mmc_complete
101 1 0 rngd
103 1 0 systemd-journal
122 2 0 kworker/u8:2-events_unbound
136 1 0 systemd-udevd
152 1 0 systemd-network
163 1 0 systemd-timesyn
168 1 0 dbus-daemon
170 1 0 sshd
175 1 0 mpd
177 1 0 upmpdcli
212 1 0 shairport-sync
314 1 0 ympd
331 2 -20 cifsiod
332 2 -20 cifsoplockd
333 2 - cifsd
382 1 - aplay-rt
434 2 0 kworker/3:1-cifsiod
443 175 0 cat
456 2 0 kworker/u8:1-events_unbound
502 2 0 vchiq-keep/0
566 2 0 kworker/3:2-events_power_efficient
570 170 0 sshd
573 570 0 bash
595 573 0 ps
Cá nhân em cho là bỏ luôn phần webui của mpd cũng không có vấn đề gì, vì mình dùng hoàn toàn trên mpd client vẫn tốt.Hấp dẫn bác ơi!
Về MPD mình cho là không làm phần giao diện hiện cover, album... vì chính việc render nhiều hình ảnh, truy xuất nhiều trong database db ra web Ui làm nặng gánh OS, mà render MPD add ít album vào thì không có ý nghĩa, bỏ qua MPD UI là hay nhất, để phần render đó cho thiết bị remote lo.
Nếu được bác test giùm SMPD cho Pi 4, mình rất thắc mắc tại sao họ chuyển đổi nền tảng Linux, và chỉ tập trung làm cho Pi 4, lò mò đọc các blog audio Nhật lại thấy họ khen bản Pi 4 hay hơn Pi 3.Anh @mtminh, @linh0983, @quatmo, @TuanQuynhAudio, @Thanhvo31 ... và cả nhà.
Em test sơ qua thấy bản raspbian_stretch9_xenomai3.0.8 này cực kỳ hấp dẫn. Latency thấp hơn bản smpd 0.9.6 và audio-linux rất nhiều.
Từ khi em dùng nó chạy upnp server âm thanh hay hơn nghe tidal online Chromecast. Âm thanh nhẹ nhàng và rất tinh tế .
Em nghĩ là bản này rất thích hợp để làm một OS all-in-one. Nó gốc raspbian nên mình dễ thêm thắt các thứ.
Giao diện web thì mình bám theo mympd là tốt đời đẹp đạo. Nếu cần thì thêm một tab cho các settings. Cái này anh @quatmo lo dư sức
Check sau khi dọn dẹp sơ bộ OS và tắt bớt một số services:
![]()
Check service status:
![]()
htop mod:
![]()
Latency test:
Mã:pi@raspberrypi:~ $ sudo cyclictest -l 10000 -m -Sp98 -i100 -d0 # /dev/cpu_dma_latency set to 0us policy: fifo: loadavg: 0.08 0.03 0.01 2/124 649 T: 0 ( 645) P:98 I:100 C: 9788 Min: 23 Act: 49 Avg: 53 Max: 421 T: 1 ( 646) P:98 I:100 C: 10000 Min: 24 Act: 41 Avg: 49 Max: 294 T: 2 ( 647) P:98 I:100 C: 9778 Min: 34 Act: 42 Avg: 41 Max: 172 T: 3 ( 648) P:98 I:100 C: 8920 Min: 22 Act: 49 Avg: 52 Max: 267
Em dựa trên ý tưởng của anh @mtminh, và cóp nhặt thêm một số script trên web để làm ra vài cái file để check thông số. Em xin up lên cho các anh góp ý và sử dụng.
Mình chỉ cần tạo file trong /usr/bin/ rồi set 755 là chạy được.
/urs/bin/sysinfo
Mã:#!/bin/bash # cpustatus # # Prints the current state of the CPU like temperature, voltage and speed. # The temperature is reported in degrees Celsius (C) while # the CPU speed is calculated in megahertz (MHz). function convert_to_MHz { let value=$1/1000 echo "$value" } function calculate_overvolts { # We can safely ignore the integer # part of the decimal argument # since it's not realistic to run the Pi # at voltages higher than 1.99 V let overvolts=${1#*.}-20 echo "$overvolts" } temp=$(/opt/vc/bin/vcgencmd measure_temp) temp=${temp:5:4} volts=$(/opt/vc/bin/vcgencmd measure_volts) volts=${volts:5:4} if [ $volts != "1.20" ]; then overvolts=$(calculate_overvolts $volts) fi freq=$(vcgencmd measure_clock arm) freq=${freq:14:6} freq=$(convert_to_MHz $freq) tv=$(/opt/vc/bin/tvservice -s) tv=${tv:16:9} #governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) echo "-- System info --" system=$(uname -snrm) printf "$system\n" model=$(tr -d '\0' < /proc/device-tree/model) printf "$model\n" _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "IP: %s\n" "$_IP" fi echo "" echo "-- CPU info --" echo "Temperature: $temp C" echo -n "Voltage: $volts V" [ $overvolts ] && echo " (+0.$overvolts overvolt)" || echo -e "\r" echo "Current CPU: $freq MHz" #echo "Governor: $governor" echo "" echo "-- More info --" echo "HDMI Status: $tv" echo "" /opt/vc/bin/vcgencmd get_mem gpu /opt/vc/bin/vcgencmd get_mem arm /opt/vc/bin/vcgencmd get_config int | grep -E "(sdram_freq)" echo "" for id in sdram_c sdram_i sdram_p ; do echo -e "$id: $(/opt/vc/bin/vcgencmd measure_volts $id)" ; done echo "" for id in core h264 isp v3d ; do echo -e "$id:\t$(/opt/vc/bin/vcgencmd measure_clock $id)" ; done echo "" for id in uart pwm emmc pixel vec hdmi dpi ; do echo -e "$id:\t$(/opt/vc/bin/vcgencmd measure_clock $id)" ; done echo "" echo "-- System Latency --" cat /sys/block/mmcblk0/queue/scheduler; cat /proc/sys/vm/swappiness; cat /proc/sys/kernel/sched_latency_ns; cat /proc/sys/kernel/sched_rt_period_us; cat /proc/sys/kernel/sched_rt_runtime_us; cat /proc/sys/kernel/sched_autogroup_enabled; cat /proc/sys/kernel/sched_rr_timeslice_ms; cat /proc/sys/kernel/sched_min_granularity_ns; cat /proc/sys/kernel/sched_wakeup_granularity_ns echo "" echo "-- Network Buffers Size --" for mem in rmem_max wmem_max ; do echo -e "$mem:\t$(cat /proc/sys/net/core/$mem)" ; done exit 0
/urs/bin/sstatus
Mã:#!/bin/bash echo "" echo "-- Services Enabled --" echo "" systemctl list-unit-files --state=enabled echo "" echo "-- Services Running --" echo "" systemctl list-units --all --state=running echo "" exit
Theo mình bác nên dùng minipc 3 cổng lan giga trở lên loại không dùng quạt như của bác Phước, cấp nguồn linear 12v, chạy box ổ cứng 3.0, cài MinimServer hoặc AssetServer... đi dây Lan từ minipc thẳng vào Pi. Tối ưu hơn.Mình tính chơi Dual Pi (1 làm transport, 1 làm music server). Con Pi làm music server có 2 cách gắn ổ cứng. Các bác cho hỏi cách nào dùng ít bị nhiễu, nghe được tốt hơn ạ:
1. Gắn box ổ cứng 2.5'', lấy nguổn nuôi trực tiếp của Pi.
2. Gắn ổ cứng 3.5'', có nguồn riêng (giống như gắn NAS).
Cái minipc này giá tầm bao nhiêu vây bác?Theo mình bác nên dùng minipc 3 cổng lan giga trở lên loại không dùng quạt như của bác Phước, cấp nguồn linear 12v, chạy box ổ cứng 3.0, cài MinimServer hoặc AssetServer... đi dây Lan từ minipc thẳng vào Pi. Tối ưu hơn.
Mình không nghĩ là gắn ổ cứng cho Pi sẽ ngon hơn minipc và đi như vậy tín hiệu Minimserver transcoding chuyển thẳng đến Pi không qua trung gian router nữa, tránh đi qua con clock router.
Em chưa có pi4 anh ạ. Em mua tới pi3 B+ thì thấy rõ là nó càng mạnh càng noise nhiều nên dù rất muốn test nhưng ngại nên chưa mua.Nếu được bác test giùm SMPD cho Pi 4, mình rất thắc mắc tại sao họ chuyển đổi nền tảng Linux, và chỉ tập trung làm cho Pi 4, lò mò đọc các blog audio Nhật lại thấy họ khen bản Pi 4 hay hơn Pi 3.
Bác nên có Pi 4 để testEm chưa có pi4 anh ạ. Em mua tới pi3 B+ thì thấy rõ là nó càng mạnh càng noise nhiều nên dù rất muốn test nhưng ngại nên chưa mua.
Được này mất kia. Pi mạnh dùng cũng có cái sướng của nó. Vấn đề noise thật ra cũng tương đối vì tùy theo OS, thiết bị và gu nghe mà người dùng thích hay không.
Nghe anh nói vậy em lại tò mò. Chắc em lấy một cái về test cho trọn cuộc tình. Mua trễ quá sợ hết hàng UK.
Dung lượng ram có ảnh hưởng đến âm thanh không anh nhỉ? Em muốn mua bản 2GB nhưng không biết có gì bất lợi không?
https://hshop.vn/products/may-tinh-raspberry-pi-4-model-b-made-in-uk
![]()