Play Wireless Audio using Raspberry Pi
This is quite easy by using VLC player.
Step:1 Download and install VLC player in your raspberry pi( I am using Raspbian OS)
First ensure you have the latest Raspbian by using following command
sudo apt-get update
Then install VLC
sudo apt-get vlc installRun VLC player, go to view and select web in interface
In Linux it is not easy to get access
VLC in the latest versions uses a file called '.hosts' to define which computers can access the VLC remote player. You need to open this file and edit it:
you will need to edit the hosts file:
the file is in /usr/share/vlc/lua/http/.hosts
To edit this file from the command line (making sure I have permission to save changes), I use
cd /usr/share/vlc/lua/http/ sudo nano .hosts
# Access-list for VLC HTTP interface # $Id$ # # localhost ::1 127.0.0.1 # link-local addresses #fe80::/64 # private addresses fc00::/7 fec0::/10 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 169.254.0.0/16 #EndThen save the file.
Now this is the time to test the VLC player web interface is working or not.
Open the browser in Raspberry and type:
http://localhost:8080
If you see the above screen you are ready from Pi side.
Install VLCdirectpro from Android market and connect to the same network.
Open VLC Direct in your device
Open menu
Go to "Settings"
Click "Automatic Connection Wizard"
Click "Start". VLC Direct will start scanning the network, looking for VLC.
That's it! VLC Direct is now configured and ready to use!
Click "Automatic Connection Wizard"

For better Audio Quality refer to the following links to install Pulse Audio MPD:



Please make sure you are connected to your mobile and Pi in the same wireless and LAN.
ReplyDeleteIn my home I am using a wireless router which have LAN ports. Raspberry pi is connected to LAN port and Mobile is connected using WiFi.
Start VLC automatic at startup
ReplyDeletesudo nano /etc/init.d/vlc
vlc --extraintf http
# vlc autostart created by Nanda
export USER='pi'
eval cd ~$USER
# Check the state of the command - this'll either be start or stop
case "$1" in
start)
# if it's start, then start vlc using the details below
su $USER -c '/usr/bin/vlc --extraintf http
echo "Starting vlc for $USER "
;;
stop)
# if it's stop, then just kill the process
pkill Xvlc
echo "vlc stopped"
;;
*)
echo "Usage: /etc/init.d/vlc{start|stop}"
exit 1
;;
esac
exit 0
Set file properties
Once that's done make sure the file has the right propertied by typing the following:
sudo chmod 755 /etc/init.d/vlc
NOTE: Important to do this step every time you modify this file. I redid these steps to create the tutorial, skipped this step and couldn't VLC in on the reboot!
Add File to startup sequence
And now just add your file to the list of startup actions by typing the following:
sudo update-rc.d vlc defaults
And that should be it! Just restart, and you should be able to VLC straight in!
Thanks Nanda. Good solution I can play music when in bed :)
ReplyDelete