[Pending] - Added process priority setting to Comskip Launcher plugin. | Page 2

Discussion in 'Submit: code patches (MediaPortal/TV-Server/etc.)' started by cwchapma, May 11, 2013.

  1. elliottmc
    • Premium Supporter

    elliottmc Retired Team Member

    Joined:
    August 7, 2005
    Messages:
    14,927
    Likes Received:
    4,011
    Gender:
    Male
    Location:
    Cardiff, UK
    Ratings:
    +5,503 / 13
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    mm1352000 has already answered to say that he is okay with this as long as someone else does the work porting it to TVE35. So, I think we are okay in principle.

    Please bear in mind that while a recording is being processed by comskip, it cannot be deleted, and changing the priority will mean this takes even longer.

    So, if at all possible I'd like to see a situation where if the user tries to delete a recording that is being processed by comskip, MP can check this and stop the comskip process for that recording and the delete.

    However, that might be more complicated and may have to wait for TVE35.



    For now, I guess we can change the priority. Need to have a GIT branch for this fix.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Holzi
    • Team MediaPortal

    Holzi Super Moderator

    Joined:
    April 21, 2010
    Messages:
    7,928
    Likes Received:
    1,591
    Gender:
    Male
    Location:
    Ba-Wü
    Ratings:
    +2,228 / 8
    Home Country:
    Germany Germany
    Show System Specs
    Jup. Would be nice. :)
    @Sebastiii do you have a little time?
     
  4. Sebastiii
    • Team MediaPortal

    Sebastiii Development Group

    Joined:
    November 12, 2007
    Messages:
    16,264
    Likes Received:
    6,218
    Gender:
    Male
    Location:
    France
    Ratings:
    +10,224 / 9
    Home Country:
    France France
    Show System Specs
    A friend of mine told me :
    Lowering process priority wont cause more longer comskip runs to happen, unless there is CPU required for example on the playback and it's pretty sure that people tolerate not being able to delete something more than getting stuttering playback :)
    We can create bat for comskip so it's possible to watch tv while it is working (old AMD with multiple comskips running in background was too much and actually it is a bug in comskip).
    So not sure but when running under MP it is not able to set the process priority correctly - based on comskip dev it will always run at low priority by default (and even uses low I/O priority when running on >= Vista)
    Not sure why it doesn't work, but somehow TVE manages to trigger that bug in comskip.

    But seems good news too :)
    --
    Changes on 0.81.056
    - Bug solved: On some recordings comskip would restart processing the file when reaching the end of the recording resulting in an endless loop.
    --
    Yeah :)
     
  5. Holzi
    • Team MediaPortal

    Holzi Super Moderator

    Joined:
    April 21, 2010
    Messages:
    7,928
    Likes Received:
    1,591
    Gender:
    Male
    Location:
    Ba-Wü
    Ratings:
    +2,228 / 8
    Home Country:
    Germany Germany
    Show System Specs
    Means this patch got rejected?
     
  6. markus_g

    markus_g Portal Pro

    Joined:
    August 12, 2006
    Messages:
    104
    Likes Received:
    38
    Gender:
    Male
    Ratings:
    +56 / 0
    Home Country:
    Australia Australia
    Show System Specs
    I have been using version 81.056, but have all sorts of problems if more than one comskip is being run with the server plugin. Mediaportal TV video playback stops and starts but the audio isn't affected. MP becomes unresponsive or very slow when trying to stop the video. This problem is on any recording and not just the one comskip is processing.

    A quick look at the logs it appears that MP is loosing server connection when the problem is occurring.

    I have tried running lots of manual comskip processes in the background without using the TVserver plugin and this doesn't affect MP.

    I am planning on doing some more tests and will capture some logs and will report it as a bug.

    Regards,
    Markus
     
    • Like Like x 1
  7. RonD
    • Team MediaPortal

    RonD Test Group

    Joined:
    December 20, 2011
    Messages:
    904
    Likes Received:
    119
    Occupation:
    semi-pro slacker
    Location:
    SillyValley CA
    Ratings:
    +275 / 0
    Home Country:
    United States of America United States of America
    I also use comskip and have problems using the recent versions. For me I get good acceptable results using comskip rev = 0.80.042. On my main MePo 1.5.0 win7 server, Ivybridge i5-3450 4-core 3.1 GHz, integrated HD2500 graphics/LAV, 5 ATSC tuner, I can do the following on a single seat Server/Client. This is with all comskip "play_nice" disabled, full speed.

    1. record 5 simultaneous 30 minute shows, auto-start 5 comskips at end of recordings
    2. record the next 5 simultaneous 30 minute shows
    3. while 5 comskips are running and 5 more shows are recording, watch a recorded show without any visible problems.

    When I've tried recent comskip versions I have major problems and can't use MePo client to watch a show with recording and comskip activity.

    With Win7 Task Manager and Resource Monitor I see the following for 0.80.042, comskip is running at low priority and comskip process does all disk reads with "Background" IO priority.

    With current comskip versions, 0.81.056, comskip runs at Normal priority and comskip disk reads are done with "Normal IO" priority. I've also found a way to use the stock comskip launcher plugin to start/run 0.81.056 at low priority but the disk traffic is still done at "Normal IO". This helps but I still see problems with 5*recording, 5*comskip, and watching a show at the same time. I may try tweaking the "play_nice" options to see if that helps.

    Looking at the comskip release history http://www.kaashoek.com/files/readme.txt there are a few interesting comments that may explain some of what is happening.

    Changes in 0.80.017
    - Set Comskip to THREAD_MODE_BACKGROUND_BEGIN priority to prevent the disk IO from blocking all other processes

    Changes in 0.81.013
    - Disabled the IO playnice to gain speed on multi core Windows 7 machines.

    I think I chose 0.80.042 since it was the last version that still did Background Disk reads. Not really sure what causes comskip problems but suspect the Normal vs Background IO Priority is part of the story.
     
    • Like Like x 1
  8. RonD
    • Team MediaPortal

    RonD Test Group

    Joined:
    December 20, 2011
    Messages:
    904
    Likes Received:
    119
    Occupation:
    semi-pro slacker
    Location:
    SillyValley CA
    Ratings:
    +275 / 0
    Home Country:
    United States of America United States of America
    A couple of comments on adjusting comskip priority. With the stock comskip launcher you can do the following. In these examples I put all the scripts and .exe files in the following folder, you'll need to modify the folder paths for your system

    My test folder path L:\MePo\comskip81_056

    make a 1 line RunComskip.cmd file with the following. Use either /LOW or /BELOWNORMAL to lower comskip.exe priority
    start "COMSKIP" /min /I /LOW L:\MePo\comskip81_056\comskip.exe %1

    use the following for comskip launcher, this starts a cmd.com to run the script and closes the cmd window when done.
    Program: C:\Windows\System32\cmd.exe
    Parameters: /c L:\MePo\comskip81_056\RunComskip.cmd "{0}"

    since this is just a 1 line command you can also just skip the .cmd file and do the following for comskip launcher and set LOW CPU priority
    Program: C:\Windows\System32\cmd.exe
    Parameters: /c start "COMSKIP" /min /low L:\MePo\comskip81_056\comskip.exe "{0}"

    On my 5 tuner 4-core IVB i5 system setting comksip to LOW CPU priority works for 2-3 active comskips but have problems if I test with 5 active comskips, 5 active recordings, and watching 1 program on a remote client. To pass this test I also needed to lower the IO Priority. I could not find a way do this with "just scripts", needed to download/use a small IOPriorityV1.1.exe file from sourceforge, and write small vbs script to start comskip at low CPU priority and set IO Priority "VeryLow".

    http://sourceforge.net/projects/iopriority/

    I uploaded the vbs script as RunComskip.txt, you'll need to modify the extension to RunComskip.vbs to use it. In the beginning of the vbs script you'll need to modify the strComSkip and strIOpriority "strings" with the path to your .exe files. To use RunComskip.vbs do the following for comskip launcher. Modify paths as needed.

    Program: C:\Windows\System32\cscript.exe
    Parameters: L:\MePo\comskip81_056\RunComskip.vbs "{0}"

    With the vbs script I can run 5-10 background comskips while recording 5 shows and watching 1 program on a remote client. Sometimes there a few video glitches when 5 recordings stop, 5 new recordings start, and 5 new comskips start but I can live with the hickups.

    NOTE: If you go to msg #21 of this thread, there is an updated zip/dll that includes the fixes in the script. I'm using the dll version without problems. Just save the ComSkipLauncher.dll file in the TV Server Plugins folder in case you have a problem and use the new dll.
     

    Attached Files:

    • RunComskip.txt
      File size:
      2 KB
      Uploaded:
      November 22, 2013
      Views:
      253
    Last edited: April 5, 2014
    • Thank You! Thank You! x 1
  9. cwchapma

    cwchapma Portal Pro

    Joined:
    October 15, 2006
    Messages:
    56
    Likes Received:
    17
    Ratings:
    +22 / 0
    Home Country:
    Canada Canada
    Show System Specs
    I'm uploading the dll for this patch in case other people find it useful. Just replace the ComSkipLauncher.dll in 'C:\Program Files\Team MediaPortal\MediaPortal TV Server\Plugins' or your equivalent. You can set the priority in the plugin configuration.
     

    Attached Files:

    • Thank You! Thank You! x 1
  10. cwchapma

    cwchapma Portal Pro

    Joined:
    October 15, 2006
    Messages:
    56
    Likes Received:
    17
    Ratings:
    +22 / 0
    Home Country:
    Canada Canada
    Show System Specs
    Here's an updated ComskipLauncher that also sets the io priority and memory priority to low for the comskip process. Thanks to @RonD for all the great info!
     

    Attached Files:

    • Like Like x 1
    • Thank You! Thank You! x 1
  11. RonD
    • Team MediaPortal

    RonD Test Group

    Joined:
    December 20, 2011
    Messages:
    904
    Likes Received:
    119
    Occupation:
    semi-pro slacker
    Location:
    SillyValley CA
    Ratings:
    +275 / 0
    Home Country:
    United States of America United States of America
    cwchapma

    tried both of your ComSkipLaunchers on my 4 core system, run 5 parallel comskip, record 5 parallel shows, 2 active Clients (1 local, 1 remote)

    1st zip (.exe = 4/24/13) CPU = Idle, IO = Normal, shows the same problems I saw when I used script to do "Start /Low". Lower CPU priority helps, but MePo Client and video have major problems, CPU priority helps but IO Priority is still a problem

    2nd zip (.exe = 1/28/14) CPU = Idle, IO = Low, this works better, but my script approach CPU = Idle, IO = VeryLow/Background is still better.

    Could you build a 3rd version that also sets IO Priority = VeryLow = 0. In my script this is "IOPriorityV1.1.exe PID 0"

    When I use Resource Monitor or Msft Process Explorer I see the IO = Low priority, with Process Explorer I can manually tweak the IO Priority = Background and it improves the response.
     
    Last edited: February 1, 2014
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!