2015年6月23日 星期二

網樂通安裝shairport

0. 更新source.list (etc/apt/source.list)
#/etc/apt/sources.list

deb [arch=all] http://debian.csie.nctu.edu.tw/debian/ wheezy main contrib non-free
deb-src http://debian.csie.nctu.edu.tw/debian/ wheezy main contrib non-free

deb [arch=all] http://debian.csie.ntu.edu.tw/debian/ wheezy main contrib non-free
deb-src http://debian.csie.ntu.edu.tw/debian/ wheezy main contrib non-free

deb [arch=sh4] http://download.si-linux.co.jp/debian-sh/wheezy-sh4/ wheezy main contrib non-free
deb-src http://download.si-linux.co.jp/debian-sh/wheezy-sh4/ wheezy main contrib non-free

deb http://ftp.yzu.edu.tw/Linux/debian-sh4-for-nextvod/ wheezy all


1. wget http://shana1997o.myweb.hinet.net/wheezy-sh4/kernel_modules-stmfb-1003.tgz

2. tar -xvzf kernel_modules-stmfb-1003.tgz

3. cd kernel_modules-stmfb/

4. mkdir /lib/modules

5. tar -xvzf 2.6.32.59_stm24_0211-PDK7105-32BITS.tgz -C /lib/modules

6. cd ~

7. mkdir /mnt/sda1

8.mount /dev/sda1 /mnt/sda1

9. cp /root/kernel_modules-stmfb/vmlinux.ub /mnt/sda1

10.depmod -a 之後, 在 /etc/modules 裡加入:
stmfb display0=640x480-16@60:3M:0:PAL:RGB
stm_v4l2
stmcore-display-sti7105 hdmi0=enable
stmvbi
stmvout

11. reboot (重開機之後, 再ssh 登入)

12. apt-get update 

如果出現 "no public key available"的話就
apt-get install debian-keyring debian-archive-keyring ,並重新

apt-get update 


13.apt-get install alsa-utils
14. aplay -l (看是否有抓到音效卡)
root@debian-wheezy-sh4:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: STx7105 [STx7105 audio subsystem], device 0: [PCM player #0 (HDMI)]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: STx7105 [STx7105 audio subsystem], device 1: [PCM player #1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: STx7105 [STx7105 audio subsystem], device 2: [SPDIF player (HDMI)]
Subdevices: 1/1
Subdevice #0: subdevice #0
來說就是hw:card,device)

15. 確定輸出沒問題的話, 就可以設定default輸出
a. 在/etc/asound.conf (不存在的話, 就自己建), 輸入以下內容:
pcm.!default {
type hw
card 0
device 1
}

b. /etc/init.d/alsa-utils restart

16.apt-get install build-essential libssl-dev libcrypt-openssl-rsa-perl libao-dev libio-socket-inet6-perl libwww-perl avahi-utils pkg-config git chkconfig libssl-dev libavahi-client-dev libasound2-dev

17.
git clone -b 1.0-dev git://github.com/abrasive/shairport.git
cd shairport
./configure
make
make install

18.測試
shairport -a "wheezy-sh4" 

19. 開機自動啟動
a. cd /etc/init.d
    wget http://img.samantw.com/debian-sh4/shairport 
    chmod +x shairport

b.touch /root/shairport-watchdog.sh 之後在shairport-watchdog.sh加入以下內容:

# find service pids
pgrep shairport

#if we get no pids, service is not running

if [ $? -ne 0 ]

then
  server avahi-daemon restart
  service shairport start
  echo "shairport started or restarted."
fi
c. 在/etc/crontab 裡面加入
* * * * * root /bin/sh /root/shairport-watchdog.sh > /dev/null


沒有留言:

張貼留言