perrce
07-31-2008, 06:41 PM
I need the help of someone with deeper knowledge of the HME SDK than I have.
With the help of gonzotek, I found JAVE and figured out how to transcode AAC to MP3 in java. My current strategy for playing AAC files in Harmonium (at least as a proof of concept) is to create a stream for an .m4a file just as I would for an .mp3 in the application, but handle it differently in the Factory's getStream(): I would transcode to a temporary MP3 file, and then return a stream of the MP3.
When I create a stream for an .m4a file, though, I get an "unknown event opcode" , and a "handleApplicationError" message printed to the console that I can't track down. The "unknown event opcode" message is printed after createStream() is called, but before it gets to the getStream() that I overrode in the Factory.
I tracked down the origin of the "unknown event opcode" message ( Application.handleChunk() ) by searching for that string and printed a stack trace from that point. I don't know how to interpret it, though, since it occurs in a separate thread.
I can't find the source of the "handleApplicationError" message.
My best guess right now, it seems that the SDK is failing to recognize the .m4a extension and choking, even though I handle it in getStream(). I might have to modify some of TiVo's SDK code, but I don't even know what to change.
Also, the messages only print on my TiVo (Series 3). On the simulator (from the HD-HME library), it seems to run ok.
Can anyone shed some light on this?
For what it's worth, here are the messages I'm getting to the console:
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
MDNS: http://192.168.1.5:7288/mp3Test/
LOG: 192.168.1.2 icon.png HTTP GET - to factory /mp3Test/
DEBUG: Entering getStream()
DEBUG: File Not Found: icon.png
DEBUG: Entering application
DEBUG: Calling createStream()
LOG: HME receiver connected
LOG: unknown event opcode : 8
MP3Test[#1,uri=null] handleApplicationError(1,can't create rsrc. unsupported stream type /mp3test//home/ceperry/harmonium/test_data/music/test/test.m4a)
As you can see, it enters getStream() to fetch the (non-existent) icon, but never enters it again (even though it should when I call createStream() ).
Here's the stack trace that I generated at the line that prints the "unknown event opcode : 8":
at com.tivo.hme.sdk.Application.handleChunk(Application.java:78 2)
at com.tivo.hme.host.sample.Listener.readEvents(Listener.java:3 06)
at com.tivo.hme.host.sample.Listener.handleHME(Listener.java:28 8)
at com.tivo.hme.host.sample.Listener.handle(Listener.java:381)
at com.tivo.hme.host.http.server.HttpConnection.run(HttpConnect ion.java:123)
at java.lang.Thread.run(Thread.java:619)
If your willing, you can download the test program that reproduces these symptoms. It's a zip file that contains one java file, and the JAR files that will need to be in your classpath. You can download it from: http://harmonium.dazeend.org/downloads/testing/MP3Test.zip
I know this is a big question, but I'm at a loss. Thanks.
With the help of gonzotek, I found JAVE and figured out how to transcode AAC to MP3 in java. My current strategy for playing AAC files in Harmonium (at least as a proof of concept) is to create a stream for an .m4a file just as I would for an .mp3 in the application, but handle it differently in the Factory's getStream(): I would transcode to a temporary MP3 file, and then return a stream of the MP3.
When I create a stream for an .m4a file, though, I get an "unknown event opcode" , and a "handleApplicationError" message printed to the console that I can't track down. The "unknown event opcode" message is printed after createStream() is called, but before it gets to the getStream() that I overrode in the Factory.
I tracked down the origin of the "unknown event opcode" message ( Application.handleChunk() ) by searching for that string and printed a stack trace from that point. I don't know how to interpret it, though, since it occurs in a separate thread.
I can't find the source of the "handleApplicationError" message.
My best guess right now, it seems that the SDK is failing to recognize the .m4a extension and choking, even though I handle it in getStream(). I might have to modify some of TiVo's SDK code, but I don't even know what to change.
Also, the messages only print on my TiVo (Series 3). On the simulator (from the HD-HME library), it seems to run ok.
Can anyone shed some light on this?
For what it's worth, here are the messages I'm getting to the console:
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
MDNS: http://192.168.1.5:7288/mp3Test/
LOG: 192.168.1.2 icon.png HTTP GET - to factory /mp3Test/
DEBUG: Entering getStream()
DEBUG: File Not Found: icon.png
DEBUG: Entering application
DEBUG: Calling createStream()
LOG: HME receiver connected
LOG: unknown event opcode : 8
MP3Test[#1,uri=null] handleApplicationError(1,can't create rsrc. unsupported stream type /mp3test//home/ceperry/harmonium/test_data/music/test/test.m4a)
As you can see, it enters getStream() to fetch the (non-existent) icon, but never enters it again (even though it should when I call createStream() ).
Here's the stack trace that I generated at the line that prints the "unknown event opcode : 8":
at com.tivo.hme.sdk.Application.handleChunk(Application.java:78 2)
at com.tivo.hme.host.sample.Listener.readEvents(Listener.java:3 06)
at com.tivo.hme.host.sample.Listener.handleHME(Listener.java:28 8)
at com.tivo.hme.host.sample.Listener.handle(Listener.java:381)
at com.tivo.hme.host.http.server.HttpConnection.run(HttpConnect ion.java:123)
at java.lang.Thread.run(Thread.java:619)
If your willing, you can download the test program that reproduces these symptoms. It's a zip file that contains one java file, and the JAR files that will need to be in your classpath. You can download it from: http://harmonium.dazeend.org/downloads/testing/MP3Test.zip
I know this is a big question, but I'm at a loss. Thanks.