bas-t / ffdecsawrapper

FFdecsa empowered softcam for MythTV
GNU General Public License v3.0
17 stars 9 forks source link

[patch] Faster mythtv channel switching #19

Closed jirif closed 10 years ago

jirif commented 10 years ago

O_SYNC is overkill for not hard debuging tasks. Using it with ffdecsawrapper logging facility (--log used in your init scripts) causing mythtv channel switching timeouts and failures (Ubuntu 12.04.4, Mythtv 27, Intel(R) Celeron(R) CPU 847 @ 1.10GHz, 4G ram, 500G Hdd WDC WD5000BEVT) because of huge disk IO. Following patch fixing this issue and removing missleading comment. Mythtv itself do not using O_SYNC for years.

diff --git a/dvbloopback/src/forward.c b/dvbloopback/src/forward.c
index 64c45d0..0ca831d 100644
--- a/dvbloopback/src/forward.c
+++ b/dvbloopback/src/forward.c
@@ -223,9 +223,7 @@ int init_osd(int real, int virt) {
.
 int log_rotate(int report_error)
 {
-  /* http://www.gossamer-threads.com/lists/mythtv/dev/110113 */
-
-  int new_logfd = open(logfile, O_WRONLY|O_CREAT|O_APPEND|O_SYNC|O_LARGEFILE, 0664);
+  int new_logfd = open(logfile, O_WRONLY|O_CREAT|O_APPEND|O_LARGEFILE, 0664);
   if (new_logfd < 0) {
     // If we can't open the new logfile, send data to /dev/null
     if (report_error) {
bas-t commented 10 years ago

Please elaborate, what are the exact symptons before and after this patch. How long have you been testing this? Also, in mythtv 0.26, 10 files contain O_SYNC, in mythtv 0.27 it is 13 files

bas-t commented 10 years ago

Oh, one more thing, the logrotate stuff is not in mythtv anymore. So why not remove it alltogether from FFdecsawrapper? I'll be testing this tomorrow.