Public bug reported:

Binary package hint: dvd+rw-tools

When burning DVDs, growisofs is not honoring the --use-the-force-luke=bufsize:X 
option, allocating an internal ring buffer ridiculously small, so that DVD 
burning is affected by frequent buffer underruns (the speed drops from 8x to as 
low as 2x).
The ring buffer is not of constant size: it varies for each burn, even though 
k3b informs -use-the-force-luke=bufsize:128M

I checked the code myself and found out that from version 7 growisofs
tries limit the buffer size to a maximum of 1/4 of the RAM. In the
source _SC_AVPHYS_PAGES returns the number of available, really free
memory pages, not the total number of memory pages. Linux tends to use
all available memory with buffers and cache, and keep just a bare
minimum of free pages during normal use.

So, the code cuts the size of the buffer in half again and again until
it is less or equal to 1/4 size of free memory (usually a few MB, 32 or
64 MB at most).

Andy Polyakov (author of growisofs) did not answer my e-mail last year
so I patched growisofs myself. Later Fedora applied the same patch I did
before.

I simply replaced _SC_AVPHYS_PAGES with _SC_PHYS_PAGES (total number of
pages of physical memory in system). I have been using this modified
growisofs for a year and no problem arised at all. It might have been a
typo only...

--- growisofs.c.bak     2007-01-21 12:56:05.000000000 +0100
+++ growisofs.c 2007-01-21 13:00:02.000000000 +0100
@@ -3096,12 +3096,12 @@

 #if defined(__unix) || defined(__unix__)

-#if defined(_SC_PAGESIZE) && defined(_SC_AVPHYS_PAGES)
-    { size_t phys_mem = (size_t)sysconf(_SC_AVPHYS_PAGES) *
+#if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
+    { size_t phys_mem = (size_t)sysconf(_SC_PHYS_PAGES) *
                        (size_t)sysconf(_SC_PAGESIZE);

        if (phys_mem)
-       {   phys_mem /= 2;  /* normally AVPHYS is a bit smaller, so
+       {   phys_mem /= 2;  /* normally PHYS is a bit smaller, so
                             *  we commonly land on 1/4 RAM */
            while (the_buffer_size > phys_mem) the_buffer_size /= 2;
        }

** Affects: dvd+rw-tools (Ubuntu)
     Importance: Undecided
         Status: New

-- 
growisofs buffer size does not respect bufsize option
https://bugs.launchpad.net/bugs/162736
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to