{"id":256180,"date":"2023-12-05T10:55:32","date_gmt":"2023-12-05T02:55:32","guid":{"rendered":"https:\/\/blog.zhenglei.net\/?p=256180"},"modified":"2023-12-05T10:55:32","modified_gmt":"2023-12-05T02:55:32","slug":"setup-home-wifi-audio-system","status":"publish","type":"post","link":"https:\/\/blog.zhenglei.net\/?p=256180","title":{"rendered":"Setup Home WiFi Audio System"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Build home MPD wifi audio system, by combine:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Active Speaker<\/li>\n\n\n\n<li>Wifi Router with usb port, and support openwrt<\/li>\n\n\n\n<li>USB sound card<\/li>\n<\/ul>\n\n\n\n<p> <\/p>\n\n\n\n<p>Upgrade openwrt to the latest version<\/p>\n\n\n\n<p>SSH log into openwrt<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>######################################\n######### Repository #################\n\ncp \/etc\/opkg\/distfeeds.conf  \/etc\/opkg\/distfeeds.conf.bak\nsed -i \"s#downloads.openwrt.org#mirrors.ustc.edu.cn\/openwrt#g\" \/etc\/opkg\/distfeeds.conf\n#sed -i \"s#downloads.openwrt.org#mirrors.tuna.tsinghua.edu.cn\/openwrt#g\" \/etc\/opkg\/distfeeds.conf\n#sed -i \"s#downloads.openwrt.org#mirrors.aliyun.com\/openwrt#g\" \/etc\/opkg\/distfeeds.conf\n#sed -i \"s#downloads.openwrt.org#mirrors.cloud.tencent.com\/openwrt#g\" \/etc\/opkg\/distfeeds.conf\n\nopkg update\n\n\n######################################\n########## pulseaudio ################\n\nopkg install kmod-input-core\nopkg install kmod-sound-core\nopkg install kmod-usb-audio\nopkg install pulseaudio-daemon\n\n\n#########################################\n########## Sound Blaster ################\n# opkg install kmod-ac97\n# opkg install kmod-sound-ens1371\n\n\n########## AC 97 ########################\n#opkg install kmod-sound-cs5535audio \n\n\n####### Motherboard Sound Card ##########\n#opkg install  kmod-sound-i8x0\n\n############ Soc Sound Card #############\n#opkg install  kmod-sound-soc-core \n\n\n\n##### Editor ############################ \n# opkg install nano\n\n\n###########  Utility  ###################\n#opkg install usbutils\n#opkg install alsa-utils\n\n\n### Allow module load ###\nsed -i \"s\/--disallow-module-loading\/\/\"   \/etc\/init.d\/pulseaudio\n\n### Load TCP module ###\nsed -i \"s\/load-module module-native-protocol-unix\/load-module module-native-protocol-tcp auth-anonymous=1\/\"  \/etc\/pulse\/system.pa\n\n\n\n\n\n### Firewall ###\nsh -c \" cat >\/etc\/config\/firewall \" &lt;&lt; EOF\n\n\n######  ssh port ##################\nconfig redirect\n       option src              wan\n       option src_dport        22\n       option dest             lan\n       option dest_ip          192.168.1.1\n       option dest_port        22\n       option proto            tcp\n\n###### pulseaudio port ############\nconfig redirect\n       option src              wan\n       option src_dport        4713\n       option dest             lan\n       option dest_ip          192.168.1.1\n       option dest_port        4713\n       option proto            tcp\n\n###### Http Port ##################\nonfig redirect\n        option src 'wan'\n        option src_dport '80'\n        option dest 'lan'\n        option dest_ip '192.168.1.1'\n        option dest_port '80'\n        option proto 'tcp'\n\nEOF\n\n\n\n\/etc\/init.d\/firewall   restart\n\/etc\/init.d\/pulseaudio restart\n\n\n\n\n######################################\n######################################\n########## WiFI Relay ################\nopkg install relayd\nopkg install luci-proto-relay\n\n\n# From web admin portal, setup new wireless wan port for 5G and 2G separately:\n# http:\/\/192.168.1.1\/cgi-bin\/luci\/\n### Network\n### Wireless\n### Scan\n### Selected your existed SSID, Joining Network\n### ## Replace wireless configuration  = yes\n### ## Create \/ Assign firewall-zone   = LAN\n### Go to Network\/Interface\n### Set the IP of  wireless wan, as normal<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Login into your MPD system,  add the following block into the the mpd.conf file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>audio_output {\n\n type \"pulse\"\n\n name \" Wifi Router\"\n\n server \"IP_OF_WIFI_ROUTER:4713\" \n\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Now, you can find  the &#8220;Wifi Router&#8221; option item,  from Outputs\/Server properties\/M.A.L.P, suppose M.A.L.P apk installed android handset<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Build home MPD wifi audio system, by com &hellip; <a href=\"https:\/\/blog.zhenglei.net\/?p=256180\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[233,12],"tags":[111,403,204,229],"class_list":["post-256180","post","type-post","status-publish","format-standard","hentry","category-openwrt","category-streaming","tag-audio","tag-mpd","tag-openwrt","tag-router"],"_links":{"self":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts\/256180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256180"}],"version-history":[{"count":1,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts\/256180\/revisions"}],"predecessor-version":[{"id":256181,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=\/wp\/v2\/posts\/256180\/revisions\/256181"}],"wp:attachment":[{"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhenglei.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}