Can someone shed some light on the memory allocation system of ivtv?

I've got 3 capture cards, 512MB RAM, driver 0.3.7b on kernel 2.6.12.
I've been using the "stable recommended" firmware for the last couple
of months and it has been working like a charm. Recording 3 shows and
watching a 4th works great.

Last weekend I wanted to give the latest firmware another try; from
what I've read, the latest firmware causes the ivtv-driver to switch
to frame-based DMA in stead of block-based and to switch to dynamic
buffer allocation.

Unfortunatly I ran into "memory problems":
Aug  1 17:19:55 [kernel] oom-killer: gfp_mask=0x1d2
Aug  1 17:19:56 [kernel] DMA per-cpu:
Aug  1 17:19:56 [kernel] cpu 0 hot: low 2, high 6, batch 1
Aug  1 17:19:56 [kernel] cpu 0 cold: low 0, high 2, batch 1
Aug  1 17:19:56 [kernel] Normal per-cpu:
Aug  1 17:19:56 [kernel] cpu 0 hot: low 62, high 186, batch 31
Aug  1 17:19:56 [kernel] cpu 0 cold: low 0, high 62, batch 31
Aug  1 17:19:56 [kernel] HighMem per-cpu: empty
Aug  1 17:19:56 [kernel] Free pages:       67424kB (0kB HighMem)
Aug  1 17:19:56 [kernel] Active:51080 inactive:50510 dirty:19
writeback:0 unstable:0 free:16856 slab:6985 mapped:1003
36 pagetables:1096
Aug  1 17:19:56 [kernel] DMA free:4028kB min:2048kB low:2560kB
high:3072kB active:4768kB inactive:4136kB present:1638
4kB pages_scanned:10822 all_unreclaimable? yes
Aug  1 17:19:56 [kernel] lowmem_reserve[]: 0 495 495
Aug  1 17:19:56 [kernel] Normal free:63396kB min:63484kB low:79352kB
high:95224kB active:199552kB inactive:197904kB p
resent:507840kB pages_scanned:477336 all_unreclaimable? yes
Aug  1 17:19:56 [kernel] lowmem_reserve[]: 0 0 0
Aug  1 17:19:56 [kernel] HighMem free:0kB min:128kB low:160kB
high:192kB active:0kB inactive:0kB present:0kB pages_sc
anned:0 all_unreclaimable? no
Aug  1 17:19:56 [kernel] lowmem_reserve[]: 0 0 0
Aug  1 17:19:56 [kernel] DMA: 1*4kB 1*8kB 1*16kB 1*32kB 0*64kB 1*128kB
1*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 4
028kB
Aug  1 17:19:56 [kernel] Normal: 477*4kB 134*8kB 12*16kB 0*32kB 1*64kB
0*128kB 1*256kB 1*512kB 0*1024kB 1*2048kB 14*4
096kB = 63396kB
Aug  1 17:19:56 [kernel] HighMem: empty
Aug  1 17:19:56 [kernel] Swap cache: add 132927, delete 132888, find
1427/2189, race 0+0
Aug  1 17:19:56 [kernel] Free swap  = 0kB
Aug  1 17:19:56 [kernel] Total swap = 506036kB
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 3944 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11284 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11289 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11290 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11291 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11292 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11293 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11372 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11373 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11374 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11375 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 11376 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 24091 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 24092 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 24093 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 24098 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 3953 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 3954 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 4584 (mysqld).
Aug  1 17:19:56 [kernel] Out of Memory: Killed process 4585 (mysqld).
Aug  1 17:20:03 [kernel] ivtv: ENC Stream 0 OVERFLOW #0: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:03 [kernel] ivtv: ENC Stream 0 OVERFLOW #1: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:03 [kernel] ivtv: ENC Stream 0 OVERFLOW #2: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:03 [kernel] ivtv: ENC Stream 0 OVERFLOW #3: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:03 [kernel] ivtv: ENC Stream 0 OVERFLOW #4: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:03 [kernel] ivtv: ENC Stream 0 OVERFLOW #5: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:03 [kernel] ivtv: ENC Stream 0 OVERFLOW #6: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:03 [kernel] ivtv: ENC Stream 0 OVERFLOW #7: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:03 [kernel] ivtv: ENC Stream 0 OVERFLOW #8: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:04 [kernel] ivtv: ENC Stream 0 OVERFLOW #9: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:04 [kernel] ivtv: ENC Stream 0 OVERFLOW #10: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:04 [kernel] ivtv: ENC Stream 0 OVERFLOW #11: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:04 [kernel] ivtv: ENC Stream 0 OVERFLOW #12: Stealing a
Buffer, 512 currently allocated
Aug  1 17:20:04 [kernel] ivtv: ENC Stream 0 OVERFLOW #13: Stealing a
Buffer, 512 currently allocated
...

I've switched back to the old firmware after that and for the rest of
the week I had no problems.
What's the recommended configuration, e.g. what is the recommended
setting vm.min_free_kbytes / card (or doesn't that matter)? Should I
add more memory (go to 1GB)?

N.

On 8/4/05, Graeme Wilford <[EMAIL PROTECTED]> wrote:
> This seems to have worked! I've not done extensive testing but using
> mpg_buffers=8 while throwing in dec_yuv_buffers=4 and
> max_dec_yuv_buffers=4 for good luck allowed me to play a DVD via
> Xv/YUV while simultaneously capturing an uncorrupted MPEG stream.
> 
> I'll need to play around to see if this is consistent and to optimise
> the buffer sizes...
> 
> Later, ivtv was unable to dynamically allocate YUV buffers due to a
> lack of free memory. I already had vm.min_free_kbytes=16384 but this
> would have needed an increase using the settings above. Instead, I've
> turned off dynamic buffer allocation and removed the min_free setting
> for now.
> 
> Thanks, John.
> 
> Cheets,
> Wilf.
> 
> On 02/08/05, John Harvey <[EMAIL PROTECTED]> wrote:
> > I'm not using the 350 for capturing but did notice a while ago that the
> > playback suffered when capturing when the capturing ran out of buffers.
> > Have you  tried setting mpg_buffers=8 and/or turning off dynamic buffer
> > allocation.
> >
> > John
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] [mailto:ivtv-devel-
> > > [EMAIL PROTECTED] On Behalf Of Graeme Wilford
> > > Sent: 02 August 2005 22:46
> > > To: ivtv-devel@lists.sourceforge.net
> > > Subject: Re: [ivtv-devel] [PATCH] yuv improvements
> > >
> > > John, Ian - I've done some testing with this new patch.
> > >
> > > With mplayer, I get real bad frame drop and/or audio sync issues with
> > > both avi's and DVDs - worse than before the patch *but* with xine,
> > > playback is almost perfect in both cases. This is a little strange as
> > > both xine and mplayer yielded similar results before the patch.
> > >
> > > Anyhow, on a 2.53GHz Celeron with 2.6.12-1.1372_FC3 kernel, X driver
> > > 0.10.5, ivtv-0.3.7a (dynamic buffers) + this patch, latest firmware
> > > and xine-0.99.3, I get perfect imaging with no tearing. Just the odd
> > > discarded frame. Nice job!
> > >
> > > However, using YUV output on the 350 definitely causes simultaneous
> > > mpeg recordings to corrupt and this is still evident with this patch.
> > > The mpeg stream has lots of frames missing. I get no errors reported
> > > by the ivtv driver so the loss of frames seems to occur at the
> > > firmware level on the card, before the ivtv driver gets near it...
> > >
> > > If you can't reproduce the problem, please let me know the driver
> > > options and firmware you're using.
> > >
> > > Cheers,
> > > Wilf.
> > >
> > > On 02/08/05, John Harvey <[EMAIL PROTECTED]> wrote:
> > > > This patch includes the previous patch I sent from Ian for filtering. It
> > > > adds some improvements from Ian to fix some color alignment issues.
> > > > Also thanks to Ian we have worked out how to do multi-buffering without
> > > > crashing the firmware so this patch should fix all the tearing issues as
> > > > well.
> > > >
> > > > Any problems let me know.
> > > >
> > > > John
> > >
> > > --
> > > [EMAIL PROTECTED]
> > >
> --
> [EMAIL PROTECTED]
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> ivtv-devel mailing list
> ivtv-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ivtv-devel
>


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
ivtv-devel mailing list
ivtv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ivtv-devel

Reply via email to