TiVo Community Forum banner
1 - 2 of 2 Posts

· Registered
61 Posts
Awesome app...I've got it running on my Ubuntu 8.04 server against a Tivo HD..and it works wonderfully.

I do have one issue..and my apologies if it's been addressed previously..but I've found that one has to be very careful how one exits the HME "environment". If I exit "cleanly" by hitting left arrow multiple times (waiting for each successive menu to be rendered), then everything's great...works as expected.

However, if I exit by just hitting the Tivo button (and from there doing whatever...standby, live tv, or anything else)...then the app doesn't seem to exit gracefully. In many cases, the VLC process will still be running on the ubuntu box, happily transcoding away (though a netstat -a reveals that there is no remote socket attached to the VLC process, so the Tivo has dropped the connection from its perspective). If I immediately go back to the HME app and select another stream (or even the same one, for that matter), it generally "does its thing" and changes gears successfully as I begin watching content. All seems well and good. However, if I hit the Tivo button/standby and go to bed..and try to access the HME app later on the next day...I get an error trying to open the stream (*any* stream or local file) as the VLC app has either frozen and/or crashed (probably due to some memory leak in the vlc application...been quite a problem over the years it appears from various threads dug up in a quick google search on the topic).

The HME "control" python process doesn't seem to recognize this fact...and never restarts VLC or attempts to clean up the defunct process. I've also tested with hitting the Tivo button, observing that VLC is still running..and then manually killing the VLC process. Going back into HME has the same problem...it won't start up another VLC process and again errors out when trying to open up a stream or file.

Killing the start.py and restarting it fixes the issue in all these cases, however I can't but wonder if there's a way to have the HME application sense that something's amiss and "punt" with regards to the VLC process. I took a look at the code, and I see that it's keeping some basic accounting that enumerates clients and kills the VLC when number of clients = 0..and then can subsequently start a fresh VLC process when needed. This is where I think the weakness lies...when one exits with the Tivo button, the HME process doesn't seem to be getting notified that it is disconnecting. Is there a better way to sense a "hang up"? Or perhaps a different approach is needed...one thing I thought of is instead of trying to count clients and killing the VLC process when clients=0, instead actively look at the number of sockets open (via a system call to netstat or some other way) and attached to the VLC process. When THAT number is zero, then kill the VLC process if it's still running. If no one is pulling data from VLC, then that's a sure-fire sign that the VLC process isn't needed and is going to cause problems if it hangs around.

Anyway, in the mean time I'll try to be careful how I exit the application, and I'll try to train the wife on the particulars on how to avoid the issue as well.

Thanks again for a wonderful application released for free to the public :)

· Registered
61 Posts
VLC as an app should be able to transcode anything to TiVo compliant video. My gut tells me there should be some built-in transcoding logic that works roughly this:

1. Display all video file types (.avi,.mp4,.m4v,wmv,etc)
2. Attempt to play selected stream as pass-through
3. If pass through fails (error reading stream), then re-attempt with transcode

I am guessing the logic currently works like this:
1. If file type = mp4 or mpg, then pass-through without transcoding

--side note: the needs_vlc variable doesn't seem to have any effect on my tests.

Live TV streams and tvants stream and transcode just fine, so my gut tells me with a little logic and error checking, just about anything should too. It's also possible that it currently works like this and I am totally missing something...
That's pretty much correct. If you look at the __init__.py file, you'll see this:

PASSTHROUGH_EXTS = ('.mpg', '.mp4')
TRANSCODE_EXTS = ('.mov', '.wmv', '.asf', '.flv', '.mkv', '.avi', '.m4v')
Pretty self-explanatory...so if you want your .mpg or .mp4 files to run through VLC just erase them from the PASSTHROUGH_EXTS and put them in the TRANSCODE_EXTS. Also, that's where you can add any other extensions that you want the app to display, since it basically does a union of the two EXTS lists to come up with the extensions it will display on the tivo as eligible files for opening.

Also, as an aside, I'll add that I modified the vlc.py file and changed the PARAMS string to this:

PARAMS = '#transcode{vcodec=%(VCODEC)s,vb=%(VBITRATE)d,' + \
Basically, I took out the instructions to VLC to transcode the audio so that the audio track would be passed through natively (though the video portion still gets transcoded). This allows me to encode files with AC3 audio (dvd's, high-def recordings from the tivo, etc) with "pass-thru" settings under handbrake and play back that audio without degradation. Otherwise, VLC's attempt to re-encode the AC3 resulted in the channel ordering being all messed up (the center channel coming out the rear right, etc). Maybe that would be a good config.ini setting to include in future releases...a "passthru_audio = 1" or something?

Anyway, hope that helps someone...

Merry Christmas all :)

1 - 2 of 2 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.