PDA

View Full Version : Help creating streams for unsupported types


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.

perrce
08-01-2008, 07:57 AM
I still don't know what was going on, but for the benefit of others, I worked around the problem by transcoding before calling createStream().

perrce
08-01-2008, 12:38 PM
For the benefit of others who may search to this thread... I continued looking at the error and found the source. The application error is being sent from the receiver, so apparently the receiver is objecting to the .m4a file.

s2kdave
08-01-2008, 08:39 PM
yes, the receiver only supports certain audio types. You need to transcode it to mp3 if you want it to work. You can also set the content type to audio/mp3 on the stream.

perrce
08-02-2008, 12:53 AM
Yeah, that's what I figured out. I had to set the mime type to "audio/mpeg" since that's what's going to be sent back to the receiver after I transcode it. Now if I can just figure out how to transcode a stream. I had high hopes for JAVE. It's dead simple to use, but only goes file-to-file and I need an InputStream. Might have to directly call ffmpeg directly.