LiveTV\TimeShifting on NAS...Almost working... (1 Viewer)

Chris31

New Member
September 24, 2006
3
0
Hello, my first post here but have been reading on here a little here and there and have been using MediaPortal for only about a month. I've used MCE for nearly 2 years but have grown to like MediaPortal and would like to switch over. I've also built a large collection of movies, shows and other things I'd like to keep but keeping them on an HTPC and keeping it quiet and cool is turning into a problem.

My solution to that is adding everything to my NAS box and keeping the HTPC to a minimal cool SFF HTPC. This includes having the timeshift buffer on the NAS as well as recording and managing recordings/shows from there, keeping hassle to a minimum. The NAS runs FreeNAS, FreeBSD based, from a USB PenDrive and has 1TB of storage using UFS as the file system. For this I use it mapped to WinXP as a drive letter, not the UNC address. For example "G:\MediaPortal" is what the recording folder is set to in MediaPortal.

So, I can record to the NAS and watch it as its recording, couldn’t get MCE to do that. I can have the timeshift buffer on the NAS and watch live TV with timeshifting on...BUT only for a while. For testing I set the timeshift buffer to 2, 5 and finally 30 minutes but get the same results. MediaPortal makes the directories it needs no problems, it makes the files it needs no problems. The problem is MediaPortal wont delete the MSDVRMM******** (long filename no extension) files it creates. I think it needs two active MSDVRMM type files but it will keep creating them, up to 8, and then finally at the end of time the buffer is set for it will give an error and then no more LiveTV or timeshifting. When I close MediaPortal it will delete all the SBE**.tmp files but NONE of the MSDVRMM files. If the files aren’t deleted before MediaPortal is opened again then the timeshift buffer on the NAS won’t work and I can’t use timeshifting or record. If I delete the files manually and then open MediaPortal it will work fine until the end of the buffer, 5mins or 30mins whatever I set it to. It handles the SBE**.tmp files fine, it will add, resize, purge, delete, rename and whatever it does with them fine.

Now, if I sit there and watch the folder, *\card1\TempSBE\, while timeshifting is on and keep deleting the 3rd oldest MSDVRMM file in the buffer it will keep LiveTV/timeshifting going for ever as it should. I tried this on a 5min buffer and had live TV with timeshifting on for 1.5hrs with no problems but I had to keep manually deleting the 3rd oldest MSDVRMM file manually every couple minutes. All files and folders on the NAS for MediaPortal have Read, Write, Execute privileges. And since it handles the SBE files fine, deletes renames etc, privileges aren’t the problem as they all have the same.

What I need to know is if anyone knows a workaround for this or if you know whether this is a bug. There was a thread on here similar to this but it was Windows based NAS or server and I don’t think they got as far as I have with this. I really think this is a bug in MediaPortal. It should handle these MSDVRMM files better, like it does the SBE files. It, at the very least, should delete the MSDVRMM files when the program closes as it does the SBE files. I know this is kinda long and I hope someone is still reading this with an answer/workaround or even questions. Maybe someone can point this to someone on the MediaPortal TestTeam and have them look into it. I tried to open an account to post on their forums but couldn’t. If this gets fixed then MediaPortal would be nearly as network aware as I, or you, need. Any ideas or suggestion would be appreciated…




MediaPortal: 0.2.0.4
Windows Version: XP Pro SP2
CPU Type: Athlon 64
Memory: 1GB
TV Card: 150MCE
 

NickName

MP Donator
  • Premium Supporter
  • June 23, 2006
    359
    12
    Gold Coast
    Home Country
    A workaround for you.

    I have a temporary workaround that may work. Try using a 'directory monitoring' program (i.e. DirMon) and then use that program to run a BAT or VBS script to delete the third file for you whenever it encounters it.
    Hope that helps,

    regards,

    Nick Name
     

    Chris31

    New Member
    September 24, 2006
    3
    0
    Thanks for the suggestion. I've never used DirMon but looking at it DirMon seems to only work by using the file extension or entire file path. The files MediaPortal creates that I need handled don’t have extensions and the folder can’t be emptied while timeshitfting is running. An example of the file MediaPortal creates is:

    MSDVRMM_339608504_77_15709190

    The only constant in the file seems to be the MSDVRMM part of the file and they always seem to be 4KB in size.

    They are stored in the \card1\TempSBE directory. On windows to see the \TempSBE folder you have to uncheck "Hide protected operating system files" in folder options. I also have "Hide extensions for known file types" unchecked so everything has its file extensions showing. I know a little VB so I might try writing a little program that will monitor the folder and delete the 3rd oldest, if I can. Thanks for the suggestion of let me know if you think DirMon will work on files without an extension, maybe by using the prefix. Anyone else have any ideas?

    Thanks again...
     

    NickName

    MP Donator
  • Premium Supporter
  • June 23, 2006
    359
    12
    Gold Coast
    Home Country
    OK, maybe Dirmon may be of no use however you could use a VBscript that simply runs the whole time your HTPC is on.
    ie. it just loops continuosly from bootup checking for the third oldest MSDVRMM* file and deleting it.
    That would have the advantage of being less software running. Just be sure to put a sleep command in your script else you'll max out you CPU.
    I'd reckon every 30 seconds would be ok so you'd use:
    sleep(30000)
    in the loop.
    Give us a yell if you get stuck and I'll help with the script although I am very busy this week.
    On a similar but different note, I am looking at running my Timeshift buffer in a RAM drive (about 1.3 gig of ram needed for a 30 minute Timeshift buffer I estimate). This would be very quick and silent and would save hard drive 'wear and tear'... I don't know yet how this will affect recording though I'd simply 'NTFS mount' the RAM drive as a folder (\card1) in the Recording folder. This way Mediaportal would think it was talking to a HD disk and not to RAM. ;-)
    This is 'work in progress'

    Just re-read your post... If the file can't be deleted while Timeshift is running, I assume you need to delete it when Mediaportal shutsdown? If so, get the VBScript to watch for either the Mediaportal window to close or for the Mediapotal process to end before trying to delete. The script may not run though if you shutdown the box from inside Mediaportal. You may need to close Mediaportal and then shutdown the box. My MCE remote can shutdown the box with or without Mediaportal running. :)


    Good luck,

    Nick Name.
     

    scoop

    Retired Team Member
  • Premium Supporter
  • November 14, 2004
    614
    7
    Hi,

    While this might or might not work in the end, please note that the SBE from Microsoft was never designed to work with networked storage (or even external storage).

    Kind regards,
    Michel
     

    FlipGer

    Retired Team Member
  • Premium Supporter
  • April 27, 2004
    2,658
    115
    50
    Leipzig, Germany
    Home Country
    Germany Germany

    scoop

    Retired Team Member
  • Premium Supporter
  • November 14, 2004
    614
    7
    Hi,

    To clarify a bit more: it's not considered a bug in MP, as the SBE is used in MP as a "black box" (i.e. the SBE does the handling of all temporary files, not MP).

    Kind regards,
    Michel
     

    Frodo

    Retired Team Member
  • Premium Supporter
  • April 22, 2004
    1,517
    121
    54
    The Netherlands
    Home Country
    Netherlands Netherlands
    The problem here is that the StreamBuffer engine does not support network drives.
    I'm surprised you got it to work (although not perfectly)
    All the timeshifting files are maintained (created/deleted) by the SBE itself.
    There is no way we can 'influence' this.

    So unfortunaly there is nothing we can do about this.

    You can hope Microsoft is going to fix this, or wait for TvEngine v3
    which will support network drives for timeshifting since it wont use Microsoft's
    SBE anymore

    Frodo
     

    Chris31

    New Member
    September 24, 2006
    3
    0
    Thanks for the replies, didn’t know if I'd get any or not. So, I've written a small program in VB 2005 that monitors the *\card1\TempSBE folder and deletes the oldest MSDVRMM*** files. I've had timeshifting going for nearly 12 hours straight on a 5 minute buffer located on FreeNAS.

    You guys are much more knowledgeable on the workings of SBE then I am. I never thought much about what made MediaPortal work behind the scenes until I wanted something besides MCE and found it wasn’t easy to get. So, for now, it seems this little work around is working fine.

    Cant wait for TvEngine v3 to come out, sounds very nice. I hope MCE, MediaPortal and the rest will eventually become more "network aware". It seems like it would be a necessary thing since many people, at least I do, like keeping large collections of shows/movies and storage becomes an issue on a quite attractive HTPC. Nothing more annoying than to have your file server in the living room.

    I really like MediaPortal and the community here seems really nice. Hope you guys keep developing it and adding new/innovative features. I'll update this if I run into problems or find a new issue, hope this is all I needed :) ...
     

    Users who are viewing this thread

    Top Bottom