Description of problem: 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). I verified via /proc/<growisofs_pid>/smaps that the allocation that seems to be the ring buffer is not of constant size. It varies for each burn, from 1MB to 4MB, even though k3b informs --use-the-force-luke=bufsize:128M (I have 1GB of RAM in this machine, so 128M is nothing). This problem started after the recent update from dvd+rw-tools-6.1-4.1 to dvd+rw-tools-7.0-0.fc6.2. Downgrading to dvd+rw-tools-6.1-4.1 (from FC6 installation media) fixes the problem. Version-Release number of selected component (if applicable): dvd+rw-tools-7.0-0.fc6.2 How reproducible: Always Steps to Reproduce: 1. growisofs -Z /dev/hdb=file.iso -dvd-compat -speed=8 -use-the-force-luke=bufsize:128m 2. check memory mappings at /proc/`pidof growisofs`/smaps (here, the ring buffer is the forth last mapping) Actual results: The ring buffer is 1 to 4 MBs in size. High risk of buffer underruns. Expected results: The ring buffer should have the size given by the front-end via the --use-the-force-luke=bufsize:X option.
I went to investigate the bug by looking into the source. It seems to be a bug introduced on dvd+rw-tools version 7.0. The changelog for growisofs.c states: * 7.0: * - limit ring buffer size to 1/4 of RAM; But it doesn't match for me, since I have 1GB of RAM and sometimes growisofs allocates only 1MB of buffer size. So I went down to where this is limited and found this (growisofs.c:3100): size_t phys_mem = (size_t)sysconf(_SC_AVPHYS_PAGES) * (size_t)sysconf(_SC_PAGESIZE); if (phys_mem) { phys_mem /= 2; /* normally AVPHYS is a bit smaller, so * we commonly land on 1/4 RAM */ while (the_buffer_size > phys_mem) the_buffer_size /= 2; } This is pretty clear the problem. _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, this code cuts the size of the buffer in half again and again until it is less or equal to half the size of free memory. Right now free informs me that I have 7MB of really free memory, but 594MB of "available" memory (discounting space used by buffers and cache), out of a total of 940MB (1GB physical). So, if I started burning a DVD right now, it would give me 2MB of buffer, that is the biggest power of 2 smaller than 3.5MB, that is half of 7MB.
Created attachment 141860 [details] Patch to fix this problem This fixes the problem for me. I'll ask dvd+rw-tools' maintainer (Andy Polyakov) to take a look here.
Andy Polyakov doesn't answer my e-mails. Could this bug be fixed by Fedora? The patch is in the attachment 141860 [details].
dvd+rw-tools-7.0-0.fc6.3 should appear soon in the testing repo
Please also try http://people.redhat.com/harald/downloads/dvd+rw-tools/dvd+rw-tools-7.0-0.el5.3/
Harald: tested dvd+rw-tools-7.0-0.fc6.4 from updates-testing and it worked! Thanks! I don't have RHEL5, so I can't test the last one.