Page 1 of 1
Improve analogue aquisition with saa7134
Posted: Wed Apr 15, 2009 10:47 am
by foreverg
I have setted up a system with a pair of 8-chip saa7134 card.
To use all of 16 channels I had to recompile the kernel of my ubuntu 8.10 server (32bit) and installed Zoneminder trought debs available apt-get.
In /etc/modprobe.d/saa7134 I put:
Code: Select all
options saa7134 card=37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37
blacklist saa7134_alsa
In /etc/sysctl.conf instead to allocate 4GB of shared memory. In the system are installed 4GB of RAM, recognised as 3.5gb by the OS.
Code: Select all
kernel.shmall=2048000
kernel.shmmax = 4194304000
I need 12 of the 16 channels to acquire at least at 640x480 @10 Fps.. but I got images like this..
How can I solve it?
Posted: Wed Apr 15, 2009 9:09 pm
by cordel
First make sure that your distro actually reads the values in /etc/sysctl.conf for shared memory as bytes and not something else like pages for example. You can easily verify this with ipcs -l and see whats actually configured.
It's also a bad idea to try to set all your memory to be used as shared memory, you leave no room for processes to use other memory space. You should not ever set more than half unless you know what the requirements are of all other processes in the system as a rule of thumb.
I have seen a few reasons that can cause the image to look like this.
Improper driver settings.
Improper settings in ZM
Bad Memory.
These can be complicated by the fact that the drivers in the kernel are moving to Video4Linux Version2 and a Video4Linux compatibility layer has been added and ZM has to use that compatibility layer. Mostly just for your information to be aware of.
Start by making appropriate settings for your shared memory. Then let us know how you have ZM configured and a snip from dmesg on how the system initializes the card would be good.
Posted: Thu Apr 16, 2009 7:47 am
by foreverg
I replaced one saa7134 card with a 1chip/4 channel Bt878 that is working fine.. the same problem still with saa7134.
I'm using official 2.6.27.11 kernel.
Here is dmesg:
Code: Select all
[ 6.441312] Linux video capture interface: v2.00
[ 6.452571] bttv: driver version 0.9.17 loaded
[ 6.452574] bttv: using 8 buffers with 2080k (520 pages) each for capture
[ 6.484046] parport_pc 00:07: reported by Plug and Play ACPI
[ 6.484050] iTCO_wdt: Found a ICH7 or ICH7R TCO device (Version=2, TCOBASE=0x0860)
[ 6.484127] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
[ 6.484154] parport0: PC-style at 0x378 (0x778), irq 7, dma 3 [PCSPP,TRISTATE,COMPAT,EPP,ECP,DMA]
[ 6.489234] intel_rng: FWH not detected
[ 6.521958] bttv: Bt8xx card found (0).
[ 6.521971] bttv 0000:03:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[ 6.521979] bttv0: Bt878 (rev 17) at 0000:03:00.0, irq: 19, latency: 64, mmio: 0xfdffe000
[ 6.521988] bttv0: using: GrandTec Multi Capture Card (Bt878) [card=77,insmod option]
[ 6.522013] bttv0: gpio: en=00000000, out=00000000 in=00f36fff [init]
[ 6.522050] bttv0: tuner absent
[ 6.522087] bttv0: registered device video0
[ 6.522110] bttv0: registered device vbi0
[ 6.522129] bttv0: PLL: 28636363 => 35468950 .<3>cdc_acm: This device cannot do calls on its own. It is no modem.
[ 6.533142] cdc_acm 3-1:1.0: ttyACM0: USB ACM device
[ 6.541271] .<6>usbcore: registered new interface driver cdc_acm
[ 6.551394] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
[ 6.561489] ok
[ 6.581694] saa7130/34: v4l2 driver version 0.2.14 loaded
[ 6.581737] saa7134 0000:04:09.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 6.581743] saa7130[0]: found at 0000:04:09.0, rev: 1, irq: 17, latency: 64, mmio: 0xfebffc00
[ 6.581749] saa7130[0]: subsystem: 1131:0000, board: AVerMedia DVD EZMaker [card=33,insmod option]
[ 6.581760] saa7130[0]: board init: gpio is 10000
[ 6.690241] saa7130[0]: Huh, no eeprom present (err=-5)?
[ 6.690337] saa7130[0]: registered device video1 [v4l2]
[ 6.690361] saa7130[0]: registered device vbi1
[ 6.690388] saa7134 0000:04:0a.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[ 6.690394] saa7130[1]: found at 0000:04:0a.0, rev: 1, irq: 18, latency: 64, mmio: 0xfebff800
[ 6.690401] saa7130[1]: subsystem: 1131:0000, board: AVerMedia DVD EZMaker [card=33,insmod option]
[ 6.690419] saa7130[1]: board init: gpio is 10000
[ 6.800055] saa7130[1]: Huh, no eeprom present (err=-5)?
[ 6.800139] saa7130[1]: registered device video2 [v4l2]
[ 6.800163] saa7130[1]: registered device vbi2
[ 6.800191] saa7134 0000:04:0b.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[ 6.800197] saa7130[2]: found at 0000:04:0b.0, rev: 1, irq: 19, latency: 64, mmio: 0xfebff400
[ 6.800203] saa7130[2]: subsystem: 1131:0000, board: AVerMedia DVD EZMaker [card=33,insmod option]
[ 6.800220] saa7130[2]: board init: gpio is 10000
[ 6.833012] saa7130[1]/irq[10,-29317]: r=0x20 s=0x00 PE
[ 6.833015] saa7130[1]/irq: looping -- clearing PE (parity error!) enable bit
[ 6.910108] saa7130[2]: Huh, no eeprom present (err=-5)?
[ 6.910206] saa7130[2]: registered device video3 [v4l2]
[ 6.910232] saa7130[2]: registered device vbi3
[ 6.910257] saa7134 0000:04:0e.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[ 6.910263] saa7130[3]: found at 0000:04:0e.0, rev: 1, irq: 18, latency: 64, mmio: 0xfebff000
[ 6.910270] saa7130[3]: subsystem: 1131:0000, board: AVerMedia DVD EZMaker [card=33,insmod option]
[ 6.910282] saa7130[3]: board init: gpio is 10000
[ 6.986411] saa7130[2]/irq[10,-29302]: r=0x20 s=0x00 PE
[ 6.986415] saa7130[2]/irq: looping -- clearing PE (parity error!) enable bit
[ 7.020065] saa7130[3]: Huh, no eeprom present (err=-5)?
[ 7.020167] saa7130[3]: registered device video4 [v4l2]
[ 7.020191] saa7130[3]: registered device vbi4
[ 7.020216] saa7134 0000:04:0f.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[ 7.020222] saa7130[4]: found at 0000:04:0f.0, rev: 1, irq: 19, latency: 64, mmio: 0xfebfec00
[ 7.020228] saa7130[4]: subsystem: 1131:0000, board: AVerMedia DVD EZMaker [card=33,insmod option]
[ 7.020244] saa7130[4]: board init: gpio is 10000
[ 7.083013] saa7130[3]/irq[10,-29292]: r=0x20 s=0x00 PE
[ 7.083018] saa7130[3]/irq: looping -- clearing PE (parity error!) enable bit
[ 7.130056] saa7130[4]: Huh, no eeprom present (err=-5)?
[ 7.130132] saa7130[4]: registered device video5 [v4l2]
[ 7.130160] saa7130[4]: registered device vbi5
[ 7.133029] saa7130[4]/irq[10,-29287]: r=0x20 s=0x00 PE
[ 7.133032] saa7130[4]/irq: looping -- clearing PE (parity error!) enable bit
[ 7.158206] saa7134 ALSA driver for DMA sound loaded
[ 7.158229] saa7130[0]/alsa: saa7130[0] at 0xfebffc00 irq 17 registered as card -2
[ 7.158524] saa7130[1]/alsa: saa7130[1] at 0xfebff800 irq 18 registered as card -1
[ 7.158770] saa7130[2]/alsa: saa7130[2] at 0xfebff400 irq 19 registered as card -1
[ 7.159015] saa7130[3]/alsa: saa7130[3] at 0xfebff000 irq 18 registered as card -1
[ 7.159259] saa7130[4]/alsa: saa7130[4] at 0xfebfec00 irq 19 registered as card -1
[ 8.171277] loop: module loaded
[ 8.184265] lp0: using parport0 (interrupt-driven).
[ 8.219253] w83627ehf: Found W83627DHG chip at 0x290
[ 8.239390] coretemp coretemp.0: Using relative temperature scale!
[ 8.239421] coretemp coretemp.1: Using relative temperature scale!
[ 8.481412] Adding 10610892k swap on /dev/sda5. Priority:-1 extents:1 across:10610892k
[ 9.131853] EXT3 FS on sda1, internal journal
[ 10.417717] type=1505 audit(1239867747.333:2): operation="profile_load" name="/usr/lib/cups/backend/cups-pdf" name2="default" pid=4150
[ 10.417863] type=1505 audit(1239867747.333:3): operation="profile_load" name="/usr/sbin/cupsd" name2="default" pid=4150
[ 10.443157] type=1505 audit(1239867747.363:4): operation="profile_load" name="/usr/sbin/mysqld" name2="default" pid=4154
[ 10.628917] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 10.652996] r8169: eth0: link up
[ 10.652999] r8169: eth0: link up
[ 11.151295] NET: Registered protocol family 10
[ 11.151663] lo: Disabled Privacy Extensions
[ 12.502662] warning: `avahi-daemon' uses 32-bit capabilities (legacy support in use)
[ 14.482652] ppdev: user-space parallel port driver
[ 20.443195] saa7130[0]/irq[10,-27956]: r=0x20 s=0x10 PE
[ 20.443203] saa7130[0]/irq: looping -- clearing PE (parity error!) enable bit
[ 21.950015] eth0: no IPv6 routers present
[ 24.616018] [drm] Initialized drm 1.1.0 20060810
[ 24.618689] pci 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 24.618695] pci 0000:00:02.0: setting latency timer to 64
[ 24.618816] [drm] Initialized i915 1.6.0 20060119 on minor 0
[ 24.758572] mtrr: type mismatch for e0000000,10000000 old: write-back new: write-combining
[ 25.100420] set status page addr 0x00033000
[ 42.297452] mtrr: no MTRR for e0000000,10000000 found
[ 44.054083] mtrr: type mismatch for e0000000,10000000 old: write-back new: write-combining
[ 44.407870] set status page addr 0x00033000
And this is what i get form ipcs -l:
Code: Select all
------ Limiti della memoria condivisa --------
numero massimo di segmenti = 4096
dimensione max seg (kbyte) = 131072
max total shared memory (kbytes) = 536870912
dimensione min seg (byte) = 1
------ Limiti di semaforo --------
numero max di matrici = 128
numero max di semafori per matrice = 250
numero max di semafori su tutto il sistema = 32000
numero max opz. per chiamata semop = 32
valore max del semaforo = 32767
------ Messaggi: limiti --------
numero max di code su tutto il sistema = 1698
dimensione max del messaggio (byte) = 8192
dimensione massima predefinita della coda (byte) = 16384
Posted: Sat Jun 13, 2009 9:14 pm
by chrilleman
Hello,
really late answer but i maybe have a solution.
I am not using card=37, instead I am using card=97, that is woking for me on the saa7130.
saa7130[0]: found at 0000:06:0c.0, rev: 1, irq: 16, latency: 66, mmio: 0xfca00000
saa7130[0]: subsystem: 1131:0000, board: LifeView FlyDVB-S /Acorp TV134DS [card=97,insmod option]
saa7130[0]: board init: gpio is ff000
saa7130[0]: Oops: IR config error [card=97]
saa7130[0]: Huh, no eeprom present (err=-5)?
saa7130[0]: registered device video0 [v4l2]
saa7130[0]: registered device vbi0
ACPI: PCI Interrupt 0000:06:0d.0[A] -> GSI 21 (level, low) -> IRQ 20
saa7130[1]: found at 0000:06:0d.0, rev: 1, irq: 20, latency: 66, mmio: 0xfca00400
saa7130[1]: subsystem: 1131:0000, board: LifeView FlyDVB-S /Acorp TV134DS [card=97,insmod option]
saa7130[1]: board init: gpio is 10000
saa7130[1]: Oops: IR config error [card=97]
saa7130[1]: Huh, no eeprom present (err=-5)?
saa7130[1]: registered device video1 [v4l2]
saa7130[1]: registered device vbi1
ACPI: PCI Interrupt 0000:06:0e.0[A] -> GSI 22 (level, low) -> IRQ 21
saa7130[2]: found at 0000:06:0e.0, rev: 1, irq: 21, latency: 66, mmio: 0xfca00800
saa7130[2]: subsystem: 1131:0000, board: LifeView FlyDVB-S /Acorp TV134DS [card=97,insmod option]
saa7130[2]: board init: gpio is 10000
saa7130[2]: Oops: IR config error [card=97]
saa7130[2]: Huh, no eeprom present (err=-5)?
saa7130[2]: registered device video2 [v4l2]
saa7130[2]: registered device vbi2
ACPI: PCI Interrupt 0000:06:0f.0[A] -> GSI 16 (level, low) -> IRQ 17
saa7130[3]: found at 0000:06:0f.0, rev: 1, irq: 17, latency: 66, mmio: 0xfca00c00
saa7130[3]: subsystem: 1131:0000, board: LifeView FlyDVB-S /Acorp TV134DS [card=97,insmod option]
saa7130[3]: board init: gpio is 10000
saa7130[3]: Oops: IR config error [card=97]
saa7130[3]: Huh, no eeprom present (err=-5)?
saa7130[3]: registered device video3 [v4l2]
saa7130[3]: registered device vbi3
Hope it helps
Re: Improve analogue aquisition with saa7134
Posted: Sat Sep 19, 2009 10:05 am
by controloye
Hi foreverg,
I tried your method but failed. I can see 8 videos only while I have 2 cards with 8 ports each. after adding
Code: Select all
options saa7134 card=37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37
blacklist saa7134_alsa
now I'm getting following error in my dmesg.
Code: Select all
[ 5240.571330] card: can only take 8 arguments
[ 5240.571338] saa7134: `37' invalid for parameter `card'
I can see 8 channels perfectly. while i need 16.
I am trying on ubuntu 8.10 server. I am new to kernel thing and have zeo knowledge about kernel compilation. I have download saa7134 drivers from
http://linux.bytesex.org/v4l2/saa7134.html and have unzipped them. I can see saa7134.h file there. I can change settings if someone guides me. and finally what are the step to recompile the kernel.
I'll be thankful for help
foreverg wrote:I have setted up a system with a pair of 8-chip saa7134 card.
To use all of 16 channels I had to recompile the kernel of my ubuntu 8.10 server (32bit) and installed Zoneminder trought debs available apt-get.
In /etc/modprobe.d/saa7134 I put:
Code: Select all
options saa7134 card=37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37
blacklist saa7134_alsa
In /etc/sysctl.conf instead to allocate 4GB of shared memory. In the system are installed 4GB of RAM, recognised as 3.5gb by the OS.
Code: Select all
kernel.shmall=2048000
kernel.shmmax = 4194304000
I need 12 of the 16 channels to acquire at least at 640x480 @10 Fps.. but I got images like this..
How can I solve it?