Hi,
We are using a AM5708 to get a video stream from the VIN2A Port.
A picture is 320x240 pixels with 12bits or 16b RAW pixel format (bits D12 to D15 are tie down by a pull-Down).
We are able tu grab a picture with the Folowing Bash Script:
# This script triggers acquistions of defined number of frames and saves then in file by using pipe. # Optionally it can be copied to the host (with option 'T') # Author: Martin Rechsteiner, CC ISN, HLSU T&A (2022) # definition of constants mxFrames=1 HOSTIP=10.10.10.11 HOSTUSER=pi fileName=tofFrames.bin if [ "$1" == "N" ]; then mxFrames=$2 echo "Number of acquistions: $mxFrames" if [ "$3" != "" ]; then fileName=$3 fi else if [ "$1" != "" ]; then fileName=$1 fi fi echo "Linux Video-driver debug disabled" echo 0 > /sys/class/video4linux/video1/dev_debug echo 0 > /sys/module/videobuf2_v4l2/parameters/debug echo 0 > /sys/module/videobuf2_common/parameters/debug echo "start dummy video-piping in background" cat /dev/video1 > dummyFrame & BGND_PID=$! usleep 500000 kill $BGND_PID rm dummyFrame echo "start video-piping in background" cat /dev/video1 > $fileName & BGND_PID=$! echo "Trigger $ acquisitions" for nn in `seq 1 $mxFrames`; do echo "Shutter $nn -----------------------------------------" echo 1 > /sys/class/gpio/gpio137/value echo 0 > /sys/class/gpio/gpio137/value usleep 500000 done kill $BGND_PID usleep 50000 echo "Piping stopped. Acquisition done. Frames written to $fileName" ls -l $fileName if [[ "$1" == "T" || "$2" == "T" || "$3" == "T" || "$4" == "T" || "$5" == "T" ]]; then scp -i ~/.ssh/id_rsa $fileName $HOSTUSER@$HOSTIP:~/SitaraBoard/transfer/. echo "File '$fileName' copied to host." fi
But whats we want is to build an application in C to grab the Video Stream with V4L, the Answer is:
I_V4L_OpenVideo: Video Device: /dev/video1 Opening with Success!!!
.....[ 67.866443] vin2a-0: vpdma list busy, cannot post
The V4L driver is configurate as below:
fmt.fmt.pix.width = 640; //2*byte
fmt.fmt.pix.height = 480; //2*byte
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_Y16;
fmt.fmt.pix.field = V4L2_FIELD_NONE;
I_V4L.h
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef I_V4L_H
#define I_V4L_H
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include <sys/types.h>
/* Exported types ------------------------------------------------------------*/
/** @defgroup I_V4L_Exported_Types I_V4L Exported Types
* @{
*/
enum io_method
{
IO_METHOD_READ,
IO_METHOD_MMAP,
IO_METHOD_USERPTR,
};
struct buffer
{
void *start;
size_t length;
};
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup I_V4L_Exported_Constant I_V4L Exported Constant
* @{
*/
#define I_V4L__DEVICE_VIDEO0 "/dev/video0"
#define I_V4L__DEVICE_VIDEO1 "/dev/video1"
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/** @defgroup I_V4L_Exported_Macro I_V4L Exported Macro
* @{
*/
/**
* @}
*/
/* Exported functions Prototypes --------------------------------------------------------*/
/** @defgroup I_V4L_Exported_Functions_Prototypes I_V4L Exported Functions Prototypes
* @{
*/
uint8_t I_V4L_OpenVideo(void);
uint8_t I_V4L_CloseVideo(void);
/**
* @}
*/
#endif /* I_V4L_H */
Do you have any idea what is going wrong here?
Thanks for your support