Difference between revisions of "Hulu Desktop Integration"

From MythTV Official Wiki
Jump to: navigation, search
(added unclutter install instructions for when x cursor is visible)
(LinHES)
 
(17 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[[Category:HOWTO]]
+
{{Outdated2|Access to Hulu is now handled through the [[MythNetvision]] plugin.}}
  
 
==General==
 
==General==
  
This guide will walk you through the installation and integration of Hulu Desktop for Linux.  Hulu only officially supports Ubuntu 8.04+ and Fedora 9+, but most other distros should work.  This guide was written for Ubuntu 9.04 (Jaunty Jackalope).  It assumes that you're running as the user that as your Mythfrontend, and that you have already configured LIRC to work.  Full LIRC setup is outside the scope of this article.
+
This guide will walk you through the installation and integration of Hulu Desktop for Linux.  Hulu builds for Fedora 11 and Ubuntu 9.04, but most other distros should work.  It assumes that you're running as the user that your Mythfrontend runs as, and that you have already configured LIRC to work.  Full LIRC setup is outside the scope of this article.
  
 
Please note that the guide doesn't fully integrate Hulu into your Mythfrontend--it configures it to launch Hulu Desktop from Myth and sets up LIRC.
 
Please note that the guide doesn't fully integrate Hulu into your Mythfrontend--it configures it to launch Hulu Desktop from Myth and sets up LIRC.
  
==Installation==
+
==Hulu Desktop Installation==
  
Installation of the Hulu Desktop app itself is fairly trivial, assuming you have the necessary prerequisites.  You will need Flash installed. If you don't already have it, install it with:
+
Installation of the Hulu Desktop app itself is fairly trivial, assuming you have the necessary prerequisites.  You will need Flash installed.
 +
 
 +
===Ubuntu===
 +
 
 +
If you don't have Flash installed:
  
 
  sudo apt-get install flashplugin-nonfree
 
  sudo apt-get install flashplugin-nonfree
Line 17: Line 21:
 
  sudo dpkg --install ''filename''
 
  sudo dpkg --install ''filename''
  
==MythFrontend==
+
===Gentoo===
 +
 
 +
Hulu Desktop is now in Portage, keyworded ~x86 and ~amd64, so installation is simple:
 +
 
 +
echo media-tv/huludesktop ~\* >>/etc/portage/package.keywords
 +
emerge -av media-tv/huludesktop
 +
 
 +
If you don't already have Flash or other dependencies installed, they will be downloaded and installed as well.
 +
 
 +
===LinHES===
 +
 
 +
sudo pacman -Sy huludesktop
 +
 
 +
The package will take care of placing Hulu Desktop in the menu.  You'll find it under Media Libray > Online Streams.  Remote customize should be all you need to do.
 +
 
 +
==MythFrontend Customizations==
  
 
The next step allows you to launch Hulu from your Mythfrontend.  We're going to edit the XML files for your theme for this.  Copying XML files from /usr/share/mythtv into ~/.mythtv allows you to customize menus and prevents them from being overwritten during an upgrade.   
 
The next step allows you to launch Hulu from your Mythfrontend.  We're going to edit the XML files for your theme for this.  Copying XML files from /usr/share/mythtv into ~/.mythtv allows you to customize menus and prevents them from being overwritten during an upgrade.   
Line 23: Line 42:
 
Get a command line, and enter the following:
 
Get a command line, and enter the following:
  
  cp /usr/share/mythtv/mainmenu.xml ~/.mythtv
+
  cp /usr/share/mythtv/themes/defaultmenu/mainmenu.xml ~/.mythtv
 +
''# (or library.xml or wherever else you want to put the hulu command)''
  
 
This assumes you haven't already edited your Mythfrontend's appearance.  If you have, edit your existing copy of mainmenu.xml.  In my case, I wanted Hulu available on the main menu.  You can add it to wherever you like, you just need to copy the right XML file and edit it.
 
This assumes you haven't already edited your Mythfrontend's appearance.  If you have, edit your existing copy of mainmenu.xml.  In my case, I wanted Hulu available on the main menu.  You can add it to wherever you like, you just need to copy the right XML file and edit it.
Line 36: Line 56:
 
The next time you run your Mythfrontend, the button will appear on your main menu.
 
The next time you run your Mythfrontend, the button will appear on your main menu.
  
If you experience your X mouse cursor showing over hulu desktop try installing unclutter:
+
==LIRC Configuration==
sudo apt-get install unclutter
 
 
 
==LIRC==
 
 
 
I'll admit there is probably a better way to do this than the way I've written it here.  After a few hours of searching, I wasn't able to find it.  This will do the job until I find the right way.
 
  
First, open ~/.huludesktop in your favorite editor and find the ''lirc_remote_identifier'' line.  Replace ''mceusb'' with your remote.  If you don't know it, exit the editor and run irw.  Hit a few buttons on your remote, and you'll get output similar to the following:
+
First, open ~/.huludesktop in your favorite editor and find the ''lirc_remote_identifier'' line.  Replace ''mceusb'' with your remote.  If you don't know it, exit the editor and run '''irw'''.  Hit a few buttons on your remote, and you'll get output similar to the following:
  
 
  squeaker@myth:~$ irw
 
  squeaker@myth:~$ irw
Line 49: Line 64:
 
  0000000000001797 00 Right Hauppauge_350
 
  0000000000001797 00 Right Hauppauge_350
  
Whatever is in the place of ''Hauppauge_350'' on your system is your remote.  Edit ~/.huludesktop accordingly.
+
Whatever is in place of ''Hauppauge_350'' in your output is your remote.  Edit ~/.huludesktop accordingly.
 
 
  
 
Hulu Desktop requires the -r (--release) option for proper operation.
 
Hulu Desktop requires the -r (--release) option for proper operation.
  
If you are using '''Fedora''', you can add the line:
+
If you are using '''Fedora''', you can edit the line:
 +
LIRCD_OPTIONS=""
 +
to read
 
  LIRCD_OPTIONS="-r"
 
  LIRCD_OPTIONS="-r"
under the start() section of /etc/init.d/lirc
+
in /etc/sysconfig/lirc
 +
 
 +
If you are using '''Ubuntu''', edit /etc/lirc/hardware.conf and change
 +
 
 +
REMOTE_LIRCD_ARGS=""
 +
 
 +
to
  
If you are using '''Ubuntu''', you can add the line:
 
 
  REMOTE_LIRCD_ARGS="-r"
 
  REMOTE_LIRCD_ARGS="-r"
to /etc/lirc/hardware.conf
 
  
  
Now, restart LIRC.  If all goes well, LIRC is now running with the --release switch.  You can verify this:
+
Now, restart LIRC.  If all goes well, LIRC is now running with the -r switch.  You can verify this:
 +
 
 +
squeaker@myth:~$ ps aux | grep lircd
 +
root    26192  0.0  0.0  3116  584 ?        Ss  14:22  0:00 /usr/sbin/lircd --device=/dev/lirc0 -r
  
root@myth:/etc/init.d# ps aux | grep lircd
+
===Customizations===
root    26192  0.0  0.0  3116  584 ?        Ss  14:22  0:00 /usr/sbin/lircd --device=/dev/lirc0 --release
 
root    27575  0.0  0.0  3336  804 pts/0    S+  14:49  0:00 grep lircd
 
  
As usual, YMMV.  The arrow keys worked immediately for me with LIRC and Hulu after this, since they happened to have the same names as my lircd.conf file.  In order to make the menu appear, I had to change
+
As usual, YMMV.  The arrow keys worked for me immediately, since they happened to have the same names as my lircd.conf file.  In order to make the menu appear, I had to make an edit to ~/.huludesktop:
  
 
  button_name_menu = Home
 
  button_name_menu = Home
Line 75: Line 96:
 
to
 
to
  
  button_name_menu = Menu
+
  button_name_menu = Menu/i
  
for everything to work correctly.
+
for everything to work correctly. If you don't know what name LIRC has for your menu key, fire up '''irw''' and press your menu key.  You should see output similar to the following:
 +
 
 +
squeaker@myth:~$ irw
 +
000000000000178d 00 Menu/i Hauppauge_350
 +
000000000000178d 00 Menu/i_UP Hauppauge_350
 +
^C
 +
 
 +
Edit ~/.huludesktop accordingly.  Repeat as necessary to adapt other keys.
 +
 
 +
==Troubleshooting==
 +
If huludesktop will run fine when launched alone, but will not play videos when launched from MythTV, or it says "This request is taking longer than expected...", it may be due to Flash hardware acceleration being enabled. Open huludesktop, right click inside a video and select "Settings" and disable hardware acceleration.
 +
 
 +
 
 +
===Fullscreen Performance Issues===
 +
 
 +
On some systems, Flash video playback may be choppy or have display tearing when running at a high resolution in fullscreen mode.  To deal with this, you may want to run huludesktop from a script which sets the screen to a lower resolution while huludesktop is running, and increases it after closure.  Hulu's highest quality streams are 480p, so setting your resolution to that mode is probably best, though you may want to test various resolutions to find the best combination of smoothness and quality. To find out what resolutions your display supports, run '''xrandr'''. You can create the following script at '''/usr/local/bin/hulu''' For example, if your display normally runs at 1920x1080, but also supports 720x480, (these examples aren't common HDTV resolutions, change per xrandr options) the script can contain the following:
 +
 
 +
cd /usr/local/bin
 +
sudo nano hulu
 +
 
 +
Now copy and past the following code into the file
 +
 
 +
#!/bin/sh
 +
xrandr --output default --mode 720x480 && huludesktop
 +
xrandr --output default --mode 1920x1080
 +
 
 +
Exit and save. You need to set permissions for this script
 +
 +
sudo chmod a+x hulu
 +
 
 +
Then use '''/usr/local/bin/hulu''' in your mainmenu.xml file instead of '''/usr/bin/huludesktop'''.
 +
 
 +
===Hiding the mouse cursor===
 +
 
 +
If you experience your X mouse cursor showing over Hulu Desktop, try installing unclutter:
 +
 
 +
sudo apt-get install unclutter

Latest revision as of 05:21, 27 February 2012

Time.png Outdated: Access to Hulu is now handled through the MythNetvision plugin.

General

This guide will walk you through the installation and integration of Hulu Desktop for Linux. Hulu builds for Fedora 11 and Ubuntu 9.04, but most other distros should work. It assumes that you're running as the user that your Mythfrontend runs as, and that you have already configured LIRC to work. Full LIRC setup is outside the scope of this article.

Please note that the guide doesn't fully integrate Hulu into your Mythfrontend--it configures it to launch Hulu Desktop from Myth and sets up LIRC.

Hulu Desktop Installation

Installation of the Hulu Desktop app itself is fairly trivial, assuming you have the necessary prerequisites. You will need Flash installed.

Ubuntu

If you don't have Flash installed:

sudo apt-get install flashplugin-nonfree

Now, download the .deb for your architecture and distro from Hulu Labs. To install using the command prompt:

sudo dpkg --install filename

Gentoo

Hulu Desktop is now in Portage, keyworded ~x86 and ~amd64, so installation is simple:

echo media-tv/huludesktop ~\* >>/etc/portage/package.keywords 
emerge -av media-tv/huludesktop

If you don't already have Flash or other dependencies installed, they will be downloaded and installed as well.

LinHES

sudo pacman -Sy huludesktop

The package will take care of placing Hulu Desktop in the menu. You'll find it under Media Libray > Online Streams. Remote customize should be all you need to do.

MythFrontend Customizations

The next step allows you to launch Hulu from your Mythfrontend. We're going to edit the XML files for your theme for this. Copying XML files from /usr/share/mythtv into ~/.mythtv allows you to customize menus and prevents them from being overwritten during an upgrade.

Get a command line, and enter the following:

cp /usr/share/mythtv/themes/defaultmenu/mainmenu.xml ~/.mythtv
# (or library.xml or wherever else you want to put the hulu command)

This assumes you haven't already edited your Mythfrontend's appearance. If you have, edit your existing copy of mainmenu.xml. In my case, I wanted Hulu available on the main menu. You can add it to wherever you like, you just need to copy the right XML file and edit it.

Now, open up mainmenu.xml (or whatever file you copied over) in your favorite editor. Add the following lines where you want your Hulu button to live.

<button>
       <text>Hulu Desktop</text>
       <action>EXEC /usr/bin/huludesktop</action>
</button>

The next time you run your Mythfrontend, the button will appear on your main menu.

LIRC Configuration

First, open ~/.huludesktop in your favorite editor and find the lirc_remote_identifier line. Replace mceusb with your remote. If you don't know it, exit the editor and run irw. Hit a few buttons on your remote, and you'll get output similar to the following:

squeaker@myth:~$ irw
0000000000001795 00 Down Hauppauge_350
0000000000001797 00 Right Hauppauge_350

Whatever is in place of Hauppauge_350 in your output is your remote. Edit ~/.huludesktop accordingly.

Hulu Desktop requires the -r (--release) option for proper operation.

If you are using Fedora, you can edit the line:

LIRCD_OPTIONS=""

to read

LIRCD_OPTIONS="-r"

in /etc/sysconfig/lirc

If you are using Ubuntu, edit /etc/lirc/hardware.conf and change

REMOTE_LIRCD_ARGS=""

to

REMOTE_LIRCD_ARGS="-r"


Now, restart LIRC. If all goes well, LIRC is now running with the -r switch. You can verify this:

squeaker@myth:~$ ps aux | grep lircd
root     26192  0.0  0.0   3116   584 ?        Ss   14:22   0:00 /usr/sbin/lircd --device=/dev/lirc0 -r

Customizations

As usual, YMMV. The arrow keys worked for me immediately, since they happened to have the same names as my lircd.conf file. In order to make the menu appear, I had to make an edit to ~/.huludesktop:

button_name_menu = Home

to

button_name_menu = Menu/i

for everything to work correctly. If you don't know what name LIRC has for your menu key, fire up irw and press your menu key. You should see output similar to the following:

squeaker@myth:~$ irw
000000000000178d 00 Menu/i Hauppauge_350
000000000000178d 00 Menu/i_UP Hauppauge_350
^C

Edit ~/.huludesktop accordingly. Repeat as necessary to adapt other keys.

Troubleshooting

If huludesktop will run fine when launched alone, but will not play videos when launched from MythTV, or it says "This request is taking longer than expected...", it may be due to Flash hardware acceleration being enabled. Open huludesktop, right click inside a video and select "Settings" and disable hardware acceleration.


Fullscreen Performance Issues

On some systems, Flash video playback may be choppy or have display tearing when running at a high resolution in fullscreen mode. To deal with this, you may want to run huludesktop from a script which sets the screen to a lower resolution while huludesktop is running, and increases it after closure. Hulu's highest quality streams are 480p, so setting your resolution to that mode is probably best, though you may want to test various resolutions to find the best combination of smoothness and quality. To find out what resolutions your display supports, run xrandr. You can create the following script at /usr/local/bin/hulu For example, if your display normally runs at 1920x1080, but also supports 720x480, (these examples aren't common HDTV resolutions, change per xrandr options) the script can contain the following:

cd /usr/local/bin
sudo nano hulu

Now copy and past the following code into the file

#!/bin/sh
xrandr --output default --mode 720x480 && huludesktop
xrandr --output default --mode 1920x1080

Exit and save. You need to set permissions for this script

sudo chmod a+x hulu

Then use /usr/local/bin/hulu in your mainmenu.xml file instead of /usr/bin/huludesktop.

Hiding the mouse cursor

If you experience your X mouse cursor showing over Hulu Desktop, try installing unclutter:

sudo apt-get install unclutter