Mpd mpc/zh-hans

From Qi-Hardware
Jump to: navigation, search

[edit] 安装

首先,必须更新openWRT的源代码文件夹:

$ cd openwrt-xburst
$ scripts/feeds update

之后,安装mpd/mpc和alsa utils:

$ scripts/feeds install alsa-lib
$ scripts/feeds install alsa-utils
$ scripts/feeds install alsa-utils-tests
$ scripts/feeds install mpd
$ scripts/feeds install mpc

[edit] 配置

openwrt-xburst文件夹里运行:

$ make menuconfig

Sound菜单里, 启用[mpc] [mpd]. 在Base system菜单里, 启用libstdcpp. 之后, 运行make.

$ make

你会得到含有mpd/mpc的rootfs.你需要修改""/etc/mpd.conf""让它跑起来 uncomment :

  music_directory	"~/music"
  playlist_directory	"~/.mpd/playlists"
  db_file		"~/.mpd/database"
  log_file		"~/.mpd/log"
  pid_file		"~/.mpd/pid"
  state_file		"~/.mpd/state"

增加默认网关地址

$ route add default gw 192.168.1.2

运行"alsamixer"启动DAC然后你可以运行一些命令来玩玩在线电台

$ mpc add http://sc-rly.181.fm:80/stream/1023
$ mpc play

[edit] 宿主机的设置

# ifconfig usb0 192.168.1.2
# modprobe iptable_nat
# echo "1" > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Personal tools
Namespaces
Variants
Actions
Navigation
interactive
Toolbox
Print/export