Page 1 of 2 12 LastLast
Results 1 to 15 of 21

Thread: Tweaking nosdd.tcl to prevent audio skips

  1. #1
    Join Date
    Aug 2002
    Posts
    114

    Tweaking nosdd.tcl to prevent A/V skips

    I want to thank AW for his fine contributions to the Tivo community. nosdd is most definitely a great tool to play with on my extra Tivo.

    One thing I have noticed on the T60, however, is that the nosdd script will cause the audio output to go out for about a half-second. I've looked through the tcl code for both nosdd and the reference function from mfslib.tcl, but I really can't determine a more efficient method by which to check the tyDb records.

    Nevertheless, I am not a tcl guru, but I have thought of a few things:

    Would it help any if there was a slight pause while checking each record? Or, is the opening of the database causing the most overhead?

    I'll keep looking at the code, but if anyone has any additional recommendations, please feel free to share.


    Thanks!
    Last edited by OvitivO; 08-30-2002 at 01:30 AM.

  2. #2
    Join Date
    Jan 2002
    Location
    Sonoran Desert
    Posts
    2,829
    I considered doing this, but I don't get skips so I won't be able tell weather or not its effective. As I said earlier, tivoweb is able to parse the todo list, and I don't think this causes freezing for anybody, but I can't tell for certain. If it doesn't cause you any freezing when you look at the todo list in tivoweb, let me know, and I will look at what they are doing differently.

    As a temporary solution, see if adding 'after 250' before the last bracket helps any. That will create a 250ms delay between each loop, but it will make the script take much longer to complete (and possibly not cancel the SDD in time).
    Before PMing me: Iím not your personal tech support. If you have a question, ask in public so I don't have to repeat if somebody else asks. If you want images or slices, use emule. I will ignore all support PMs.

    Sponsor a vegetarian! I have taken the pledge, how about you?

  3. #3
    Join Date
    Aug 2002
    Posts
    114

    Only opening the database

    By commenting out everything except the top of the script, I still get the brief drop in A/V.

    e.g.:


    #!/tvbin/tivosh

    EnableTransactionHoldoff true
    tvsource $tcl_library/tv/mfslib.tcl

    proc strim {str} { return [string trim $str "\{\} "] }

    set db [dbopen]
    (I'll focus on this area for now.)

    Still testing different things -- let me know if you think of anything else.

    Thanks!

  4. #4
    Join Date
    Aug 2002
    Posts
    114

    set db [dbopen]

    OK, I've narrowed it down to "set db [dbopen]"

    This makes sense, but now I'm at a loss to debug/improve this process.



  5. #5
    Join Date
    Jan 2002
    Location
    Sonoran Desert
    Posts
    2,829
    This means that you have a very filled up database. Almost any script you run will freeze when you first start it, unless you clean out your tivo first.

    Since cleaning out your tivo regularly isn't how a non hacked tivo should have to function, going about it that way is a bad idea, so we have two options; find an alternative way of opening the database, or have nosdd loop infinitely. I don't like the latter, but I am not enough of a TCL guru to know how to work around the prior.

    MrBlack51 and I were playing around with tivotitle to fix the freezing that it gets, he said he found a way to get a handle on the database without it freezing, but I never got back to him on that.

    Meanwhile I suppose I will look into it.

    EDIT: try this just for a test, run tivosh, then just type 'dbopen'. If your audio doesn't freeze, then that means we have to slow things down at the start.
    Last edited by AlphaWolf; 08-29-2002 at 09:00 PM.
    Before PMing me: Iím not your personal tech support. If you have a question, ask in public so I don't have to repeat if somebody else asks. If you want images or slices, use emule. I will ignore all support PMs.

    Sponsor a vegetarian! I have taken the pledge, how about you?

  6. #6
    Join Date
    Jun 2001
    Posts
    3,108
    here is the edited TivoTitle that AW and I worked on. If I am really paying attention, I can hear a micro-skip in the audio when the dbopen occurs, but its a whole lot better than it was with the version I was using. If it helps anyone, great.

    As per the readme, version number has been incremented and comments added.
    Attached Files Attached Files

  7. #7
    Join Date
    Aug 2002
    Posts
    114

    Possible fix?

    So far, this modification appears to be working, and although there is a very, very slight hiccup in audio, it seems to be much better.

    I'd like to get some confirmation about this still obtaining the end result of removing SDDs. Thanks!

    Code:
    #!/tvbin/tivosh
    # SDD unscheduler by AlphaWolf_HK, mrblack51
    
    EnableTransactionHoldoff true
    tvsource $tcl_library/tv/mfslib.tcl
    
    proc strim {str} { return [string trim $str "\{\} "] }
    
    # initializing db now, due to A/V glitch issue
    
    set dbPoolSize [expr 100 * 1024]
    
    exec sleep 1
    puts stdout "set dbopen"
    set db [dbopen $dbPoolSize]
    puts stdout "done with set dbopen"
    
    # check tyDbs
    
    ForeachMfsFile fsid name type /Recording/Active "" {
            if { $type == "tyDb" } {
                    RetryTransaction {
                            set rec [db $db openid $fsid]
                            set showing [dbobj $rec get Showing]
                            set program [dbobj $showing get Program]
                            set title [strim [dbobj $program get Title]]
                            set state [dbobj $rec get State]
    
                            if {$state == 6 && $title == "TiVo Service Data"} {
                                    puts "Found $title at FSID: $fsid and unscheduling it."
                                    dbobj $rec set State 2
                            }
                    }
            }
    }

  8. #8
    Join Date
    Jan 2002
    Location
    Sonoran Desert
    Posts
    2,829
    That would work, though you don't need all of that...try this (in fact this might work better):

    Code:
    #!/tvbin/tivosh
    
    EnableTransactionHoldoff true
    tvsource $tcl_library/tv/mfslib.tcl
    
    setpri fifo 1
    after 1000
    set db [dbopen 102400]
    
    ForeachMfsFile fsid name type /Recording/Active "" {
            if { $type == "tyDb" } {
                    RetryTransaction {
                            set rec [db $db openid $fsid]
                            set showing [dbobj $rec get Showing]
                            set program [dbobj $showing get Program]
                            set title [dbobj $program get Title]
                           
                            if {$title == "{TiVo Service Data}"} {
                                    dbobj $rec set State 2
                            }
                    }
            }
    }
    Let me know how it works so I can make a more formal release in the other thread.

    EDIT: If it still skips, try lowering the number after dbopen til it stops.
    Last edited by AlphaWolf; 08-29-2002 at 11:52 PM.
    Before PMing me: Iím not your personal tech support. If you have a question, ask in public so I don't have to repeat if somebody else asks. If you want images or slices, use emule. I will ignore all support PMs.

    Sponsor a vegetarian! I have taken the pledge, how about you?

  9. #9
    Join Date
    Aug 2002
    Posts
    114

    Ok, so far

    That definitely appears to be helping w/ the A/V skips.

    Just wondering, however. Was a pool size of 102400 arbitrarily picked?

    Thanks again guys -- I may be able to run this a lot more often to catch the smaller files. (I did notice a few SUCCESS entries in svclog that were about 2 minutes apart a few days ago.)


  10. #10
    Join Date
    Jan 2002
    Location
    Sonoran Desert
    Posts
    2,829
    Er...hold everything for a sec....Embeem pointed out to me that nice does nothing for a tivo, and setpri should eliminate all skip problems, period. I know that most people here are using 25xtreme...so that brings a question, does 25xtreme include setpri? Reason I ask is because I have been using 'setpri fifo 1' for all of my hacks, and none of them have ever caused any freezing, at all.

    Try this, at bash type: 'setpri' (no quotes)

    If you see "command not found", then you DON'T have it, or haven't installed it properly, hence why you still see skipping all the time, even if you use 'setpri fifo 1' in your rc.sysinit.

    Download setpri from the below link, put it in /bin or somewhere in your path entry, then on the line before you call cron in your rc.sysinit, add this line:

    setpri fifo 1

    Try using the origional nosdd script that way. It shouldn't freeze at all.

    http://tivo.samba.org/download/mbm/bin/
    Last edited by AlphaWolf; 08-30-2002 at 12:50 AM.
    Before PMing me: Iím not your personal tech support. If you have a question, ask in public so I don't have to repeat if somebody else asks. If you want images or slices, use emule. I will ignore all support PMs.

    Sponsor a vegetarian! I have taken the pledge, how about you?

  11. #11
    Join Date
    Jul 2002
    Posts
    109
    Originally posted by AlphaWolf
    ...so that brings a question, does 25xtreme include setpri?
    No, it does not. At least it is not in any of the directories in the standard 25Xtreme path

  12. #12
    Join Date
    Aug 2002
    Posts
    114

    Very smooth

    Yup, setpri really helps out. I ran this nosdd script every minute for about an hour and didn't notice any A/V issues.

    Thanks again to everyone.

    The final script I ended up using:

    Code:
    #!/tvbin/tivosh
    
    EnableTransactionHoldoff true
    tvsource $tcl_library/tv/mfslib.tcl
    
    setpri fifo 1
    after 1000
    set db [dbopen 102400]
    
    ForeachMfsFile fsid name type /Recording/Active "" {
            if { $type == "tyDb" } {
                    RetryTransaction {
                            set rec [db $db openid $fsid]
                            set showing [dbobj $rec get Showing]
                            set program [dbobj $showing get Program]
                            set title [dbobj $program get Title]
                            set state [dbobj $rec get State]
                           
                            if {$title == "{TiVo Service Data}"} {
                            	puts "Found $title at FSID: $fsid and unscheduling it."
                                    dbobj $rec set State 2
                            }
                    }
            }
    }
    (I decided to keep the unscheduling details for logging purposes.)

    fwiw, my test platform is a T60

  13. #13
    Join Date
    Aug 2002
    Posts
    114

    Post nosdd.log

    For those that are interested, here's my nosdd log. I run the script every 2 minutes, and i thought this would be of interest to those that were not sure how often the feed attempts to send the sdd through the stream.

    (I'll set up item-specific timestamps soon, if this is hard to read.)

    [...]
    Fri Aug 30 06:00:00 UTC 2002
    Found {TiVo Service Data} at FSID: 841194 and unscheduling it.
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Fri Aug 30 07:00:00 UTC 2002
    Found {TiVo Service Data} at FSID: 850349 and unscheduling it.
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    retrying after errTmActiveLockConflict ...
    Found {TiVo Service Data} at FSID: 850373 and unscheduling it.
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    Fri Aug 30 08:00:00 UTC 2002
    retrying after errTmActiveLockConflict ...
    retrying after errTmActiveLockConflict ...
    Found {TiVo Service Data} at FSID: 850384 and unscheduling it.
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    retrying after errTmActiveLockConflict ...
    retrying after errTmActiveLockConflict ...
    Found {TiVo Service Data} at FSID: 850393 and unscheduling it.
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    Fri Aug 30 09:00:00 UTC 2002
    Found {TiVo Service Data} at FSID: 850394 and unscheduling it.
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    retrying after errFsLockConflict ...
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850405 and unscheduling it.
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    Fri Aug 30 10:00:00 UTC 2002
    Found {TiVo Service Data} at FSID: 850422 and unscheduling it.
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    retrying after errTmActiveLockConflict ...
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    retrying after errTmActiveLockConflict ...
    retrying after errTmActiveLockConflict ...
    retrying after errTmActiveLockConflict ...
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    retrying after errTmActiveLockConflict ...
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    Fri Aug 30 11:00:01 UTC 2002
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    Fri Aug 30 12:00:00 UTC 2002
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    retrying after errTmActiveLockConflict ...
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    retrying after errTmActiveLockConflict ...
    Fri Aug 30 13:00:01 UTC 2002
    Found {TiVo Service Data} at FSID: 845008 and unscheduling it.
    Found {TiVo Service Data} at FSID: 847853 and unscheduling it.
    Found {TiVo Service Data} at FSID: 850374 and unscheduling it.
    Fri Aug 30 14:00:00 UTC 2002
    [...]

    errFsLockConflict and errTmActiveLockConflict also threw up a few flags (or at least piqued my interest).

  14. #14
    Join Date
    Sep 2001
    Posts
    457
    Does your post indicate that out of 30 runs per hour only the run at the top of the hour (XX:00) is doing any work?

    Or am I missing something?

  15. #15
    Join Date
    Aug 2002
    Posts
    114

    The times

    The times are only hourly place markers. To alleviate the potential for confusion, I modified the script to give a more accurate description of the time at which each fsid was unscheduled.

    Code:
    #!/tvbin/tivosh
    
    EnableTransactionHoldoff true
    tvsource $tcl_library/tv/mfslib.tcl
    
    setpri fifo 1
    after 1000
    set time [clock format [clock sec] -format %Y-%M-%H:%M:%S]
    set db [dbopen 102400]
    
    ForeachMfsFile fsid name type /Recording/Active "" {
            if { $type == "tyDb" } {
                    RetryTransaction {
                            set rec [db $db openid $fsid]
                            set showing [dbobj $rec get Showing]
                            set program [dbobj $showing get Program]
                            set title [dbobj $program get Title]
                            set state [dbobj $rec get State]
                            
                            if {$title == "{TiVo Service Data}"} {
                                    puts "$time :: Found $title at FSID: $fsid and unscheduling it."
                                    dbobj $rec set State 2
                            }
                    }
            }
    }
    You all may find [clock] unnecessary, but it gives me a little bit more detail about the sdds.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •