id summary reporter owner description type status priority milestone component version severity resolution keywords cc mlocked 11252 Reduce DeviceReadBuffer thread wakeup Rune Petersen jpoet "This patch affects 2 threads: - DeviceReadBuffer reader thread. - The (DVB/ASI)StreamHandler thread. === DeviceReadBuffer reader thread: === The reader thread will continually poll and read from the device when data is available. Depending on the driver this will result in the thread will wake up and read() 700+ times a second with a reads of ~2KB (DVB HD content). The patch calls usleep(1000) if a read is less than 'dev_read_size/2' This reduces the thread to ~200 read() calls a second with reads of 7-8KB (DVB HD content). === The (DVB/ASI)StreamHandler thread: === The thread will continually call DeviceReadBuffer::Read() and then process the content. Currently DeviceReadBuffer::Read() will return if more than 4*188 bytes is available in the buffer (timeout 500ms.) This results in DeviceReadBuffer::Read() being called 700+ times a second with a reads of ~2KB (DVB HD content). The patch changes DeviceReadBuffer::Read() to wait for more data (~24KB) and decrease the timeout to 20 ms. The timeout is now responsible for controlling the maximum latency of the data stream. This reduces the thread to ~70 DeviceReadBuffer::Read() calls a second with reads of 20KB (DVB HD content). The combined result if this patch reduces CPU usage by ~15% on a 700MHz Cortex-A9 when recording DVB HD content. " Patch - Feature closed minor 0.27 MythTV - General 0.26-fixes medium fixed 0