1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anyone get HD-Photos to work as standalone HME?

Discussion in 'Developers Corner' started by minckster, Apr 3, 2007.

  1. Apr 3, 2007 #1 of 28
    minckster

    minckster New Member

    642
    0
    Aug 31, 2006
    Manhattan NYC
    The Java Network Launch Protocol (JNLP) file for the HD-Photos app in TiVo Desktop 2.4 is available at Program Files\TiVo\Desktop\Hme\hdphotos.jnlp. Has anyone been able to get this to work as a standalone HME app, particularly on a Mac?

    I can copy the .jnlp to my Mac, double click it, and it appears to start working. It downloads JAR files from TiVo, and actually launches an HD Photos app, but that quickly closes. The error messages in my console.log file follow. The app's attempt to contact the TiVo Desktop server doesn't seem promising for getting this app to work with TiVo Desktop 1.9.3 for Mac.
    After the JNLP file downloads the numerous JAR files, they're available in /Library/Caches/Java/cache/tmp, so Java developers may be able to do something.
     
  2. Apr 4, 2007 #2 of 28
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    I was able to get the app to run through Galleon (on Linux) by copying the .jar files (ALhme-host-sample.jar, AMhme-host-sample.jar, AThme-host-sample.jar , RMhdphotos.jar, RMhme-host-sample.jar, RThdphotos.jar, and RThme-host-sample.jar) to Galleon's hme folder and then adding "com.tivo.hme.hdphotos.HDPhotos" to launcher.txt.

    The app (and icon) appeared on my TiVos and I saw this in the log:
    Code:
    LOG: HDPhotos.init()
    LOG: HD Photos Version: 1.7a1
    But when I tried to select it I got the standard "Can't Read (0x50006)" error and saw this in the log:
    Code:
    INFO [Acceptor] AppHost - Unexpected error: java.lang.NullPointerException
    I'll try messing around a bit more, but I'm guessing your assesment of needing TiVo Desktop is probably correct. How else does it know what folder to use?
     
  3. Apr 5, 2007 #3 of 28
    Dennis Wilkinson

    Dennis Wilkinson New Member

    2,064
    0
    Sep 24, 2001
    East...
    I've got it working on a Mac as a standalone. When I originally looked at this, I thought it would be too painful to do, but I've since found a way to do it without doing much at all.

    First off, the HD Photos application doesn't stand alone. You see, the original TiVoConnect photo sharing protocol actually contains all the controls necessary for the server to return HD photos, and if you form your requests appropriately you can get them. All the HD Photos HME application does is call the copy of TiVo Desktop already running on your host and requests photos from it at 720p resolution.

    Given that, TiVo apparently wanted to implement things such that if your copy of TiVo Deskop exits it takes the HME application with it, so they added a new command (BlockUntilTerminate) to the TiVoConnect set that blocks and never drops the connection until you exit TiVo Desktop of the caller drops it. That opens up a denial-of-service avenue (people could issue this command until the server could no longer handle new requests), so there's a handshake -- TiVo Desktop sets a blocking ID in the environment for the HME app that it then passes back to the Desktop. Only the updated Windows version of TiVo Desktop supports this command, and the HME app will exit if the command isn't supported.

    Originally, I got things working by building a proxy server with PHP on Apache and a little mod_rewrite to handle the URL format. But I've since found a way (OK, "since" being about an hour ago) to just turn off the new command which seems to be working much better, although the app itself has some bugs.

    Instructions

    So, here's how to make this run on Mac OS X, in a nutshell. This might or might not help with Galleon.

    First, you need to get a copy of the HME application itself. I don't want to just post it here, and unfortunately I couldn't convince any of the current Mac archiving tools to unpack the .exe of the prerelease TiVo Desktop 2.4 for Windows. I got mine by installing on a Windows box, then copying just the folder at C:\Program Files\TiVo\Desktop\Hme to my Mac. Let's say I put it on my own Desktop (meaning I now have a folder at ~/Desktop/Hme).

    Open ~/Desktop/Hme/hdphotos.jnlp in a text editor (it's just XML). You'll see a set of <resources></resources> tags. Before the closing </resource> tag, insert the following:

    Code:
    <property name="com.tivo.hdphotos.title" value="Your Sharing Name" />
    <property name="com.tivo.calypso.host" value="127.0.0.1:8101" />
    (Perhaps) obviously, replace "Your Sharing Name" with whatever you want to see this as in Music, Photos, and More.

    Then, look for this line, in the <application-desc> block:
    Code:
    <argument>--exitwithcalypso</argument>
    and delete it. Save your changes.

    Make sure TiVo Desktop is running and sharing photos on your Mac, then open up a Terminal (Applications > Utilities > Terminal) window and type the following:

    Code:
    javaws -Xnosplash ~/Desktop/Hme/hdphotos.jnlp
    The first run will pull down all the actual .jar files, and every time you launch you'll be asked whether or not to trust the code, which you'll need to do. Then take a look in Music, Photos, etc. on your Series 3 and browse on in.

    Notes and caveats:
    • This is wholly unsupported by TiVo! It may work for you, it may not, it may cause the world to end (but probably not ;)).
    • this will mirror all the photos that all the users on the machine are sharing. There's no need to run more than one copy of the HME application.
    • performance (on the 1GHz G4 I've tested this on) is adequate.
    • This probably isn't the simplest thing to make start up automagically on login, although i haven't actually tried to do that (I don't even leave it running full-time at the moment)
    • we've neutered the way the HME app checks to ensure that TiVo Desktop stays running by doing things this way, so if you stop TiVo Desktop, this won't stop with it until you quit it yourself
    • There appears to be a bug (either with the Mac Desktop or with the HME app, it's not clear) that causes all of your albums to be shown as folders inside every album in the HME app. If you have a lot of albums, this could be irritating. Just page down.
    • If you're running the Mac firewall, port 7288 will need to be open to TCP traffic in addition to the usual TiVo Desktop ports
    • I don't have an Intel-based Mac at home, so I have not tried that configuration yet, but I'd expect it to work just fine.
    • I have on one occasion seen TiVo Desktop exit sometime while I was testing this, although I'm not 100% positive it was triggered by the HME app or if I inadvertently nuked it.
    • Did I mention this was unsupported?

    Getting the actual .jnlp and related files appears to be the hard part (you'd either need to have access to a Windows box or at least a friendly Windows user, barring someone figuring out how to extract things from the installer on a Mac.)

    As always, I hope someone finds this useful. I'm going to sit down and watch Lost now.
     
  4. Apr 5, 2007 #4 of 28
    minckster

    minckster New Member

    642
    0
    Aug 31, 2006
    Manhattan NYC
    Thanks Dennis! I found that very useful - and very easy. I can't imagine why TiVo isn't releasing (or leaking) this as a standalone HME app.

    The app doesn't scale UP images to fill the TV screen's entire width or height. Does it do that from Windows? If not, I would have preferred if TiVo had built a widescreen rather than a HD photo viewer. (I just resized all of my images on the Mac side of things.)
     
  5. Apr 5, 2007 #5 of 28
    Dennis Wilkinson

    Dennis Wilkinson New Member

    2,064
    0
    Sep 24, 2001
    East...
    Hadn't noticed that -- I suppose all of my photos (well, at least those that I've looked at) are sufficiently large that they need to be scaled down to fit 1280x720 (well, slightly smaller -- TiVo seems to leave a little room for overscan, which for those of us whose HDTVs are CRT-based RPTVs is a good thing but would show up on many/most LCD/plasma sets). For portrait-oriented or squarish images there's some black to the top/bottom or to the sides, but I'd expect that, since filling the screen would crop image data.
     
  6. Apr 5, 2007 #6 of 28
    Dennis Wilkinson

    Dennis Wilkinson New Member

    2,064
    0
    Sep 24, 2001
    East...
    Man, I guess I was tired when I wrote that monstrosity of a sentence... :D

    What I meant to say was "My original solution would have been too complicated for most people to set up, but I've since found a way to avoid the issue I had to work around. The new solution is pretty simple to describe."
     
  7. Apr 5, 2007 #7 of 28
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    Galleon doesn't use the jnlp file (at least, not that I can tell). Usually you just dump the .jar files into the /hme subfolder and then update the launcher.txt file with the class.

    I'm not sure how to pass those parameters (hdphotos.title and calypso.host) to the class through launcher.txt, but I'll take a stab at it. Of course, this also assumes that it will connect to Galleon's existing photo app in lieu of TiVo Desktop.
     
  8. Apr 5, 2007 #8 of 28
    Dennis Wilkinson

    Dennis Wilkinson New Member

    2,064
    0
    Sep 24, 2001
    East...
    Those can also be set in the environment. Use CALYPSO_HOST and HDPHOTOS_TITLE for the environment variable names.

    IIRC, Galleon's photo app is an HME application and doesn't use the TiVoConnect protocol (and won't work with HD Photos as a consequence.) javaHMO uses the older protocol and may work.
     
  9. Apr 5, 2007 #9 of 28
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    :up:

    :thumbsdown:

    So what you're saying is that getting this to run under Galleon (or rather, on Linux without TiVo Desktop) is probably a futile effort. :)
     
  10. Dennis Wilkinson

    Dennis Wilkinson New Member

    2,064
    0
    Sep 24, 2001
    East...
    Not really -- just that in order for it to work, you'll also have to have javaHMO (Leon's pre-Galleon effort that used the original HMO protocol) running on the machine (they should be able to coexist, if memory serves.)

    That said, it might be simpler to modify Galleon's photo application to support High Def.
     
  11. jtkohl

    jtkohl New Member

    170
    0
    Feb 6, 2004
    Arlington,...
    I found that with Galleon running, hdphotos gets a Java exception due to port conflicts with mdns. If I start hdphotos first, then start Galleon, both work OK.
    Last time I looked at Galleon, it included a back-rev Jmdns run-time, IIRC.
     
  12. minckster

    minckster New Member

    642
    0
    Aug 31, 2006
    Manhattan NYC
    You can select the port that HD Photos uses. The option is at the very end of hdphotos.jnlp and initially set to 7288, which is a little odd to specify because that's the default port anyways.
     
  13. jtkohl

    jtkohl New Member

    170
    0
    Feb 6, 2004
    Arlington,...
    even when selecting the port to be different from Galleon, I get this exception trace if Galleon is already running:

    Code:
    Thread javawsApplicationMain: java.net.BindException: Address already in use
        java.net.PlainDatagramSocketImpl.bind0(Native Method)
        java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:82)
        java.net.DatagramSocket.bind(DatagramSocket.java:368)
        java.net.MulticastSocket.<init>(MulticastSocket.java:147)
        java.net.MulticastSocket.<init>(MulticastSocket.java:112)
        javax.jmdns.JmDNS.openMulticastSocket(JmDNS.java:267)
        javax.jmdns.JmDNS.init(JmDNS.java:235)
        javax.jmdns.JmDNS.<init>(JmDNS.java:194)
        com.tivo.hme.host.sample.Main.<init>(Main.java:240)
        com.tivo.hme.host.sample.Main.<init>(Main.java:90)
        com.tivo.hme.host.sample.Main.main(Main.java:670)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:585)
        com.sun.javaws.Launcher.executeApplication(Launcher.java:1161)
        com.sun.javaws.Launcher.executeMainClass(Launcher.java:1108)
        com.sun.javaws.Launcher.continueLaunch(Launcher.java:951)
        com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:522)
        com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:218)
        com.sun.javaws.Launcher.run(Launcher.java:165)
        java.lang.Thread.run(Thread.java:613)
    
     
  14. Dennis Wilkinson

    Dennis Wilkinson New Member

    2,064
    0
    Sep 24, 2001
    East...
    Sounds like the port conflict is for the port that mDNS uses for itself (5353). Not sure how to resolve that, although if that's an issue, I'm not sure how other HME applications would plug into Galleon.
     
  15. windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    It sounds like he's running it alongside Galleon, not through it.
     
  16. Dennis Wilkinson

    Dennis Wilkinson New Member

    2,064
    0
    Sep 24, 2001
    East...
  17. jtkohl

    jtkohl New Member

    170
    0
    Feb 6, 2004
    Arlington,...
    Yes, running galleon in one java process, hdphotos in another.

    I'm pretty sure the problem is the version of javax.jmdns used by galleon.
    Galleon 2.3.0 includes a different version of hme-host-sample.jar than the one downloaded by the webstart for hdphotos. Galleon gets an exception when I try to use the same copy of hme-host-sample.jar (from /Users/jtk/Library/Caches/Java/cache/javaws/http/Dcds.tivo.com.edgesuite.net/P80/DMTiVoDesktop/DMhdphotos/RMhme-host-sample.jar)

    Code:
    Exception in thread "JmDNS.SocketListener" java.lang.AbstractMethodError: org.lnicholls.galleon.server.TiVoListener.serviceAdded(Ljavax/jmdns/ServiceEvent;)V
            at javax.jmdns.JmDNS.updateRecord(JmDNS.java:909)
            at javax.jmdns.JmDNS.handleResponse(JmDNS.java:994)
            at javax.jmdns.JmDNS.access$900(JmDNS.java:25)
            at javax.jmdns.JmDNS$SocketListener.run(JmDNS.java:1139)
            at java.lang.Thread.run(Thread.java:613)
    
    
    Now the javax.jmdns included in TiVo HME SDK 1.4 is the same as what's in galleon's copy, but it's not the same as JmDNS 1.0 (downloaded from jmdns.sourceforge.net). I don't know for sure what's inside the hdphotos edition of hme-host-sample.jar, but using either the hdphotos copy of hme-host-sample.jar or jmdns.jar from sourceforge yields the same exception.

    Time to get galleon updated to current software, I guess.

    And TiVo: GET A NEW HME SDK READY, will ya?
     
  18. jtkohl

    jtkohl New Member

    170
    0
    Feb 6, 2004
    Arlington,...
    I pulled down the latest Galleon from sourceforge (the latest version in CVS). It identifies itself as Galleon 2.4.0, and it seems to fix the mdns related problems. Yay!
     
  19. windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    But you still can't get the HD Photos app to run standalone, can you?
     
  20. jtkohl

    jtkohl New Member

    170
    0
    Feb 6, 2004
    Arlington,...
    Yes, I'm doing that just fine now. use --iface xx.xx.xx.xx as a new parameter in the .jnlp file (to select the real ethernet), and start HD photos first, or use the CVS head version of Galleon (which still needs some fixing, though, it has a few warts)
     

Share This Page