@quatmo
GP nhiều món ăn chơi, nhưng thiếu mấy em hót gơ: Tidal với AssetUPnp.
Mã:_____ _ _____ _ / ____| | | | __ \| | | | __ ___ _ __ | |_ ___ ___ | |__) | | __ _ _ _ ___ _ __ | | |_ |/ _ \ '_ \| __/ _ \ / _ \| ___/| |/ _` | | | |/ _ \ '__| | |__| | __/ | | | || (_) | (_) | | | | (_| | |_| | __/ | \_____|\___|_| |_|\__\___/ \___/|_| |_|\__,_|\__, |\___|_| __/ | |___/ Profile: Profile not Setting RamSystem: Ramsystem not enabled Free memory: 3718MB of total 3857MB Kernel: 4.19.106-GentooPlayer-ST+ ─────────────────────────────────────── GentooPlayer | 16:30 | mer 22/07/2020 ─────────────────────────────────────── v2.15 | Raspberry Pi 4B+ (aarch64) ─────────────────────────────────────── eth0 | 192.168.11.187 ─────────────────────────────────────── Players Info: Squeezelite-R2 [Disabled] Squeezelite [Disabled] Networkaudiod [Disabled] LigitechMediaServer [Disabled] BubbleUpnp [Disabled] HQPlayer Embedded [Disabled] Mpd [Disabled] UpMpdCli [Disabled] RoonBridge [Disabled] RoonServer [Disabled] Mpd-Sima [Disabled] MYmpd [Disabled] minimserver [Disabled] shairport-sync [Disabled] spotifyd [Enabled]
Ngon! NAS giờ đáng giá hơn rồi, bác có file cài đặt hệ điều hành của NAS (cùng loại cới bác Phước), share giùm mình, mình cài lại thay thế cho Windows.Hôm nay gắn được Gsuite "vô cực" lên NAS XPEnology bằng RCLONE + SynoCli Disk Tools (thay cho Fuse) , đã quá
Mời ạnh em có NAS thì gắn ngay ạ
Link
https://plextips.plexed.co.uk/rclone/rclone-on-synology/
Đang định mua thêm ổ cứng mà tình hình này tạm hoãn ạ,
không biết pỏn với jav bôt lên có toi mất Gsuite không a?
Edit: với đường truyền 100Mbps của Vitteo, em play phim bằng PLEX + nghe nhạc 24/96 cùng lúc ngon lành ạ.
Chỉ không biết lúc nào account bị toi thôi.
em có NAS này, nhưng đọc cái link đó hoa mắt luôn, thua......Hôm nay gắn được Gsuite "vô cực" lên NAS XPEnology bằng RCLONE + SynoCli Disk Tools (thay cho Fuse) , đã quá
Mời ạnh em có NAS thì gắn ngay ạ
Link
https://plextips.plexed.co.uk/rclone/rclone-on-synology/
Đang định mua thêm ổ cứng mà tình hình này tạm hoãn ạ,
không biết pỏn với jav bôt lên có toi mất Gsuite không a?
Edit: với đường truyền 100Mbps của Vitteo, em play phim bằng PLEX + nghe nhạc 24/96 cùng lúc ngon lành ạ.
Chỉ không biết lúc nào account bị toi thôi.
em cài bản 1.3 xenomai của bác TuanQuynh, mount NAS xong rồi cho nó scan, được 1 lát lại crash luôn thì phải, không ping thấy con pi nữa, phải reboot lại, không biết có bác nào lỗi giống em không.,
Pi 2 xenomai cũng bị nếu gắn NAS nặng vài chục GB.
Để nghe Tidal thì ổn.
Em cài asset scan khoảng 20 phút thì ngủm, tắt đi mở lại. Tầm 5 làn thì ok.
# Recommend for rpi2: (600 - 900MHz)
force_turbo=1
boot_delay=1
arm_freq=800
# Recommend for rpi3: (600 - 1200MHz)
force_turbo=1
boot_delay=1
arm_freq=900
# Recommend for rpi3 B+ (600 - 1400MHz)
force_turbo=1
boot_delay=1
arm_freq=1200
//x.x.x.x/Music /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,cache=none,iocharset=utf8,username=xxx,password=xxx
#!/bin/bash
mpc stop
umount /var/lib/mpd/music/NAS
LOG=/var/lib/mpd/music/RAM/.nas_setting.log
# work dir
dst=/tmp/cifsdst
mkdir $dst
# detect protocol
user=`echo $2 | tr -d " "`
pass=`echo $3 | tr -d " "`
opt="cache=none,iocharset=utf8,username=$user,password=$pass"
echo "updating fstab start!!" > $LOG
hst=`echo $1 | sed -E 's/^\/\/([^/]+).+/\1/g'`
echo " Checking ping reply to ${hst}" >> $LOG
/bin/ping -c 1 -W 1 ${hst} > /dev/null
if [ ! $? = 0 ]; then
echo " !!!${hst} has not reply via ipv4" >> $LOG
echo " Checking via ipv6" >> $LOG
/bin/ping6 -c 1 -W 1 ${hst} > /dev/null
if [ ! $? = 0 ]; then
echo " !!!${hst} has not reply via ipv6" >> $LOG
echo "!!!Aborting the process!!!" >> $LOG
echo "check succeeded" >> $LOG
exit 1
fi
fi
echo "" >> $LOG
echo " Checking cifs security mode and protocol version" >> $LOG
exopt=""
declare -a aver=("1.0" "2.0" "2.1" "3.0")
for e in ${aver[@]}; do
mount -t cifs $1 $dst -o $opt,sec=ntlm,vers=${e} >/dev/null 2>&1
if [ $? = 0 ]; then
exopt=sec\=ntlm,vers\=${e}
umount $dst
fi
mount -t cifs $1 $dst -o $opt,sec=ntlmssp,vers=${e} >/dev/null 2>&1
if [ $? = 0 ]; then
exopt=sec\=ntlmssp,vers\=${e}
umount $dst
fi
done
if [ "$exopt" = "" ]; then
echo " !!!Can not resolve the security mode or protocol version." >> $LOG
echo " Aborting the process!!!" >> $LOG
echo " check succeeded" >> $LOG
rmdir $dst
exit 1
fi
echo " security mode and protocol version: $exopt" >> $LOG
exopt=,$exopt
sync
# detect best rsize prepare
declare -a arsize=("7300" "16060" "32120" "61320" "129940")
fioconf=/home/pi/misc/fio.conf
testfile=
bestrsize=
bestbw=0
bestctx=1000000
declare -a arsize2=()
declare -a abw=()
declare -a alatency=()
declare -a actx=()
declare -a amajf=()
declare -a aminf=()
mount -t cifs $1 $dst -o $opt,$exopt,wsize=4096 >/dev/null 2>&1
dd of=$dst/rsize_test_dummy bs=4k count=0 seek=2500
sync
umount $dst
echo "" >> $LOG
echo " Checking best rsize" >> $LOG
echo "" >> $LOG
echo " rsize BW CTX latency" >> $LOG
for e in ${arsize[@]}; do
mount -t cifs $1 $dst -o ro,$opt,$exopt,rsize=${e} >/dev/null 2>&1
# fio start
out=`fio --readonly -filename="$dst/rsize_test_dummy" --output-format=terse $fioconf | cut -d';' -f7,8,16,90,91,92`
#echo "RSIZE ${e}:$out" >> $LOG
# detect best rsize
bw=`echo $out|cut -d';' -f1`
latency=`echo $out|cut -d';' -f3|cut -d'.' -f1`
ctx=`echo $out|cut -d';' -f4`
majf=`echo $out|cut -d';' -f5`
minf=`echo $out|cut -d';' -f6`
arsize2+=( ${e} )
abw+=( $bw )
alatency+=( $latency )
actx+=( $ctx )
amajf+=( $majf )
aminf+=( $minf )
printf "%7d %8d %6d %8d\n" ${e} $bw $ctx $latency >> $LOG
if [ $bw -gt $bestbw ];then
bestbw=$bw
bestrsize=${e}
fi
sudo umount $dst
done
i=0
#echo "rsize bw lat ctx majf minf" >> $LOG
for e in ${arsize2[@]}; do
count=0
for ((ibw = 0; ibw < ${#abw[@]}; ibw++)){
if [ ${abw[i]} -lt ${abw[ibw]} ];then
let count++
fi
}
if [ $count -lt 3 ];then
count=0
for ((ilat = 0; ilat < ${#alatency[@]}; ilat++)){
if [ ${alatency[i]} -gt ${alatency[ilat]} ];then
let count++
fi
}
if [ $count -lt 3 ];then
count=0
for ((ictx = 0; ictx < ${#actx[@]}; ictx++)){
if [ ${actx[i]} -gt ${actx[ictx]} ];then
let count++
fi
}
if [ $count -lt 3 ];then
if [ "$bestbw" = "" ];then
bestctx=${actx[i]}
bestbw=${abw[i]}
bestrsize=",rsize=${e}"
elif [ ${actx[i]} -lt $bestctx ];then
bestctx=${actx[i]}
bestbw=${abw[i]}
bestrsize=",rsize=${e}"
fi
fi
fi
fi
#echo "${e} ${abw[i]} ${alatency[i]} ${actx[i]} ${amajf[i]} ${aminf[i]}" >> $LOG
let i++
done
# clean up
mount -t cifs $1 $dst -o $opt,$exopt,rsize=4096 >/dev/null 2>&1
rm "$dst/rsize_test_dummy"
umount $dst
rmdir $dst
# edit fstab
target=/etc/fstab
nas="$1 /var/lib/mpd/music/NAS cifs ro,noauto,x-systemd.automount$exopt$bestrsize,$opt"
echo "" >> $LOG
echo " best bandwidth : $bestbw kB/sec" >> $LOG
echo "" >> $LOG
echo " fstab setting : $nas" >> $LOG
sed -i.bak -e "/# NAS Setting/{n;d}" $target
sed -i -e "/# NAS Setting/a $nas" $target
sync
echo " Restarting mpd and mounting NAS with new setting" >> $LOG
systemctl stop mpd
systemctl daemon-reload
mount -a
systemctl start mpd
mountpoint /var/lib/mpd/music/NAS
ret=$?
echo "" >> $LOG
echo "NAS setting succeeded" >> $LOG
sleep 2
rm $LOG
exit $ret
Ngon! NAS giờ đáng giá hơn rồi, bác có file cài đặt hệ điều hành của NAS (cùng loại cới bác Phước), share giùm mình, mình cài lại thay thế cho Windows.
Nếu sẵn teamview mình thử xemem có NAS này, nhưng đọc cái link đó hoa mắt luôn, thua......
auto mount k bác, khởi động lại nas thì sao bác nhỉHôm nay gắn được Gsuite "vô cực" lên NAS XPEnology bằng RCLONE + SynoCli Disk Tools (thay cho Fuse) , đã quá
Mời ạnh em có NAS thì gắn ngay ạ
Link
https://plextips.plexed.co.uk/rclone/rclone-on-synology/
Đang định mua thêm ổ cứng mà tình hình này tạm hoãn ạ,
không biết pỏn với jav bôt lên có toi mất Gsuite không a?
Edit: với đường truyền 100Mbps của Vitteo, em play phim bằng PLEX + nghe nhạc 24/96 cùng lúc ngon lành ạ.
Chỉ không biết lúc nào account bị toi thôi.
Đang nghiên cứu thêm bác ạ, cũng có manh mối, thằng syno này nó khác họ nên hơi khó nháauto mount k bác, khởi động lại nas thì sao bác nhỉ
Bác check CPU trước khi cài lên Openwrt xong check CPU nó chạy lúc đang duyệt thư mục rồi so sánh.Mình đang định cài lên Router chạy Openwrt nữa là hết thuốc, khỏi NAS, không biết CPU yếu thì có bị lag không nữa?
Của mình là NEC5800
Các file cài đây bác tham khảo
https://drive.google.com/drive/folders/1xhsy93abCT5w74NI96hFbJTuYf5F-IY8?usp=sharing
https://xpenology.org/
Nếu sẵn teamview mình thử xem
Các tham số của mount cifs nằm ở đây:Các anh thử dùm em các bước sau ạ:
- Fix cpu frequency cố định ở khoảng 2/3 của range dao động. Theo em thấy khi set cpu ở ngưỡng này cho âm thanh hay nhất. Và chạy rất smooth.
edit/boot/config.txt
Mã:# Recommend for rpi2: (600 - 900MHz) force_turbo=1 boot_delay=1 arm_freq=800 # Recommend for rpi3: (600 - 1200MHz) force_turbo=1 boot_delay=1 arm_freq=900 # Recommend for rpi3 B+ (600 - 1400MHz) force_turbo=1 boot_delay=1 arm_freq=1200
- Thay đổi tham số mount. vers=x tùy theo version của SMB:
Mã://x.x.x.x/Music /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,username=xxx,password=xxx,rsize=32120,cache=none,iocharset=utf8 //x.x.x.x/Music /mnt/NAS cifs vers=1.0,user=xxx,password=xxx,x-systemd.automount 0 0
PS: Em đang mò để chôm cái script lấy tham số mount của smb. Thấy rất hay:
Mã:#!/bin/bash mpc stop umount /var/lib/mpd/music/NAS LOG=/var/lib/mpd/music/RAM/.nas_setting.log # work dir dst=/tmp/cifsdst mkdir $dst # detect protocol user=`echo $2 | tr -d " "` pass=`echo $3 | tr -d " "` opt="cache=none,iocharset=utf8,username=$user,password=$pass" echo "updating fstab start!!" > $LOG hst=`echo $1 | sed -E 's/^\/\/([^/]+).+/\1/g'` echo " Checking ping reply to ${hst}" >> $LOG /bin/ping -c 1 -W 1 ${hst} > /dev/null if [ ! $? = 0 ]; then echo " !!!${hst} has not reply via ipv4" >> $LOG echo " Checking via ipv6" >> $LOG /bin/ping6 -c 1 -W 1 ${hst} > /dev/null if [ ! $? = 0 ]; then echo " !!!${hst} has not reply via ipv6" >> $LOG echo "!!!Aborting the process!!!" >> $LOG echo "check succeeded" >> $LOG exit 1 fi fi echo "" >> $LOG echo " Checking cifs security mode and protocol version" >> $LOG exopt="" declare -a aver=("1.0" "2.0" "2.1" "3.0") for e in ${aver[@]}; do mount -t cifs $1 $dst -o $opt,sec=ntlm,vers=${e} >/dev/null 2>&1 if [ $? = 0 ]; then exopt=sec\=ntlm,vers\=${e} umount $dst fi mount -t cifs $1 $dst -o $opt,sec=ntlmssp,vers=${e} >/dev/null 2>&1 if [ $? = 0 ]; then exopt=sec\=ntlmssp,vers\=${e} umount $dst fi done if [ "$exopt" = "" ]; then echo " !!!Can not resolve the security mode or protocol version." >> $LOG echo " Aborting the process!!!" >> $LOG echo " check succeeded" >> $LOG rmdir $dst exit 1 fi echo " security mode and protocol version: $exopt" >> $LOG exopt=,$exopt sync # detect best rsize prepare declare -a arsize=("7300" "16060" "32120" "61320" "129940") fioconf=/home/pi/misc/fio.conf testfile= bestrsize= bestbw=0 bestctx=1000000 declare -a arsize2=() declare -a abw=() declare -a alatency=() declare -a actx=() declare -a amajf=() declare -a aminf=() mount -t cifs $1 $dst -o $opt,$exopt,wsize=4096 >/dev/null 2>&1 dd of=$dst/rsize_test_dummy bs=4k count=0 seek=2500 sync umount $dst echo "" >> $LOG echo " Checking best rsize" >> $LOG echo "" >> $LOG echo " rsize BW CTX latency" >> $LOG for e in ${arsize[@]}; do mount -t cifs $1 $dst -o ro,$opt,$exopt,rsize=${e} >/dev/null 2>&1 # fio start out=`fio --readonly -filename="$dst/rsize_test_dummy" --output-format=terse $fioconf | cut -d';' -f7,8,16,90,91,92` #echo "RSIZE ${e}:$out" >> $LOG # detect best rsize bw=`echo $out|cut -d';' -f1` latency=`echo $out|cut -d';' -f3|cut -d'.' -f1` ctx=`echo $out|cut -d';' -f4` majf=`echo $out|cut -d';' -f5` minf=`echo $out|cut -d';' -f6` arsize2+=( ${e} ) abw+=( $bw ) alatency+=( $latency ) actx+=( $ctx ) amajf+=( $majf ) aminf+=( $minf ) printf "%7d %8d %6d %8d\n" ${e} $bw $ctx $latency >> $LOG if [ $bw -gt $bestbw ];then bestbw=$bw bestrsize=${e} fi sudo umount $dst done i=0 #echo "rsize bw lat ctx majf minf" >> $LOG for e in ${arsize2[@]}; do count=0 for ((ibw = 0; ibw < ${#abw[@]}; ibw++)){ if [ ${abw[i]} -lt ${abw[ibw]} ];then let count++ fi } if [ $count -lt 3 ];then count=0 for ((ilat = 0; ilat < ${#alatency[@]}; ilat++)){ if [ ${alatency[i]} -gt ${alatency[ilat]} ];then let count++ fi } if [ $count -lt 3 ];then count=0 for ((ictx = 0; ictx < ${#actx[@]}; ictx++)){ if [ ${actx[i]} -gt ${actx[ictx]} ];then let count++ fi } if [ $count -lt 3 ];then if [ "$bestbw" = "" ];then bestctx=${actx[i]} bestbw=${abw[i]} bestrsize=",rsize=${e}" elif [ ${actx[i]} -lt $bestctx ];then bestctx=${actx[i]} bestbw=${abw[i]} bestrsize=",rsize=${e}" fi fi fi fi #echo "${e} ${abw[i]} ${alatency[i]} ${actx[i]} ${amajf[i]} ${aminf[i]}" >> $LOG let i++ done # clean up mount -t cifs $1 $dst -o $opt,$exopt,rsize=4096 >/dev/null 2>&1 rm "$dst/rsize_test_dummy" umount $dst rmdir $dst # edit fstab target=/etc/fstab nas="$1 /var/lib/mpd/music/NAS cifs ro,noauto,x-systemd.automount$exopt$bestrsize,$opt" echo "" >> $LOG echo " best bandwidth : $bestbw kB/sec" >> $LOG echo "" >> $LOG echo " fstab setting : $nas" >> $LOG sed -i.bak -e "/# NAS Setting/{n;d}" $target sed -i -e "/# NAS Setting/a $nas" $target sync echo " Restarting mpd and mounting NAS with new setting" >> $LOG systemctl stop mpd systemctl daemon-reload mount -a systemctl start mpd mountpoint /var/lib/mpd/music/NAS ret=$? echo "" >> $LOG echo "NAS setting succeeded" >> $LOG sleep 2 rm $LOG exit $ret
auto mount k bác, khởi động lại nas thì sao bác nhỉ
#!/bin/ash
/usr/bin/rclone --config /var/services/homes/admin/.config/rclone/rclone.conf mount -v YOURDRIVE : /volume1/homes/admin/YOUR MOUNT POINT --allow-other --dir-cache-time 672h --vfs-cache-max-age 675h --vfs-read-chunk-size 64M --vfs-read-chunk-size-limit 1G --buffer-size 32M &
Cảm ơn anh. Vậy mình tạm cho là tham số sau tương đối an toàn và dễ chịu với nhiều OS:Các tham số của mount cifs nằm ở đây:
https://www.samba.org/~ab/output/htmldocs/manpages-3/mount.cifs.8.html
Nếu có nhiều tùy chọn thì chúng được phân cách bởi dấu phẩy. Dưới đây là 1 số tùy chọn đáng chú ý:
- auto: tự động mount thiết bị khi máy tính khởi động.
- noauto: không tự động mount, nếu muốn sử dụng thiết bị thì sau khi khởi động vào hệ thống bạn cần chạy lệnh mount.
- user: cho phép người dùng thông thường được quyền mount.
- nouser: chỉ có người dùng root mới có quyền mount.
- exec: cho phép chạy các file nhị phân (binary) trên thiết bị.
- noexec: không cho phép chạy các file binary trên thiết bị.
- ro (read-only): chỉ cho phép quyền đọc trên thiết bị.
- rw (read-write): cho phép quyền đọc/ghi trên thiết bị.
- sync: thao tác nhập xuất (I/O) trên filesystem được đồng bộ hóa.
- async: thao tác nhập xuất (I/O) trên filesystem diễn ra không đồng bộ.
- defaults: tương đương với tập các tùy chọn rw, suid, dev, exec, auto, nouser, async
//x.x.x.x/Music /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,cache=none,iocharset=utf8,username=xxx,password=xxx
# NAS Setting
[global]
direct=1
size=9800k
numjobs=1
invalidate=1
ioengine=mmap
[Seq-Read]
rw=read
#!/bin/bash
#####################
# nasmount.sh v1.2
#####################
echo " Unmounted first..."
umount /var/lib/mpd/music/NAS
umount /mnt/NAS
umount /mnt/MPD
echo ""
echo " IO Testing..."
LOG=/opt/scripts/.nas_setting.log
# work dir
dst=/tmp/cifsdst
mkdir $dst
# detect protocol
mpnt=`echo $2 | tr -d " "`
user=`echo $3 | tr -d " "`
pass=`echo $4 | tr -d " "`
opt="cache=none,iocharset=utf8,username=$user,password=$pass"
echo " Updating fstab start!!" > $LOG
hst=`echo $1 | sed -E 's/^\/\/([^/]+).+/\1/g'`
echo " Checking ping reply to ${hst}" >> $LOG
/bin/ping -c 1 -W 1 ${hst} > /dev/null
if [ ! $? = 0 ]; then
echo " !!!${hst} has not reply via ipv4" >> $LOG
echo " Checking via ipv6" >> $LOG
/bin/ping6 -c 1 -W 1 ${hst} > /dev/null
if [ ! $? = 0 ]; then
echo " !!!${hst} has not reply via ipv6" >> $LOG
echo "!!!Aborting the process!!!" >> $LOG
echo "check succeeded" >> $LOG
exit 1
fi
fi
echo "" >> $LOG
echo " Checking cifs security mode and protocol version" >> $LOG
exopt=""
declare -a aver=("1.0" "2.0" "2.1" "3.0")
for e in ${aver[@]}; do
mount -t cifs $1 $dst -o $opt,sec=ntlm,vers=${e} >/dev/null 2>&1
if [ $? = 0 ]; then
exopt=sec\=ntlm,vers\=${e}
umount $dst
fi
mount -t cifs $1 $dst -o $opt,sec=ntlmssp,vers=${e} >/dev/null 2>&1
if [ $? = 0 ]; then
exopt=sec\=ntlmssp,vers\=${e}
umount $dst
fi
done
if [ "$exopt" = "" ]; then
echo " !!!Can not resolve the security mode or protocol version." >> $LOG
echo " Aborting the process!!!" >> $LOG
echo " check succeeded" >> $LOG
rmdir $dst
exit 1
fi
echo " security mode and protocol version: $exopt" >> $LOG
exopt=,$exopt
sync
# detect best rsize prepare
declare -a arsize=("7300" "16060" "32120" "61320" "129940")
fioconf=/opt/scripts/fio.conf
testfile=
bestrsize=
bestbw=0
bestctx=1000000
declare -a arsize2=()
declare -a abw=()
declare -a alatency=()
declare -a actx=()
declare -a amajf=()
declare -a aminf=()
mount -t cifs $1 $dst -o $opt,$exopt,wsize=4096 >/dev/null 2>&1
dd of=$dst/rsize_test_dummy bs=4k count=0 seek=2500
sync
umount $dst
echo "" >> $LOG
echo " Checking best rsize" >> $LOG
echo "" >> $LOG
echo " rsize BW CTX latency" >> $LOG
for e in ${arsize[@]}; do
mount -t cifs $1 $dst -o ro,$opt,$exopt,rsize=${e} >/dev/null 2>&1
# fio start
out=`fio --readonly -filename="$dst/rsize_test_dummy" --output-format=terse $fioconf | cut -d';' -f7,8,16,90,91,92`
#echo "RSIZE ${e}:$out" >> $LOG
# detect best rsize
bw=`echo $out|cut -d';' -f1`
latency=`echo $out|cut -d';' -f3|cut -d'.' -f1`
ctx=`echo $out|cut -d';' -f4`
majf=`echo $out|cut -d';' -f5`
minf=`echo $out|cut -d';' -f6`
arsize2+=( ${e} )
abw+=( $bw )
alatency+=( $latency )
actx+=( $ctx )
amajf+=( $majf )
aminf+=( $minf )
printf "%7d %8d %6d %8d\n" ${e} $bw $ctx $latency >> $LOG
if [ $bw -gt $bestbw ];then
bestbw=$bw
bestrsize=${e}
fi
sudo umount $dst
done
i=0
#echo "rsize bw lat ctx majf minf" >> $LOG
for e in ${arsize2[@]}; do
count=0
for ((ibw = 0; ibw < ${#abw[@]}; ibw++)){
if [ ${abw[i]} -lt ${abw[ibw]} ];then
let count++
fi
}
if [ $count -lt 3 ];then
count=0
for ((ilat = 0; ilat < ${#alatency[@]}; ilat++)){
if [ ${alatency[i]} -gt ${alatency[ilat]} ];then
let count++
fi
}
if [ $count -lt 3 ];then
count=0
for ((ictx = 0; ictx < ${#actx[@]}; ictx++)){
if [ ${actx[i]} -gt ${actx[ictx]} ];then
let count++
fi
}
if [ $count -lt 3 ];then
if [ "$bestbw" = "" ];then
bestctx=${actx[i]}
bestbw=${abw[i]}
bestrsize=",rsize=${e}"
elif [ ${actx[i]} -lt $bestctx ];then
bestctx=${actx[i]}
bestbw=${abw[i]}
bestrsize=",rsize=${e}"
fi
fi
fi
fi
#echo "${e} ${abw[i]} ${alatency[i]} ${actx[i]} ${amajf[i]} ${aminf[i]}" >> $LOG
let i++
done
# clean up
mount -t cifs $1 $dst -o $opt,$exopt,rsize=4096 >/dev/null 2>&1
rm "$dst/rsize_test_dummy"
umount $dst
rmdir $dst
# edit fstab
target=/etc/fstab
nas="$1 $2 cifs ro,noauto,x-systemd.automount$exopt$bestrsize,$opt"
echo "" >> $LOG
echo " best bandwidth : $bestbw kB/sec" >> $LOG
echo "" >> $LOG
echo " fstab setting : $nas" >> $LOG
sed -i.bak -e "/# NAS Setting/{n;d}" $target
sed -i -e "/# NAS Setting/a $nas" $target
sync
echo " Restarting OS and mounting NAS with new setting" >> $LOG
mount -a
mountpoint $mpnt
ret=$?
echo "" >> $LOG
echo "NAS setting succeeded" >> $LOG
sleep 2
echo ""
echo " Job report:"
cat $LOG
echo ""
echo "Check fstab:"
echo ""
cat /etc/fstab
exit $ret
sudo /opt/scripts/nasmount.sh //x.x.x.x/share /mnt/NAS xxx yyy
pi@xenomaipi:~ $ sudo /opt/scripts/nasmount.sh //192.168.18.2/share /mnt/NAS xxx yyy
Unmounted first...
umount: /var/lib/mpd/music/NAS: not mounted.
umount: /mnt/NAS: not mounted.
umount: /mnt/MPD: no mount point specified.
IO Testing...
0+0 records in
0+0 records out
0 bytes copied, 0.108174 s, 0.0 kB/s
/mnt/NAS is not a mountpoint
Job report:
Updating fstab start!!
Checking ping reply to 192.168.18.2
Checking cifs security mode and protocol version
security mode and protocol version: sec=ntlm,vers=1.0
Checking best rsize
rsize BW CTX latency
7300 6464 2474 608
16060 10560 886 370
32120 10961 836 351
61320 10961 746 355
129940 10925 729 356
best bandwidth : 10925 kB/sec
fstab setting : //192.168.18.2/share /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,rsize=129940,cache=none,iocharset=utf8,username=xxx,password=yyy
Restarting OS and mounting NAS with new setting
NAS setting succeeded
Check fstab:
proc /proc proc defaults 0 0
PARTUUID=738a4d67-01 /boot vfat defaults 0 2
PARTUUID=738a4d67-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
# NAS Setting
//192.168.18.2/share /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,rsize=129940,cache=none,iocharset=utf8,username=xxx,password=yyy
pi@xenomaipi:~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 3.5G 1.8G 1.6G 55% /
devtmpfs 484M 0 484M 0% /dev
tmpfs 488M 0 488M 0% /dev/shm
tmpfs 488M 6.5M 482M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 488M 0 488M 0% /sys/fs/cgroup
/dev/mmcblk0p1 253M 64M 189M 26% /boot
tmpfs 98M 0 98M 0% /run/user/1000
//192.168.18.2/share 1.9T 1.7T 141G 93% /mnt/NAS
pi@xenomaipi:~ $ menu
-- Menu Config v1.4b --
1. OpenHome Start & Enable
2. OpenHome Stop & Disable
3. Asset UPnP Start & Enable
4. Asset UPnP Stop & Disable
5. Use Tidal Hifi acc 1
6. Use Tidal Hifi acc 2
7. Restart xenomaipi
8. Shutdown xenomaipi
9. Add NAS to fstab
10. Exit menu
9
Please input your music location: //192.168.18.2/Data/Music
Your mount point?: /mnt/NAS
Your user name?: xxx
Your password?: yyy
Unmounted first...
umount: /var/lib/mpd/music/NAS: not mounted.
umount: /mnt/NAS: not mounted.
umount: /mnt/MPD: no mount point specified.
IO Testing...
0+0 records in
0+0 records out
0 bytes copied, 0.0941819 s, 0.0 kB/s
/mnt/NAS is not a mountpoint
Job report:
Updating fstab start!!
Checking ping reply to 192.168.18.2
Checking cifs security mode and protocol version
security mode and protocol version: sec=ntlm,vers=1.0
Checking best rsize
rsize BW CTX latency
7300 6511 2744 600
16060 10663 906 366
32120 11023 684 354
61320 11111 751 351
129940 10888 659 354
best bandwidth : 10888 kB/sec
fstab setting : //192.168.18.2/Data/Music /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,rsize=129940,cache=none,iocharset=utf8,username=xxx,password=yyy
Restarting OS and mounting NAS with new setting
NAS setting succeeded
Check fstab:
proc /proc proc defaults 0 0
PARTUUID=738a4d67-01 /boot vfat defaults 0 2
PARTUUID=738a4d67-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
# NAS Setting
//192.168.18.2/Data/Music /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,rsize=129940,cache=none,iocharset=utf8,username=xxx,password=yyy
-- Menu Config v1.4b --
1. OpenHome Start & Enable
2. OpenHome Stop & Disable
3. Asset UPnP Start & Enable
4. Asset UPnP Stop & Disable
5. Use Tidal Hifi acc 1
6. Use Tidal Hifi acc 2
7. Restart xenomaipi
8. Shutdown xenomaipi
9. Add NAS to fstab
10. Exit menu
10
pi@xenomaipi:~ $
Các bác cho hỏi có biết tay chơi đàn guitar trong album nào ở link sau không ạ:
ro,noauto,x-systemd.automount,sec=ntlm,vers=x.x,cache=none,iocharset=utf8,username=xxx,password=yyy
pi@xenomaipi:~ $ modinfo cifs
filename: /lib/modules/4.9.80-v7+/kernel/fs/cifs/cifs.ko
version: 2.09
description: VFS to access servers complying with the SNIA CIFS Specification e.g. Samba and Windows
license: GPL
author: Steve French <[email protected]>
alias: fs-cifs
srcversion: D013E76AE039C5575636E43
depends:
intree: Y
vermagic: 4.9.80-v7+ SMP mod_unload modversions ARMv7 p2v8
parm: CIFSMaxBufSize:Network buffer size (not including header). Default: 16384 Range: 8192 to 130048 (uint)
parm: cifs_min_rcv:Network buffers in pool. Default: 4 Range: 1 to 64 (uint)
parm: cifs_min_small:Small network buffers in pool. Default: 30 Range: 2 to 256 (uint)
parm: cifs_max_pending:Simultaneous requests to server. Default: 32767 Range: 2 to 32767. (uint)
parm: enable_oplocks:Enable or disable oplocks. Default: y/Y/1 (bool)
_netdev,uid=1000,gid=1000 0 0
//x.x.x.x/share /mnt/NAS cifs _netdev,username=xxx,password=yyy,vers=x.x,uid=1000,gid=1000,sec=ntlm,iocharset=utf8 0 0
//x.x.x.x/share /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,rsize=16384,cache=none,iocharset=utf8,username=xxx,password=yyy
/etc/fstab
# <device> <dir> <type> <options> <dump> <fsck>
UUID=0a3407de-014b-458b-b5c1-848e92a327a3 / ext4 noatime 0 1
UUID=f9fe0b69-a280-415d-a03a-a32752370dee none swap defaults 0 0
UUID=b411dc99-f0a0-4c87-9e05-184977be8539 /home ext4 noatime 0 2
Báo cáo với cả nhà là em đã chôm và mod được cách add nas tự động vào trong fstab bằng script rồi. Chạy ngon ạ. Sau này mình sẽ đưa vào menu luôn.
Script này check được version của smb và xác định rsize bằng cách test speed IO.
Em chôm của dev paparius@smpd . Many thanks to paparius
Em mod lại để cho dễ dùng với nhiều tình huống khác nhau.
Cần chuẩn bị các bước sau:
1. Install fio:
sudo apt-get fio
2. Thêm # NAS Setting vào cuối file /etc/fstab":
Script sau khi chạy sẽ xóa và chèn tham số mount nas vào bên dưới dòng này:
Mã:# NAS Setting
3. Tạo file fio.conf:
sudo nano /opt/scripts/fio.conf
Mã:[global] direct=1 size=9800k numjobs=1 invalidate=1 ioengine=mmap [Seq-Read] rw=read
4. Tạo file nasmount.sh:
sudo nano /opt/scripts/nasmount.sh
Mã:#!/bin/bash ##################### # nasmount.sh v1.2 ##################### echo " Unmounted first..." umount /var/lib/mpd/music/NAS umount /mnt/NAS umount /mnt/MPD echo "" echo " IO Testing..." LOG=/opt/scripts/.nas_setting.log # work dir dst=/tmp/cifsdst mkdir $dst # detect protocol mpnt=`echo $2 | tr -d " "` user=`echo $3 | tr -d " "` pass=`echo $4 | tr -d " "` opt="cache=none,iocharset=utf8,username=$user,password=$pass" echo " Updating fstab start!!" > $LOG hst=`echo $1 | sed -E 's/^\/\/([^/]+).+/\1/g'` echo " Checking ping reply to ${hst}" >> $LOG /bin/ping -c 1 -W 1 ${hst} > /dev/null if [ ! $? = 0 ]; then echo " !!!${hst} has not reply via ipv4" >> $LOG echo " Checking via ipv6" >> $LOG /bin/ping6 -c 1 -W 1 ${hst} > /dev/null if [ ! $? = 0 ]; then echo " !!!${hst} has not reply via ipv6" >> $LOG echo "!!!Aborting the process!!!" >> $LOG echo "check succeeded" >> $LOG exit 1 fi fi echo "" >> $LOG echo " Checking cifs security mode and protocol version" >> $LOG exopt="" declare -a aver=("1.0" "2.0" "2.1" "3.0") for e in ${aver[@]}; do mount -t cifs $1 $dst -o $opt,sec=ntlm,vers=${e} >/dev/null 2>&1 if [ $? = 0 ]; then exopt=sec\=ntlm,vers\=${e} umount $dst fi mount -t cifs $1 $dst -o $opt,sec=ntlmssp,vers=${e} >/dev/null 2>&1 if [ $? = 0 ]; then exopt=sec\=ntlmssp,vers\=${e} umount $dst fi done if [ "$exopt" = "" ]; then echo " !!!Can not resolve the security mode or protocol version." >> $LOG echo " Aborting the process!!!" >> $LOG echo " check succeeded" >> $LOG rmdir $dst exit 1 fi echo " security mode and protocol version: $exopt" >> $LOG exopt=,$exopt sync # detect best rsize prepare declare -a arsize=("7300" "16060" "32120" "61320" "129940") fioconf=/opt/scripts/fio.conf testfile= bestrsize= bestbw=0 bestctx=1000000 declare -a arsize2=() declare -a abw=() declare -a alatency=() declare -a actx=() declare -a amajf=() declare -a aminf=() mount -t cifs $1 $dst -o $opt,$exopt,wsize=4096 >/dev/null 2>&1 dd of=$dst/rsize_test_dummy bs=4k count=0 seek=2500 sync umount $dst echo "" >> $LOG echo " Checking best rsize" >> $LOG echo "" >> $LOG echo " rsize BW CTX latency" >> $LOG for e in ${arsize[@]}; do mount -t cifs $1 $dst -o ro,$opt,$exopt,rsize=${e} >/dev/null 2>&1 # fio start out=`fio --readonly -filename="$dst/rsize_test_dummy" --output-format=terse $fioconf | cut -d';' -f7,8,16,90,91,92` #echo "RSIZE ${e}:$out" >> $LOG # detect best rsize bw=`echo $out|cut -d';' -f1` latency=`echo $out|cut -d';' -f3|cut -d'.' -f1` ctx=`echo $out|cut -d';' -f4` majf=`echo $out|cut -d';' -f5` minf=`echo $out|cut -d';' -f6` arsize2+=( ${e} ) abw+=( $bw ) alatency+=( $latency ) actx+=( $ctx ) amajf+=( $majf ) aminf+=( $minf ) printf "%7d %8d %6d %8d\n" ${e} $bw $ctx $latency >> $LOG if [ $bw -gt $bestbw ];then bestbw=$bw bestrsize=${e} fi sudo umount $dst done i=0 #echo "rsize bw lat ctx majf minf" >> $LOG for e in ${arsize2[@]}; do count=0 for ((ibw = 0; ibw < ${#abw[@]}; ibw++)){ if [ ${abw[i]} -lt ${abw[ibw]} ];then let count++ fi } if [ $count -lt 3 ];then count=0 for ((ilat = 0; ilat < ${#alatency[@]}; ilat++)){ if [ ${alatency[i]} -gt ${alatency[ilat]} ];then let count++ fi } if [ $count -lt 3 ];then count=0 for ((ictx = 0; ictx < ${#actx[@]}; ictx++)){ if [ ${actx[i]} -gt ${actx[ictx]} ];then let count++ fi } if [ $count -lt 3 ];then if [ "$bestbw" = "" ];then bestctx=${actx[i]} bestbw=${abw[i]} bestrsize=",rsize=${e}" elif [ ${actx[i]} -lt $bestctx ];then bestctx=${actx[i]} bestbw=${abw[i]} bestrsize=",rsize=${e}" fi fi fi fi #echo "${e} ${abw[i]} ${alatency[i]} ${actx[i]} ${amajf[i]} ${aminf[i]}" >> $LOG let i++ done # clean up mount -t cifs $1 $dst -o $opt,$exopt,rsize=4096 >/dev/null 2>&1 rm "$dst/rsize_test_dummy" umount $dst rmdir $dst # edit fstab target=/etc/fstab nas="$1 $2 cifs ro,noauto,x-systemd.automount$exopt$bestrsize,$opt" echo "" >> $LOG echo " best bandwidth : $bestbw kB/sec" >> $LOG echo "" >> $LOG echo " fstab setting : $nas" >> $LOG sed -i.bak -e "/# NAS Setting/{n;d}" $target sed -i -e "/# NAS Setting/a $nas" $target sync echo " Restarting OS and mounting NAS with new setting" >> $LOG mount -a mountpoint $mpnt ret=$? echo "" >> $LOG echo "NAS setting succeeded" >> $LOG sleep 2 echo "" echo " Job report:" cat $LOG echo "" echo "Check fstab:" echo "" cat /etc/fstab exit $ret
sudo chmod 775 /opt/scripts/nasmount.sh
Cách dùng:
Chạy lệnh với 4 biến: nas / mount point / user / password
Foder share không nên có khoảng trắng. Nếu share path có khoảng trắng thì dùng \040
Thí dụ: //x.x.x.x/nhac viet sẽ là //x.x.x.x/nhac\040viet
Mã:sudo /opt/scripts/nasmount.sh //x.x.x.x/share /mnt/NAS xxx yyy
sudo reboot
Vậy là xong ạ.
Test run:
Mã:pi@xenomaipi:~ $ sudo /opt/scripts/nasmount.sh //192.168.18.2/share /mnt/NAS xxx yyy Unmounted first... umount: /var/lib/mpd/music/NAS: not mounted. umount: /mnt/NAS: not mounted. umount: /mnt/MPD: no mount point specified. IO Testing... 0+0 records in 0+0 records out 0 bytes copied, 0.108174 s, 0.0 kB/s /mnt/NAS is not a mountpoint Job report: Updating fstab start!! Checking ping reply to 192.168.18.2 Checking cifs security mode and protocol version security mode and protocol version: sec=ntlm,vers=1.0 Checking best rsize rsize BW CTX latency 7300 6464 2474 608 16060 10560 886 370 32120 10961 836 351 61320 10961 746 355 129940 10925 729 356 best bandwidth : 10925 kB/sec fstab setting : //192.168.18.2/share /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,rsize=129940,cache=none,iocharset=utf8,username=xxx,password=yyy Restarting OS and mounting NAS with new setting NAS setting succeeded Check fstab: proc /proc proc defaults 0 0 PARTUUID=738a4d67-01 /boot vfat defaults 0 2 PARTUUID=738a4d67-02 / ext4 defaults,noatime 0 1 # a swapfile is not a swap partition, no line here # use dphys-swapfile swap[on|off] for that # NAS Setting //192.168.18.2/share /mnt/NAS cifs ro,noauto,x-systemd.automount,sec=ntlm,vers=1.0,rsize=129940,cache=none,iocharset=utf8,username=xxx,password=yyy
Reboot và kiểm tra lại:
Mã:pi@xenomaipi:~ $ df -h Filesystem Size Used Avail Use% Mounted on /dev/root 3.5G 1.8G 1.6G 55% / devtmpfs 484M 0 484M 0% /dev tmpfs 488M 0 488M 0% /dev/shm tmpfs 488M 6.5M 482M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 488M 0 488M 0% /sys/fs/cgroup /dev/mmcblk0p1 253M 64M 189M 26% /boot tmpfs 98M 0 98M 0% /run/user/1000 //192.168.18.2/share 1.9T 1.7T 141G 93% /mnt/NAS
Trước mắt em test cách kết hợp với bubbleupnp server + upmpdcli upnp renderer trên cùng 1 pi OK các anh ạ. Tidal play trực tiếp ngon. Java Oracle chính hãng chạy nhẹ hơn Open java nhiều.Em xin báo cáo tình hình xenomaipi.
- Hiện tại anh @TuanQuynhAudio đang nghiên kiú thêm về build kernel và cơ chế output sound RT.
- Em chạy lăng quăng để tìm hướng đi cho việc play Tidal trực tiếp.
- Mong muốn lớn nhất của em là chạy được Tidal trực tiếp. Nếu như không cải thiện được âm thanh của openhome chính hãng. Có thể mình phải quay về upmpdcli. Nhưng hiện giờ Tidal đổi api nên openhome upmpdcli không chạy được nữa. Trừ khi anh TQ ra tay
- Còn một cách nữa là setup bubbleupnp server lên pi làm proxy streaming Tidal, đẩy sang upnp renderer trên pi luôn. Cách này cần java.
- Anh TQ thiên về hướng dùng 1 OS cho tất cả các pi từ pi2 cho đến pi4.
- Em thấy là âm thanh của dòng jessie và stretch có vẻ hợp tiếng với pi2 / pi3 hơn. Em thiên về tách ra 2 OS. Một OS cho pi2 / pi3 và OS kia cho pi3 B+ / pi4.
Đường còn dài. Nhưng em kỳ vọng vào âm thanh của xenomai. Nó hay hơn rất nhiều so với PREEMPT_RT.
Kính báo với cả nhà ạ