Jump to content
    

Видеокамера + tvp5150

В 30.09.2022 в 11:02, Niyaz сказал:

какой сигнал декодируете? pal/ntsc?

не знаю. Как узнать?

В 30.09.2022 в 11:02, Niyaz сказал:

У вас стабильное видео?

у меня его вообще нет.

На текущий момент вроде разобрался с gstreamer1 и его плугами. Запускаю программу на qml, получаю

Цитата

[ 2010.653787] In MVC: mxc_v4l_open
[ 2010.658502]    device name is Mxc Camera
[ 2010.662427] adr of cam 0x826d0000
[ 2010.723661] End of mxc_v4l_open: v2f pix widthxheight 288 x 352
[ 2010.729604] End of mxc_v4l_open: crop_bounds widthxheight 720 x 525
[ 2010.736270] End of mxc_v4l_open: crop_defrect widthxheight 720 x 525
[ 2010.742686] End of mxc_v4l_open: crop_current widthxheight 720 x 525
[ 2010.749139] On Open: Input to ipu size is 720 x 525
[ 2010.853976] Selecting video route: route input=0, output=0 => tvp5150 input=0, opmode=0
[ 2010.899339] Set video std register to 0.
[ 2011.004189] Selecting video route: route input=0, output=0 => tvp5150 input=0, opmode=0
[ 2011.049369] Set video std register to 0.
[ 2011.054099] In MVC:mxc_v4l_ioctl
[ 2011.057353] In MVC: mxc_v4l_do_ioctl c050561a
[ 2011.061722]    case VIDIOC_ENUMINPUT
[ 2011.065398] In MVC:mxc_v4l_ioctl
[ 2011.068650] In MVC: mxc_v4l_do_ioctl c0045627
[ 2011.073017]    case VIDIOC_S_INPUT
[ 2011.076597] In MVC:mxc_v4l_ioctl
[ 2011.079900] In MVC: mxc_v4l_do_ioctl 80685600
[ 2011.084354]    case VIDIOC_QUERYCAP
[ 2011.087967] In MVC:mxc_v4l_close
[ 2011.093271] mxc_v4l_close: release resource
[ 2011.097458] MVC: In mxc_free_frame_buf
[ 2011.101209] In MVC:mxc_free_frames
[ 2011.147893]
[ 2011.147893] In MVC: mxc_v4l_open
[ 2011.152610]    device name is Mxc Camera
[ 2011.156618] adr of cam 0x826d0000
[ 2011.213650] End of mxc_v4l_open: v2f pix widthxheight 288 x 352
[ 2011.219592] End of mxc_v4l_open: crop_bounds widthxheight 720 x 525
[ 2011.226069] End of mxc_v4l_open: crop_defrect widthxheight 720 x 525
[ 2011.232496] End of mxc_v4l_open: crop_current widthxheight 720 x 525
[ 2011.238955] On Open: Input to ipu size is 720 x 525
[ 2011.343486] Selecting video route: route input=0, output=0 => tvp5150 input=0, opmode=0
[ 2011.389330] Set video std register to 0.
[ 2011.494470] Selecting video route: route input=0, output=0 => tvp5150 input=0, opmode=0
[ 2011.539360] Set video std register to 0.
[ 2011.544084] In MVC:mxc_v4l_ioctl
[ 2011.547337] In MVC: mxc_v4l_do_ioctl c050561a
[ 2011.551707]    case VIDIOC_ENUMINPUT
[ 2011.555364] In MVC:mxc_v4l_ioctl
[ 2011.558615] In MVC: mxc_v4l_do_ioctl c0045627
[ 2011.562983]    case VIDIOC_S_INPUT
[ 2011.566554] In MVC:mxc_v4l_ioctl
[ 2011.569853] In MVC: mxc_v4l_do_ioctl 80685600
[ 2011.574305]    case VIDIOC_QUERYCAP
[ 2011.577913] In MVC:mxc_v4l_close
[ 2011.583197] mxc_v4l_close: release resource
[ 2011.587385] MVC: In mxc_free_frame_buf
[ 2011.591135] In MVC:mxc_free_frames
Segmentation fault

 

 

Share this post


Link to post
Share on other sites

13 minutes ago, ericN said:

не знаю. Как узнать?

я считываю статус регистры: i2cdump -y -f -r 0x88-0x8c 0 0x5c

Status Register #5 показывает детектируемый сигнал, если у вас на автодетект настроен

Edited by Niyaz
опечатка

Share this post


Link to post
Share on other sites

В 30.09.2022 в 11:22, Niyaz сказал:

я считываю статус регистры: i2cdump -y -f -r 0x88-0x8c 0 0x5c

так?

Цитата

# i2cdump -y -f -r 0x88-0x8c 0 0x5c
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
80:                         XX XX XX XX XX                     XXXXX
#

В данном случае я вас слушаю как кухарка с смартфоном и с камерой. Я пытаюсь настроить linux на системном уровне. Физически подключил аналоговую камеру к tvp5150, а tvp5150 по csi/i2c к процессору. Пытаюсь подцепить готовые драйвера за завести камеру без погружения в исходники драйверов и в даташит tvp5150. Пока без успешно. Похоже придется залезать в исходники драйвера и там ковыряться. Только драйвера чего? драйвер tvp5150? или драйвер v4l2? или ещё какого плуга/прослойки?

Share this post


Link to post
Share on other sites

6 minutes ago, ericN said:

так?

В данном случае я вас слушаю как кухарка с смартфоном и с камерой. Я пытаюсь настроить linux на системном уровне. Физически подключил аналоговую камеру к tvp5150, а tvp5150 по csi/i2c к процессору. Пытаюсь подцепить готовые драйвера за завести камеру без погружения в исходники драйверов и в даташит tvp5150. Пока без успешно. Похоже придется залезать в исходники драйвера и там ковыряться. Только драйвера чего? драйвер tvp5150? или драйвер v4l2? или ещё какого плуга/прослойки?

почему то у вас не вернуло валидные данные - здесь не понятно почему

Я использую linux-5.15, там драйвер tvp5150.c подходит, у меня чип allwinner v3s

врядли надо копать v4l2, там все должно правильно работать

Edited by Niyaz

Share this post


Link to post
Share on other sites

у меня при загрузке tvp5150 вроде обнаруживается

Цитата

[    2.292364] In MVC:camera_init
[    2.295640] In MVC: init_camera_struct
[    2.299396] adr of cam = 0x82067000
[    2.302910] cam->sensor == NUUL in initCam
[    2.307172] exit from init_camera_struct
[    2.331615]    Video device registered: Mxc Camera #0
[    2.393551] tvp5150 2-005c: chip found at address 0x5c (21a8000.i2c)
[    2.424553] ata1: SATA link down (SStatus 0 SControl 300)
[    2.429997] ahci-imx 2200000.sata: no device found, disabling link.
[    2.436295] ahci-imx 2200000.sata: pass ahci_imx..hotplug=1 to enable hotplug
[    2.453537] tvp5150 2-005c: tvp5150am1 detected.
[    2.487647] In MVC: mxc_v4l2_master_attach
[    2.491745]    slave.name = tvp5150
[    2.495251]    master.name = mxc_v4l2_cap0
[    2.553555] End of mxc_v4l2_master_attach: v2f pix widthxheight 288 x 352
[    2.560348] End of mxc_v4l2_master_attach: crop_bounds widthxheight 720 x 525
[    2.567508] End of mxc_v4l2_master_attach: crop_defrect widthxheight 720 x 525
[    2.574748] End of mxc_v4l2_master_attach: crop_current widthxheight 720 x 525

и появляется /dev/video0

но вот при запуске программы получаю Segmentation fault.

у меня Linux version 5.10.9. Но он уже перепатченый под мою борду (для другой, не камеры, перефирии).  Может действительно в 5.15 всё заработает изкоропки.

Share this post


Link to post
Share on other sites

8 minutes ago, ericN said:

у меня при загрузке tvp5150 вроде обнаруживается

и появляется /dev/video0

но вот при запуске программы получаю Segmentation fault.

у меня Linux version 5.10.9. Но он уже перепатченый под мою борду (для другой, не камеры, перефирии).  Может действительно в 5.15 всё заработает изкоропки.

попробуйте эти команды

v4l2-ctl --set-fmt-video=width=720,height=288,pixelformat=UYVY --stream-mmap=4 --verbose -d /dev/video0

v4l2-ctl -d /dev/video0 --try-fmt-video=width=720,height=288,pixelformat=UYVY,field=none --stream-mmap --stream-count=1 --stream-to=test.yuv

можно эту еще:

fswebcam -S 5 -d /dev/video0 -p UYVY -r 720x288 test.jpg
 

Edited by Niyaz
обновил

Share this post


Link to post
Share on other sites

может есть мысли, что можно дернуть, чтобы проверить работу камеры и tvp5150? Может какуюнить утилиту из gstreamer1?

В 30.09.2022 в 11:51, Niyaz сказал:

попробуйте эту команду

-sh: v4l2-ctl: not found

щя, поищю в пакетах

Share this post


Link to post
Share on other sites

On 9/30/2022 at 2:08 AM, ericN said:

какой сигнал декодируете? pal/ntsc?

не знаю. Как узнать?

Из документации на камеру.

Иногда камера дает что-то одно, иногда ее можно настроить. Зависит от камеры и ее конфигурации.

On 9/30/2022 at 2:38 AM, ericN said:

так?

В данном случае я вас слушаю как кухарка с смартфоном и с камерой. Я пытаюсь настроить linux на системном уровне. Физически подключил аналоговую камеру к tvp5150, а tvp5150 по csi/i2c к процессору. Пытаюсь подцепить готовые драйвера за завести камеру без погружения в исходники драйверов и в даташит tvp5150. Пока без успешно. Похоже придется залезать в исходники драйвера и там ковыряться. Только драйвера чего? драйвер tvp5150? или драйвер v4l2? или ещё какого плуга/прослойки?

Для начала определите какой сигнал идет от камеры. SD: PAL/SECAM/NTSC или HD: 1080i, 1080p 720p. Может быть и 4K, но я сомневаюсь.
Сколько кадров в секунду, сколько строк.

Потом найдите как настроить на этот сигнал tvp5150+ драйвер и поддерживает ли его tvp5150 + драйвер.

 

Share this post


Link to post
Share on other sites

В 02.10.2022 в 23:08, Tarbal сказал:

Для начала определите какой сигнал идет от камеры.

нешел.... накамере маркировка (камера тестовая) v-cvc13p - это камера заднего вида от авто.

TV system -PAL (какой конкретно PAL - не нашел)

Кол-во строк и кадров определяет вроде как PAL. (хотя глянул - есть PAL I, есть PAL H, ... )
Мануал на камеру на английском Resolution: 330 K, мануал на русском Расширение 330 строк (перевод китайский)
 
сейчас при запуске теста вываливается вот это
Цитата

 

# qmlscene test.qml
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).

(<unknown>:267): GLib-GObject-
[ 4702.606752] In MVC: mxc_v4l_open
[1;35mCRITICAL **: 01:18[ 4702.611714]    device name is Mxc Camera
:22.600: Object class GstImxV[ 4702.618521] adr of cam 0x826d8000
4l2VideoSrc doesn't implement property 'exposure-mode' from interface 'GstPhotography'
[ 4702.683626] End of mxc_v4l_open: v2f pix widthxheight 288 x 352
[ 4702.689568] End of mxc_v4l_open: crop_bounds widthxheight 720 x 525
[ 4702.695903] End of mxc_v4l_open: crop_defrect widthxheight 720 x 525
[ 4702.702285] End of mxc_v4l_open: crop_current widthxheight 720 x 525
[ 4702.708822] On Open: Input to ipu size is 720 x 525
[ 4702.812871] Selecting video route: route input=0, output=0 => tvp5150 input=0, opmode=0
[ 4702.849358] Set video std register to 0.
[ 4702.951657] Selecting video route: route input=0, output=0 => tvp5150 input=0, opmode=0
[ 4702.989410] Set video std register to 0.
[ 4702.994009] In MVC:mxc_v4l_ioctl
[ 4702.997258] In MVC: mxc_v4l_do_ioctl 80685600
[ 4703.001627]    case VIDIOC_QUERYCAP
[ 4703.005318] In MVC:mxc_v4l_ioctl
[ 4703.008616] In MVC: mxc_v4l_do_ioctl 8008563f
[ 4703.013022]    case default or not supported
[ 4703.017385] In MVC:mxc_v4l_ioctl
[ 4703.020801] In MVC: mxc_v4l_do_ioctl 80085617
[ 4703.025273]    case VIDIOC_G_STD
[ 4703.028525] In mxc_v4l2_g_std
[ 4703.031508] In MVC:mxc_v4l_ioctl
[ 4703.034769] In MVC: mxc_v4l_do_ioctl 40085618
[ 4703.039128]    case VIDIOC_S_STD
[ 4703.042356] In mxc_v4l2_s_std 0
[ 4703.045542] ERROR: unrecognized std! 0 (PAL=ff, NTSC=b000
[ 4703.050945] In MVC:mxc_v4l_ioctl
[ 4703.054195] In MVC: mxc_v4l_do_ioctl c0cc5604
[ 4703.058558]    case VIDIOC_G_FMT
[ 4703.061787] In MVC: mxc_v4l2_g_fmt type=1
[ 4703.065835]    type is V4L2_BUF_TYPE_VIDEO_CAPTURE
[ 4703.070630] End of mxc_v4l2_g_fmt: v2f pix widthxheight 288 x 352
[ 4703.076743] End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 625
[ 4703.083196] End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 525
[ 4703.089726] End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 576
[ 4703.096293] In MVC:mxc_v4l_ioctl
[ 4703.099526] In MVC: mxc_v4l_do_ioctl c02c564a
[ 4703.103914] In MVC:mxc_v4l_ioctl
[ 4703.107147] In MVC: mxc_v4l_do_ioctl c0045627
[ 4703.111504]    case VIDIOC_S_INPUT
[ 4703.114922] In MVC:mxc_streamoff
[ 4703.118155] In MVC:mxc_v4l_ioctl
[ 4703.121386] In MVC: mxc_v4l_do_ioctl c0cc5616
[ 4703.125783]    case VIDIOC_S_PARM
[ 4703.129101] In mxc_v4l2_s_param
[ 4703.132244]    Current capabilities are 1001
[ 4703.136531]    Current capturemode is 0  change to 0
[ 4703.141498]    Current framerate is 30  change to 30
[ 4703.146501] ioctl_s_parm TVP5150_OUTPUT_CONTROL_CHIP_ENABLE
[ 4703.152076]    clock_curr=mclk=0
[ 4703.213676]    g_fmt_cap returns widthxheight of input as 720 x 525
[ 4703.220657] In MVC:mxc_v4l_ioctl
[ 4703.223984] In MVC: mxc_v4l_do_ioctl c0cc5605
[ 4703.228361]    case VIDIOC_S_FMT
[ 4703.231601] In MVC: mxc_v4l2_s_fmt
[ 4703.235179]    type=V4L2_BUF_TYPE_VIDEO_CAPTURE
[ 4703.239785] End of mxc_v4l2_s_fmt: v2f pix widthxheight 720 x 520
[ 4703.245979] End of mxc_v4l2_s_fmt: crop_bounds widthxheight 720 x 525
[ 4703.252477] End of mxc_v4l2_s_fmt: crop_defrect widthxheight 720 x 525
[ 4703.259203] End of mxc_v4l2_s_fmt: crop_current widthxheight 720 x 525
[ 4703.266013] In MVC:mxc_v4l_ioctl
[ 4703.269266] In MVC: mxc_v4l_do_ioctl c0cc5604
[ 4703.273645]    case VIDIOC_G_FMT
[ 4703.276879] In MVC: mxc_v4l2_g_fmt type=1
[ 4703.280888]    type is V4L2_BUF_TYPE_VIDEO_CAPTURE
[ 4703.285698] End of mxc_v4l2_g_fmt: v2f pix widthxheight 720 x 520
[ 4703.291793] End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 525
[ 4703.298274] End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 525
[ 4703.304815] End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 525
[ 4703.311349] In MVC:mxc_v4l_ioctl
[ 4703.314595] In MVC: mxc_v4l_do_ioctl c008561c
[ 4703.318954]    case VIDIOC_S_CTRL
[ 4703.322269] In MVC:mxc_v4l2_s_ctrl
[ 4703.325719]    default case
[ 4703.328518] In MVC:mxc_v4l_ioctl
[ 4703.331748] In MVC: mxc_v4l_do_ioctl c008561c
[ 4703.336123]    case VIDIOC_S_CTRL
[ 4703.339439] In MVC:mxc_v4l2_s_ctrl
[ 4703.342840]    default case
[ 4703.345651] In MVC:mxc_v4l_ioctl
[ 4703.348883] In MVC: mxc_v4l_do_ioctl c008561b
[ 4703.353255]    case VIDIOC_G_CTRL
[ 4703.356571] In MVC:mxc_v4l2_g_ctrl
[ 4703.359973] ERROR: v4l2 capture: unsupported ioctrl!
[ 4703.364954] In MVC:mxc_v4l_ioctl
[ 4703.368184] In MVC: mxc_v4l_do_ioctl c008561c
[ 4703.372540]    case VIDIOC_S_CTRL
[ 4703.375893] In MVC:mxc_v4l2_s_ctrl
[ 4703.379296]    default case
[ 4703.399827] In MVC:mxc_v4l_ioctl
[ 4703.403145] In MVC: mxc_v4l_do_ioctl c0cc5604
[ 4703.407514]    case VIDIOC_G_FMT
[ 4703.410770] In MVC: mxc_v4l2_g_fmt type=1
[ 4703.414823]    type is V4L2_BUF_TYPE_VIDEO_CAPTURE
[ 4703.419624] End of mxc_v4l2_g_fmt: v2f pix widthxheight 720 x 520
[ 4703.425817] End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 525
[ 4703.432298] End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 525
[ 4703.438852] End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 525
[ 4703.459048] In MVC:mxc_v4l_ioctl
[ 4703.462290] In MVC: mxc_v4l_do_ioctl c0cc5604
[ 4703.466854]    case VIDIOC_G_FMT
[ 4703.470201] In MVC: mxc_v4l2_g_fmt type=1
[ 4703.474266]    type is V4L2_BUF_TYPE_VIDEO_CAPTURE
[ 4703.479084] End of mxc_v4l2_g_fmt: v2f pix widthxheight 720 x 520
[ 4703.485227] End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 525
[ 4703.491768] End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 525
[ 4703.498349] End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 525
[ 4703.505393] In MVC:mxc_v4l_ioctl
[ 4703.508657] In MVC: mxc_v4l_do_ioctl c0145608
[ 4703.513028]    case VIDIOC_REQBUFS
[ 4703.516454] In MVC:mxc_streamoff
[ 4703.519685] MVC: In mxc_free_frame_buf
[ 4703.523453] In MVC:mxc_allocate_frame_buf - size=748800
[ 4703.555080] In MVC:mxc_v4l_ioctl
[ 4703.558321] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.562679]    case VIDIOC_QUERYBUF
[ 4703.566190] In MVC:mxc_v4l2_buffer_status
[ 4703.570217] In MVC:mxc_mmap
[ 4703.573015]    pgoff=0x44400, start=0x66e48000, end=0x66eff000
[ 4703.578934] In MVC:mxc_v4l_ioctl
[ 4703.582167] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.586545]    case VIDIOC_QUERYBUF
[ 4703.590039] In MVC:mxc_v4l2_buffer_status
[ 4703.594065] In MVC:mxc_v4l_ioctl
[ 4703.597296] In MVC: mxc_v4l_do_ioctl 80685600
[ 4703.601653]    case VIDIOC_QUERYCAP
[ 4703.605356] In MVC:mxc_v4l_ioctl
[ 4703.608591] In MVC: mxc_v4l_do_ioctl c050560f
[ 4703.612949]    case VIDIOC_QBUF
[ 4703.616125] In MVC:mxc_v4l_ioctl
[ 4703.619360] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.623734]    case VIDIOC_QUERYBUF
[ 4703.627224] In MVC:mxc_v4l2_buffer_status
[ 4703.631245] In MVC:mxc_mmap
[ 4703.634084]    pgoff=0x44500, start=0x66c49000, end=0x66d00000
[ 4703.639936] In MVC:mxc_v4l_ioctl
[ 4703.643185] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.647543]    case VIDIOC_QUERYBUF
[ 4703.651032] In MVC:mxc_v4l2_buffer_status
[ 4703.655083] In MVC:mxc_v4l_ioctl
[ 4703.658315] In MVC: mxc_v4l_do_ioctl 80685600
[ 4703.662672]    case VIDIOC_QUERYCAP
[ 4703.666189] In MVC:mxc_v4l_ioctl
[ 4703.669423] In MVC: mxc_v4l_do_ioctl c050560f
[ 4703.673796]    case VIDIOC_QBUF
[ 4703.676945] In MVC:mxc_v4l_ioctl
[ 4703.680175] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.684571]    case VIDIOC_QUERYBUF
[ 4703.688062] In MVC:mxc_v4l2_buffer_status
[ 4703.692078] In MVC:mxc_mmap
[ 4703.694904]    pgoff=0x44600, start=0x66b92000, end=0x66c49000
[ 4703.700766] In MVC:mxc_v4l_ioctl
[ 4703.704015] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.708374]    case VIDIOC_QUERYBUF
[ 4703.711862] In MVC:mxc_v4l2_buffer_status
[ 4703.715913] In MVC:mxc_v4l_ioctl
[ 4703.719144] In MVC: mxc_v4l_do_ioctl 80685600
[ 4703.723519]    case VIDIOC_QUERYCAP
[ 4703.727018] In MVC:mxc_v4l_ioctl
[ 4703.730249] In MVC: mxc_v4l_do_ioctl c050560f
[ 4703.734622]    case VIDIOC_QBUF
[ 4703.737772] In MVC:mxc_v4l_ioctl
[ 4703.741002] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.745373]    case VIDIOC_QUERYBUF
[ 4703.748863] In MVC:mxc_v4l2_buffer_status
[ 4703.752880] In MVC:mxc_mmap
[ 4703.755693]    pgoff=0x44700, start=0x66adb000, end=0x66b92000
[ 4703.761543] In MVC:mxc_v4l_ioctl
[ 4703.764816] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.769174]    case VIDIOC_QUERYBUF
[ 4703.772663] In MVC:mxc_v4l2_buffer_status
[ 4703.776693] In MVC:mxc_v4l_ioctl
[ 4703.779929] In MVC: mxc_v4l_do_ioctl 80685600
[ 4703.784300]    case VIDIOC_QUERYCAP
[ 4703.787801] In MVC:mxc_v4l_ioctl
[ 4703.791030] In MVC: mxc_v4l_do_ioctl c050560f
[ 4703.795428]    case VIDIOC_QBUF
[ 4703.798577] In MVC:mxc_v4l_ioctl
[ 4703.801807] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.806178]    case VIDIOC_QUERYBUF
[ 4703.809670] In MVC:mxc_v4l2_buffer_status
[ 4703.813714] In MVC:mxc_mmap
[ 4703.816512]    pgoff=0x44800, start=0x66a24000, end=0x66adb000
[ 4703.822363] In MVC:mxc_v4l_ioctl
[ 4703.825639] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.829997]    case VIDIOC_QUERYBUF
[ 4703.833501] In MVC:mxc_v4l2_buffer_status
[ 4703.837513] In MVC:mxc_v4l_ioctl
[ 4703.840744] In MVC: mxc_v4l_do_ioctl 80685600
[ 4703.845118]    case VIDIOC_QUERYCAP
[ 4703.848618] In MVC:mxc_v4l_ioctl
[ 4703.851848] In MVC: mxc_v4l_do_ioctl c050560f
[ 4703.856245]    case VIDIOC_QBUF
[ 4703.859395] In MVC:mxc_v4l_ioctl
[ 4703.862625] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.866999]    case VIDIOC_QUERYBUF
[ 4703.870490] In MVC:mxc_v4l2_buffer_status
[ 4703.874525] In MVC:mxc_mmap
[ 4703.877325]    pgoff=0x44900, start=0x6696d000, end=0x66a24000
[ 4703.883224] In MVC:mxc_v4l_ioctl
[ 4703.886456] In MVC: mxc_v4l_do_ioctl c0505609
[ 4703.890812]    case VIDIOC_QUERYBUF
[ 4703.894319] In MVC:mxc_v4l2_buffer_status
[ 4703.898332] In MVC:mxc_v4l_ioctl
[ 4703.901561] In MVC: mxc_v4l_do_ioctl 80685600
[ 4703.905956]    case VIDIOC_QUERYCAP
[ 4703.909455] In MVC:mxc_v4l_ioctl
[ 4703.912685] In MVC: mxc_v4l_do_ioctl c050560f
[ 4703.917060]    case VIDIOC_QBUF
[ 4703.920205] In MVC:mxc_v4l_ioctl
[ 4703.923452] In MVC: mxc_v4l_do_ioctl 40045612
[ 4703.927810]    case VIDIOC_STREAMON
[ 4703.931298] In MVC:mxc_streamon
[ 4703.939048] In MVC:mxc_v4l_ioctl
[ 4703.942288] In MVC: mxc_v4l_do_ioctl c0505611
[ 4703.946679]    case VIDIOC_DQBUF
[ 4703.949909] In MVC:mxc_v4l_dqueue
[ 4704.004946] In MVC:camera_callback
[ 4704.009307] In MVC:mxc_v4l_ioctl
[ 4704.012571] In MVC: mxc_v4l_do_ioctl c0cc5604
[ 4704.017096]    case VIDIOC_G_FMT
[ 4704.020362] In MVC: mxc_v4l2_g_fmt type=1
[ 4704.024461]    type is V4L2_BUF_TYPE_VIDEO_CAPTURE
[ 4704.029301] End of mxc_v4l2_g_fmt: v2f pix widthxheight 720 x 520
[ 4704.035428] End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 525
[ 4704.040415] imx-ipuv3 2400000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00000001
[ 4704.041888] End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 525
[ 4704.048944] In MVC:camera_callback
[ 4704.058919] End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 525
[ 4704.072661] In MVC:mxc_v4l_ioctl
[ 4704.075874] In MVC:camera_callback
[ 4704.079510] In MVC: mxc_v4l_do_ioctl c0cc5604
[ 4704.083949]    case VIDIOC_G_FMT
[ 4704.087221] In MVC: mxc_v4l2_g_fmt type=1
[ 4704.091271]    type is V4L2_BUF_TYPE_VIDEO_CAPTURE
[ 4704.096260] End of mxc_v4l2_g_fmt: v2f pix widthxheight 720 x 520
[ 4704.102402] End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 525
[ 4704.108899] End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 525
[ 4704.111317] In MVC:camera_callback
[ 4704.115484] End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 525
[ 4704.125543] In MVC:mxc_v4l_ioctl
[ 4704.128811] In MVC: mxc_v4l_do_ioctl c0505611
[ 4704.133203]    case VIDIOC_DQBUF
[ 4704.136439] In MVC:mxc_v4l_dqueue
[ 4704.139917] In MVC:mxc_v4l_ioctl
[ 4704.143203] In MVC: mxc_v4l_do_ioctl c0505611
[ 4704.146773] In MVC:camera_callback
[ 4704.147575]    case VIDIOC_DQBUF
[ 4704.154221] In MVC:mxc_v4l_dqueue
[ 4704.157666] In MVC:mxc_v4l_ioctl
[ 4704.160917] In MVC: mxc_v4l_do_ioctl c0505611
[ 4704.165309]    case VIDIOC_DQBUF
[ 4704.168541] In MVC:mxc_v4l_dqueue
[ 4704.171960] In MVC:mxc_v4l_ioctl
[ 4704.175220] In MVC: mxc_v4l_do_ioctl c0505611
[ 4704.179586]    case VIDIOC_DQBUF
[ 4704.182232] In MVC:camera_callback
[ 4704.182820] In MVC:mxc_v4l_dqueue
[ 4704.189590] ERROR: v4l2 capture: mxc_v4l_dqueue() interrupt received
[ 4704.212274] In MVC:mxc_v4l_close
[ 4704.217275] mxc_v4l_close: release resource
[ 4704.221467] MVC: In mxc_free_frame_buf
[ 4704.226575] In MVC:mxc_free_frames
Segmentation fault

 

 

Кто может подсказать - как это всё должно работать?
Вот включили питание.... прошел u-boot, началась загрузка ядра. в дереве девайсов встретилось описание tvp5150... вызывается нужный probe().... вот от сюда... что дальше?
Вызвали своё приложение... и что дальше? Как работает драйвер? Вызывается у драйвера tvp5150.с функция init()? или функция open()? Как происходит взаимодействие с v4l2? Каким боком тут gstreamer1?
 
 

Share this post


Link to post
Share on other sites

В 30.09.2022 в 11:51, Niyaz сказал:

попробуйте эти команды

v4l2-ctl --set-fmt-video=width=720,height=288,pixelformat=UYVY --stream-mmap=4 --verbose -d /dev/video0

v4l2-ctl -d /dev/video0 --try-fmt-video=width=720,height=288,pixelformat=UYVY,field=none --stream-mmap --stream-count=1 --stream-to=test.yuv

Цитата

# v4l2-ctl --set-fmt-video=width=720,height=288,pixelformat=UYVY --stream-mmap=4
 --verbose -d /dev/video0
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
The pixelformat 'UYVY' is invalid
                VIDIOC_REQBUFS returned 0 (SucYUV420
cess)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq:      0 bytesused: 152064 ts: 777.310884
cap dqbuf: 1 seq:      0 bytesused: 152064 ts: 777.370846 delta: 59.962 ms
cap dqbuf: 2 seq:      0 bytesused: 152064 ts: 777.430868 delta: 60.022 ms
cap dqbuf: 3 seq:      0 bytesused: 152064 ts: 777.490824 delta: 59.956 ms
cap dqbuf: 0 seq:      0 bytesused: 152064 ts: 777.550841 delta: 60.017 ms fps: 0.00
cap dqbuf: 1 seq:      0 bytesused: 152064 ts: 777.610799 delta: 59.958 ms fps: 0.00
cap dqbuf: 2 seq:      0 bytesused: 152064 ts: 777.670819 delta: 60.020 ms fps: 0.00
cap dqbuf: 3 seq:      0 bytesused: 152064 ts: 777.730780 delta: 59.961 ms fps: 0.00
cap dqbuf: 0 seq:      0 bytesused: 152064 ts: 777.790800 delta: 60.020 ms fps: 0.00
cap dqbuf: 1 seq:      0 bytesused: 152064 ts: 777.850761 delta: 59.961 ms fps: 0.00
cap dqbuf: 2 seq:      0 bytesused: 152064 ts: 777.910773 delta: 60.012 ms fps: 0.00
cap dqbuf: 3 seq:      0 bytesused: 152064 ts: 777.970737 delta: 59.964 ms fps: 0.00
cap dqbuf: 0 seq:      0 bytesused: 152064 ts: 778.030758 delta: 60.021 ms fps: 0.00
cap dqbuf: 1 seq:      0 bytesused: 152064 ts: 778.090719 delta: 59.961 ms fps: 0.00
cap dqbuf: 2 seq:      0 bytesused: 152064 ts: 778.150737 delta: 60.018 ms fps: 0.00
cap dqbuf: 3 seq:      0 bytesused: 152064 ts: 778.210694 delta: 59.957 ms fps: 0.00
cap dqbuf: 0 seq:      0 bytesused: 152064 ts: 778.270719 delta: 60.025 ms fps: 0.00
cap dqbuf: 1 seq:      0 bytesused: 152064 ts: 778.330678 delta: 59.959 ms fps: 0.00
cap dqbuf: 2 seq:      0 bytesused: 152064 ts: 778.390695 delta: 60.017 ms fps: 0.00
cap dqbuf: 3 seq:      0 bytesused: 152064 ts: 778.450651 delta: 59.956 ms fps: 0.00
cap dqbuf: 0 seq:      0 bytesused: 152064 ts: 778.510678 delta: 60.027 ms fps: 0.00
cap dqbuf: 1 seq:      0 bytesused: 152064 ts: 778.570634 delta: 59.956 ms fps: 0.00
cap dqbuf: 2 seq:      0 bytesused: 152064 ts: 778.630652 delta: 60.018 ms fps: 0.00
cap dqbuf: 3 seq:      0 bytesused: 152064 ts: 778.690613 delta: 59.961 ms fps: 0.00
^CERROR: v4l2 capture: mxc_v4l_dqueue() interrupt received

 

Цитата

# v4l2-ctl -d /dev/video0 --try-fmt-video=width=720,height=288,pixelformat=UYVY,
field=none --stream-mmap --stream-count=1 --stream-to=test.yuv
The pixelformat 'UYVY' is invalid
YUV420
<
#

 

 

List all video devices

Цитата

 

# v4l2-ctl --list-devices
 ():
        /dev/video0

#

 

 

List supported video formats and resolutions of default video device /dev/video0

Цитата

 

# v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

#

 

 

Get all details of a video device

Цитата

# v4l2-ctl --all
Driver Info:
        Driver name      : mxc_v4l2
        Card type        :
        Bus info         :
        Driver version   : 0.1.11
        Capabilities     : 0x05000005
                Video Capture
                Video Overlay
                Read/Write
                Streaming
Video input : 0 (CSI IC MEM: no power)
Video output: 0 (DISP3 BG)
Video Standard = 0x000000ff
        PAL-B/B1/G/H/I/D/D1/K
Format Video Capture:
        Width/Height      : 288/352
        Pixel Format      : 'YU12'
        Field             : Any
        Bytes per Line    : 432
        Size Image        : 152064
        Colorspace        : Default
        Transfer Function : Default (maps to Rec. 709)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Limited Range)
Format Video Overlay:
        Left/Top    : 0/0
        Width/Height: 160/160
        Field       : Any
        Chroma Key  : 0x00000000
        Global Alpha: 0x00
        Clip Count  : 0
        Clip Bitmap : No
Framebuffer Format:
        Capability    : Extern Overlay
        Flags         : Overlay Matches Capture/Output Size
        Width         : 0
        Height        : 0
        Pixel Format  : ''
Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 720, Height 625
        Default     : Left 0, Top 0, Width 720, Height 625
        Pixel Aspect: 0/0
Streaming Parameters Video Capture:
        Frames per second: 30.000 (30/1)
        Read buffers     : 0
Streaming Parameters Video Output:
        Frames per second: invalid (0/0)
        Write buffers    : 0

попробовал так

#v4l2-ctl --set-fmt-video=width=720,height=625,pixelformat=YU12 --stream-mmap=4 --verbose -d /dev/video0

Цитата

# v4l2-ctl --set-fmt-video=width=720,height=625,pixelformat=YU12 --stream-mmap=4 --verbose -d /dev/video0
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
The pixelformat 'YU12' is invalid
                VIDIOC_REQBUFS returned 0 (SuccYUV420
ess)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq:      0 bytesused: 152064 ts: 1289.440616
cap dqbuf: 1 seq:      0 bytesused: 152064 ts: 1289.500634 delta: 60.018 ms
cap dqbuf: 2 seq:      0 bytesused: 152064 ts: 1289.560600 delta: 59.966 m

 

Кто-то может сказать что тут не так? Почему The pixelformat is invalid?

 

Share this post


Link to post
Share on other sites

Найдите команду, чтобы посмотреть список поддерживаемых вашим входным устройством форматов. надо один из них выбрать.
Вроде:

v4l2-ctl --list-formats



PAL: 25 кадров и 625 строк в кадре из них кажется 574 активных. Посмотрите в гугле сколько точно. Размер в пикселях 720 по горизонтали на 574 по вертикали. Пиксели не квадратные, чтобы aspect ratio сохранить как 3/4. Но последняя информация в конфигурации драйвера не используется.

720 на 625 не может быть. 720 -- активных пикселей, а 625 полных строк. Активных строк в PAL 574, а не 625. Активных пикселей в строке 720 плюс сколько-то на синхроимпульс, сколько-то на  front porch, сколько-то на синхроимпульс на back porch.

Но если можно указать что PAL, то все встанет как надо.

Отличия разных PAL форматов незначительны и скорее всего будет работать без нюансов.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...