[LIVE] Hulu Desktop Intergration

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
jskube Offline
Junior Member
Posts: 32
Joined: May 2009
Reputation: 0
Post: #1
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:
  • 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.
(This post was last modified: 2010-05-17 15:06 by jskube.)
find quote
FishOil Offline
Posting Freak
Posts: 1,027
Joined: May 2009
Reputation: 15
Post: #2
Far too complicated IMO

I have a much simpler way using irexec

Button A and Button B

Button A
killall xbmc.bin and launch huludesktop

Button B
killall huludesktop and launch xbmc.bin
(This post was last modified: 2011-09-28 03:32 by FishOil.)
find quote
steve1977 Offline
Posting Freak
Posts: 1,984
Joined: Dec 2006
Reputation: 0
Post: #3
jskube Wrote: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

Love the description. Exactly what I was looking for!!! Thanks so much for this!!! One question: I am not using XBMC-Live, but the "regular" XBMC for Linux. How do I need to alter the above part of your desription. Thanks!!!

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
steve1977 Offline
Posting Freak
Posts: 1,984
Joined: Dec 2006
Reputation: 0
Post: #4
Giving the description above a shot. I am not succeeding to make the following change:

> REMOTE_LIRCD_ARGS="--release"

When I edit it, I am getting the following error upon restart:

>>> * Starting remote control daemon(s) : LIRC
>>> /usr/sbin/lircd: unrecognized option '---release'
>>> Usage: lircd [options] [config-file]

Any thoughts? Thanks for your help!!!

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
jskube Offline
Junior Member
Posts: 32
Joined: May 2009
Reputation: 0
Post: #5
steve1977 Wrote:Love the description. Exactly what I was looking for!!! Thanks so much for this!!! One question: I am not using XBMC-Live, but the "regular" XBMC for Linux. How do I need to alter the above part of your desription. Thanks!!!

I can try and help you out. How are you starting xbmc? Once I know that I can prob. give you a better idea.

steve1977 Wrote:Giving the description above a shot. I am not succeeding to make the following change:

> REMOTE_LIRCD_ARGS="--release"

When I edit it, I am getting the following error upon restart:

>>> * Starting remote control daemon(s) : LIRC
>>> /usr/sbin/lircd: unrecognized option '---release'
>>> Usage: lircd [options] [config-file]

Any thoughts? Thanks for your help!!!

It looks like from the error you have --- in front of release when you only need --. Try that, if that doesn't work let me know and ill look more into it.
find quote
steve1977 Offline
Posting Freak
Posts: 1,984
Joined: Dec 2006
Reputation: 0
Post: #6
jskube Wrote:I can try and help you out. How are you starting xbmc? Once I know that I can prob. give you a better idea.

I am running Ubuntu 10.05 and have XBMC set at start-up. So, it auto-boots into XBMC upon start-up.

jskube Wrote:It looks like from the error you have --- in front of release when you only need --. Try that, if that doesn't work let me know and ill look more into it.

Actually, I had only 2 "-". No clue why it shows 3? I searched a bit around on the internet and I found out that I can also "-r" instead of "--release". Not sure whether this works the same way, but this way works!!! So, should be fine.

I have a new question though. How do I create the "-huludesktop" file and in what folder to I put it?

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
jskube Offline
Junior Member
Posts: 32
Joined: May 2009
Reputation: 0
Post: #7
steve1977 Wrote:I am running Ubuntu 10.05 and have XBMC set at start-up. So, it auto-boots into XBMC upon start-up.



Actually, I had only 2 "-". No clue why it shows 3? I searched a bit around on the internet and I found out that I can also "-r" instead of "--release". Not sure whether this works the same way, but this way works!!! So, should be fine.

I have a new question though. How do I create the "-huludesktop" file and in what folder to I put it?

I just noticed I wasn't clear on the .huludesktop file so I corrected that in guide. The .huludesktop file should be in the home directory of the user that is running huludesktop so /home/xbmc/.huludesktop for example on XBMC-Live.

You can check to make sure -r is working by just running irw and then watching the output. The --release command has lirc report back when the button has been let go. So with irw running and you press a button you should see the button and the the button with _UP after. If you see that you are good.

As for you start up script can you put it up on paste bin so I can see exactly how you are starting up? Also if you are just running this computer as a dedicated HTPC you can just install the XBMC-Live package to auto start XBMC. I dont actually use the XBMC-Live distro but regular Ubuntu Karmic with the XBMC-Live package installed.
find quote
cowfodder Offline
Fan
Posts: 388
Joined: Jan 2010
Reputation: 2
Post: #8
Quote: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>


Maybe I'm just an idiot, but I can't seem to figure out where to put this.

*edit* Never mind, It's in userdata
(This post was last modified: 2010-05-17 15:33 by cowfodder.)
find quote
steve1977 Offline
Posting Freak
Posts: 1,984
Joined: Dec 2006
Reputation: 0
Post: #9
jskube Wrote:As for you start up script can you put it up on paste bin so I can see exactly how you are starting up?

Thanks for your quick reply. Where can I find the start up script?

Actually, I think I am moving along well. However, I don't have a file called xbmc-live in /etc/init.d and actually nothing related to xbmc in this folder. any idea where to look for?

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
steve1977 Offline
Posting Freak
Posts: 1,984
Joined: Dec 2006
Reputation: 0
Post: #10
cowfodder Wrote:Maybe I'm just an idiot, but I can't seem to figure out where to put this.

*edit* Never mind, It's in userdata

Actually, I am struggling with the same question. I don't have anything related to launcher in "/user/username/.xbmc/userdata"? No I need to create a file and just copy it there?

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
jskube Offline
Junior Member
Posts: 32
Joined: May 2009
Reputation: 0
Post: #11
steve1977 Wrote:Actually, I am struggling with the same question. I don't have anything related to launcher in "/user/username/.xbmc/userdata"? No I need to create a file and just copy it there?

That is an example script to be used with the Launcher plugin. If you don't have it installed already it is pretty straight forward. I didn't really cover installing Launcher because I already use if for my emulators but I guess I could add it if people wanted that included as well.
find quote
steve1977 Offline
Posting Freak
Posts: 1,984
Joined: Dec 2006
Reputation: 0
Post: #12
jskube Wrote:That is an example script to be used with the Launcher plugin. If you don't have it installed already it is pretty straight forward. I didn't really cover installing Launcher because I already use if for my emulators but I guess I could add it if people wanted that included as well.

Thanks. I guess I got this solved now as well. Missing piece is the xbmc-live script, which I cannot find in /etc/lirc.d. Guess this must be related to me actually working off a "regular" XBMC and not the live version. Thoughts?

Also, he launcher script should just be "xbmc" instead of "xbmc-live" for my case?

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
jskube Offline
Junior Member
Posts: 32
Joined: May 2009
Reputation: 0
Post: #13
steve1977 Wrote:Thanks. I guess I got this solved now as well. Missing piece is the xbmc-live script, which I cannot find in /etc/lirc.d. Guess this must be related to me actually working off a "regular" XBMC and not the live version. Thoughts?

Also, he launcher script should just be "xbmc" instead of "xbmc-live" for my case?

You can install the xbmc-live package.

Code:
apt-get install xbmc-live

That will give you the /etc/init.d/xbmc-live script. If you install that package then that script will be used to start xbmc for you on boot.
find quote
feyner Offline
Junior Member
Posts: 1
Joined: May 2010
Reputation: 0
Post: #14
Few adjustments for xbmc-live users. libgtk2.0-2 is required for hulu desktop.
to install use:

Code:
apt-get install libgtk2.0-2

If this fails due to dependencies, follow it up with:

Code:
apt-get -f install

Then you can continue with the dpkg install of huludesktop.
find quote
steve1977 Offline
Posting Freak
Posts: 1,984
Joined: Dec 2006
Reputation: 0
Post: #15
jskube Wrote:You can install the xbmc-live package.

Trying to avoid this. Will look out for a way to make it work. Let me play a bit around. I managed so far to start HuluDesktop, but am getting stopped by a security warning (and mouse is de-activated, so I cannot click ok). Will need to start Gnome and start it from there (at least for the first time). Will give it a try tomorrow.

Cheers!!!

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
Post Reply