Actions
Bug #892
closedPower: tvheadend is constantly waking the system
Start date:
2012-03-06
Due date:
% Done:
100%
Estimated time:
Found in version:
git-fdf89b2
Affected Versions:
Description
I noticed when checking my NAS-box with "powertop" that tvheadend is constantly waking
up the system (wasting energy) even if its not in active use (neither recordings nor live tv).
Cn Avg residency P-states (frequencies) C0 (cpu running) ( 0.0%) polling 1.8ms ( 0.1%) C1 mwait 1.7ms (136.6%) Wakeups-from-idle per second : 797.2 interval: 5.0s no ACPI power usage estimate available Top causes for wakeups: 38.9% (936.0) tvheadend 28.6% (686.8) USB device 1-7 : MediaTV Digital Home (Sundtek) 18.9% (455.0) [ehci_hcd:usb1, uhci_hcd:usb2] <interrupt> 12.2% (294.6) mediasrv
An strace on tvheadend shows this activity over and over
[...] sendto(6, "\0\0\0\0", 4, MSG_NOSIGNAL, NULL, 0) = 4 recvfrom(6, "\1Fo\4\200\4\0\0\0\0\0", 11, MSG_WAITALL, NULL, NULL) = 11 recvfrom(6, "\0\0\0\0", 4, MSG_WAITALL, NULL, NULL) = 4 fcntl(6, F_SETLK, {type=F_UNLCK, whence=SEEK_CUR, start=0, len=0}) = 0 semop(720898, {{0, 0, SEM_UNDO}, {0, 1, SEM_UNDO}}, 2) = 0 semop(720898, {{0, -1, SEM_UNDO}}, 1) = 0 semop(688129, {{0, 0, SEM_UNDO}, {0, 1, SEM_UNDO}}, 2) = 0 semop(688129, {{0, -1, SEM_UNDO}}, 1) = 0 fcntl(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_CUR, start=0, len=0}) = 0 sendto(6, "\1Go\2\200\2\0\0\0\0\0", 11, MSG_NOSIGNAL, NULL, 0) = 11 sendto(6, "\334\377", 2, MSG_NOSIGNAL, NULL, 0) = 2 recvfrom(6, "\1Go\2\200\2\0\0\0\0\0", 11, MSG_WAITALL, NULL, NULL) = 11 recvfrom(6, "\334\377", 2, MSG_WAITALL, NULL, NULL) = 2 fcntl(6, F_SETLK, {type=F_UNLCK, whence=SEEK_CUR, start=0, len=0}) = 0 semop(720898, {{0, 0, SEM_UNDO}, {0, 1, SEM_UNDO}}, 2) = 0 semop(720898, {{0, -1, SEM_UNDO}}, 1) = 0 semop(688129, {{0, 0, SEM_UNDO}, {0, 1, SEM_UNDO}}, 2) = 0 semop(688129, {{0, -1, SEM_UNDO}}, 1) = 0 fcntl(6, F_SETLKW, {type=F_WRLCK, whence=SEEK_CUR, start=0, len=0}) = 0 sendto(6, "\1Ho\2\200\2\0\0\0\0\0", 11, MSG_NOSIGNAL, NULL, 0) = 11 sendto(6, "\334\377", 2, MSG_NOSIGNAL, NULL, 0) = 2 recvfrom(6, "\1Ho\2\200\2\0\0\0\0\0", 11, MSG_WAITALL, NULL, NULL) = 11 recvfrom(6, "\334\377", 2, MSG_WAITALL, NULL, NULL) = 2 fcntl(6, F_SETLK, {type=F_UNLCK, whence=SEEK_CUR, start=0, len=0}) = 0 futex(0x7bb9e0, FUTEX_WAKE_PRIVATE, 1) = 1
When attaching gdb i noticed one thread that had constant activity:
Thread 11 (Thread 0x7f3255f5f700 (LWP 32028)): #0 0x00007f32584a85ad in nanosleep () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007f32584d9984 in usleep () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007f3259a4720e in __net_read () from /opt/lib/libmediaclient.so #3 0x00007f3259a3f5c5 in read () from /opt/lib/libmediaclient.so #4 0x000000000043c57c in read (aux=0x880c50) at /usr/include/bits/unistd.h: #5 dvb_adapter_input_dvr (aux=0x880c50) at /home/frank/tvheadend/src/dvb/dvb_adapter.c:533 #6 0x00007f3258a1ad8c in start_thread () from /lib/x86_64-linux-gnu/libpthread #7 0x00007f32584e104d in clone () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x0000000000000000 in ?? ()
The code dvb_adapter_input_dvr() looks like this:
while(1) { r = read(fd, tsb, sizeof(tsb)); [...]
I understand that EPG-data comes in from DVB but still i wonder if tvheadend
really has to read from the dvb device all the time?
Files
Actions