[mythtv-commits] Ticket #11252: Reduce DeviceReadBuffer thread wakeup

MythTV noreply at mythtv.org
Thu Jan 3 23:44:26 UTC 2013


#11252: Reduce DeviceReadBuffer thread wakeup
------------------------------------+----------------------------
 Reporter:  Rune Petersen <rune@…>  |          Owner:  danielk
     Type:  Patch - Feature         |         Status:  infoneeded
 Priority:  minor                   |      Milestone:  unknown
Component:  MythTV - General        |        Version:  0.26-fixes
 Severity:  medium                  |     Resolution:
 Keywords:                          |  Ticket locked:  0
------------------------------------+----------------------------

Comment (by Rune Petersen <rune@…>):

 Your change will have no affect on will have no affect on wakeups.

 I'll try to explain why:
 The current code will wait for at least 188*4 bytes of data and time out
 after (now) 20ms. if not enough data is received.
 This this gives you very low latency, at the cost of 700+ wakeups a second
 at bitrates over 6Mbps.

 My change trades a little latency (worst case 20ms.) for a reduction in
 wakeups.
 try to read it as: wait for 20ms. unless the readThreshold is exceeded
 readThreshold should not be seen as a minimum read, but more as a flush
 threshold in case of starvation.
 The actual size of the latency is  negotiable, even 10ms. will be
 noticeable.


 The change to streamhandler is because of the reduced timeout in
 DeviceReadBuffer::Read() can result in Read() returning 0 bytes read in
 very low bitrate situations will will result in a 100ms. delay/latency
 spike. The old code waited 500ms. which makes this scenario more or less
 impossible.


 CPU usage on my Cortex-A9 using unmodified MythTV is 36-40% when recording
 DVB HD content.
 (with all my patches (not just this one) CPU usage is ~10% )

 Just for fun:
 my Cortex-A9 runs at 700MHz and has 128KB L2 Cache, your E8400 runs at
 3GHz, and has 6MB L2 Cache.

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/11252#comment:5>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list