Name Mode Size
LICENSE 100644 1 kb 100644 3 kb
defaultnortp_pa 100644 1 kb
defaultrtp_pa 100644 1 kb 100644 3 kb
rtpoff 100644 0 kb
rtpon 100644 0 kb
# rtp_mpd_pulseaudio_switcher A script in bash to switch MPD outputs to turn on and off RTP multicast across the LAN. #About Simple bash script to turn off rtp by swapping pulseaudio pref files in user config directory. Also toggles MPD. Because RTP takes up bandwidth across your LAN. Related: If you're having trouble with RTP and UFW, [see my UFW setup script](, or try using the following commands: sudo iptables -A ufw-before-input -p igmp -d -j ACCEPT sudo iptables -A ufw-before-output -p igmp -d -j ACCEPT sudo ufw allow in proto udp from sudo ufw allow in proto udp to Related: If you're having problems with UFW clobbering your wifi, you can filter it at the router level if you're using DD-WRT. Try this code in your firewall: insmod ebtables insmod ebtable_filter iptables -I FORWARD -m pkttype --pkt-type multicast -i br0 -j DROP (via ) or if that doesn't work, try *this* insmod ebtables insmod ebtable_filter insmod ebt_pkttype ebtables -A FORWARD -o "interface to block" --pkttype-type multicast -j DROP ebtables -A OUTPUT -o "interface to block" --pkttype-type multicast -j DROP (via ) #Prerequisites Pulseaudio MPD MPC They should all be available in your distro. #Installation Copy it. run it as necessary. I call it by a combination of a tasker task and SSH plugin. If you have user configurations in $HOME/.config/pulse, you will want to merge them into the included files. **$HOME/.config/pulse/ will be overwritten.** Remember, the user config can be only overriding values (if you include the default), which I've done in these snippets. You'll need to put in the appropriate pulseaudio switches as well. You will want to edit the switcher script with the appropriate MPD outputs. Use mpc to determine what outputs you switch to and from mpc outputs Output 1 (Icecast Radio) is disabled Output 2 (My Pulse Output) is enabled Output 3 (MPD RTP) is disabled #Via SSH ```/usr/bin/ssh -F $HOME/.ssh/config -i $HOME/.ssh/my_rsa_key -q MPD_HOST 2> /dev/null < $HOME/rtpoff ```/usr/bin/ssh -F $HOME/.ssh/config -i $HOME/.ssh/my_rsa_key -q MPD_HOST 2> /dev/null < $HOME/rtpon You're using those above to funnel a command into SSH, the command in question should be the only thing in those files. #TODO * Use sed so that it's not clobbering user if you have additonal stuff in there. * Detect MPD outputs so you don't have to hardcode them