Toybrick
标题:
求指导IMX415如何适配60帧
[打印本页]
作者:
jackwei
时间:
2024-12-12 10:05
标题:
求指导IMX415如何适配60帧
本帖最后由 jackwei 于 2024-12-12 10:48 编辑
一.
按照以下配置能正常运行
3864 X
2192 30fps
{
.bus_fmt = MEDIA_BUS_FMT_SGBRG10_1X10,
.width = 3864,
.height = 2192,
.max_fps = {
.numerator = 10000,
.denominator = 300000,
},
.exp_def = 0x08ca - 0x08,
.hts_def = 0x044c * IMX415_4LANES * 2,
.vts_def = 0x08ca,
.global_reg_list = imx415_global_10bit_3864x2192_regs,
.reg_list = imx415_linear_10bit_3864x2192_891M_regs,
.hdr_mode = NO_HDR,
.mipi_freq_idx = 1,
.bpp = 10,
.vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0,
},
------------------------------------------------------------------------------------------------------
二.
目前想提升到60fps,尝试改成 一下的设置,没有成功,还是 30FPS
只写这一种模式 1
944 X 1097 60fps
使用gstream 能正常运行摄像头 用 fpsdisplaysink插件看帧率也是 30帧
参考文章 :
https://t.rock-chips.com/forum.php?mod=viewthread&tid=4490
具体修改,按照我的理解:
(1)需要换小分辨率 将驱动原有的 19244 X 1097 30fps 改成60FPS,
(2)换相应的 global_reg_list
(3)修改
denominator 为 60
,修改
vts_def 值 (除以2),
调整
exp_def
(4)对照第(3)步的值,修改
reg_list 主要是
vtsMax值 地址是
0x3024
0x3025
三. 感觉还是各种值理解有误:
(1)尤其是对
mipi_freq_idx 到底使用什么值存在疑惑,
(2) 对参考文章中的
e) mipi_freq_idx是用来表示使用link_freq_items中哪个的频率,你可以在link_freq_items新加一个60fps使用的mipi freq
以
1944 X 1097 60fps 需要添加的
mipi_freq
频率是
hts_def
*
vts_def
* 60 吗
-------------------------------------------------------------------------------------------------------------
以下是具体的代码:
{
.bus_fmt = MEDIA_BUS_FMT_SGBRG12_1X12,
.width = 1944,
.height = 1097,
.max_fps = {
.numerator = 10000,
.denominator = 600000,
},
.exp_def = 0x062e- 0x08,
.hts_def = 0x030e * 3,
.vts_def = 0x062e, // 0x0c5d / 2 = 0x062e
.global_reg_list = imx415_global_12bit_3864x2192_regs,
.reg_list = imx415_linear_12bit_1932x1096_594M_regs,
.hdr_mode = NO_HDR,
.mipi_freq_idx = 0,
.bpp = 12,
.vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0,
},
static const s64 link_freq_items[] = {
MIPI_FREQ_297M,
MIPI_FREQ_446M,
MIPI_FREQ_743M,
MIPI_FREQ_891M,
};
----------------相关的寄存器值-------------------------------------
static __maybe_unused const struct regval imx415_global_12bit_3864x2192_regs[] = {
{0x3002, 0x00},
{0x3008, 0x7F},
{0x300A, 0x5B},
{0x30C1, 0x00},
{0x3031, 0x01},
{0x3032, 0x01},
{0x30D9, 0x06},
{0x3116, 0x24},
{0x3118, 0xC0},
{0x311E, 0x24},
{0x32D4, 0x21},
{0x32EC, 0xA1},
{0x3452, 0x7F},
{0x3453, 0x03},
{0x358A, 0x04},
{0x35A1, 0x02},
{0x36BC, 0x0C},
{0x36CC, 0x53},
{0x36CD, 0x00},
{0x36CE, 0x3C},
{0x36D0, 0x8C},
{0x36D1, 0x00},
{0x36D2, 0x71},
{0x36D4, 0x3C},
{0x36D6, 0x53},
{0x36D7, 0x00},
{0x36D8, 0x71},
{0x36DA, 0x8C},
{0x36DB, 0x00},
{0x3701, 0x03},
{0x3724, 0x02},
{0x3726, 0x02},
{0x3732, 0x02},
{0x3734, 0x03},
{0x3736, 0x03},
{0x3742, 0x03},
{0x3862, 0xE0},
{0x38CC, 0x30},
{0x38CD, 0x2F},
{0x395C, 0x0C},
{0x3A42, 0xD1},
{0x3A4C, 0x77},
{0x3AE0, 0x02},
{0x3AEC, 0x0C},
{0x3B00, 0x2E},
{0x3B06, 0x29},
{0x3B98, 0x25},
{0x3B99, 0x21},
{0x3B9B, 0x13},
{0x3B9C, 0x13},
{0x3B9D, 0x13},
{0x3B9E, 0x13},
{0x3BA1, 0x00},
{0x3BA2, 0x06},
{0x3BA3, 0x0B},
{0x3BA4, 0x10},
{0x3BA5, 0x14},
{0x3BA6, 0x18},
{0x3BA7, 0x1A},
{0x3BA8, 0x1A},
{0x3BA9, 0x1A},
{0x3BAC, 0xED},
{0x3BAD, 0x01},
{0x3BAE, 0xF6},
{0x3BAF, 0x02},
{0x3BB0, 0xA2},
{0x3BB1, 0x03},
{0x3BB2, 0xE0},
{0x3BB3, 0x03},
{0x3BB4, 0xE0},
{0x3BB5, 0x03},
{0x3BB6, 0xE0},
{0x3BB7, 0x03},
{0x3BB8, 0xE0},
{0x3BBA, 0xE0},
{0x3BBC, 0xDA},
{0x3BBE, 0x88},
{0x3BC0, 0x44},
{0x3BC2, 0x7B},
{0x3BC4, 0xA2},
{0x3BC8, 0xBD},
{0x3BCA, 0xBD},
{0x4004, 0x48},
{0x4005, 0x09},
{REG_NULL, 0x00},
};
static __maybe_unused const struct regval imx415_linear_12bit_1932x1096_594M_regs[] = {
{0x3020, 0x01},
{0x3021, 0x01},
{0x3022, 0x01},
{0x3024, 0x2E}, //0x5D
{0x3025, 0x06}, //0x0C
{0x3028, 0x0E},
{0x3029, 0x03},
{0x302C, 0x00},
{0x302D, 0x00},
{0x3031, 0x00},
{0x3033, 0x07},
{0x3050, 0x08},
{0x3051, 0x00},
{0x3054, 0x19},
{0x3058, 0x3E},
{0x3060, 0x25},
{0x3064, 0x4A},
{0x30CF, 0x00},
{0x30D9, 0x02},
{0x30DA, 0x01},
{0x3118, 0x80},
{0x3260, 0x01},
{0x3701, 0x00},
{0x400C, 0x00},
{0x4018, 0x67},
{0x401A, 0x27},
{0x401C, 0x27},
{0x401E, 0xB7},
{0x401F, 0x00},
{0x4020, 0x2F},
{0x4022, 0x4F},
{0x4024, 0x2F},
{0x4026, 0x47},
{0x4028, 0x27},
{0x4074, 0x01},
{REG_NULL, 0x00},
};
作者:
troy
时间:
2025-1-17 11:22
看这个链接
https://t.rock-chips.com/forum.php?mod=viewthread&tid=4827&extra=
欢迎光临 Toybrick (https://t.rock-chips.com/)
Powered by Discuz! X3.3