您尚未登录。

楼主 #1 2020-05-04 03:29:16

aodzip
会员
注册时间: 2019-10-15
已发帖子: 130
积分: 100

摄像头驱动 主线DVP与MIPI-CSI2

白嫖: https://github.com/aodzip/sun6i-mipi-csi

MIPI-CSI2 驱动已经测试OV5640摄像头2Lane模式 1080P@15FPS 720P@30FPS
DVP没测试,因为主线本身就支持DVP,希望没给它改坏吧





以下由 @哇酷小二 2020-05-04 添加:
-------------------------------------

不方便打开github的朋友可以此处下载: sun6i-mipi-csi_20200504.7z

离线

#2 2020-05-04 07:04:23

smartcar
会员
注册时间: 2018-02-19
已发帖子: 735
积分: 735

Re: 摄像头驱动 主线DVP与MIPI-CSI2

大佬真乃世外高人也!

离线

#3 2020-05-04 08:23:58

哇酷小二
wechat微信:whycan_cn
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,378
积分: 1902
个人网站

Re: 摄像头驱动 主线DVP与MIPI-CSI2

也就是说我的V3s MIPI摄像头有救了,楼主真是神人!





离线

#4 2020-05-04 08:55:39

拉轰的脚踏车
会员
注册时间: 2020-03-20
已发帖子: 288
积分: 222

Re: 摄像头驱动 主线DVP与MIPI-CSI2

MIPI摄像头可以用的话, DVP坏了就坏了,  感谢楼主分享啊!

离线

#5 2020-05-04 08:59:14

达克罗德
会员
注册时间: 2018-04-10
已发帖子: 1,134
积分: 1086.5

Re: 摄像头驱动 主线DVP与MIPI-CSI2

楼主发的东西都超有价值!

离线

#6 2020-05-04 09:24:04

湘楚浪子
会员
注册时间: 2019-12-22
已发帖子: 40
积分: 39.5

Re: 摄像头驱动 主线DVP与MIPI-CSI2

牛叉牛叉,看起来楼主好像是从全志 linux 4.9抠出来的代码,值得学习!

离线

#7 2020-05-04 11:26:16

yytyu
会员
注册时间: 2018-11-01
已发帖子: 34
积分: 18

Re: 摄像头驱动 主线DVP与MIPI-CSI2

大佬厉害

离线

#8 2020-05-04 12:31:34

god
会员
注册时间: 2019-10-04
已发帖子: 10
积分: 10

Re: 摄像头驱动 主线DVP与MIPI-CSI2

湘楚浪子 说:

牛叉牛叉,看起来楼主好像是从全志 linux 4.9抠出来的代码,值得学习!

难度很大,老外搞了1-2年了,都没搞定!国人厉害!

离线

#9 2020-05-04 12:58:01

有梦的地方
会员
注册时间: 2020-03-17
已发帖子: 284
积分: 284

Re: 摄像头驱动 主线DVP与MIPI-CSI2

god 说:

难度很大,老外搞了1-2年了,都没搞定!国人厉害!

DVP看git log记录也是南京一个同行搞定的,太佩服牛人了。

离线

#10 2020-05-04 14:48:34

微凉VeiLiang
会员
所在地: 深圳
注册时间: 2018-10-28
已发帖子: 595
积分: 525
个人网站

Re: 摄像头驱动 主线DVP与MIPI-CSI2

厉害了,mipi我一直是裸机下跑

离线

#11 2020-05-04 21:32:01

zhenfanhei
会员
注册时间: 2018-01-18
已发帖子: 296
积分: 251
个人网站

Re: 摄像头驱动 主线DVP与MIPI-CSI2

楼主老厉害了,mipi都搞定了,还乐于分享,就更厉害了,等有空了翻出板子来试一把





离线

#12 2020-05-05 15:15:33

AaronHo
会员
注册时间: 2020-03-08
已发帖子: 13
积分: 13

Re: 摄像头驱动 主线DVP与MIPI-CSI2

支持一下大佬!!!
主线内核顶起!!!

离线

#13 2020-05-08 00:18:36

yangshuwei
会员
注册时间: 2020-03-22
已发帖子: 138
积分: 70

Re: 摄像头驱动 主线DVP与MIPI-CSI2

支持大佬

离线

#14 2020-05-25 15:53:23

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

白嫖: https://github.com/aodzip/sun6i-mipi-csi

MIPI-CSI2 驱动已经测试OV5640摄像头2Lane模式 1080P@15FPS 720P@30FPS
DVP没测试,因为主线本身就支持DVP,希望没给它改坏吧





以下由 @哇酷小二 2020-05-04 添加:
-------------------------------------

不方便打开github的朋友可以此处下载: sun6i-mipi-csi_20200504.7z


大佬,我移植后,运行fswebcam出现以下情况,请是什么问题?我用的摄像头是ov5647

# fswebcam -S 5 -d /dev/video0 -p YUV420P -r 320x240 test.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Error starting stream.
VIDIOC_STREAMON: Invalid argument
Unable to use mmap. Using read instead.
Unable to use read.

离线

楼主 #15 2020-05-25 16:02:53

aodzip
会员
注册时间: 2019-10-15
已发帖子: 130
积分: 100

Re: 摄像头驱动 主线DVP与MIPI-CSI2

wupaul2001 说:

大佬,我移植后,运行fswebcam出现以下情况,请是什么问题?我用的摄像头是ov5647

# fswebcam -S 5 -d /dev/video0 -p YUV420P -r 320x240 test.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Error starting stream.
VIDIOC_STREAMON: Invalid argument
Unable to use mmap. Using read instead.
Unable to use read.

请提供更详细的信息:Linux版本,media-ctl所使用的参数,dmesg日志
而且github上的版本比坑网缓存的驱动改动已经很大了,你是从github同步的代码吗?

最近编辑记录 aodzip (2020-05-25 16:04:20)

离线

#16 2020-05-25 16:11:16

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

请提供更详细的信息:Linux版本,media-ctl所使用的参数,dmesg日志
而且github上的版本比坑网缓存的驱动改动已经很大了,你是从github同步的代码吗?


我是从github下的,我文件系统没安装media-ctl,系统是linux 5.2

离线

#17 2020-05-25 16:12:18

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.2.0-licheepi-zero+ (paulwu@paulwu-virtual-machine) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #57 SMP Mon May 25 13:44:58 CST 2020
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Lichee Pi Zero with Dock
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 15784
[    0.000000]   Normal zone: 124 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 15784 pages, LIFO batch:3
[    0.000000] percpu: Embedded 16 pages/cpu s34508 r8192 d22836 u65536
[    0.000000] pcpu-alloc: s34508 r8192 d22836 u65536 alloc=16*4096
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 15660
[    0.000000] Kernel command line: console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw  vt.global_cursor_default=0
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 50572K/63136K available (7168K kernel code, 303K rwdata, 1968K rodata, 1024K init, 268K bss, 12564K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x2fc/0x488 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000019] Switching to timer-based delay loop, resolution 41ns
[    0.000213] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000465] Console: colour dummy device 80x30
[    0.000764] printk: console [tty0] enabled
[    0.000822] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000853] pid_max: default: 32768 minimum: 301
[    0.001024] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001056] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001897] CPU: Testing write buffer coherency: ok
[    0.002472] /cpus/cpu@0 missing clock-frequency property
[    0.002517] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.003353] Setting up static identity map for 0x40100000 - 0x40100060
[    0.003613] rcu: Hierarchical SRCU implementation.
[    0.004189] smp: Bringing up secondary CPUs ...
[    0.004229] smp: Brought up 1 node, 1 CPU
[    0.004246] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.004261] CPU: All CPU(s) started in SVC mode.
[    0.005357] devtmpfs: initialized
[    0.009161] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.009525] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.009575] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.009844] pinctrl core: initialized pinctrl subsystem
[    0.011013] NET: Registered protocol family 16
[    0.011614] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.012924] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.012973] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.039450] SCSI subsystem initialized
[    0.039780] usbcore: registered new interface driver usbfs
[    0.039867] usbcore: registered new interface driver hub
[    0.039992] usbcore: registered new device driver usb
[    0.040421] mc: Linux media interface: v0.10
[    0.040485] videodev: Linux video capture interface: v2.00
[    0.040836] Advanced Linux Sound Architecture Driver Initialized.
[    0.042375] clocksource: Switched to clocksource arch_sys_counter
[    0.054758] NET: Registered protocol family 2
[    0.055616] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.055685] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.055725] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.055756] TCP: Hash tables configured (established 1024 bind 1024)
[    0.055921] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.055988] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.056335] NET: Registered protocol family 1
[    0.057302] RPC: Registered named UNIX socket transport module.
[    0.057349] RPC: Registered udp transport module.
[    0.057362] RPC: Registered tcp transport module.
[    0.057375] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.059997] Initialise system trusted keyrings
[    0.060422] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.068745] NFS: Registering the id_resolver key type
[    0.068833] Key type id_resolver registered
[    0.068850] Key type id_legacy registered
[    0.068877] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.104345] Key type asymmetric registered
[    0.104391] Asymmetric key parser 'x509' registered
[    0.104502] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.104528] io scheduler mq-deadline registered
[    0.104543] io scheduler kyber registered
[    0.109950] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.110479] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    0.111378] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[    0.179835] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.183305] printk: console [ttyS0] disabled
[    0.203639] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 36, base_baud = 1500000) is a U6_16550A
[    0.765386] printk: console [ttyS0] enabled
[    0.793147] 1c28800.serial: ttyS1 at MMIO 0x1c28800 (irq = 37, base_baud = 1500000) is a U6_16550A
[    0.804317] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    0.840350] panel-simple panel: panel supply power not found, using dummy regulator
[    0.849922] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.862282] libphy: Fixed MDIO Bus: probed
[    0.867252] PPP generic driver version 2.4.2
[    0.871890] PPP BSD Compression module registered
[    0.876684] PPP Deflate Compression module registered
[    0.881759] PPP MPPE Compression module registered
[    0.886578] NET: Registered protocol family 24
[    0.891182] usbcore: registered new interface driver asix
[    0.896698] usbcore: registered new interface driver ax88179_178a
[    0.902872] usbcore: registered new interface driver cdc_ether
[    0.908745] usbcore: registered new interface driver net1080
[    0.914468] usbcore: registered new interface driver cdc_subset
[    0.920419] usbcore: registered new interface driver zaurus
[    0.926062] usbcore: registered new interface driver simcom_wwan
[    0.932138] usbcore: registered new interface driver sierra_net
[    0.938149] usbcore: registered new interface driver cdc_ncm
[    0.943835] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.950356] ehci-platform: EHCI generic platform driver
[    0.955939] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.961567] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.969580] ehci-platform 1c1a000.usb: irq 27, io mem 0x01c1a000
[    1.002386] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    1.009638] hub 1-0:1.0: USB hub found
[    1.013641] hub 1-0:1.0: 1 port detected
[    1.018292] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.024648] ohci-platform: OHCI generic platform driver
[    1.030229] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    1.036986] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    1.044966] ohci-platform 1c1a400.usb: irq 28, io mem 0x01c1a400
[    1.117475] hub 2-0:1.0: USB hub found
[    1.121334] hub 2-0:1.0: 1 port detected
[    1.128933] usbcore: registered new interface driver usb-storage
[    1.135283] usbcore: registered new interface driver usbserial_generic
[    1.141861] usbserial: USB Serial support registered for generic
[    1.147991] usbcore: registered new interface driver option
[    1.153644] usbserial: USB Serial support registered for GSM modem (1-port)
[    1.160782] usbcore: registered new interface driver qcserial
[    1.166640] usbserial: USB Serial support registered for Qualcomm USB modem
[    1.174253] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.185799] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.191586] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.200953] hub 3-0:1.0: USB hub found
[    1.204984] hub 3-0:1.0: 1 port detected
[    1.211145] sun6i-rtc 1c20400.rtc: registered as rtc0
[    1.216351] sun6i-rtc 1c20400.rtc: RTC enabled
[    1.221027] i2c /dev entries driver
[    1.225840] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    1.241427] bm_cw2015_init
[    1.245032] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.253845] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.290370] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.297736] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    1.332474] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[    1.340682] usbcore: registered new interface driver usbhid
[    1.346384] usbhid: USB HID core driver
[    1.354882] sun4i-codec 1c22c00.codec: ASoC: codec-analog@01c23000 not registered
[    1.362526] sun4i-codec 1c22c00.codec: Failed to register our card
[    1.370075] Initializing XFRM netlink socket
[    1.374534] NET: Registered protocol family 17
[    1.379625] Key type dns_resolver registered
[    1.384205] Registering SWP/SWPB emulation handler
[    1.390189] Loading compiled-in X.509 certificates
[    1.400452] simple-framebuffer 43da8000.framebuffer: framebuffer at 0x43da8000, 0x258000 bytes, mapped to 0x(ptrval)
[    1.411165] simple-framebuffer 43da8000.framebuffer: format=x8r8g8b8, mode=1024x600x32, linelength=4096
[    1.431195] Console: switching to colour frame buffer device 128x37
[    1.447318] simple-framebuffer 43da8000.framebuffer: fb0: simplefb registered!
[    1.457761] sun4i-drm display-engine: bound 1100000.mixer (ops 0xc084b380)
[    1.465551] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc084867c)
[    1.473486] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.480256] [drm] No driver support for vblank timestamp query.
[    1.486337] checking generic (43da8000 258000) vs hw (0 ffffffff)
[    1.486344] fb0: switching to sun4i-drm-fb from simple
[    1.491753] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.505301] Console: switching to colour dummy device 80x30
[    1.511235] mmc0: new high speed SDHC card at address 0001
[    1.518786] mmcblk0: mmc0:0001 N1BN1 7.52 GiB 
[    1.525001]  mmcblk0: p1 p2
[    1.530517] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    1.584642] Console: switching to colour frame buffer device 128x37
[    1.608202] sun4i-drm display-engine: fb0: sun4i-drmdrmfb frame buffer device
[    1.616836] debugfs: Directory '1c22c00.codec' with parent 'V3s Audio Codec' already present!
[    1.625671] sun4i-codec 1c22c00.codec: ASoC: Failed to create component debugfs directory: -17
[    1.636094] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[    1.644762] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T01:14:47 UTC (4487)
[    1.653452] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.665301] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.676133] vcc3v0: disabling
[    1.683126] vcc5v0: disabling
[    1.689943] ALSA device list:
[    1.696706]   #0: V3s Audio Codec
[    1.704505] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.717099] cfg80211: failed to load regulatory.db
[    1.758347] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.770763] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.785121] devtmpfs: mounted
[    1.793540] Freeing unused kernel memory: 1024K
[    1.802285] Run /sbin/init as init process
[    1.951507] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    2.188946] random: dd: uninitialized urandom read (512 bytes read)
[    3.769924] random: crng init done

离线

楼主 #18 2020-05-25 16:12:37

aodzip
会员
注册时间: 2019-10-15
已发帖子: 130
积分: 100

Re: 摄像头驱动 主线DVP与MIPI-CSI2

wupaul2001 说:

我是从github下的,我文件系统没安装media-ctl,系统是linux 5.2

请先严格按照github上所指示的环境和初始化方法配置。

离线

#19 2020-05-25 16:15:35

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

请先严格按照github上所指示的环境和初始化方法配置。


buildroot 2019把media-ctl去掉了,我该怎么弄,我是v3s

离线

楼主 #20 2020-05-25 16:17:47

aodzip
会员
注册时间: 2019-10-15
已发帖子: 130
积分: 100

Re: 摄像头驱动 主线DVP与MIPI-CSI2

wupaul2001 说:

buildroot 2019把media-ctl去掉了,我该怎么弄,我是v3s

这个驱动在编写的时候,是基于
Buildroot环境buildroot 2020.02.1
Linux Kernel版本5.4.35

你先准备一个相同的环境,内核我认为都是5.4版本的就可以接受

最近编辑记录 aodzip (2020-05-25 16:18:31)

离线

#21 2020-05-25 18:05:28

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

这个驱动在编写的时候,是基于
Buildroot环境buildroot 2020.02.1
Linux Kernel版本5.4.35

你先准备一个相同的环境,内核我认为都是5.4版本的就可以接受


环境弄好了,运行media-ctl报
# media-ctl --set-v4l2 '5:0[fmt:UYVY8_2X8/1920x1080@1/15]'
Unable to setup formats: Inappropriate ioctl for device (25)

离线

楼主 #22 2020-05-25 20:16:18

aodzip
会员
注册时间: 2019-10-15
已发帖子: 130
积分: 100

Re: 摄像头驱动 主线DVP与MIPI-CSI2

wupaul2001 说:

环境弄好了,运行media-ctl报
# media-ctl --set-v4l2 '5:0[fmt:UYVY8_2X8/1920x1080@1/15]'
Unable to setup formats: Inappropriate ioctl for device (25)

可能是因为摄像头不支持FPS设置,尝试这个指令

media-ctl --set-v4l2 '5:0[fmt:UYVY8_2X8/1920x1080]'

离线

#23 2020-05-25 22:56:39

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

可能是因为摄像头不支持FPS设置,尝试这个指令

media-ctl --set-v4l2 '5:0[fmt:UYVY8_2X8/1920x1080]'

好的, 我明天试试,谢谢指点

离线

#24 2020-05-26 10:57:38

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

我试了那命令,还是不行,估计是不支持了。我用media-ctl -p打印如下

Device topology
- entity 1: sun6i-csi (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
    pad0: Sink
        <- "ov5647 1-0036":0 [ENABLED,IMMUTABLE]

- entity 5: ov5647 1-0036 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev0
    pad0: Source
        -> "sun6i-csi":0 [ENABLED,IMMUTABLE]

离线

#25 2020-05-26 11:21:34

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

可能是因为摄像头不支持FPS设置,尝试这个指令

media-ctl --set-v4l2 '5:0[fmt:UYVY8_2X8/1920x1080]'

大佬,能帮忙看看吗?

离线

#26 2020-05-26 11:41:28

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

你方便远程么?

media-ctl --set-v4l2 '5:0[fmt:UYVY8_2X8/1920x1080]'

可以的,能加一吓吗?

离线

楼主 #27 2020-05-26 11:43:12

aodzip
会员
注册时间: 2019-10-15
已发帖子: 130
积分: 100

Re: 摄像头驱动 主线DVP与MIPI-CSI2

wupaul2001 说:

大佬,能帮忙看看吗?

看了下OV5647在主线的驱动,输出的格式好像只支持MEDIA_BUS_FMT_SBGGR8_1X8
而我5640的DEMO是MEDIA_BUS_FMT_UYVY8_2X8
你可能要自己改很多东西

最近编辑记录 aodzip (2020-05-26 11:43:25)

离线

楼主 #28 2020-05-26 11:43:50

aodzip
会员
注册时间: 2019-10-15
已发帖子: 130
积分: 100

Re: 摄像头驱动 主线DVP与MIPI-CSI2

wupaul2001 说:

可以的,能加一吓吗?

我加你

最近编辑记录 aodzip (2020-05-26 11:43:57)

离线

#29 2020-05-26 11:44:31

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

看了下OV5647在主线的驱动,输出的格式好像只支持MEDIA_BUS_FMT_SBGGR8_1X8
而我5640的DEMO是MEDIA_BUS_FMT_UYVY8_2X8
你可能要自己改很多东西


好的,那我换个摄像头吧,谢谢大佬指点了

离线

#30 2020-05-26 11:46:30

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

我加你

大佬我QQ是110460775

离线

#31 2020-06-26 01:31:28

david
会员
注册时间: 2018-03-05
已发帖子: 357
积分: 297.5

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

白嫖: https://github.com/aodzip/sun6i-mipi-csi

MIPI-CSI2 驱动已经测试OV5640摄像头2Lane模式 1080P@15FPS 720P@30FPS
DVP没测试,因为主线本身就支持DVP,希望没给它改坏吧

楼主牛,好像硬件编码也搞定了?

离线

#32 2020-07-27 14:45:18

kesion
会员
注册时间: 2020-07-03
已发帖子: 45
积分: 32

Re: 摄像头驱动 主线DVP与MIPI-CSI2

好贴,留名,以后再研究,还卡在内核编译,

离线

#33 2020-08-24 13:22:34

hunter
会员
注册时间: 2020-08-21
已发帖子: 2
积分: 2

Re: 摄像头驱动 主线DVP与MIPI-CSI2

aodzip 说:

这个驱动在编写的时候,是基于
Buildroot环境buildroot 2020.02.1
Linux Kernel版本5.4.35

你先准备一个相同的环境,内核我认为都是5.4版本的就可以接受

大佬,可以上传一份编译好的buildroot源码吗,我的buildroot也是2020.02.1的,但是不支持media-ctl,一勾选上就编译报错

离线

#34 2020-12-22 19:50:26

angelsan
会员
注册时间: 2020-04-02
已发帖子: 139
积分: 131.5

Re: 摄像头驱动 主线DVP与MIPI-CSI2

drivers/staging/media/sunxi/sun6i-csi/sun6i_video.o: In function `sun6i_video_frame_done':
sun6i_video.c:(.text+0xb44): multiple definition of `sun6i_video_frame_done'
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.o:sun6i_video.c:(.text+0xb44): first defined here
drivers/staging/media/sunxi/sun6i-csi/sun6i_video.o: In function `sun6i_video_init':
sun6i_video.c:(.text+0xc10): multiple definition of `sun6i_video_init'
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.o:sun6i_video.c:(.text+0xc10): first defined here
drivers/staging/media/sunxi/sun6i-csi/sun6i_video.o: In function `sun6i_video_cleanup':
sun6i_video.c:(.text+0xe20): multiple definition of `sun6i_video_cleanup'
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.o:sun6i_video.c:(.text+0xe20): first defined here
drivers/staging/media/sunxi/sun6i-csi/sun6i_csi.o: In function `sun6i_csi_is_format_supported':
sun6i_csi.c:(.text+0x5fc): multiple definition of `sun6i_csi_is_format_supported'
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.o:sun6i_csi.c:(.text+0x5cc): first defined here
drivers/staging/media/sunxi/sun6i-csi/sun6i_csi.o: In function `sun6i_csi_set_power':
sun6i_csi.c:(.text+0xa54): multiple definition of `sun6i_csi_set_power'
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.o:sun6i_csi.c:(.text+0x9f0): first defined here
drivers/staging/media/sunxi/sun6i-csi/sun6i_csi.o: In function `sun6i_csi_update_config':
sun6i_csi.c:(.text+0xc54): multiple definition of `sun6i_csi_update_config'
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.o:sun6i_csi.c:(.text+0xbf0): first defined here
drivers/staging/media/sunxi/sun6i-csi/sun6i_csi.o: In function `sun6i_csi_update_buf_addr':
sun6i_csi.c:(.text+0x1954): multiple definition of `sun6i_csi_update_buf_addr'
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.o:sun6i_csi.c:(.text+0x18c4): first defined here
drivers/staging/media/sunxi/sun6i-csi/sun6i_csi.o: In function `sun6i_csi_set_stream':
sun6i_csi.c:(.text+0x19bc): multiple definition of `sun6i_csi_set_stream'
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.o:sun6i_csi.c:(.text+0x192c): first defined here
Makefile:1061: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

只有我自己遇到吗?

离线

#35 2020-12-23 10:08:30

shawn.d
会员
注册时间: 2020-09-12
已发帖子: 164
积分: 100

Re: 摄像头驱动 主线DVP与MIPI-CSI2

v3s也能用,不错不错

离线

#36 2020-12-24 22:19:54

pichen
会员
注册时间: 2020-12-24
已发帖子: 2
积分: 2

Re: 摄像头驱动 主线DVP与MIPI-CSI2

必须支持大佬,群里就指点过我。。。牛逼

离线

#37 2021-01-09 10:33:55

angelsan
会员
注册时间: 2020-04-02
已发帖子: 139
积分: 131.5

Re: 摄像头驱动 主线DVP与MIPI-CSI2

一样问题,来加Q交流一下 19730384

wupaul2001 说:
aodzip 说:

白嫖: https://github.com/aodzip/sun6i-mipi-csi

MIPI-CSI2 驱动已经测试OV5640摄像头2Lane模式 1080P@15FPS 720P@30FPS
DVP没测试,因为主线本身就支持DVP,希望没给它改坏吧





以下由 @哇酷小二 2020-05-04 添加:
-------------------------------------

不方便打开github的朋友可以此处下载: sun6i-mipi-csi_20200504.7z


大佬,我移植后,运行fswebcam出现以下情况,请是什么问题?我用的摄像头是ov5647

# fswebcam -S 5 -d /dev/video0 -p YUV420P -r 320x240 test.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Error starting stream.
VIDIOC_STREAMON: Invalid argument
Unable to use mmap. Using read instead.
Unable to use read.

离线

#38 2021-05-18 09:24:52

1157727586
会员
注册时间: 2020-12-01
已发帖子: 0
积分: 0

Re: 摄像头驱动 主线DVP与MIPI-CSI2

该评论内容与本帖子无关,鼓励各位坑友积极发言讨论与帖子有关的内容!

离线

  • 不通过:与技术无关

#39 2021-06-27 01:38:53

niyazfattahov
会员
注册时间: 2021-06-23
已发帖子: 21
积分: 10

Re: 摄像头驱动 主线DVP与MIPI-CSI2

dts.rar
Hello, do I have right dt for ov5640 camera dvp-csi? How can I grab image/video from this camera? What kernel config should I select?
I have media-ctl v4l2. fswebcam and e.t.c.
I tried
fswebcam -r 1920x1080 img.jpg

--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Error starting stream.
VIDIOC_STREAMON: Invalid argument
Unable to use mmap. Using read instead.
Unable to use read.

I tried:
ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 output.jpg

What I need to do in order to get some image/video?
How camera is configured from linux to select custom resolution?
I'm using Buildroot 2020.02.01 & linux 5.4.31

最近编辑记录 niyazfattahov (2021-06-27 01:41:58)

离线

#40 2021-08-25 21:24:22

小王子&木头人
会员
注册时间: 2018-05-08
已发帖子: 72
积分: 4

Re: 摄像头驱动 主线DVP与MIPI-CSI2

有没有csi的pin配置

离线

#41 2021-11-14 19:59:40

alen
会员
注册时间: 2020-06-29
已发帖子: 11
积分: 1

Re: 摄像头驱动 主线DVP与MIPI-CSI2

@aodzip
您好,我在linux5.2内核上移植了您的 sun6i-mipi-csi ,在内核启动的时候报错:
ov7251: probe of 0-0060 failed with error -2
请问这是什么原因啊?

离线

#42 2023-06-05 15:00:55

ookk303
会员
注册时间: 2023-01-18
已发帖子: 35
积分: 7

Re: 摄像头驱动 主线DVP与MIPI-CSI2

下的官方的5.2内核
放进内核时 编译报错 多次定义
然后发现这里还有一份 drivers/media/platform/sunxi/sun6i-csi/

离线

#43 2023-06-24 17:00:23

bidezhi7777
会员
注册时间: 2021-04-22
已发帖子: 23
积分: 3

Re: 摄像头驱动 主线DVP与MIPI-CSI2

OV428,也是支持DVP.MIPI~~

离线

#44 2023-09-09 11:32:06

sjshe3326
会员
注册时间: 2020-10-19
已发帖子: 123
积分: 67.5

Re: 摄像头驱动 主线DVP与MIPI-CSI2

微凉VeiLiang 说:

厉害了,mipi我一直是裸机下跑

裸机下的mipi 资料能够提供下参考么。谢谢

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn