<html><head></head><body><div class="ydpbe77268dyahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
<div dir="ltr" data-setdir="false">Thank you, Kieran!</div><div dir="ltr" data-setdir="false">I made the change you suggested. </div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Now, when I run libcamera-hello, I get the following error messages. Please advise how to resolve these errors.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">radiostudio@imx:~ $ libcamera-hello<span class="ydp3c561296Apple-converted-space"> </span></p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.606988987] [1991]<span class="ydp3c561296Apple-converted-space"> </span>INFO Camera camera_manager.cpp:284 libcamera v0.2.0+46-075b54d5</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.628537890] [1997]<span class="ydp3c561296Apple-converted-space"> </span>WARN CameraSensor camera_sensor.cpp:248 'xyz123 10-0036': Recommended V4L2 control 0x009a0922 not supported</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.628620872] [1997]<span class="ydp3c561296Apple-converted-space"> </span>WARN CameraSensor camera_sensor.cpp:315 'xyz123 10-0036': The sensor kernel driver needs to be fixed</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.628650260] [1997]<span class="ydp3c561296Apple-converted-space"> </span>WARN CameraSensor camera_sensor.cpp:317 'xyz123 10-0036': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.629229908] [1997]<span class="ydp3c561296Apple-converted-space"> </span>WARN CameraSensorProperties camera_sensor_properties.cpp:274 No static properties available for 'xyz123'</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.629268186] [1997]<span class="ydp3c561296Apple-converted-space"> </span>WARN CameraSensorProperties camera_sensor_properties.cpp:276 Please consider updating the camera sensor properties database</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.629299316] [1997]<span class="ydp3c561296Apple-converted-space"> </span>WARN CameraSensor camera_sensor.cpp:463 'xyz123 10-0036': Failed to retrieve the camera location</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.629328705] [1997]<span class="ydp3c561296Apple-converted-space"> </span>WARN CameraSensor camera_sensor.cpp:485 'xyz123 10-0036': Rotation control not available, default to 0 degrees</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.651220959] [1997] ERROR IPARPI ipa_base.cpp:124 Could not create camera helper for xyz123</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.651336904] [1997] ERROR RPI pipeline_base.cpp:804 Failed to load a suitable IPA library</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">[0:03:13.651366644] [1997] ERROR RPI vc4.cpp:216 Failed to register camera xyz123 10-0036: -22</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">Made X/EGL preview window</p><p class="ydp3c561296p1" style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; color: rgb(0, 0, 0);">ERROR: *** no cameras available ***</p></div><br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">when I do a dmesg -T | grep -i xyz123, I get the following messages:</div><div dir="ltr" data-setdir="false"><div><div>[Fri Mar 15 21:45:33 2024] xyz123: loading out-of-tree module taints kernel.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_probe has been invoked to probe xyz123.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: allocated memory for xyz123.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_check_hwcfg has been invoked to check xyz123 hardware config.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: number of csi lanes: 2.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_power_on has been invoked to power xyz123 up.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_write_registers has been invoked with number of registers set to: 03</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_write_register has been invoked with address: 0103</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_write_register has been invoked with address: 3205</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_write_register has been invoked with address: 0100</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_write_register has been invoked with address: 3205</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_identify_module has been invoked to identify xyz123.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_read_register has been invoked with address: 0x302A</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_read_register prepared a I2C write message with: addr: 0x36, flags: 0x00, len: 0x02</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_read_register prepared a I2C read message with: addr: 0x36, flags: 0x01, len: 0x01</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: chip id first byte matches: 4 == 4</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_read_register has been invoked with address: 0x302B</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_read_register prepared a I2C write message with: addr: 0x36, flags: 0x00, len: 0x02</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_read_register prepared a I2C read message with: addr: 0x36, flags: 0x01, len: 0x01</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: chip id second byte matches: 28 == 28</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_init_ctrls has been invoked to initialize controls of xyz123.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_init_ctrls succesfully initialized controls</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: default pixel rate of xyz123: 10804320.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: current link frequency of xyz123: 192000000.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: default vblank of xyz123: 8.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: default hblank of xyz123: 8.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: Default width specified in device tree: 720</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: Default height specified in device tree: 720</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has been invoked to set default format of xyz123.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has set code to 12295.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has set colorspace to 8.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has set ycbcr_enc to 1.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has set quantization to 1.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has set xfer_func to 2.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has set width to 720.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has set height to 720.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has set field to 1.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_set_default_format has completed.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_probe has initialized media entity pads for xyz123 to 0 and 2.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_probe has registered the subdevice of xyz123.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_probe has completed probing xyz123.</div><div>[Fri Mar 15 21:45:33 2024] xyz123 10-0036: xyz123_power_off has been invoked to power xyz123 down.</div><div>[Fri Mar 15 21:45:35 2024] xyz123 10-0036: Consider updating driver xyz123 to match on endpoints</div><div>[Fri Mar 15 21:45:38 2024] xyz123 10-0036: xyz123_open has been invoked to open xyz123.</div><div>[Fri Mar 15 21:45:38 2024] xyz123 10-0036: xyz123_get_format_code has been invoked to get format code of xyz123.</div><div>[Fri Mar 15 21:45:41 2024] xyz123 10-0036: xyz123_open has been invoked to open xyz123.</div><div>[Fri Mar 15 21:45:41 2024] xyz123 10-0036: xyz123_get_format_code has been invoked to get format code of xyz123.</div><div>[Fri Mar 15 21:45:41 2024] xyz123 10-0036: xyz123_enum_mbus_code has been invoked.</div><div>[Fri Mar 15 21:45:41 2024] xyz123 10-0036: xyz123_get_format_code has been invoked to get format code of xyz123.</div><div>[Fri Mar 15 21:45:41 2024] xyz123 10-0036: xyz123_enum_mbus_code is exiting.</div><div>[Fri Mar 15 21:45:41 2024] xyz123 10-0036: xyz123_enum_mbus_code has been invoked.</div><div>[Fri Mar 15 21:45:41 2024] xyz123 10-0036: In xyz123_enum_mbus_code, code-> index has reached limit: 1.</div><div>[Fri Mar 15 21:45:41 2024] xyz123 10-0036: xyz123_get_format_code has been invoked to get format code of xyz123.</div><div>[Fri Mar 15 21:45:42 2024] xyz123 10-0036: __xyz123_get_pad_format has been invoked.</div><div>[Fri Mar 15 21:45:42 2024] xyz123 10-0036: format is NOT V4L2_SUBDEV_FORMAT_TRY.</div><div><br></div></div><br></div><div dir="ltr" data-setdir="false"><br></div><div><br></div>
</div><div id="yahoo_quoted_1259068547" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Friday, March 15, 2024 at 06:24:43 PM GMT+5:30, Kieran Bingham <kieran.bingham@ideasonboard.com> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr">Quoting deva seetharam (2024-03-15 12:31:14)<br clear="none">> Thank you once again, Dave!<br clear="none">> I have changed the code to use only the first (and only) entry in codes array as follows. However, as per dmesg, these functions are getting called repeatedly. When I run libcamera-hello or rpicam-hello, it prints one line ([0:41:31.852290414] [10447] INFO Camera camera_manager.cpp:284 libcamera v0.2.0+46-075b54d5] and hangs. I don't know how to proceed. Please advise.<br clear="none">> <br clear="none">> As you guessed, I read the codes drivers of image sensors such as imx219 to write this driver. <br clear="none">> I read books such as the ones by Rubini and Madieu, and many web pages such as Video for Linux 2 API pages, etc. But, I could not get a clear picture of the structure of a V4L2 driver for an image sensor. <br clear="none">> <br clear="none">> Could you please recommend any relevant material? Thank you! <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> static u32 oah0428_get_format_code(struct xyz123 *xyz123, u32 code)<br clear="none">> {<br clear="none">> unsigned int i;<br clear="none">> struct i2c_client *client = v4l2_get_subdevdata(&xyz123->sd);<br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> dev_dbg(&client->dev,<br clear="none">> "%s has been invoked to get format code of xyz123.\n",<br clear="none">> __func__);<br clear="none">> <br clear="none">> return codes[0];<br clear="none">> }<br clear="none">> <br clear="none">> <br clear="none">> static int xyz123_enum_mbus_code(struct v4l2_subdev *sd,<br clear="none">> struct v4l2_subdev_state *sd_state,<br clear="none">> struct v4l2_subdev_mbus_code_enum *code)<br clear="none">> {<br clear="none">> struct xyz123 *xyz123 = to_xyz123(sd);<br clear="none">> struct i2c_client *client = v4l2_get_subdevdata(&xyz123->sd);<br clear="none">> <br clear="none">> <br clear="none">> dev_dbg(&client->dev, "%s has been invoked.\n", __func__);<br clear="none">> mutex_lock(&xyz123->mutex);<br clear="none">> code->code = xyz123_get_format_code(xyz123, codes[0]);<br clear="none">> mutex_unlock(&xyz123->mutex);<br clear="none">> <br clear="none">> return 0;<br clear="none">> }<br clear="none">> <br clear="none"><br clear="none">If you always return success on these functions the enumeration becomes<br clear="none">an infinite loop. You have to check the index and return an error when<br clear="none">you have returned all your codes.<br clear="none">--<br clear="none">Kieran<div class="yqt0879579546" id="yqtfd57186"><br clear="none"><br clear="none"><br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> On Wednesday, March 13, 2024 at 04:46:46 PM GMT+5:30, Dave Stevenson <<a shape="rect" ymailto="mailto:dave.stevenson@raspberrypi.com" href="mailto:dave.stevenson@raspberrypi.com">dave.stevenson@raspberrypi.com</a>> wrote: <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> Hi Deva<br clear="none">> <br clear="none">> On Wed, 13 Mar 2024 at 03:28, deva seetharam <<a shape="rect" ymailto="mailto:tagsense@yahoo.com" href="mailto:tagsense@yahoo.com">tagsense@yahoo.com</a>> wrote:<br clear="none">> ><br clear="none">> > Thank you, Dave and Laurent, for your inputs. I am not the decision maker about open sourcing. But, I talked to the client. They are saying they will open source the driver, if this sensor is released as a product. At this stage, it is just a skunk project to check the feasibility.<br clear="none">> > Here is the driver prototype source code for your review and advice: https://pastebin.com/nGkJsZP0.<br clear="none">> > Looking forward to your advice on fixing the issues. Thank you!<br clear="none">> <br clear="none">> So it is as I hypothesised - you're not advertising the formats correctly.<br clear="none">> <br clear="none">> static const u32 codes[] = {MEDIA_BUS_FMT_SBGGR10_1X10};<br clear="none">> ...<br clear="none">> static int xyz123_enum_mbus_code(struct v4l2_subdev *sd,<br clear="none">> struct v4l2_subdev_state *sd_state,<br clear="none">> struct v4l2_subdev_mbus_code_enum *code)<br clear="none">> {<br clear="none">> ...<br clear="none">> if (code->index >= (ARRAY_SIZE(codes) / 4))<br clear="none">> {<br clear="none">> dev_err(&client->dev, "In %s, code-> index is too large: %d.\n",<br clear="none">> __func__, code->index);<br clear="none">> return -EINVAL;<br clear="none">> }<br clear="none">> <br clear="none">> ARRAY_SIZE(codes) = 1, so ARRAY_SIZE(codes) / 4 = 0 (integer maths).<br clear="none">> <br clear="none">> You've presumably copied from imx219 or similar which has an array in<br clear="none">> codes due to the Bayer order changing due to flips. You've removed<br clear="none">> bits of that, but not here.<br clear="none">> I'd confirm whether your sensor does change Bayer order or not with<br clear="none">> flips, and either reinstate it or totally remove it.<br clear="none">> <br clear="none">> <br clear="none">> Dave<br clear="none">> <br clear="none">> ><br clear="none">> ><br clear="none">> > On Monday, March 11, 2024 at 07:34:04 PM GMT+5:30, Dave Stevenson <<a shape="rect" ymailto="mailto:dave.stevenson@raspberrypi.com" href="mailto:dave.stevenson@raspberrypi.com">dave.stevenson@raspberrypi.com</a>> wrote:<br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> > Hi Deva<br clear="none">> ><br clear="none">> > On Sat, 9 Mar 2024 at 11:00, deva seetharam <<a shape="rect" ymailto="mailto:tagsense@yahoo.com" href="mailto:tagsense@yahoo.com">tagsense@yahoo.com</a>> wrote:<br clear="none">> > ><br clear="none">> > > Greetings!!<br clear="none">> > ><br clear="none">> > > For a new image sensor (due to a restrictive NDA, cannot reveal the manufacturer or the part number), I have to create the device tree source file and the kernel driver. I have compiled and installed the device tree and kernel module. I see the kernel module is getting loaded and the overlay is getting accepted into device tree. However, when I run libcamera, I get the following error:<br clear="none">> > ><br clear="none">> > > [0:00:41.253567807] [1920] ERROR CameraSensor camera_sensor.cpp:127 'xyz123 10-0036': No image format found<br clear="none">> > > [0:00:41.253599677] [1920] ERROR RPI vc4.cpp:216 Failed to register camera xyz123 10-0036: -22<br clear="none">> ><br clear="none">> > Address 0x36 - that'll likely be Omnivision then.<br clear="none">> ><br clear="none">> > > Please suggest how this error can be fixed. Thank you!<br clear="none">> > ><br clear="none">> > > I am also including the dts file, (relevant portions of) lsmod and dmesg outputs.<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > the device tree overlay file is as follows:<br clear="none">> > > <pre><br clear="none">> > > /dts-v1/;<br clear="none">> > > /plugin/;<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > #include <dt-bindings/gpio/gpio.h><br clear="none">> > ><br clear="none">> > ><br clear="none">> > > / {<br clear="none">> > > compatible = "brcm,bcm2835";<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > <a shape="rect" ymailto="mailto:fragment@0" href="mailto:fragment@0">fragment@0</a> {<br clear="none">> > > target = <&i2c0if>;<br clear="none">> > > __overlay__ {<br clear="none">> > > status = "okay";<br clear="none">> > > };<br clear="none">> > > };<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > clk_frag: <a shape="rect" ymailto="mailto:fragment@1" href="mailto:fragment@1">fragment@1</a> {<br clear="none">> > > target = <&cam1_clk>;<br clear="none">> > > __overlay__ {<br clear="none">> > > status = "okay";<br clear="none">> > > clock-frequency = <24000000>;<br clear="none">> > > };<br clear="none">> > > };<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > i2c_frag: <a shape="rect" ymailto="mailto:fragment@100" href="mailto:fragment@100">fragment@100</a> {<br clear="none">> > > target = <&i2c_csi_dsi>;<br clear="none">> > > __overlay__ {<br clear="none">> > > #address-cells = <1>;<br clear="none">> > > #size-cells = <0>;<br clear="none">> > > status = "okay";<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > xyz123: <a shape="rect" ymailto="mailto:xyz123@36" href="mailto:xyz123@36">xyz123@36</a> {<br clear="none">> > > compatible = "abc,xyz123";<br clear="none">> > > reg = <0x36>;<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > clocks = <&cam1_clk>;<br clear="none">> > > clock-names = "xclk";<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > port {<br clear="none">> > > cam_endpoint: endpoint {<br clear="none">> > > clock-lanes = <0>;<br clear="none">> > > data-lanes = <1 2>;<br clear="none">> > > clock-noncontinuous;<br clear="none">> > > link-frequencies = /bits/ 64 <192000000>;<br clear="none">> > > };<br clear="none">> > > };<br clear="none">> > > };<br clear="none">> > > };<br clear="none">> > > };<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > csi_frag: <a shape="rect" ymailto="mailto:fragment@101" href="mailto:fragment@101">fragment@101</a> {<br clear="none">> > > target = <&csi1>;<br clear="none">> > > csi: __overlay__ {<br clear="none">> > > status = "okay";<br clear="none">> > > brcm,media-controller;<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > port {<br clear="none">> > > csi_ep: endpoint {<br clear="none">> > > remote-endpoint = <&cam_endpoint>;<br clear="none">> > > clock-lanes = <0>;<br clear="none">> > > data-lanes = <1 2>;<br clear="none">> > > clock-noncontinuous;<br clear="none">> > > };<br clear="none">> > > };<br clear="none">> > > };<br clear="none">> > > };<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > };<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > &xyz123 {<br clear="none">> > > status = "okay";<br clear="none">> > > default-width = <720>;<br clear="none">> > > default-height = <720>;<br clear="none">> > > };<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > &cam_endpoint {<br clear="none">> > > remote-endpoint = <&csi_ep>;<br clear="none">> > > };<br clear="none">> > ><br clear="none">> > ><br clear="none">> > ><br clear="none">> > > the output of lsmod is as follows:<br clear="none">> > > <pre><br clear="none">> > > xyz123 24576 1<br clear="none">> > > v4l2_fwnode 24576 2 xyz123,bcm2835_unicam<br clear="none">> > > v4l2_async 24576 3 v4l2_fwnode,xyz123,bcm2835_unicam<br clear="none">> > > videodev 278528 10 v4l2_async,bcm2835_codec,xyz123,videobuf2_v4l2,bcm2835_unicam,bcm2835_v4l2,videobuf2_common,rpivid_hevc,v4l2_mem2mem,bcm2835_isp<br clear="none">> > > mc 61440 10 v4l2_async,videodev,bcm2835_codec,xyz123,videobuf2_v4l2,bcm2835_unicam,videobuf2_common,rpivid_hevc,v4l2_mem2mem,bcm2835_isp<br clear="none">> > ><br clear="none">> > > </pre><br clear="none">> > ><br clear="none">> > > the output of dmesg is as follows:<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123: loading out-of-tree module taints kernel.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_probe has been invoked to probe xyz123.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: allocated memory for xyz123.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_check_hwcfg has been invoked to check xyz123 hardware config.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: number of csi lanes: 2.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_power_on has been invoked to power xyz123 up.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_write_registers has been invoked with number of registers set to: 03<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_write_register has been invoked with address: 0103<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_write_register has been invoked with address: 3205<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_write_register has been invoked with address: 0100<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_write_register has been invoked with address: 3205<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_identify_module has been invoked to identify xyz123.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_read_register has been invoked with address: 0x302A<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_read_register prepared a I2C write message with: addr: 0x36, flags: 0x00, len: 0x02<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_read_register prepared a I2C read message with: addr: 0x36, flags: 0x01, len: 0x01<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: chip id first byte matches: 4 == 4<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_read_register has been invoked with address: 0x302B<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_read_register prepared a I2C write message with: addr: 0x36, flags: 0x00, len: 0x02<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_read_register prepared a I2C read message with: addr: 0x36, flags: 0x01, len: 0x01<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: chip id second byte matches: 28 == 28<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_init_ctrls has been invoked to initialize controls of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_init_ctrls succesfully initialized controls<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: default pixel rate of xyz123: 10804320.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: current link frequency of xyz123: 192000000.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: default vblank of xyz123: 8.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: default hblank of xyz123: 8.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: Default width specified in device tree: 720<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: Default height specified in device tree: 720<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has been invoked to set default format of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has set code to 12295.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has set colorspace to 8.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has set ycbcr_enc to 1.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has set quantization to 1.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has set xfer_func to 2.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has set width to 720.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has set height to 720.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has set field to 1.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_set_default_format has completed.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_probe has initialized media entity pads for xyz123 to 0 and 2.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_probe has registered the subdevice of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_probe has completed probing xyz123.<br clear="none">> > > [Sat Mar 9 15:58:15 2024] xyz123 10-0036: xyz123_power_off has been invoked to power xyz123 down.<br clear="none">> > > [Sat Mar 9 15:58:17 2024] xyz123 10-0036: Consider updating driver xyz123 to match on endpoints<br clear="none">> > > [Sat Mar 9 15:58:19 2024] xyz123 10-0036: xyz123_open has been invoked to open xyz123.<br clear="none">> > > [Sat Mar 9 15:58:19 2024] xyz123 10-0036: xyz123_get_format_code has been invoked to get format code of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:19 2024] xyz123 10-0036: h_flip: 0, v_flip: 0, code_index: 0 and 12295 of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:22 2024] xyz123 10-0036: xyz123_open has been invoked to open xyz123.<br clear="none">> > > [Sat Mar 9 15:58:22 2024] xyz123 10-0036: xyz123_get_format_code has been invoked to get format code of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:22 2024] xyz123 10-0036: h_flip: 0, v_flip: 0, code_index: 0 and 12295 of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:22 2024] xyz123 10-0036: xyz123_enum_mbus_code has been invoked.<br clear="none">> > > [Sat Mar 9 15:58:22 2024] xyz123 10-0036: In xyz123_enum_mbus_code, code-> index has reached limit: 0.<br clear="none">> ><br clear="none">> > That looks like the likely issue if your limit is 0, so you're not<br clear="none">> > returning the supported formats via enum_mbus_code.<br clear="none">> ><br clear="none">> > Confirm what "v4l2-ctl -d /dev/v4l-subdev0 --list-subdev-mbus-codes<br clear="none">> > 0" returns. It should be along the lines of:<br clear="none">> ><br clear="none">> > pi@raspberrypi:~ $ v4l2-ctl -d /dev/v4l-subdev0 --list-subdev-mbus-codes 0<br clear="none">> > ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0)<br clear="none">> > 0x3007: MEDIA_BUS_FMT_SBGGR10_1X10<br clear="none">> ><br clear="none">> > Based on your code of 12295 (0x3007 aka MEDIA_BUS_FMT_SBGGR10_1X10)<br clear="none">> > from set_default_format, that should be returned for index 0, and<br clear="none">> > -EINVAL otherwise.<br clear="none">> ><br clear="none">> > As Laurent says, anything more will need reviewing of the driver source.<br clear="none">> ><br clear="none">> > Dave<br clear="none">> ><br clear="none">> ><br clear="none">> > > [Sat Mar 9 15:58:24 2024] xyz123 10-0036: xyz123_enum_mbus_code has been invoked.<br clear="none">> > > [Sat Mar 9 15:58:24 2024] xyz123 10-0036: In xyz123_enum_mbus_code, code-> index has reached limit: 0.<br clear="none">> > > [Sat Mar 9 15:58:24 2024] xyz123 10-0036: xyz123_enum_mbus_code has been invoked.<br clear="none">> > > [Sat Mar 9 15:58:24 2024] xyz123 10-0036: In xyz123_enum_mbus_code, code-> index has reached limit: 0.<br clear="none">> > > [Sat Mar 9 15:58:32 2024] xyz123 10-0036: xyz123_open has been invoked to open xyz123.<br clear="none">> > > [Sat Mar 9 15:58:32 2024] xyz123 10-0036: xyz123_get_format_code has been invoked to get format code of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:32 2024] xyz123 10-0036: h_flip: 0, v_flip: 0, code_index: 0 and 12295 of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:32 2024] xyz123 10-0036: xyz123_enum_mbus_code has been invoked.<br clear="none">> > > [Sat Mar 9 15:58:32 2024] xyz123 10-0036: In xyz123_enum_mbus_code, code-> index has reached limit: 0.<br clear="none">> > > [Sat Mar 9 15:58:33 2024] xyz123 10-0036: xyz123_enum_mbus_code has been invoked.<br clear="none">> > > [Sat Mar 9 15:58:33 2024] xyz123 10-0036: In xyz123_enum_mbus_code, code-> index has reached limit: 0.<br clear="none">> > > [Sat Mar 9 15:58:33 2024] xyz123 10-0036: xyz123_enum_mbus_code has been invoked.<br clear="none">> > > [Sat Mar 9 15:58:33 2024] xyz123 10-0036: In xyz123_enum_mbus_code, code-> index has reached limit: 0.<br clear="none">> > > [Sat Mar 9 15:58:51 2024] xyz123 10-0036: xyz123_open has been invoked to open xyz123.<br clear="none">> > > [Sat Mar 9 15:58:51 2024] xyz123 10-0036: xyz123_get_format_code has been invoked to get format code of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:51 2024] xyz123 10-0036: h_flip: 0, v_flip: 0, code_index: 0 and 12295 of xyz123.<br clear="none">> > > [Sat Mar 9 15:58:51 2024] xyz123 10-0036: xyz123_enum_mbus_code has been invoked.<br clear="none">> > > [Sat Mar 9 15:58:51 2024] xyz123 10-0036: In xyz123_enum_mbus_code, code-> index has reached limit: 0.<br clear="none">> > ><br clear="none">> > ><br clear="none">> > ><br clear="none"></div></div></div>
</div>
</div></body></html>