IMX8MP ISP and VVCAM Driver Troubleshooting

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8MP ISP and VVCAM Driver Troubleshooting

Jump to solution
2,729 Views
Cbrobson
Contributor II

Hello,

I am working on writing drivers for a currently non-supported image sensor to work with the IMX8M Plus. I have developed my source code for both the isp-imx package and the isp-vvcam package, and I have created a custom .dtb file for my sensor as well. On the imx8mp-evk board, I can load my image via SD card, boot into Linux, and see the correct .drv, .xml, .txt, and .ko files in their correct places on the target hardware.

I then execute a slightly modified run.sh script directly. I can see that all of my kernel modules load without issue, and I get the message "Starting isp_media_server with configuration file CAMERA0". This seems good so far, but unfortunately my g-streamer commands are failing with outputs "Failed to allocate the required memory" and "Internal Data Stream Error" (Full output attached).

Cbrobson_0-1637168853356.png

My next step was to troubleshoot using v4l2-ctl, in order to determine if the issue is coming from my higher-level isp-imx driver, or my lower-level v4l2 driver. I have included the output from the command v4l2-ctl -d /dev/video2 --all (my sensor is connected on video2)--I am not entirely sure how to interpret that output, but nothing jumps out as incorrect to me. I have attached it here for reference. I then attempt to capture a raw Bayer frame using the command

v4l2-ctl -d /dev/video2 --set-fmt-video=width=1920,height=1080,pixelformat='YUYV' --stream-mmap --stream-count=1 --stream-to=image_1920x1080.bayer

Which results in a brief pause, followed by the following message:

VIDIOC_REQBUFS returned -1 (Resource temporarily unavailable)

This seems to indicate to me that the issue is with kernel-module-isp-vvcam, rather than isp-imx, but unfortunately I am not sure how to narrow it down much further than that.

I am currently looking into the VIDIOC_REQBUFS function, hoping I can find where it ties into my driver code. I realize that this is a very specific question, and might be difficult to answer without access to my source code, but maybe someone can help to at least point me in the right direction. Are there any additional troubleshooting steps I could try?

Please let me know if you have any other questions, or if anything above is unclear!

Thank you,

Cody Robson

0 Kudos
Reply
1 Solution
2,685 Views
Cbrobson
Contributor II

Hello!

Quick update: I found I can troubleshoot with dmesg to localize the issue within my v4l2 driver code. My read_reg functions aren't working--errors being thrown from their internal i2c_transfer calls. I have confirmed the I2C information is correct, and I can read and write the registers using i2cget and i2cset directly (connected on i2c directly, rather than through the CSI port). Using an oscilloscope, I can even see that the pixel clock turns on when I set the start streaming bit.

After some investigation today, I believe that the issue is not due to my reg_read functions themselves (although this is still possible). Instead, it seems that my supply voltages are not properly being set. The first outputs in dmesg after entering the probe function are the three below:

[ 2264.809541] ar0234 1-0010: supply DOVDD not found, using dummy regulator
[ 2264.817373] ar0234 1-0010: supply DVDD not found, using dummy regulator
[ 2264.824165] ar0234 1-0010: supply AVDD not found, using dummy regulator

These regulators are set in the probe function as below:

sensor->io_regulator = devm_regulator_get(dev, "DOVDD");
sensor->io_regulator = devm_regulator_get(dev, "DVDD");
sensor->io_regulator = devm_regulator_get(dev, "AVDD");

(with some error handling in between) the syntax of which is taken directly from the OV2775 driver that is included in the IMX8MP BSP.

Taking DMM to my sensor board, I can indeed see that my supply voltages are not correct, and my clock never makes it past a buffer to the sensor itself, because the buffer's supply voltage is insufficient.

However, I am unfamiliar with the process of setting up these regulators, and I am not sure how to troubleshoot any further at the moment. As I said, this setup was copied directly from the OV2775 driver, so I don't quite understand at the moment why those supplies would not be found.

Again, any advice is much appreciated!

Thanks again,

Cody

View solution in original post

0 Kudos
Reply
3 Replies
1,913 Views
chp0423
Contributor III

@Cbrobson Did you solve the problem? I met the same issue with you: gst-launch said internal stream error. Thanks!

0 Kudos
Reply
2,685 Views
Cbrobson
Contributor II

Hello!

Quick update: I found I can troubleshoot with dmesg to localize the issue within my v4l2 driver code. My read_reg functions aren't working--errors being thrown from their internal i2c_transfer calls. I have confirmed the I2C information is correct, and I can read and write the registers using i2cget and i2cset directly (connected on i2c directly, rather than through the CSI port). Using an oscilloscope, I can even see that the pixel clock turns on when I set the start streaming bit.

After some investigation today, I believe that the issue is not due to my reg_read functions themselves (although this is still possible). Instead, it seems that my supply voltages are not properly being set. The first outputs in dmesg after entering the probe function are the three below:

[ 2264.809541] ar0234 1-0010: supply DOVDD not found, using dummy regulator
[ 2264.817373] ar0234 1-0010: supply DVDD not found, using dummy regulator
[ 2264.824165] ar0234 1-0010: supply AVDD not found, using dummy regulator

These regulators are set in the probe function as below:

sensor->io_regulator = devm_regulator_get(dev, "DOVDD");
sensor->io_regulator = devm_regulator_get(dev, "DVDD");
sensor->io_regulator = devm_regulator_get(dev, "AVDD");

(with some error handling in between) the syntax of which is taken directly from the OV2775 driver that is included in the IMX8MP BSP.

Taking DMM to my sensor board, I can indeed see that my supply voltages are not correct, and my clock never makes it past a buffer to the sensor itself, because the buffer's supply voltage is insufficient.

However, I am unfamiliar with the process of setting up these regulators, and I am not sure how to troubleshoot any further at the moment. As I said, this setup was copied directly from the OV2775 driver, so I don't quite understand at the moment why those supplies would not be found.

Again, any advice is much appreciated!

Thanks again,

Cody

0 Kudos
Reply
2,686 Views
Cbrobson
Contributor II

Hello!

Quick update: I found I can troubleshoot with dmesg to localize the issue within my v4l2 driver code. My read_reg functions aren't working--errors being thrown from their internal i2c_transfer calls. I have confirmed the I2C information is correct, and I can read and write the registers using i2cget and i2cset directly (connected on i2c directly, rather than through the CSI port). Using an oscilloscope, I can even see that the pixel clock turns on when I set the start streaming bit.

After some investigation today, I believe that the issue is not due to my reg_read functions themselves (although this is still possible). Instead, it seems that my supply voltages are not properly being set. The first outputs in dmesg after entering the probe function are the three below:

[ 2264.809541] ar0234 1-0010: supply DOVDD not found, using dummy regulator
[ 2264.817373] ar0234 1-0010: supply DVDD not found, using dummy regulator
[ 2264.824165] ar0234 1-0010: supply AVDD not found, using dummy regulator

These regulators are set in the probe function as below:

sensor->io_regulator = devm_regulator_get(dev, "DOVDD");
sensor->io_regulator = devm_regulator_get(dev, "DVDD");
sensor->io_regulator = devm_regulator_get(dev, "AVDD");

(with some error handling in between) the syntax of which is taken directly from the OV2775 driver that is included in the IMX8MP BSP.

Taking DMM to my sensor board, I can indeed see that my supply voltages are not correct, and my clock never makes it past a buffer to the sensor itself, because the buffer's supply voltage is insufficient.

However, I am unfamiliar with the process of setting up these regulators, and I am not sure how to troubleshoot any further at the moment. As I said, this setup was copied directly from the OV2775 driver, so I don't quite understand at the moment why those supplies would not be found.

Again, any advice is much appreciated!

Thanks again,

Cody

0 Kudos
Reply