Dear TI - experts,
We are trying to play video on our custom board. The custom board is derived from the Beagleboard. Our custom board includes a DM3730 CPU with the TPS65951 PMIC.
We are using kernel version: 3.2.18
We have connected our platform to a 7 inch LCD display (800x480 resolution)
We are able to to run the SGX demos and touchscreen test application. The framebuffer is good. Now we want to play video on that target. There lies our problem.
Since we are using Open Embedded, the following packages are added to our "console-image":
TI_DSP_INSTALL = " \
dsp-tools \
gstreamer-ti \
ti-codec-engine \
ti-dmai \
ti-dmai-apps \
ti-cmem-module \
ti-dspbios \
ti-dsplink \
gst-ffmpeg \
gst-openmax \
gst-plugins-bad \
gst-plugins-base \
gst-plugins-ugly \
gst-plugins-good \
gst-meta-base \
gst-meta-debug \
gst-meta-video \
gst-omapfb \
ti-codecs-omap3530 \
"
The Gstreamer TI - package uses the TI-DMAI package to access the linux framebuffer or the v4l2 drivers. This is place where it goes wrong.
The bootargs:
[ 0.000000] Kernel command line: console=ttyO2,115200n8 mpurate=auto camera= vram=12M mem=96M@0x80000000 mem=128M@0x88000000 omapfb.mode=lcd:800x480MR-16@60 omapdss.def_disp=lcd rootwait=1 rw ubi.mtd=5,2048 rootfstype=ubifs root=ubi0:ame-stum-rootfs
FBDEV
In the kernel config the number of framebuffers is set to 3.
After startup there are 3 framebuffers created on /dev/fb* (fb0, fb1 and fb2)
After the kernel is booted, the following sh script is executed:
sh /usr/share/ti/gst/omap3530/loadmodules.sh
#!/bin/sh
#
# CMEM Allocation
# 1x5250000 Circular buffer
# 6x829440,1x691200 Video buffers (max D1 PAL)
# 1x345600 Underlying software components (codecs, etc.)
# 1x1 Dummy buffer used during final flush
rmmod cmemk 2>/dev/null
modprobe cmemk allowOverlap=1 phys_start=0x86300000 phys_end=0x87300000 \
pools=1x5250000,6x829440,1x345600,1x691200,1x1
# insert DSP/BIOS Link driver
modprobe dsplinkk
# insert Local Power Manager driver
modprobe lpm_omap3530
# insert SDMA driver
modprobe sdmak
Afterwards the debug variables of DMAI and Gstreamer are set:
export DMAI_DEBUG=2
export GST_DEBUG=3
The gstreamer test src is executed using the command:
gst-launch -v videotestsrc pattern=snow ! TIDmaiVideoSink displayStd=fbdev displayDevice=/dev/fb0 videoStd=VGA videoOutput=LCD accelFrameCopy=FALSE sync=false
The following error is reported:
0:00:00.959930420 296 0x16b5988 ERROR TIDmaiVideoSink gsttidmaivideosink.c:1987:gst_tidmaivideosink_alloc_display_buffers: useUserptrBufs=TRUE can only be used with V4L2 displays
0:00:00.960144043 296 0x16b5988 ERROR TIDmaiVideoSink gsttidmaivideosink.c:744:gst_tidmaivideosink_buffer_alloc: Failed to allocate display buffers
Even when the useUserptrBufs is set to false the same error is reported:
gst-launch -v videotestsrc pattern=snow ! TIDmaiVideoSink useUserptrBufs=FALSE displayStd=fbdev displayDevice=/dev/fb0 videoStd=VGA videoOutput=LCD accelFrameCopy=FALSE sync=false
When we look in the function gst_tidmaivideosink_buffer_alloc of gsttidmaivideosink.c, it makes sense
if (!dmaisink->useUserptrBufs && dmaisink->hDisplay) {
GST_ELEMENT_ERROR(dmaisink, RESOURCE, FAILED,
("Cannot use pad buffer allocation after mmap buffers already "
"in use\n"), (NULL));
return GST_FLOW_UNEXPECTED;
}
else {
dmaisink->useUserptrBufs = TRUE;
}
Or we will get an error in the if statement or the useUserptrBufs is set to true and afterwards in the code the error is reported that only useUserptrBufs can be set for v4l2 displays. Or I will get an error or my variable is overwritten on which afterwards I will get an error.
Any ideas about how to solve this??
V4L2
The number of framebuffers is set in the kernel config to 1.
This will create 1 framebuffer(/dev/fb0) and 2 video entries (/dev/video0 and /dev/video1)
The same boot args as described above are applied to this kernel.
After start up the same variables/start up scripts are executed.
sh /usr/share/ti/gst/omap3530/loadmodules.sh (see content above)
export DMAI_DEBUG=2
export GST_DEBUG=3
The v4l2 devices are proberly created:
[ 4.789550] omap_vout omap_vout: Buffer Size = 3686400
[ 4.795837] omap_vout omap_vout: : registered and initialized video device 0
[ 4.803222] omap_vout omap_vout: Buffer Size = 3686400
[ 4.809448] omap_vout omap_vout: : registered and initialized video device 1
Now I want to play video using the following command:
gst-launch -v videotestsrc pattern=snow ! TIDmaiVideoSink videoStd=VGA videoOutput=LCD accelFrameCopy=FALSE sync=false
The following error is reported:
ti.sdo.dmai - [Display] VIDIOC_DQBUF failed (Invalid argument)
WARN TIDmaiVideoSink gsttidmaivideosink.c:1705:gst_tidmaivideosink_render:<tidmaivideosink0> error: Failed to get display buffer
This seems to be something between my kernel and gstreamer-ti.
Any ideas about how to solve this??
We don't require explicitly the v4l2 drivers since we don't need to capture images on our platform. The goal is to play video in H264 format on the LCD display using the onboard DSP.
Any help would be appreciated.
Thanks
Erwin