找回密碼
 新用戶註冊
搜索
熱搜: hifi av 音樂
樓主: obee

[CAS] 又平又正的 CAS (MPD on Linux) - 2013-05-02

[複製鏈接]
發表於 2013-3-11 12:55:44 | 顯示全部樓層
ah....i see. will give a try and see. it sounds really complicated.
回復

使用道具 舉報

 樓主| 發表於 2013-3-11 13:02:58 | 顯示全部樓層
在 Pogoplug 上 compile MPD latest stable version.
首先, 我唔建議大家咁做, 要玩好的 MPD, 我建議買cubox + 日本人 Yo 的 image. 因為佢地 tune 好左個 mpd. 其次,  pogoplug 跟的 mpd 係 version 0.15 (現在的 stable version 係 version 0.17.3), 都夠用.

不過, 如果都想玩下, 可以跟下面 steps:
(login pogoplug via SSH, using "root")
1. Install basic MPD libraries
  1. apt-get install build-essential libncurses5-dev libncursesw5-dev libglib2.0-dev
複製代碼
2. Install optional libraries
  1. apt-get -y install libid3tag0 libid3tag0-dev libmad0 libmad0-dev libcue-dev libcue1 libasound2 libasound-dev libasound2-dev libsamplerate0 libsamplerate-dev libavformat52 libavformat-dev libavcodec-dev libavcodec52 libavutil49 libavutil-dev libaudiofile0 libaudiofile-dev libavahi-client-dev libavahi-glib-dev
複製代碼
3. Download latest MPD (v0.17.3)
  1. wget http://downloads.sourceforge.net/project/musicpd/mpd/0.17.3/mpd-0.17.3.tar.bz2
  2. bunzip2 mpd-0.17.3.tar.bz2
  3. ls
  4. tar xvf mpd-0.17.3.tar
複製代碼
4. Configure & make
  1. cd mpd-0.17.3
  2. ./configure
  3. make
  4. make install
複製代碼
5. Restart mpd & check version
  1. service mpd restart
  2. mpd -V
複製代碼
未命名.png
回復

使用道具 舉報

 樓主| 發表於 2013-3-11 19:17:49 | 顯示全部樓層
本帖最後由 obee 於 2013-3-16 10:37 編輯

Pogoplug + MPD 另一玩法 --- 裝 ArchLinux (上)
同上文所介紹過嘅 Sheevaplug 版本類似, 但呢個 Arch Linux 有keep 住更新, 所以我會建議如果對Linux較有經驗嘅師兄玩呢個 Arch Linux:
http://archlinuxarm.org/platform ... tform_tabs-ui-tabs2
(下面的只係將setup 內容寫多次...)

Pogoplug 係一個好平又可以玩到 Linux + MPD 嘅方案, 但如果講易 setup, Cubox 會易好多, 只係 write image + setup network share (mount) 就可以, 打少好多 command, 無咁易出錯.


1. 如上文講, 新開盒的 pogoplug 要做以下 step, 否則可跳到下個 step
1.1 插電, network 線, 開機
1.2 找出IP, 用putty (Windows) 或 terminal + ssh (Mac) login
1.3 打 command:
  1. killall hbwd
複製代碼
  1. cd /tmp
  2. wget http://jeff.doozan.com/debian/uboot/install_uboot_mtd0.sh
  3. chmod +x install_uboot_mtd0.sh
  4. ./install_uboot_mtd0.sh
複製代碼
2. 裝左 step 1 的 boot loader 後, 不用poweroff / reboot. 插入 1G 或以上的 USB 手指 (不用事先 format)
2.1 "界" partition:
  1. /sbin/fdisk /dev/sda
複製代碼

2.2 按 "o". 清晒成隻手指
2.3 按 "n", 再按 "p", 再按 "1", 再按 "enter", 再按 "w", 就"界"做好左一個 Linux partition


3. 接住, 打以下 command:
  1. cd /tmp
  2. wget http://archlinuxarm.org/os/pogoplug/mke2fs
  3. chmod 755 mke2fs
  4. ./mke2fs -j /dev/sda1
複製代碼
會同個新 partition 做 format


等一/兩分鐘... OK 了


4. 接住, 打以下 command 去 download Arch Linux:
  1. mkdir usb
  2. mount /dev/sda1 usb
  3. cd usb
  4. wget http://archlinuxarm.org/os/ArchLinuxARM-armv5te-latest.tar.gz
複製代碼
(這個 Arch Linux 係最新版本的)5. 接住, 打以下 command 去爆開 Arch Linux 去隻 USB 手指:
  1. tar -xzvf ArchLinuxARM-armv5te-*.tar.gz
複製代碼
等十分鐘左右...


6. 最後, delete 左唔要嘅野同 reboot, 正常嘅話, 個 pogoplug 會著黃燈, 你可以用 ssh login 去 Arch Linux.
  1. rm ArchLinuxARM-armv5te-*.tar.gz
  2. sync
  3. cd ..
  4. umount usb
  5. reboot
複製代碼


如果 reboot 後著綠燈, 或者著黃燈但等左5分鐘都 login 唔到, 咁可能你的 usb 手指唔夾...

(login username 係 "root", password 都係 "root")


如果 login 到, 可以繼續 "Pogoplug + MPD 另一玩法 --- 裝 ArchLinux (下)"

Update: 2013-03-16: 我發現就算 reboot 後著黃燈, 佢都有可能 boot 唔起, 但留左係用 usb boot, 但又無 boot 到嘅情況, 唔知有無師兄都有呢個情況?

http://archlinuxarm.org/forum/viewtopic.php?f=18&t=4778
回復

使用道具 舉報

發表於 2013-3-12 23:09:09 | 顯示全部樓層
Hi obee, thx for your sharing!

I have done all tasks. And run
"ls /var/lib/mpd/music"
List music files

It can connect to MPD via Android MPD client but it can't load playlist. Same as other ching.

I tried to "service mpd restart" but I got this error.

------------------------------------
root@squeezeplug:~# service mpd restart
Stopping Music Player Daemon: mpd.
Starting Music Player Daemon: mpdfailed to stat music directory "/var/lib/mpd/music": Value too large for defined data type
.
------------------------------------
回復

使用道具 舉報

發表於 2013-3-12 23:23:59 | 顯示全部樓層
Tried to search Internet. It can solve by

----------
Change
----------
echo "xxx.xxx.xxx.xxx:/MusicFolder /var/lib/mpd/music cifs username=Music,password=music,file_mode=0644,dir_mode=0755,iocharset=utf8 0 0" >> /etc/fstab
----------
To
----------
mount -t smbfs -o noserverino,ro,username=Music,password=music //xxx.xxx.xxx.xxx/MusicFolder /var/lib/mpd/music
回復

使用道具 舉報

發表於 2013-3-13 00:13:16 | 顯示全部樓層
When I am trying to play music, it show this error.
------------------
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
Mar 13 00:05 : output: Failed to open "My ALSA Device" [alsa]: Failed to open ALSA device "hw:0,0": No such file or directory
------------------

My device M2Tech Hiface Two
------------------
root@squeezeplug:/music# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: M20 [M2Tech USB Audio 2.0], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
------------------
回復

使用道具 舉報

 樓主| 發表於 2013-3-13 00:34:19 | 顯示全部樓層
warren.wslee 發表於 2013-3-13 00:13
When I am trying to play music, it show this error.
------------------
ALSA lib pcm_hw.c:1401:(_snd_ ...

try to replace the line "device    hw:0,0" to "device     hw:1,0" in /etc/mpd.conf

Then restart mpd, try again.
回復

使用道具 舉報

 樓主| 發表於 2013-3-13 00:36:02 | 顯示全部樓層
warren.wslee 發表於 2013-3-12 23:23
Tried to search Internet. It can solve by

----------


The way you do won't persist after poweroff or reboot. You should update the /etc/fstab for auto-mounting.
回復

使用道具 舉報

 樓主| 發表於 2013-3-13 00:52:42 | 顯示全部樓層
warren.wslee 發表於 2013-3-13 00:13
When I am trying to play music, it show this error.
------------------
ALSA lib pcm_hw.c:1401:(_snd_ ...

btw, is M2Tech plug-and-play?
回復

使用道具 舉報

發表於 2013-3-13 03:33:24 | 顯示全部樓層
obee 發表於 2013-3-13 00:34
try to replace the line "device    hw:0,0" to "device     hw:1,0" in /etc/mpd.conf

Then restart m ...

Checked. To support Hiface Two, it requires ALSA 1.0.24 or later for. The SqueezePlug (4.0.6) ALSA version is 1.0.23. I tried to upgrade but it can't due to can't find kernel source.

------------------
checking for directory with ALSA kernel sources... /tmp/alsa-driver-1.0.25/alsa-kernel
checking for directory with kernel source... Please install the package with full kernel sources for your distribution
or use --with-kernel=dir option to specify another directory with kernel
sources (default is /usr/src/linux).
------------------
回復

使用道具 舉報

 樓主| 發表於 2013-3-15 09:47:23 | 顯示全部樓層
Pogoplug + MPD 另一玩法 --- 裝 ArchLinux (下)
接上文...
用 root (password = root) login 後, 執行:
  1. pacman -Syu;
複製代碼
等1分鐘 (如果佢出現 network error / file not found 之類, 請重打多次個 command)
  1. pacman -S mpd alsa-utils mpc;
複製代碼
等 5-10分鐘 (如果佢出現 network error / file not found 之類, 請重打多次個 command)
  1. pacman -S nfs-utils unzip git gcc make bc
複製代碼
等 5-10分鐘 (如果佢出現 network error / file not found 之類, 請重打多次個 command)


之後 edit 番個 /etc/mpd.conf:
https://wiki.archlinux.org/index.php/Music_Player_Daemon
回復

使用道具 舉報

發表於 2013-3-15 11:39:46 | 顯示全部樓層
Obee hing

I follow your instruction (but use 406 image instead) and I can start up MPD.  However it seems it cannot locate my USB drive.  Should I make a mount point for my USB drive ?  If yes, how to make MPD looking for music file from the USB drive ?
回復

使用道具 舉報

 樓主| 發表於 2013-3-15 11:47:13 | 顯示全部樓層
elo 發表於 2013-3-15 11:39
Obee hing

I follow your instruction (but use 406 image instead) and I can start up MPD.  However it ...

You need to mount the USB first.
You can run "setup", I remember there's an option to mount the USB drive. Then you add a symbolic link of the USB mount point to the mpd music library.
For example (just an example!), if your USB mount at "/mnt/usb", then you can run "ln -s /var/lib/mpd/music/usb /mnt/usb", and you can see the folder "usb" inside music library of mpd.

Of course, you need to "refresh database"
回復

使用道具 舉報

 樓主| 發表於 2013-3-15 12:04:13 | 顯示全部樓層
Linux 下透過 SSH Upload / Download File
好多時候, 我地想將 file(s) 由 linux upload / download, 有唔小方法, 我建議用SSH上的FTP.
呢個叫 mindterm 的幾好用: http://www.cryptzone.com/products/mindterm/

先去download 個 free edition, 之後係電腦上打開 mindterm.jar (你的 Windows / Mac 要有 Java Runtime Environment).


出左個 login 畫面, 輸入 cubox / pogoplug 的 IP address....
Login 之後, menu bar 上: "Plugins" -> "SFTP File Transfer"


咁就可以 upload / download file! (用過 cuteftp 的實識用, 唔多講)
回復

使用道具 舉報

發表於 2013-3-15 18:52:30 | 顯示全部樓層
Obee hing

I typed the command "ln -s /var/lib/mpd/music/usb /mnt/usb" but it shows :

ln: creating symbolic link '/mnt/usb/usb' : Operation not permitted.

Please help.
回復

使用道具 舉報

 樓主| 發表於 2013-3-15 19:47:34 | 顯示全部樓層
elo 發表於 2013-3-15 18:52
Obee hing

I typed the command "ln -s /var/lib/mpd/music/usb /mnt/usb" but it shows :

Sorry, I made a mistake.
You should do
"ln -s /mnt/usb /var/lib/mpd/music/usb"
instead
回復

使用道具 舉報

發表於 2013-3-15 21:28:38 | 顯示全部樓層
Thanks. It works!

However after update the database, I can see the music file and but I press play (connected to USB DAC), no music output from the speaker and the timer shows it is still at 0:00, means it did not start playing at all.  Questions:

1. How to check whether my DAC is recognise by Pogoplug ?

2. Why the player do not play the music file (timer shows 0:00) ?

Thanks.
回復

使用道具 舉報

發表於 2013-3-15 21:36:32 | 顯示全部樓層
本帖最後由 elo 於 2013-3-15 21:41 編輯

OK just find out seems my USB DAC recognise by the Pogoplug as when I type aplay -l, it shows :

card 1: A20 (AMR USB Audio 2.0), device 0: USB Audio (USB Audio)
Subdevices: 1/1
Subdevice #0: subdevice #0

What should I need to do after that ?

Thanks.
回復

使用道具 舉報

發表於 2013-3-15 22:11:57 | 顯示全部樓層
Obee hing

I re-read your previous messages here and now I can play the music files without problem.  

Thanks again.
回復

使用道具 舉報

 樓主| 發表於 2013-3-15 23:37:34 | 顯示全部樓層
elo 發表於 2013-3-15 22:11
Obee hing

I re-read your previous messages here and now I can play the music files without problem. ...

Sorry for late reply.
Congrats on your success. I guess you just changed the "hw" value in mpd.conf under "device" option.
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 新用戶註冊

本版積分規則

Archiver|小黑屋|聯絡我們|刊登廣告|Hiendy.com 影音俱樂部 一個屬於音響愛好者的家

GMT+8, 2024-10-3 18:06 , Processed in 0.041545 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表