2010-05-17, 05:18
Well with nothing better to do this evening I put together a quick way to integrate Hulu desktop into XBMC and launch it properly.
This isn't the cleanest way or the easiest way but this is the way that works best for me. This guide is pretty step by step but may not be suited for those who aren't comfortable at the command line. So this is very much one of those "Proceed at your own risk" type of things but when you are done you will have the following:
As most of us know by know now Flash on Linux is pretty slow so to give Hulu Desktop all of the processing power it needs I have written this small guide to stop XBMC before launching Hulu. I also run at 1080p but set it to run Hulu Desktop at 720p. Anyway onto the changes
First we need to grab Hulu Desktop
Now install it
Ok now the Hulu is installed we need to get the latest flash player. Currently Ubuntu is only stocking the stable build of flash but the newest beta has some built in hardware acceleration and such that should slightly improve playback. So we don't conflict with flash that is already installed by Ubuntu will put this file in a separate directory.
Now extract
Ok now lets create a hidden directory to store this version of flash.
Now we have to setup hulu. I am going to assume you are using lircd so you can use your remote to control things. We are going to have to make a few changes. First lets start with lirc.
First open up the config file
Now find the following
Change that to
Go ahead and save that and restart lircd
Now to create our .huludesktop file. I am posting my copy of the file I use and I will point out where you may have to make changes. This file needs to be in the home directory of the user who is going to be running Hulu desktop. I the case of XBMC-Live it should be the user xbmc.
Now we need to add this information into the .huludesktop file
The first line that you will have to change to your system is the "lirc_remote_identifier" line. To see what your remotes name is do the following
Then go ahead and change "lirc_remote_identifier" to what ever you remotes name is. In my case my remotes name is "imon_pad" but like I said yours will prob. be different. Also make sure you change the buttons names to correspond to the buttons on your remote. If you are unsure what the button names are just run
Now go ahead and press the buttons you want the names to. You should see output similar to the following
In that example I pressed the up key on my remote.
Now with that all done we need to create a launcher script and then make some changes to xbmc-live launcher script.
First do the following
Insert the following lines
If you dont have a 1080p display and already run at 720p you can remove the xrandr line.
Now make the file executable
Now to modify the the xbmc-live script. This seems odd but for whatever reason when you run something from launcher inside of xbmc and stop xbmc it kills the script in its place. This way the script will keep running once xbmc has been stopped.
Now go to line 68. You should see these blocks of code
Change that to
Depending on how fast your computer is you may have to tweak the sleep command to make sure xbmc and X have enough time to quit.
We are almost there, just one more change. Now we need to make it so xbmc can call the service command without a password.
We need to change the following
Look for the following line
Now change it to
There you go! Now all you have to do is call "sudo service xbmc-live hulu" from XBMC and it will start hulu desktop for you at 720p using the latest flash beta which you can control with your remote. Also when you quit Hulu Desktop it will bring you back to XBMC. I personally used a launcher script to call Hulu up.
Here is my launcher script
Now after all of this tldr; you can sit back, relax and enjoy some 30 Rock or maybe some Air Wolf. If you have any questions feel free to ask.
This isn't the cleanest way or the easiest way but this is the way that works best for me. This guide is pretty step by step but may not be suited for those who aren't comfortable at the command line. So this is very much one of those "Proceed at your own risk" type of things but when you are done you will have the following:
- Working Hulu Desktop
- Launch-able from XBMC at 720p
- Latest Flash beta for ( albeit a small amount ) hardware assistance
- Control with Lircd
As most of us know by know now Flash on Linux is pretty slow so to give Hulu Desktop all of the processing power it needs I have written this small guide to stop XBMC before launching Hulu. I also run at 1080p but set it to run Hulu Desktop at 720p. Anyway onto the changes
First we need to grab Hulu Desktop
Code:
wget http://download.hulu.com/huludesktop_i386.deb
Now install it
Code:
dpkg -i huludesktop_i386.deb
Ok now the Hulu is installed we need to get the latest flash player. Currently Ubuntu is only stocking the stable build of flash but the newest beta has some built in hardware acceleration and such that should slightly improve playback. So we don't conflict with flash that is already installed by Ubuntu will put this file in a separate directory.
Code:
wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_1_rc4_linux_050510.tar.gz
Now extract
Code:
tar zxvf flashplayer10/flashplayer10_1_rc4_linux_050510.tar.gz
Ok now lets create a hidden directory to store this version of flash.
Code:
mkdir .flashlib
mv libflashplayer.so .flashlib
Now we have to setup hulu. I am going to assume you are using lircd so you can use your remote to control things. We are going to have to make a few changes. First lets start with lirc.
First open up the config file
Code:
vi /etc/lirc/hardware.conf
Now find the following
Code:
REMOTE_LIRCD_ARGS=""
Change that to
Code:
REMOTE_LIRCD_ARGS="--release"
Go ahead and save that and restart lircd
Code:
/etc/init.d/lirc restart
Now to create our .huludesktop file. I am posting my copy of the file I use and I will point out where you may have to make changes. This file needs to be in the home directory of the user who is going to be running Hulu desktop. I the case of XBMC-Live it should be the user xbmc.
Code:
vi /home/xbmc/.huludesktop
Now we need to add this information into the .huludesktop file
Code:
[display]
fullscreen = TRUE
width = 1280
height = 729
pos_x = 0
pos_y = 0
[remote]
lirc_device = /dev/lircd
lirc_remote_identifier = imon_pad
lirc_release_suffix = _UP
lirc_repeat_threshold = 10
button_name_up = Up
button_name_down = Down
button_name_left = Left
button_name_right = Right
button_name_select = Enter
button_name_menu = Escape
[flash]
flash_location = /home/xbmc/.flashlib/libflashplayer.so
[screensaver]
suspend_script = (null)
resume_script = (null)
[version]
latest = (null)
eula_version = 1
The first line that you will have to change to your system is the "lirc_remote_identifier" line. To see what your remotes name is do the following
Code:
cat /etc/lirc/lircd.conf | grep name
Then go ahead and change "lirc_remote_identifier" to what ever you remotes name is. In my case my remotes name is "imon_pad" but like I said yours will prob. be different. Also make sure you change the buttons names to correspond to the buttons on your remote. If you are unsure what the button names are just run
Code:
irw
Now go ahead and press the buttons you want the names to. You should see output similar to the following
Code:
0100800000000000 00 Up imon_pad
In that example I pressed the up key on my remote.
Now with that all done we need to create a launcher script and then make some changes to xbmc-live launcher script.
First do the following
Code:
vi /usr/bin/hululauncher.sh
Insert the following lines
Code:
xrandr -d 0:0 -s 1280x720
/usr/bin/huludesktop
If you dont have a 1080p display and already run at 720p you can remove the xrandr line.
Now make the file executable
Code:
chmod +x /usr/bin/hululauncher.sh
Now to modify the the xbmc-live script. This seems odd but for whatever reason when you run something from launcher inside of xbmc and stop xbmc it kills the script in its place. This way the script will keep running once xbmc has been stopped.
Code:
vi /etc/init.d/xbmc-live
Now go to line 68. You should see these blocks of code
Code:
reload|force-reload) $ECHO
$ECHO "Since the script you are attempting to invoke has been converted to a
n"
$ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND
$JOB"
reload "$JOB"
;;
*)
$ECHO
$ECHO "The script you are attempting to invoke has been converted to an Upstart" 1>&2
$ECHO "job, but $COMMAND is not supported for Upstart jobs." 1>&2
exit 1
esac
Change that to
Code:
reload|force-reload) $ECHO
$ECHO "Since the script you are attempting to invoke has been converted to a
n"
$ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND
$JOB"
reload "$JOB"
;;
hulu)
/etc/init.d/xbmc-live stop
sleep 1
su xbmc -c '/usr/bin/xinit /usr/bin/launchhulu.sh' ?
/etc/init.d/xbmc-live start ;;
*)
$ECHO
$ECHO "The script you are attempting to invoke has been converted to an Upstart" 1>&2
$ECHO "job, but $COMMAND is not supported for Upstart jobs." 1>&2
exit 1
esac
Depending on how fast your computer is you may have to tweak the sleep command to make sure xbmc and X have enough time to quit.
We are almost there, just one more change. Now we need to make it so xbmc can call the service command without a password.
We need to change the following
Code:
vi /etc/sudoers
Look for the following line
Code:
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt
Now change it to
Code:
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt, /usr/sbin/service
There you go! Now all you have to do is call "sudo service xbmc-live hulu" from XBMC and it will start hulu desktop for you at 720p using the latest flash beta which you can control with your remote. Also when you quit Hulu Desktop it will bring you back to XBMC. I personally used a launcher script to call Hulu up.
Here is my launcher script
Code:
<launcher>
<name>Hulu</name>
<application>sudo service xbmc-live hulu</application>
<args></args>
<rompath></rompath>
<romext></romext>
<thumb></thumb>
<wait>true</wait>
<roms>
</roms>
</launcher>
Now after all of this tldr; you can sit back, relax and enjoy some 30 Rock or maybe some Air Wolf. If you have any questions feel free to ask.