The ivtv module is unable to dynamically allocate enough bufferspace.
By default, the kernel only reserves 5-6% of memory (minimum) for
in-kernel allocation and on small-mem systems, this may only be a few
Mb. After a system has been up for a while, 'free' memory can drop
down to the minimum level. This doesn't affect user applications -
only code in kernel-space. Use vmstat to check 'free' memory.

The dynbuf code in ivtv may instantaneously ask the kernel for 4Mb+ of
kernel memory for MPEG/YUV/VBI buffers. Unless this is already free,
the allocation fails and you get the error you see.

3 workarounds:

1) Increase the RAM in your box
[this makes the problem less likely to occur]

2) add ivtv_dynbuf=0 as an ivtv module option
[this forces ivtv module to allocate all memory it needs at initialisation]

3) add "vm.min_free_kbytes=16384" to /etc/sysctl.conf or if you don't
have sysctl.conf, add "echo -n 16384 > /proc/sys/vm/min_free_kbytes"
in /etc/rc.local.
[this ensures that 16Mb of free kernel memory is available at any time]

I used to use (3) but now I use (2) for safety.

Cheers,
Wilf.

On 10/08/05, Dimitri Puzin <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I have a weird problem with my myth box. It's a P-III 700 Celeron with
> 384 MB of RAM, all Intel Hardware i815 chipset and an PVR 350 running
> Debian Sarge and 2.6.12.4 Kernel, acting as a front- and backend. Upon
> system startup everything works correctly and without problems, however
> after a few days of uptime the box would OOPS and hang. Follwing dump
> from that:
> 
> Aug 10 16:46:39 sulaco kernel: saa7115: decoder set picture bright=127
> contrast=63 saturation=63 hue=0
> Aug 10 16:46:39 sulaco last message repeated 3 times
> Aug 10 16:46:39 sulaco kernel: saa7115: decoder set size
> Aug 10 16:46:39 sulaco kernel: ivtv: Allocate DMA encoder MPEG stream:
> 128 x 32768 buffers (4096KB total)
> Aug 10 16:46:39 sulaco kernel: ivtv: Allocate DMA encoder VBI stream:
> 164 x 12740 buffers (2048KB total)
> Aug 10 16:46:39 sulaco kernel: ivtv: Setup VBI API header 0x0000bd06
> pkts 1 buffs 48 ln 34 sz 64
> Aug 10 16:46:39 sulaco kernel: ivtv: Setup VBI start 0x0018ea04 frames
> 48 fpi 1 lines 0x000000f1
> Aug 10 16:46:40 sulaco kernel: saa7115: decoder disable output
> Aug 10 16:46:40 sulaco kernel: saa7115: decoder enable output
> Aug 10 16:46:40 sulaco kernel: ivtv: VBI insertion started
> Aug 10 16:46:41 sulaco kernel: ivtv: Allocate DMA decoder MPEG stream:
> 16 x 65536 buffers (1024KB total)
> Aug 10 16:46:41 sulaco kernel: mythfrontend: page allocation failure.
> order:4, mode:0xd0
> Aug 10 16:46:41 sulaco kernel:  [__alloc_pages+624/960]
> __alloc_pages+0x270/0x3c0
> Aug 10 16:46:41 sulaco kernel:  [kmem_getpages+44/160]
> kmem_getpages+0x2c/0xa0
> Aug 10 16:46:41 sulaco kernel:  [cache_grow+165/352] cache_grow+0xa5/0x160
> Aug 10 16:46:41 sulaco kernel:  [cache_alloc_refill+359/528]
> cache_alloc_refill+0x167/0x210
> Aug 10 16:46:41 sulaco kernel:  [__kmalloc+90/112] __kmalloc+0x5a/0x70
> Aug 10 16:46:41 sulaco kernel:  [pg0+408861597/1070466048]
> ivtv_init_buffer+0x2d/0x150 [ivtv]
> Aug 10 16:46:41 sulaco kernel:  [pg0+408861941/1070466048]
> ivtv_init_queue_nolock+0x35/0x80 [ivtv]
> Aug 10 16:46:41 sulaco kernel:  [pg0+408862085/1070466048]
> ivtv_init_queues_nolock+0x45/0x80 [ivtv]
> Aug 10 16:46:41 sulaco kernel:  [pg0+408868066/1070466048]
> ivtv_stream_alloc+0x102/0x200 [ivtv]
> Aug 10 16:46:41 sulaco kernel:  [pg0+408878257/1070466048]
> ivtv_claim_stream+0x51/0x1d0 [ivtv]
> Aug 10 16:46:41 sulaco kernel:  [pg0+408885468/1070466048]
> ivtv_v4l2_write+0x9c/0x160 [ivtv]
> Aug 10 16:46:41 sulaco kernel:  [vfs_write+151/256] vfs_write+0x97/0x100
> Aug 10 16:46:41 sulaco kernel:  [sys_write+71/128] sys_write+0x47/0x80
> Aug 10 16:46:41 sulaco kernel:  [syscall_call+7/11] syscall_call+0x7/0xb
> Aug 10 16:46:41 sulaco kernel: ivtv: No memory on buffer alloc!
> Aug 10 16:46:41 sulaco kernel: ivtv: Buffer alloc failed!
> Aug 10 16:46:41 sulaco kernel: ivtv: Couldn't allocate buffers for
> decoder MPEG stream
> Aug 10 16:47:22 sulaco kernel: Unable to load interpreter /lib/ld-linux.so.2
> 
> 
> I read there, the box uses up all the RAM...All I can do is a hard
> reset. After that, it works correctly for a few days again. That OOPS
> occurs typically when switching to live TV. I've experienced that for
> quite a while however I didn't success to reproduce it at will. I am not
> sure whether mythtv (with 0.18 and CVS happens the same) or the driver
> itself causes that OOPS. Following info from the ivtv drivers (I've
> stripped the timestamp, for readability). If you need more information,
> just ask.
> 
> ivtv: ==================== START INIT IVTV ====================
> ivtv: version 0.3.7 (b) loading
> ivtv: Linux version: 2.6.12.4 preempt PENTIUMIII REGPARM gcc-3.3
> ivtv: In case of problems please include the debug info
> ivtv: between the START INIT IVTV and END INIT IVTV lines when
> ivtv: mailing the ivtv-devel mailinglist.
> ivtv: Autodetected WinTV PVR 350 card
> ivtv: Found an iTVC15 based chip
> ACPI: PCI Interrupt 0000:01:09.0[A] -> GSI 18 (level, low) -> IRQ 169
> tveeprom: Hauppauge: model = 48139, rev = K257, serial# = 2868161
> tveeprom: tuner = Philips FM1216 ME MK3 (idx = 57, type = 38)
> tveeprom: tuner fmt = PAL(B/G) PAL(I) SECAM(L/L) PAL(D/K) (eeprom =
> 0x74, v4l2 = 0x00400e17)
> tveeprom: audio_processor = CS5331 (type = 9)
> ivtv: i2c attach [client=tveeprom[50],ok]
> ivtv: Tuner Type 38, Tuner formats 0x00400e17, Radio: yes, Model
> 0x00ad2557, Revision 0x00000001
> ivtv: PAL tuner detected
> ivtv: Radio detected
> tuner: Ignoring new-style parameters in presence of obsolete ones
> tuner: chip found at addr 0xc2 i2c-bus ivtv i2c driver #0
> ivtv: i2c attach [client=(tuner unset),ok]
> saa7115: starting probe for adapter ivtv i2c driver #0 (0x10005)
> saa7115: detecting saa7115 client on address 0x42
> saa7115: writing init values
> ivtv: i2c attach [client=saa7115[50],ok]
> saa7115: status: (1E) 0x00, (1F) 0x40
> saa7127: Ignoring new-style parameters in presence of obsolete ones
> saa7127: video encoder driver version V 0.3 loaded
> saa7127: starting probe on adapter ivtv i2c driver #0 (0x10005)
> saa7127: detecting saa7127 client on address 0x88
> saa7127: Selecting NTSC video Standard
> saa7127: Selecting S-Video+Composite
> saa7127: Turn WSS off
> saa7127: Widescreen Mode 4:3 Full Format
> saa7127: Selecting Normal Encoder Input
> saa7127: Enable Video Output
> ivtv: i2c attach [client=saa7127[50],ok]
> msp34xx: ivtv version
> msp34xx: init: chip=MSP3418W-B3, has NICAM support, simple (D) mode,
> simpler (G) no-thread mode
> msp34xx: $Id$ compiled on: Aug  8 2005 19:17:57
> ivtv: i2c attach [client=MSP3418W-B3,ok]
> tda9885/6/7: chip found @ 0x86
> ivtv: i2c attach [client=tda9887,ok]
> ivtv: Encoder revision: 0x02040011
> ivtv: Decoder revision: 0x02020023
> ivtv: Configuring WinTV PVR 350 card with 10 streams
> ivtv: Registered v4l2 device for encoder MPEG minor 0
> ivtv: Create DMA encoder MPEG stream: 0 x 32768 buffers (0KB total)
> ivtv: Registered v4l2 device for encoder YUV minor 32
> ivtv: Create DMA encoder YUV stream: 0 x 12960 buffers (0KB total)
> ivtv: Registered v4l2 device for encoder VBI minor 224
> ivtv: Create DMA encoder VBI stream: 0 x 12740 buffers (0KB total)
> ivtv: Registered v4l2 device for encoder PCM audio minor 24
> ivtv: Create DMA encoder PCM audio stream: 0 x 4608 buffers (0KB total)
> ivtv: Registered v4l2 device for encoder radio minor 64
> ivtv: Create encoder radio streamivtv: Registered v4l2 device for
> decoder MPEG minor 16
> ivtv: Create DMA decoder MPEG stream: 0 x 65536 buffers (0KB total)
> ivtv: Registered v4l2 device for decoder VBI minor 228
> ivtv: Create DMA decoder VBI stream: 0 x 2048 buffers (0KB total)
> ivtv: Registered v4l2 device for decoder VOUT minor 232
> ivtv: Create decoder VOUT stream
> ivtv: Registered v4l2 device for decoder YUV minor 48
> ivtv: Create DMA decoder YUV stream: 0 x 51840 buffers (0KB total)
> ivtv: Create DMA decoder OSD stream: 0 x 65536 buffers (0KB total)
> ivtv: Setting Tuner 38
> tuner: type set to 38 (Philips PAL/SECAM multi (FM1216ME MK3)) by ivtv
> i2c driver #0
> saa7115: decoder set norm PAL
> ivtv: ivtv_enc_thread: pid = 730, itv = 0xd8937ba0
> ivtv: ivtv_enc_vbi_thread: pid = 731, itv = 0xd8937ba0
> ivtv: ivtv_dec_thread: pid = 732, itv = 0xd8937ba0
> ivtv: ivtv_dec_vbi_thread: pid = 733, itv = 0xd8937ba0
> saa7115: set audio: 0x01
> saa7115: decoder set input (4)
> saa7115: now setting Composite input
> ivtv: Setting audio matrix to input 3, output 1
> ivtv: Switching standard to PAL.
> saa7115: decoder set norm PAL
> saa7115: set audio: 0x01
> saa7127: Setting Encoder Video Standard
> saa7127: Set PAL Video Mode
> saa7127: Selecting PAL video Standard
> ivtv: Initialized WinTV PVR 350, card #0
> ivtv: ====================  END INIT IVTV  ====================
> ivtv-osd: Framebuffer module loaded (attached to ivtv card id 0)
> ivtv-osd: Framebuffer is at decoder-relative address 0x00510000 and has
> 1704960 bytes.
> ivtv-osd: screen coords: [0 0] -> [720 576]
> ivtv-osd: original global alpha = 208
> ivtv-osd: current OSD state = 39
> ivtv-osd: new global alpha = 208 (1 255 0)
> ivtv-osd: framebuffer at 0xf9510000, mapped to 0xd9810000, size 1620k
> ivtv-osd: mode is 720x576x32, linelength=2880
> ivtv-osd: fb0: iTVC15 TV out frame buffer device
> ivtv: Allocate DMA decoder OSD stream: 16 x 65536 buffers (1024KB total)
> 
> Thanks a lot
> -Dimitri Puzin aka Tristan-77x
> 
> 
> 
> -------------------------------------------------------
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ivtv-devel
> 


-- 
[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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ivtv-devel

Reply via email to