Akom's Tech Ruminations

Various tech outbursts - code and solutions to practical problems

Figuring out the card number of a cheap SAA7130 capture card Linux

Posted by Admin • Sunday, June 19. 2011 • Category: Linux

So you bought yourself a cheap Philips SAA7130 (or SAA713X or SAA7134) capture card to record motion, you plugged it in and you are getting a black or grey screen. Looking in dmesg you see the famous saa7134[0]: Huh, no eeprom present (err=-5)? And
saa7134: Congratulations! Your TV card vendor saved a few saa7134: cents for a eeprom, thus your pci board has no saa7134: subsystem ID and I can't identify it automatically saa7134: I feel better now. Ok, here are the good news: saa7134: You can use the card= insmod option to specify saa7134: which board do you have. The list:
What do you do? How do you try 175 card numbers and figure out which one works? Write a script!

This script will try all the different card numbers, giving you the opportunity to check the results. I use motion, so every time I have it reload the module, start motion, and give me a chance to hit the webcam port with a browser to see if it's working.
card=1 while [ $card -lt 175 ] ; do /etc/init.d/motion stop lsmod | cut -d ' ' -f 1 | grep saa713 | xargs rmmod modprobe saa7134 card=$card,$card,$card,$card #Mine is a 7134 with 4 chips - change this line to suit yours /etc/init.d/motion restart echo "Give it a shot for card $card" read junk /etc/init.d/motion stop card=$(($card+1)) done
Hopefully it's one of them. Naturally you need to have a camera plugged into the card. If you have a multi-chip card like mine, plug a camera into the first and the last port - you never know if the numbering is backwards - and hit the port you think is "first". Once you see a legible image, CTRL-C out of the script and proceed below:

Once you found the one that works, make sure it's loaded that way every time. Create /etc/modprobe.d/saa7134.conf (or similar): options saa7134 card=26,26,26,26 (This is for a 4 encoder card. For an 8, repeat the card number 8 times, etc). Mine was card number 26, so that's what I have.

0 Trackbacks

  1. No Trackbacks

0 Comments

Display comments as (Linear | Threaded)
  1. No comments

Add Comment


You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

What is the primary language of this blog? (Anti-SPAM question)


Submitted comments will be subject to moderation before being displayed.