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

Thanhvo31

Well-Known Member
Em mới mò ra cái này. Phát audio của Youtube sang Rune/Volumio/Moode. Vui lắm ạ. Các anh rãnh thử chơi nhé:

Các bước gồm có như sau:

1. Bật UPnP / DLNA trong Rune/Volumio/Moode

2. Add vào foobar plugin UPnP MediaRenderer Output:

http://www.foobar2000.org/components/view/foo_out_upnp

3. Add vào foobar plugin foo_youtube. Chỉ cần foo_youtube_2.1_beta1.fb2k-component cho audio:

https://fy.3dyd.com/download/

Chọn output của foobar là Pi. Vào menu File ==> Youtube Source, add link Youtube vào, play!

Source: http://www.hdvietnam.com/posts/9499694/

Trên runeaudio mới có Addons, có cả Youtube addon trực tiếp trên Rune luôn., Volumio cũng có
https://github.com/rern/RuneAudio_Addons
 

chuong46

Active Member
Khi bác truy cập NAS Pi nội bộ nhạc 24/192 hay DSD64 có bị khựng ko ? Ngoài ra khi ngoài mạng bác truy cập nhạc 24/192 hay DSD64 vào có y vậy ? :rolleyes:
NAS nhà mình ở CT truy cập vào 24/192 hay DSD64 nghe ngon nhưng về nhà mạng nội bộ bị khựng lý do là gì chưa biết a . Kết nối hoàn toàn mình dùng cáp mạng . :confused::D
Của mình: Nas Pi + MinimServer kết nối Lan đến Router; Từ Router kết nối Lan đến Pi3B+Digi+Moode 3.8.3
Nghe các định dạng kể cả PCM 24/192 hay DSD64 đều rất OK.
 

linh0983

Well-Known Member
Cuối cùng mình cũng dò được chỗ con điện trở bung ra (bên phần digital đối chiếu con 502DAC). Mình check các cổng out hoạt động tốt . Riêng phần Analog con 502DAC pro nghe hay ạ . Mix hay quá ! :rolleyes:

S8.jpg


Đang nghe Album này hay tuyệt a . :oops::cool::mad:

S9.jpg
 

tml3nr

Moderator
Trên runeaudio mới có Addons, có cả Youtube addon trực tiếp trên Rune luôn., Volumio cũng có
https://github.com/rern/RuneAudio_Addons
Em có thử play Youtube trên Volumio 2.310. Cũng hay nhưng vì thích Rune hơn nên chỉ test qua một vòng cho biết, rồi cũng quay lại máng lợn.

Em có lấy thêm một thẻ Sandisk Extreme Pro, tính là để test plugin Youtube (Cho khỏi ảnh hưởng đến cái thẻ đang nghe). Nhưng đến nay vẫn chưa thử. Em ngại đụng đến Rune vì theo em test trước đây Rune rất dễ bị thay đổi cái optimize kernel của nó. Đụng vô là tiếng nó khác liền.

Đến giờ em vẫn thích nhất cách dùng VLC để phát kiểu radio.
 

TuanQuynhAudio

Well-Known Member
Cuối cùng mình cũng dò được chỗ con điện trở bung ra (bên phần digital đối chiếu con 502DAC). Mình check các cổng out hoạt động tốt . Riêng phần Analog con 502DAC pro nghe hay ạ . Mix hay quá ! :rolleyes:


Đang nghe Album này hay tuyệt a . :oops::cool::mad:
Bác dùng isolator của Ian thì GPIO05, GPIO06 (PIN 29, 31) không có cách ly. 2 chân này để lựa chọn tần số 41Khz, 48Khz (24,576Mhz và 22,792Mhz) của bo 502DAC PRO.
Bo iso của allo thì có cách ly chân GPIO06 (pin 31).
iso_Ian.png

iso_allo.png

502DAC_PRO.png
 

Thanhvo31

Well-Known Member
Em có thử play Youtube trên Volumio 2.310. Cũng hay nhưng vì thích Rune hơn nên chỉ test qua một vòng cho biết, rồi cũng quay lại máng lợn.

Em có lấy thêm một thẻ Sandisk Extreme Pro, tính là để test plugin Youtube (Cho khỏi ảnh hưởng đến cái thẻ đang nghe). Nhưng đến nay vẫn chưa thử. Em ngại đụng đến Rune vì theo em test trước đây Rune rất dễ bị thay đổi cái optimize kernel của nó. Đụng vô là tiếng nó khác liền.

Đến giờ em vẫn thích nhất cách dùng VLC để phát kiểu radio.

Add-on này, theo em đọc code, không đụng gì đến kernel đâu, bác khỏi lo xa.

Có phần pacman -Sy nhưng là option, còn lại đều vô hại.

Mã:
#!/bin/bash
# main reference
alias=RuneYoutube
### template - import default variables, functions
. /srv/http/addonstitle.sh
### template - function: start message, installed check
installstart $@
### template - function: get repository zip and extract to system directories
getinstallzip
### template - function: (optional) rank miror servers and 'pacman -Sy' before install packages
rankmirrors
command -v ffmpeg >/dev/null 2>&1 || { echo -e "$warn ERROR: ffmpeg is not installed, please run the MPC Upgrade first." >&2; exit 1; }
gitpath=https://github.com/xortuna/RuneYoutubeAddon/raw/master/
### PACMAN ###
echo -e "$bar Installing youtube-dl and atomicparsley..."
pacman -S --noconfirm youtube-dl atomicparsley
### PHP Script ###
echo -e "$bar Creating web files..."
echo '<?php
try {
set_time_limit(0);
ini_set('max_execution_time', 600);
$u = urldecode($_GET['url']);
#validate
$youtube = "/^(https:\/\/|http:\/\/|)(www\.|m\.|)(youtube\.com\/watch\?v=|youtu\.be\/)[\w-]+$/";
$playlist ="/^(https:\/\/|http:\/\/|)(www\.|m\.|)(youtube\.com\/playlist\?list=|youtu\.be\/)[\w-]+$/";
if ( preg_match ($youtube, $u ) )
{
exec("tube " . $u );
echo "sent song" . $u;
}
if(preg_match($playlist, $u))
{
exec("tubeplaylist " . $u . " >/dev/null 2>&1 &");
echo "sent playlist" . $u;
}
}
catch (Exception $e) {
echo "Exception : ", $e->getMessage(),"<br />";
}
?>' >> /srv/http/youtube.php
## Javascript Injection into Footer##
file=/srv/http/app/templates/footer.php
echo $file
echo '<script src="<?=$this->asset('"'"'/js/RuneYoutube.js'"'"')?>"></script>' >> $file
### Tube ###
echo -e "$bar Creasting bash scripts..."
echo $'#!/bin/bash
youtube-dl --no-mtime --embed-thumbnail --restrict-filenames -o \'/mnt/MPD/LocalStorage/Youtube/%(title)s.%(ext)s\' --write-description -f "bestaudio[ext=m4a]" $1 && mpc update --wait LocalStorage/Youtube && VV=$(ls /mnt/MPD/LocalStorage/Youtube/*.description -t | head -n1) && VV=$(basename $VV .description) && mpc add "LocalStorage/Youtube/$VV.m4a" && echo $VV && chown -R http:http /mnt/MPD/LocalStorage/Youtube/$VV.*' >> /usr/local/bin/tube
### Tube playlist ###
echo $'#!/bin/bash
youtube-dl --no-mtime --embed-thumbnail --restrict-filenames --ignore-errors -o \'/mnt/MPD/LocalStorage/Youtube/%(title)s.%(ext)s\' --write-description -f "bestaudio[ext=m4a]" $1 ; mpc update --wait LocalStorage/Youtube
(IFS=\'
\'
for x in $(find /mnt/MPD/LocalStorage/Youtube/ -type f -name *.description -mmin -15); do VV=$(basename "$x" .description) && mpc add "LocalStorage/Youtube/$VV.m4a" && echo $VV && rm $x; done)
#Find all descriptions less than 15 min modifcation time then add to playlist' >> /usr/local/bin/tubeplaylist
echo -e "$bar Patching files ..."
file=/srv/http/app/templates/playback.php
echo $file
sed -i -e $'/<button id="pl-manage-save" class="btn btn-default" type="button" title="Save current queue as playlist" data-toggle="modal" data-target="#modal-pl-save"><i class="fa fa-save"><\/i><\/button>/ a\
<!-- RUNE_YOUTUBE_MOD -->\
<button id="pl-import-youtube" class="btn btn-default" type="button" title="Import a playlist or video from youtube." data-toggle="modal" data-target="#modal-pl-youtube"><i class="fa fa-youtube-play"></i></button>\
<!-- END_RUNE_YOUTUBE_MOD -->' -e $'/<div id="modal-pl-save" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-pl-save-label" aria-hidden="true">/ i\
<!-- RUNE_YOUTUBE_MOD -->\
<div id="modal-pl-youtube" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-pl-youtube-label" aria-hidden="true">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header">\
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\
<h3 class="modal-title" id="modal-pl-youtube-label">Import from youtube</h3>\
</div>\
<div class="modal-body">\
<label for="pl-video-url">Enter a video or playlist url</label>\
<input id="pl-video-url" class="form-control osk-trigger" type="text" placeholder="Enter url">\
</div>\
<div class="modal-footer">\
<button type="button" class="btn btn-default btn-lg" data-dismiss="modal">Close</button>\
<button type="button" id="modal-pl-youtube-btn" class="btn btn-primary btn-lg" data-dismiss="modal">Import</button>\
</div>\
</div>\
</div>\
</div>\
<!-- END_RUNE_YOUTUBE_MOD -->' $file
# for RuneUI Enhancement
file=/srv/http/app/templates/playbackcustom.php
[[ -e $file ]] && sed -i '/id="pl-import-youtube"/ {s/<!--//; s/-->//}' $file
echo -e "$bar Creating YouTube storage directory ..."
dir=/mnt/MPD/LocalStorage/Youtube
echo $dir
mkdir $dir
echo -e "$bar Updating file permissions..."
chmod 777 /usr/local/bin/tube
chmod 777 /usr/local/bin/tubeplaylist
chmod 777 /srv/http/youtube.php
chown http:http /srv/http/youtube.php
chown http:http /usr/local/bin/tube
chown http:http /usr/local/bin/tubeplaylist
chown http:http /mnt/MPD/LocalStorage/Youtube
echo -e "$bar Getting album art..."
wgetnc $gitpath/cover.png -P /mnt/MPD/LocalStorage/Youtube
# end custom script --------------------------------------------------------------------------------<<<
### template - function: save version to database, finish message
installfinish $@
clearcache
#Check dependancies
echo -e "$bar #### Check you have expanded root FS or you will only be able to store 10 songs ####"
 
Chỉnh sửa lần cuối:

nghiadalat

Well-Known Member
Cuối cùng mình cũng dò được chỗ con điện trở bung ra (bên phần digital đối chiếu con 502DAC). Mình check các cổng out hoạt động tốt . Riêng phần Analog con 502DAC pro nghe hay ạ . Mix hay quá ! :rolleyes:

S8.jpg


Đang nghe Album này hay tuyệt a . :oops::cool::mad:

S9.jpg
Đang thèm một chút của lạ, nhà bác làm nhà em nôn nao quá.
 

vominhchi

Well-Known Member
Cuối cùng mình cũng dò được chỗ con điện trở bung ra (bên phần digital đối chiếu con 502DAC). Mình check các cổng out hoạt động tốt . Riêng phần Analog con 502DAC pro nghe hay ạ . Mix hay quá ! :rolleyes:

S8.jpg


Đang nghe Album này hay tuyệt a . :oops::cool::mad:

S9.jpg
Bác có xài isolator ko?
 

tml3nr

Moderator
Add-on này, theo em đọc code, không đụng gì đến kernel đâu, bác khỏi lo xa.

Có phần pacman -Sy nhưng là option, còn lại đều vô hại.

Mã:
#!/bin/bash
# main reference
alias=RuneYoutube
### template - import default variables, functions
. /srv/http/addonstitle.sh
### template - function: start message, installed check
installstart $@
### template - function: get repository zip and extract to system directories
getinstallzip
### template - function: (optional) rank miror servers and 'pacman -Sy' before install packages
rankmirrors
command -v ffmpeg >/dev/null 2>&1 || { echo -e "$warn ERROR: ffmpeg is not installed, please run the MPC Upgrade first." >&2; exit 1; }
gitpath=https://github.com/xortuna/RuneYoutubeAddon/raw/master/
### PACMAN ###
echo -e "$bar Installing youtube-dl and atomicparsley..."
pacman -S --noconfirm youtube-dl atomicparsley
### PHP Script ###
echo -e "$bar Creating web files..."
echo '<?php
try {
set_time_limit(0);
ini_set('max_execution_time', 600);
$u = urldecode($_GET['url']);
#validate
$youtube = "/^(https:\/\/|http:\/\/|)(www\.|m\.|)(youtube\.com\/watch\?v=|youtu\.be\/)[\w-]+$/";
$playlist ="/^(https:\/\/|http:\/\/|)(www\.|m\.|)(youtube\.com\/playlist\?list=|youtu\.be\/)[\w-]+$/";
if ( preg_match ($youtube, $u ) )
{
exec("tube " . $u );
echo "sent song" . $u;
}
if(preg_match($playlist, $u))
{
exec("tubeplaylist " . $u . " >/dev/null 2>&1 &");
echo "sent playlist" . $u;
}
}
catch (Exception $e) {
echo "Exception : ", $e->getMessage(),"<br />";
}
?>' >> /srv/http/youtube.php
## Javascript Injection into Footer##
file=/srv/http/app/templates/footer.php
echo $file
echo '<script src="<?=$this->asset('"'"'/js/RuneYoutube.js'"'"')?>"></script>' >> $file
### Tube ###
echo -e "$bar Creasting bash scripts..."
echo $'#!/bin/bash
youtube-dl --no-mtime --embed-thumbnail --restrict-filenames -o \'/mnt/MPD/LocalStorage/Youtube/%(title)s.%(ext)s\' --write-description -f "bestaudio[ext=m4a]" $1 && mpc update --wait LocalStorage/Youtube && VV=$(ls /mnt/MPD/LocalStorage/Youtube/*.description -t | head -n1) && VV=$(basename $VV .description) && mpc add "LocalStorage/Youtube/$VV.m4a" && echo $VV && chown -R http:http /mnt/MPD/LocalStorage/Youtube/$VV.*' >> /usr/local/bin/tube
### Tube playlist ###
echo $'#!/bin/bash
youtube-dl --no-mtime --embed-thumbnail --restrict-filenames --ignore-errors -o \'/mnt/MPD/LocalStorage/Youtube/%(title)s.%(ext)s\' --write-description -f "bestaudio[ext=m4a]" $1 ; mpc update --wait LocalStorage/Youtube
(IFS=\'
\'
for x in $(find /mnt/MPD/LocalStorage/Youtube/ -type f -name *.description -mmin -15); do VV=$(basename "$x" .description) && mpc add "LocalStorage/Youtube/$VV.m4a" && echo $VV && rm $x; done)
#Find all descriptions less than 15 min modifcation time then add to playlist' >> /usr/local/bin/tubeplaylist
echo -e "$bar Patching files ..."
file=/srv/http/app/templates/playback.php
echo $file
sed -i -e $'/<button id="pl-manage-save" class="btn btn-default" type="button" title="Save current queue as playlist" data-toggle="modal" data-target="#modal-pl-save"><i class="fa fa-save"><\/i><\/button>/ a\
<!-- RUNE_YOUTUBE_MOD -->\
<button id="pl-import-youtube" class="btn btn-default" type="button" title="Import a playlist or video from youtube." data-toggle="modal" data-target="#modal-pl-youtube"><i class="fa fa-youtube-play"></i></button>\
<!-- END_RUNE_YOUTUBE_MOD -->' -e $'/<div id="modal-pl-save" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-pl-save-label" aria-hidden="true">/ i\
<!-- RUNE_YOUTUBE_MOD -->\
<div id="modal-pl-youtube" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-pl-youtube-label" aria-hidden="true">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header">\
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\
<h3 class="modal-title" id="modal-pl-youtube-label">Import from youtube</h3>\
</div>\
<div class="modal-body">\
<label for="pl-video-url">Enter a video or playlist url</label>\
<input id="pl-video-url" class="form-control osk-trigger" type="text" placeholder="Enter url">\
</div>\
<div class="modal-footer">\
<button type="button" class="btn btn-default btn-lg" data-dismiss="modal">Close</button>\
<button type="button" id="modal-pl-youtube-btn" class="btn btn-primary btn-lg" data-dismiss="modal">Import</button>\
</div>\
</div>\
</div>\
</div>\
<!-- END_RUNE_YOUTUBE_MOD -->' $file
# for RuneUI Enhancement
file=/srv/http/app/templates/playbackcustom.php
[[ -e $file ]] && sed -i '/id="pl-import-youtube"/ {s/<!--//; s/-->//}' $file
echo -e "$bar Creating YouTube storage directory ..."
dir=/mnt/MPD/LocalStorage/Youtube
echo $dir
mkdir $dir
echo -e "$bar Updating file permissions..."
chmod 777 /usr/local/bin/tube
chmod 777 /usr/local/bin/tubeplaylist
chmod 777 /srv/http/youtube.php
chown http:http /srv/http/youtube.php
chown http:http /usr/local/bin/tube
chown http:http /usr/local/bin/tubeplaylist
chown http:http /mnt/MPD/LocalStorage/Youtube
echo -e "$bar Getting album art..."
wgetnc $gitpath/cover.png -P /mnt/MPD/LocalStorage/Youtube
# end custom script --------------------------------------------------------------------------------<<<
### template - function: save version to database, finish message
installfinish $@
clearcache
#Check dependancies
echo -e "$bar #### Check you have expanded root FS or you will only be able to store 10 songs ####"
Cảm ơn anh. Hôm nào rãnh em sẽ thử luôn cho hết tuồng vụ play audio Youtube :cool:
 
Chỉnh sửa lần cuối:

linh0983

Well-Known Member
Hi ! Lại nói về con 520DAC Pro a . Chú này phần Digital và Analog thì ngon nhưng nóng các bác . Do 2 con LME49600 (khuếch đại tai nghe) tỏa nhiệt . Mình thấy họ ship luôn cái case ko dùng được nó kín mít cho dù đục lỗ cũng ko ăn thua . Theo mình các bác độn gấp đôi con bulong cao lên là ok mình đã mở suốt 24 giờ ko vấn đề gì .

IMG_20171128_071525.jpg


Trước khi dùng tai nghe (nếu muốn thử) chỉnh volume sofware khoàng 15% nếu ko muốn thủng màng nhĩ a .
Mình có so sánh cùng 1 bản nhạc (loa ngoài) tiếng leng keng con này nghe rất rõ bay bay ở đâu đâu đấy a khi dùng remote chuyển qua lại giữa các DAC HAT . :p
 

vinh57

Member
Cài có đơn giản ko bác mình thì chậm chạp theo pháp bác @tml3nr vòng vòng chóng cả mặt . :D
Trình buble mình đang dùng điều khiển moode bình thường ,trên dt bạn mở youtube ấn share lần đầu tiên bạn ấn nó sẽ tự động thêm một ứng dụng gì đó hố trợ thêm sau đó bạn trở lại youtube bạn share lại và rất đơn giản
 

tml3nr

Moderator
Cài có đơn giản ko bác mình thì chậm chạp theo pháp bác @tml3nr vòng vòng chóng cả mặt . :D
Cái vụ lấy VLC phát radio hay lắm đó anh. Nói anh đừng cười chứ em mất 3 tuần vật vã mới mò ra tới nó. Riêng cái dòng lệnh #transcode{vcodec=none,acodec=mp3,ab=320... em mất 3 ngày mới mò ra :D

Em đang phát... bolero từ Youtube. Các anh có rãnh add vô nghe thử xem sao ạ. IP hiện tại là
Mã:
http://14.169.108.248:8080/vlc.mp3

vlc_radio.png
 
Chỉnh sửa lần cuối:

tml3nr

Moderator
Trình buble mình đang dùng điều khiển moode bình thường ,trên dt bạn mở youtube ấn share lần đầu tiên bạn ấn nó sẽ tự động thêm một ứng dụng gì đó hố trợ thêm sau đó bạn trở lại youtube bạn share lại và rất đơn giản
Anh chụp vài cái hình cho bọn em xem với ạ?
 

hoangmaianh123

Active Member
Cái vụ lấy VLC phát radio hay lắm đó anh. Nói anh đừng cười chứ em mất 3 tuần vật vã mới mò ra tới nó. Riêng cái dòng lệnh #transcode{vcodec=none,acodec=mp3,ab=320... em mất 3 ngày mới mò ra :D

Em đang phát... bolero từ Youtube. Anh có rãnh add vô nghe thử xem sao ạ. IP hiện tại là


vlc_02.png
[/QUOTE
Dùng VLC phát qua Rune nghe hay,mình cũng đã thử phát Youtube trên Rune nhưng không bằng VLC .
 
Bên trên