Options

Humax PVR9200T Media Controller V1.00 - Media eLinker Replacement

[Deleted User][Deleted User] Posts: 37
Forum Member
After much prodding around with the USB interface on my Hummy i've developed a replacement application for the Media eLinker software. It's a Windows console application with a simple text-based menu interface.

The software supports all existing functions of the eLinker software plus a few useful extras primarily related to file transfers as follows:

- File transfer with USB error-detection and retransmission where necessary.
- Chase-transfer of video files that are currently being recorded on the Humax.
- Auto-adjustment of filenames to remove invalid characters before file transfer.
- More detailed file transfer display info during file transfer including elapsed and remaining transfer times and data transfer rate.
- Adjustment of file transfer data block sizes.
- Display directory tree listings.
- Display disk partition summmary information.
- USB data-logging.

The software utilises the generic LIBUSB-WIN32 drivers obtained from SourceForge.net instead of the existing Humax drivers (which seem to be a modified version of the same drivers).

Installation of the drivers at the moment has to be done manually but instructions on how to do this for Windows XP systems are provided in the Release Notes.

The Release Notes also contain details of limitations and known issues so worth reading before you try out this software just so you are aware of them.

As this software is a first release it's probably best to ensure you have made backups of any files you want to keep using Media eLinker and to only use this software when not recording anything important at least until you can prove the software is stable for your particular system.

The software can be downloaded from the following link:

http://www.enigma.eclipse.co.uk/humax/HumaxMediaController.htm

As with all software there will no doubt be bugs that crop up so I will do my best to fix them where possible.

Andy Chappell.
«134567

Comments

  • Options
    [Deleted User][Deleted User] Posts: 5,528
    Forum Member
    Nice work

    But if the 9200 transmission end of things hasn't implemented an error correction protocol how can you do "File transfer with USB error-detection and retransmission where necessary" ?

    Cliff
  • Options
    [Deleted User][Deleted User] Posts: 37
    Forum Member
    Good work.

    Any chance of a Linux version?
  • Options
    [Deleted User][Deleted User] Posts: 1,144
    Forum Member
    ✭✭✭
    That looks incredible! I'll have to lug the PC downstairs again sometime soon and try it out :)
  • Options
    [Deleted User][Deleted User] Posts: 20
    Forum Member
    sidaxp wrote:
    After much prodding around with the USB interface on my Hummy i've developed a replacement application for the Media eLinker software. It's a Windows console application with a simple text-based menu interface.
    Andy Chappell.

    Hi Andy, I have been working on a Mac-osx version, using much the same approach, but I have got nowhere as close as this yet.

    Would you consider letting me have a copy of the source, so I can port to MAC osx and FreeBSD. I have only got a small way in, using libusb on both platforms. Makes no sense doing the work twice.

    I'll give you back the Make files, Diffs and binaries so you can distribute from your site.
  • Options
    wgmorgwgmorg Posts: 5,020
    Forum Member
    Well done ... your General Notes and Issues made for an interesting read.
  • Options
    [Deleted User][Deleted User] Posts: 87
    Forum Member
    Nice one Andy!
  • Options
    [Deleted User][Deleted User] Posts: 100
    Forum Member
    tshawkins wrote:
    Would you consider letting me have a copy of the source, so I can port to MAC osx and FreeBSD.
    Yes, kudos to Andy for this. I'm also interested in porting this to FreeBSD. Since it's a console-based app it should be fairly easy.

    Like CJL, I'm also curious as to how error detection and correction has been implemented if the Hummy end doesn't support it. My take is that it's to do with the fact that USB is a pull system - the host (i.e. the PC) "calls the shots" and the client (the Hummy) does what it's told so it's possible to tell the Hummy what to send.
  • Options
    [Deleted User][Deleted User] Posts: 86
    Forum Member
    parish wrote:
    Yes, kudos to Andy for this. I'm also interested in porting this to FreeBSD. Since it's a console-based app it should be fairly easy.

    Like CJL, I'm also curious as to how error detection and correction has been implemented if the Hummy end doesn't support it. My take is that it's to do with the fact that USB is a pull system - the host (i.e. the PC) "calls the shots" and the client (the Hummy) does what it's told so it's possible to tell the Hummy what to send.

    Forgive me, I skimmed the notes - but does it not work much the same as his previous file repair utility did? It'll scan the file once it's completed and then request what else is needed to complete it, without corruption? I'm sure it's all in his notes.

    Oh, and thank you very much for this software. It's very useful having error correction built in, rather than having to wait around for media elinker to finish transferring before manually clicking to re-send the file.
  • Options
    chenkschenks Posts: 13,231
    Forum Member
    ✭✭
    i've copied a file from the humax to the PC using this program.
    however when i tried to open the file in VideoReDo to edit it.. i get the following error
    No PIDs specified when trying to open a network stream
    
    any ideas ?
  • Options
    [Deleted User][Deleted User] Posts: 37
    Forum Member
    In reply to questions so far raised...

    1. Error detection and correction.

    The software reads the data in data blocks as determined by the Settings parameters and is configurable by the user. Lets say we're using 40K block sizes, it reads each 40K block and checks to see how much data was actually returned after each read. If less than 40K was returned (i.e. an error in transmission occurred) it marks the entire block as bad. The software keeps track of where each of these bad blocks occurs as the file is being transferred. When the transfer completes, it checks to see if any bad blocks exists then it requests a second transfer of the entire file from the beginning again. Unfortunately, Humax have not implemented an interface to allow a transfer from a specific point in the file so we are very limited by this at the moment. I have tried "sending random codes to the silo" so to speak (with many Humax lockups along the way!) to see if a hidden interface exists in the Humax firmware but to no avail. So, for the time-being anyway, it initiates a second transfer of the file if errors exists in the first transfer. On the second transfer it will only read just enough data blocks to correct all the errors so it's possible that if the errors only occur at the start of the file then the second transfer will complete much more quickly. Also, during testing (on my setup anyway), reading the bad parts of the file using 1K blocks usually worked without error thus potentially limiting the transfer to a maximum of less than 2 full transfers of the file. In a sense it works precisely like my original File Repair Utility (and like the merge.exe utility) but it does everything on-the-fly and will usually not require the full 2 transfers.

    The file is read on a "pull" basis as mentioned (i.e. it's the host software that calls the shots). The host initiates the transfer, requests the next block, checks the return length and status of the block, then requests the next block, etc, until the transfer is complete. The host can end the transfer at any time so doesn't necessarily need to do a full transfer on the second pass to correct all the errors.

    The USB Bulk Transfer Protocol does actually guarantee that data getting to the host is valid which is why Humax probably didn't include error detection and retransmit in their firmware. It's this that leads me to suspect that possibly the LIBUSB-WIN32 driver itself may be at fault. I haven't done any work with the drivers yet but that's next on my hit list - build the drivers in debug mode and see what I get back - then make mods as necessary. If it does prove to be the drivers at fault then it should be possible to redistribute them for both this software and the Humax Media eLinker software (which I believe is built on a modified version of the same drivers) so that we can finally get single-transfer file transfers to work. There's no guarantee at the moment tho as I haven't investigated anything on that front yet.

    2. Source Code.

    Yes, I'll give the source code to those developers interested in porting this to other platforms. The code uses mainly standard CRT calls (or the Microsoft secure equivalents) so it should be fairly straightforward to modify. I'll just scan through the source code and make sure the comments are up-to-date. I used MS Visual Studio 2005 to build the app and it's written in C (not C++). Just let me know who is up for the task and how I can contact you and i'll send you the code.

    3. Problem with VideoReDo.

    Hmmmmm that's an interesting one. I haven't used VideoReDo so maybe other users of VideoReDo can test things out and comment on that one.

    It's possible that there's a fault with my software that's causing corruption at the beginning of the file. I have only ever used Project-X in "demux" mode to test out the transfers and that seems fairly tolerant to the garbage data that is usually present at the beginning of the Humax files. It would be worth you testing out the file using ProjectX to see if you can get anything useful (in demux mode) and report back. Also, transfer the file using the Humax Media eLinker software and try using that file with VideoReDo.

    Another possibility is that the USB drivers (again) could be at fault. Many users seem to have varying degrees of success with the Media eLinker software depending on which of the 6 different USB chipsets they are using on their system. It's possible that some of these chipsets don't work very well with the LIBUSB-WIN32 drivers and just return garbage data during transfer.

    I'll get hold of VideoReDo and check it out for myself on my system.

    Andy
  • Options
    [Deleted User][Deleted User] Posts: 172
    Forum Member
    Excellent program!

    I have found a couple of minor problems:

    When in the settings menu, options B & C both change the image directory.

    If a video filename on the Humax contains '/', the directory listing in the program only shows the characters after the '/'. When attempting to download the file to the PC it seems to request the filename but without all the characters after the '/'.
  • Options
    [Deleted User][Deleted User] Posts: 61
    Forum Member
    Andy - great job - I look forward to using it as I have never had any success with the Humax Media eLinker prog.

    However, at the moment, I can't make any progress because I don't seem to be able to install/update with your driver.

    I had eLinker installed so followed your second option - but there is no such entry as 'Humax STB Drivers' in my Device Manager - when 9200 is connected or not.

    So I uninstalled the eLinker and tried your option one, but now when I switch on the 9200 I do not get the 'found new hardware' message - even when prompted by running 'scan for hardware changes'. [First time I used eLinker it certainly did find new hardware (and installed the original driver) so my USB to 9200 link must be working.]

    Any suggestions please?

    Thanks
  • Options
    [Deleted User][Deleted User] Posts: 145
    Forum Member

    Any suggestions please?

    Thanks

    I echo everyones comments at the great work you have achieved Andy.

    Victor D - Have a look in your PC SYSTEM folder (might be WINDOWS\SYSTEM32 or WINDOWS\SYSTEM for example). Check if humaxusb.dll exists. If so, remove it, then try Andy's instructions again.
  • Options
    18days18days Posts: 674
    Forum Member
    ✭✭
    Here are some stats. I think my usb cable may be too long. The good MB is not incrementing.

    The following files will be transferred to the Host PC:

    - '20060604 0831 i7The Tube.ts'


    Transfer '20060604 0831 i7The Tube.ts'
    From Humax to Host with Error Recovery, Size 173.067 MB
    Press the ESCAPE key to abort the transfer(s)...
    SOURCE GOOD-MB RECOV-MB BAD-MB TOT-MB RATE-KB ELAPSED REMAIN %
    XFER 1.52 0.00 5.63 7.15 80.44 0:01:31 0:35:12 4



    And a few minutes later


    - '20060604 0831 i7The Tube.ts'


    Transfer '20060604 0831 i7The Tube.ts'
    From Humax to Host with Error Recovery, Size 173.067 MB
    Press the ESCAPE key to abort the transfer(s)...
    SOURCE GOOD-MB RECOV-MB BAD-MB TOT-MB RATE-KB ELAPSED REMAIN %
    XFER 1.52 0.00 14.88 16.41 62.69 0:04:28 0:42:39 9
  • Options
    [Deleted User][Deleted User] Posts: 37
    Forum Member
    xyz321

    Well spotted on the errors. I'll update the code so that Settings options B and C work properly. Also, it fails if you try to specify the root directory on any drive. I'll fix that too while i'm at it.

    The '/' issue is an interesting one as that's the character used to delimit directories in the full filepath so i'll have to come up with a solution to that one. Must admit that during testing none of the files I transferred from the Humax had that character present and I never thought to test it but again well spotted. I'll sort that one out too.

    Victor Delta

    During development and testing of the software, I had numerous problems where the Humax would dissappear from the PC completely (usually after Humax lockups). It sounds like you're having similar problems to those i've had in the past.

    The classic indicator that there is a problem with the Humax USB connection to the PC seems to be that an "Unknown Device" entry appears in the "Universal Serial Bus controllers" entry in Device Manager along with the usual other entries (such as "USB Root Hub", "xxxxx Host Controller", etc). So worth checking for that situation first. If this is the case then you need to reset everything to do with USB on your PC.

    From memory, I did the following to reset everything before I could see the Humax again (and i sometimes had to do this several times before it would work too):

    - Pull the USB cable from the front of the Humax and completely power it off by pulling out the plug.

    - Uninstall Humax Media eLinker software if you have it installed. This will also remove the eLinker USB drivers too.

    - Go into the Device Manager in Windows and expand the "USB Serial Bus controllers" entry to show all the USB devices.

    - For each entry, right click and select "Uninstall" from the menu to uninstall the each USB device from your system. Do this for ALL USB devices listed under "USB Serial Bus Controllers".

    - When done, shut down Windows normally until the PC powers down.

    - Now power back up the PC and log into Windows as normal. Windows should detect and reinstall all your existing USB controllers and root hubs. Check the Device Manager again to ensure it has reinstalled all your devices as before (the Humax is currently powered-down so will not be listed!).

    - Now plug in and power up your Humax and bring it out of standby (the Humax is only recognised as a device on the PC when it is out of standby).

    - Now plug in the USB cable to the front of the Humax. Hopefully Windows should recognise the Humax and either install the drivers automatically, or it'll bring up the dialog box as per the driver install procedure in the Release Notes.

    - If it comes up with a message to the effect that "an error occurred with one of your devices" then check the Device Manager again for that "Unknown Device" entry. If it's still there then repeat the above procedure.

    This all seems a bit drastic but it's the only way I could get the Humax working again on my system! I had to do this on several occasions during development and quite often I had to do the procedure several times (no more than 3 times from memory though) before I could get the PC to recognise the Humax again. Worth a try (especially if you do have the "Unkown Device" entry listed as explained above).

    Also consider using a short 1 meter length cable rather than a longer one. That should help too.

    18days

    From those stats (especially the 80KB per second transfer rate) there's something drastically wrong there. Transfer rates are typically 1000KB to 1350KB for video transfers! The software reads the data in blocks of (default) 60KB. If a USB error occurs, then the software pauses for 1 second before it times out and continues to read the next 60KB data block. So a transfer rate of 80K per second indicates that on your system virtually all of the data blocks are timing out after every second with errors. So test out your connection using a 1 meter length cable and check if the transfer rate increases and error rates drop. Using a shorter USB cable is always preferable to using a longer one when dealing with the Humax so it seems!

    Andy
  • Options
    [Deleted User][Deleted User] Posts: 172
    Forum Member
    I have had similar problems with the pc failing to recognise the Humax and coming up with "Unknown device".

    A while ago when this problem occurred I went through the usual reinstall drivers, hack the registry etc. but with no effect. I eventually "fixed it" by power cycling the Humax.

    Yesterday after upgrading the Humax to 1.00.06 and installing the libusb drivers it was working fine, then after I disconnected and reconnected the usb it failed to load again. Power cycling the Humax made no difference. I did not make any more changes to the driver/registry. After putting the Humax into standby and turning off the pc overnight it now works again this morning.

    A possible theory is that the timing of the usb signal is marginal (maybe due to a software error) and as the box gets warm it may drift slightly causing '1's to be read as '0's or vice versa.
  • Options
    [Deleted User][Deleted User] Posts: 13
    Forum Member
    A problem was noted with a file transferred by the eLinker Replacement program, causing VideoReDo to complain and refuse to open. I've had a few instances of this behaviour with files transferred by the original eLinker, although I was using MpegStreamclip or VLC Mediaplayer to convert them and not VideoReDo.

    I used the Humax editor to trim off the opening section of these files and then found they would transfer without a problem. :cool:

    If it happens again (I believe all examples have been ITV3 progs) I'll save an example in case anyone's interested in examining it.
  • Options
    [Deleted User][Deleted User] Posts: 179
    Forum Member
    Great work, let's see how far we can take this!
    Not an option for me at the moment unfortunately due to a problem with my PC:infant:jam interfaces but good work. Can't wait to see how it works out with unix usb drivers...(TSHawkins?).
    Cheers
    Matt
  • Options
    [Deleted User][Deleted User] Posts: 4,131
    Forum Member
    ✭✭✭
    Yes, I have to say well done too... out of the blue bang! We have a better alternative to eLinker! A bit of of magic, really... Brilliant! :)

    Now where's my VisualBasic for Dummies in 24 Hours book... and your source code... ;)
  • Options
    [Deleted User][Deleted User] Posts: 37
    Forum Member
    Well so far a few minor bugs have been reported which will hopefully be fixed at the end of today. I'll release the update via the usual link to my own website.

    Current bugs are:
    - '/' in Humax filenames cause problems.
    - Settings options B & C don't work properly.

    On the file transfer front i've not noticed any problems transferring video files on my setup and using ProjectX to demux the TS files. But that might be down to ProjectX being more tolerant to the usual junk at the start of video files. If there's a problem there then I may investigate further. One thought i've had is to get the Media Controller software to do the demuxing itself as it is transferring the file from the Hummy so as to remove the need to use Project X altogether.

    It would also be good if developers on other platforms (MAC, Linux, FreeBSD, etc) could port the MC software to those platforms and test out the stability of the USB drivers there too. If we can get stable transfers on those other platforms then that would indicate a problem with the Windows LIBUSB-WIN32 drivers used by both eLinker and MC. I can then investigate the Windows drivers to see if they can be made to work properly (for both eLinker and MC) without the need for all this multiple-transfer business.

    On the Hummy USB front I did notice (during development) that if I overloaded the Hummy with USB requests after it failed an operation that eventually the Hummy would disappear from the PC and I would get the "Unknown Device" situation described above. The procedure I used to get it back again (by deleting all the USB devices and letting Windows reinstall them again on next boot-up) was all I could think of to get things talking again. If anyone can come up with an explanation to why it happens (and a better procedure than mine) then that would be useful.

    Andy.
  • Options
    [Deleted User][Deleted User] Posts: 37
    Forum Member
    Media Controller V1.01 released with minor bug fixes and is available at:

    http://www.enigma.eclipse.co.uk/humax/HumaxMediaController.htm

    Bugs fixed are:
    - Fixed Settings options B & C to work properly and now accept root directory entries (such as c:\ and d:\).
    - Fixed problem with handling the '/' character in Humax filenames.

    Andy.
  • Options
    [Deleted User][Deleted User] Posts: 172
    Forum Member
    sidaxp wrote:
    Media Controller V1.01 released with minor bug fixes.

    Wow, what service :)

    Thanks very much!
  • Options
    [Deleted User][Deleted User] Posts: 61
    Forum Member
    Andy

    Great work, thanks again. Thanks also to you, and several others, for suggestions on how to solve my USB problem. Need to disconnect Hummy from TV downstairs in order to try again.

    V
  • Options
    [Deleted User][Deleted User] Posts: 9
    Forum Member
    Andy,

    Bloody birlliant!! You are a true ledgend! I tried out your tool last night is it worked a treat! Thanks a million!!!
  • Options
    [Deleted User][Deleted User] Posts: 4,131
    Forum Member
    ✭✭✭
    Hello Andy

    I like your idea of implementing your own autopadding! (Certainly could be smarter than what Humax have cobbled together.) How possible do you think this is? Do you think you can access (read and write) other info apart from file manipulation - ie touch the EPG and the schedual timers list?

    Anyone else got a clue?
    13. Read/Write Programme Schedule Info.

    On the subject of USB commands, I would very much like a USB command to read and write the current programme schedule list from the Humax via USB. The reason is that I currently use a software package on the PC called Digiguide
    (www.digiguide.com) to plan the TV schedule at the start of the day. Once I've marked off which programmes I wish to record, I then have to go and manually set these up on the Humax. It's a pain in the arse and it can takes ages, especially when adjusting programmes with padding, etc. With this new USB command, I could extend this software to pull the recordings info directly from Digiguide and transmit it straight to the Humax via USB with all the usual checks for ensuring that autopadding is applied and that overlaps do not occur, etc. This would be a new USB command so wouldn't affect any existing functionality as used by the Humax Media eLinker software.
Sign In or Register to comment.