2009-03-05 13:03:59     BF561-EZKIT Video Capture no /dev/video0

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-03-05 13:03:59     BF561-EZKIT Video Capture no /dev/video0

Marco Rohleder (GERMANY)

Message: 70460   

 

Hi All !

 

I try to grab a picture from ADV7183B video decoder on bf561-ezkit.

 

I am using uClinux-dist-2008R1.5-RC3.

 

Because the BF561 has no TWI interface, i am usinf Software I2C.

 

When i start blackfin_cam it says:

 

root:/> modprobe blackfin_cam

Linux video capture interface: v2.00

driver for ADV7183B get_camops

Initializing camera

ADV7183B: i2c driver ready

 

lsmod tells me:

 

Module                  Size  Used by

blackfin_cam           13768  0

adv7183b                1664  1 blackfin_cam

i2c_core               15952  2 blackfin_cam,adv7183b

videodev               20928  1 blackfin_cam

v4l1_compat            10820  1 videodev

v4l2_common            12256  1 videodev

 

 

 

but after all i have no /dev/video0

 

Whats wrong ?

 

 

 

Kind regards

 

Marco

 

 

QuoteReplyEditDelete

 

 

2009-03-05 13:13:23     BF561-EZKIT Video Capture no /dev/video0

Michael Hennerich (GERMANY)

Message: 70461    Marco,

 

Check you i2c bitbang configuration - it looks like the ADV7183 wasn't properly detected.

-Michael

 

QuoteReplyEditDelete

 

 

2009-03-05 13:46:20     Re: BF561-EZKIT Video Capture no /dev/video0

Marco Rohleder (GERMANY)

Message: 70463   

 

Michael,

 

i selected

 

Device Drivers

<M> I2C Support

   <M> I2C device interface ( i think not absolutely necessary )

   <M> GPIO-based bitbanging I2C

 

 

 

In the board definition file located at /linux-2.6.x/arch/blackfin/mach-bf561/boards/ezkit.c

 

was the struct i2c_gpio_platform_data already defined with sda_pin = 1 and scl_pin = 0

 

which seems to be correct.

 

 

 

I put a few debug printfs to the blackfin_cam - code.

 

All routines where the driver is registered to the "i2c-frameworks" come back with no errors.

 

The driver runs until the end of the init function and says "device registered"

 

I searched along the forum and found some problems with the i2c-twi driver when not loaded as module but compiled statically to the kernel.

 

There was the same problem. No errors while loading, but no /dev/video0.

 

What i am saking me ? Who creates the /dev/video0 ???

 

Or is there maby anything (stupid) missing ?

 

 

 

Any idea ?

 

 

 

 

QuoteReplyEditDelete

 

 

2009-03-05 14:06:03     Re: BF561-EZKIT Video Capture no /dev/video0

Michael Hennerich (GERMANY)

Message: 70464    /dev/video is created in case everything succeeds.

 

> ADV7183B: i2c driver ready

Is misleading it doesn't mean anything.

 

I would place some printk in to the sensor init functions just to make sure they get called.

 

I would double check your ezkit hardware switch and jumper settings.

 

-Michael

 

QuoteReplyEditDelete

 

 

2009-03-05 21:40:44     Re: BF561-EZKIT Video Capture no /dev/video0

bin zhang (CHINA)

Message: 70482   

 

http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:v4l_blackfin_camera

 

I think you should read the docs first.

 

You should choose

 

Blackfin Processor Options --->

             [*] Enable DMA Support

                    Uncached SDRAM region (Enable 2M DMA region)  --->

 

Board customizations --->

             (0x100000) Kernel load address for booting           

 

I2C support  ---->I2C Hardware Bus support----->GPIO......

 

I use ADV7181B to do the capture task. I also met many problems. We could discuss it here.

 

                                                                                                        Zhang Bin

TranslateQuoteReplyEditDelete

 

 

2009-03-06 04:20:37     Re: BF561-EZKIT Video Capture no /dev/video0

Michael Hennerich (GERMANY)

Message: 70525   

 

Marco,  check your EZKIT switch settings related to i2c. See below - this is how it should look like... In your output the ADV1783 is not detected on the i2c bus.  -Michael  root:/> modprobe i2c-gpio

i2c-gpio i2c-gpio.0: using pins 1 (SDA) and 0 (SCL)

 

root:/> modprobe blackfin_cam

driver for ADV7183B get_camops

driver for ADV7183B get_camops

ADV7183B: detecting client on address 0x40

driver for ADV7183B init

ADV7183B: V4L driver Blackfin CMOS Camera now ready

ADV7183B: i2c driver ready

 

root:/> lsmod

Module                  Size  Used by

blackfin_cam            9148  0

adv7183b                1568  1 blackfin_cam

i2c_gpio                2120  0

i2c_algo_bit            4664  1 i2c_gpio

root:/>

 

root:/> cat /proc/cpuinfo

processor       : 0

vendor_id       : Analog Devices

cpu family      : 0x27bb

model name      : ADSP-BF561 600(MHz CCLK) 100(MHz SCLK) (mpu off)

stepping        : 5

cpu MHz         : 600.000/100.000

bogomips        : 1196.03

Calibration     : 598016000 loops

cache size      : 16 KB(L1 icache) 32 KB(L1 dcache-wb) 0 KB(L2 cache)

dbank-A/B       : cache/cache

icache setup    : 4 Sub-banks/4 Ways, 32 Lines/Way

dcache setup    : 2 Super-banks/4 Sub-banks/2 Ways, 64 Lines/Way

L2 SRAM         : 128KB

board name      : ADI BF561-EZKIT

board memory    : 65536 kB (0x00000000 -> 0x04000000)

kernel memory   : 56316 kB (0x00100000 -> 0x037ff000)

 

root:/>

 

 

root:/> ffmpeg -f video4linux -r 10.0 -s 720x288 -i /dev/video0 -qscale 6 -f mjpeg foo

FFmpeg version SVN-r7786, Copyright (c) 2000-2007 Fabrice Bellard, et al.

  configuration: --prefix=/usr --source-path=/home/michael/devel/svn/uclinux-dist-trunk/lib/ffmpeg/build/../ffmpeg-svn-11114 --target-os=Linux --cpu=bfin --arch=bfin --extra-

  libavutil version: 49.5.0

  libavcodec version: 51.48.0

  libavformat version: 52.1.0

  built on Mar  6 2009 09:54:38, gcc: 4.1.2 (ADI svn)

Input #0, video4linux, from '/dev/video0':

  Duration: N/A, start: 1167609755.608000, bitrate: 33177 kb/s

    Stream #0.0: Video: rawvideo, uyvy422, 720x288 [PAR 0:1 DAR 0:1], 33177 kb/s, 10.00 tb(r)

Output #0, mjpeg, to 'foo':

    Stream #0.0: Video: mjpeg, yuvj420p, 720x288 [PAR 0:1 DAR 0:1], q=2-31, 200 kb/s, 10.00 tb(c)

Stream mapping:

  Stream #0.0 -> #0.0

Press [q] to stop encoding

frame=  131 fps= 10 q=6.0 size=     484kB time=13.1 bitrate= 302.9kbits/s

 

QuoteReplyEditDelete

 

 

2009-03-06 12:13:06     Re: BF561-EZKIT Video Capture no /dev/video0

Marco Rohleder (GERMANY)

Message: 70535   

 

Hi Michael & Zhang Bin

 

first ... it is now working.

 

You were right Michael, the chip wasnt found on the i2c bus.

The above printout was very useful. Thanks a lot again.

 

The problem was caused by the configuration for the spi driver.

PF1 was already occupied for SPISEL reasons there.

 

Now its working fine. The only thing i found:

 

When the EZkit is operating with only 32M DRAM ( as our target does ) and you put the framerate for mjpeg for example above 5.0, the system crashes afer a few seconds.

 

With 64M everything is working fine :=)

 

 

 

One other question to you:

 

For our product i need at least 8 serial channels for connecting ATMs and so on.

 

I solved this by running application in core b, which does multiple software uarts.

Since the whole core b is only "uarting", its possible to run for example 16 ports with 19200 baud at the same time.

 

Or 6 ports with 115200 Baud, or even  any mixture.

 

On core a ( the linux side ) i wrote a common char driver which communicates over a few memory locations or a Timer-Register ( because it is not cached ) with core b.

 

I think, this code could be very useful for others. The problem is, it is not 100% linux-style because my knowledge of the linux internals is rare at some points. And so i made a few workarounds to make it handable to me.

 

Do you think its useful to make it public and maybe find combatans do find a 100% clean linux solution ?

 

KInd regards, Marco

 

 

QuoteReplyEditDelete

 

 

2009-03-06 12:40:27     Re: BF561-EZKIT Video Capture no /dev/video0

Michael Hennerich (GERMANY)

Message: 70536    Marco,

 

This is good news.

 

Regarding the soft_uart we have a diver that emulates a single UART using a SPORT.

This works pretty well and could be expanded to two UARTS per SPORT.

But Yes - you won't be able to get 8 channels.

 

I know people have been also using external quad UARTS such as the SC16C554 hanging on the Async. Memory Interface.

 

I think your driver could be very useful for others.

Can you please post it on our patch tracker?

 

Viele Gruesse,

-Michael

Attachments

    Outcomes