> Hans Verkuil wrote:
>> On Wednesday 08 August 2007 13:57:01 Mark Bryars wrote:
>>
>>> I think the modules may have previously been compiled with high_res
>>> timers enabled, but the rest  of the kernel not, as i hadnt copied
>>> the updated .config across to the v4l build tree.
>>>
>>> I'm seeing a lot of:
>>>
>>> Bytesused = 32832 > 0x8000!!
>>> Bytesused = 32832 > 0x8000!!
>>> Bytesused = 32896 > 0x8000!!
>>>
>>
>> Change 0x8000 to 0x8100 in ivtv_buf_swap. My mistake.
>>
> I think there is a memory leak somewhere thats causing me problems.  I
> was running a test recording system load every 15 min.
>
>  11:35:18 up 3 days, 18:38, load average: 0.40, 0.39, 0.36
>  11:50:18 up 3 days, 18:53, load average: 0.08, 0.27, 0.35
> ivtv5 warning: encoder MPEG: Couldn't find start of buffer within the
> first 256 bytes
> Bytesused = -64 > 0x8100!!
> ivtv5: All encoder MPEG stream buffers are full. Dropping data.
> ivtv5: Cause: the application is not reading fast
> enough.                    [times a million]
> ivtv5 warning: copy 4096 bytes to user failed for encoder MPEG     [also
> loads of times]
>
> Then the oom killer killed the process that was reading the data, and
> things settled down. When i restarted it there was only 15 meg of free
> ram (when there is normally 200 meg on a fresh boot) even tho there were
> barely no other processes running, and none using more than 10 megs of
> ram. Initial tests show the missing ram may have been attributed to the
> process that was reading the ivtv devices (is that how it works ?)

Looks like an application problem to me: the "copy 4096 bytes to user"
error can only happen if you give an invalid buffer (random address or too
small a buffer) to the driver (and the driver also returns an EFAULT error
which you clearly do not catch :-) ).

Since the driver cannot copy the data to the application it will keep the
buffer and so the internal buffers will fill up until you get the Dropping
data message.

The application is the one that keeps allocating memory: the driver
doesn't allocate memory on the fly, only during initialization. Old
drivers could actually allocate dynamically, but that tended to be very
fragile and was removed in the 0.10.0 version.

Regards,

       Hans


_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to