You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HQ camera link frequency can cause GPS distruption #6004
From raspberrypi/libcamera#43, the same issue of GPS interference has been noted on the HQ camera as well as the v3 that has already been fixed.
Look at tweaking the PLL settings to move the peak away from GPS on 1575MHz.
Hi, any update on this? I see that it hasn't been taken on yet. Any tips on how to resolve it as I have a whole load of these cameras inside units with GPS and when then camera is on you can kiss goodbye to GPS signal!
I had 30mins spare, so have done the quick patch to add it (based on imx708). #6468
Give it 40mins for CI to run, and you should be able to get the test kernel using sudo rpi-update pulls/6468. Please ensure anything critical is backed up first.
Same as imx708, you can load dtoverlay=imx477,link-frequency=447000000 or dtoverlay=imx477,link-frequency=453000000 to shift the link frequency by those few MHz. 447MHz needs a little more testing before merging, but 453MHz should have no issues.
This is great, I will give it a try with a new kernel.
Question...
I also have a legacy version that I need to support, with kernel 5.4.154. I build from a snapshot so I can apply code changes. Is it sufficient to just edit the line:
#define IMX477_DEFAULT_LINK_FREQ 450000000
Or could that cause problems and I need to apply the other changes to make it configurable etc?
Just changing IMX477_DEFAULT_LINK_FREQ will do nothing other than change the value advertised to userspace. Actually it may stop the driver probing as then the configured link frequency isn't the supposedly supported one.
If you want to do the quick hack, then changing register 0x030f from 0x96 to 0x97 or 0x98 in the table of registers would make the change without telling the rest of the system about it (it's not a critical thing for anything else to know about). Do note that it occurs multiple times.
I've tried it out and with a 200mm unshielded camera cable there is still some interference at 453, 456 and I even tried 459. It's better but still causing some signal loss. How high can we take the link frequency, do you know? Could it go up even higher without causing issues/damage?
You could go up to 500MHz and still be compliant with the CSI2 spec v1.0 as implemented on Pi0-4.
The IMX477 supports link frequencies up to 1.05GHz (2.1Gbit/s), and #6208 was trying to utilise that for Pi5 (supports up to 750MHz / 1.5Gbit/s) and getting higher frame rates at higher resolutions.
The module has been EMC tested with the values in the driver as they were at 450MHz, so any significant changes technically should result in redoing EMC testing.
v4l2-ctl --list-ctrls-menu -d /dev/v4l-subdev0 should give you a dump that includes the link frequency, such as
(oops, I appear to have an extra entry in there - one to fix!)
Alternatively you can use i2ctransfer to manually poke the registers whilst streaming. i2ctransfer -y -f 10 w2@0x1a 0x03 0x0f r1@0x1a should read back the current value, whilst i2ctransfer -y -f 10 w3@0x1a 0x03 0x0f 0x99 would increase it to 459MHz.
Update: sorry ignore the above, the camera wasn't running. However, even though I edited the registers in the kernel source code it is still reading as 0x96
I can confirm it's working in the latest Bookworm, but I've not been able to get it work with the old kernel.
Would this same kernel work with Bullseye or would I need to build a custom kernel for Bullseye?
I need legacy camera support and the original picamera library (otherwise I have to change a LOT of code) so need to get this hack into an older kernel somehow!
Update: On bullseye I was able to pull the new kernel and apply the new link_frequency and it works fine in libcamera - can see 0x97 at 0x030f with i2ctransfer
However, when using legacy camera (raspivid or picamera) the link_frequency is always 0x96 at 0x030f
Does the legacy stack override the registers in the kernel driver??
Activity
ranulphus commentedon Nov 14, 2024
Hi, any update on this? I see that it hasn't been taken on yet. Any tips on how to resolve it as I have a whole load of these cameras inside units with GPS and when then camera is on you can kiss goodbye to GPS signal!
6by9 commentedon Nov 14, 2024
I had 30mins spare, so have done the quick patch to add it (based on imx708).
#6468
Give it 40mins for CI to run, and you should be able to get the test kernel using
sudo rpi-update pulls/6468. Please ensure anything critical is backed up first.Same as imx708, you can load
dtoverlay=imx477,link-frequency=447000000ordtoverlay=imx477,link-frequency=453000000to shift the link frequency by those few MHz. 447MHz needs a little more testing before merging, but 453MHz should have no issues.ranulphus commentedon Nov 15, 2024
This is great, I will give it a try with a new kernel.
Question...
I also have a legacy version that I need to support, with kernel 5.4.154. I build from a snapshot so I can apply code changes. Is it sufficient to just edit the line:
#define IMX477_DEFAULT_LINK_FREQ 450000000
Or could that cause problems and I need to apply the other changes to make it configurable etc?
ranulphus commentedon Nov 18, 2024
Ok that didn't work on the old kernel. Do I need to change some registers as well?
6by9 commentedon Nov 18, 2024
Just changing
IMX477_DEFAULT_LINK_FREQwill do nothing other than change the value advertised to userspace. Actually it may stop the driver probing as then the configured link frequency isn't the supposedly supported one.If you want to do the quick hack, then changing register 0x030f from 0x96 to 0x97 or 0x98 in the table of registers would make the change without telling the rest of the system about it (it's not a critical thing for anything else to know about). Do note that it occurs multiple times.
ranulphus commentedon Nov 21, 2024
I've tried it out and with a 200mm unshielded camera cable there is still some interference at 453, 456 and I even tried 459. It's better but still causing some signal loss. How high can we take the link frequency, do you know? Could it go up even higher without causing issues/damage?
ranulphus commentedon Nov 21, 2024
Also is there some way of double checking that the link frequency change has worked? Something I can call to return the current link frequency?
6by9 commentedon Nov 21, 2024
You could go up to 500MHz and still be compliant with the CSI2 spec v1.0 as implemented on Pi0-4.
The IMX477 supports link frequencies up to 1.05GHz (2.1Gbit/s), and #6208 was trying to utilise that for Pi5 (supports up to 750MHz / 1.5Gbit/s) and getting higher frame rates at higher resolutions.
The module has been EMC tested with the values in the driver as they were at 450MHz, so any significant changes technically should result in redoing EMC testing.
v4l2-ctl --list-ctrls-menu -d /dev/v4l-subdev0should give you a dump that includes the link frequency, such as(oops, I appear to have an extra entry in there - one to fix!)
Alternatively you can use
i2ctransferto manually poke the registers whilst streaming.i2ctransfer -y -f 10 w2@0x1a 0x03 0x0f r1@0x1ashould read back the current value, whilsti2ctransfer -y -f 10 w3@0x1a 0x03 0x0f 0x99would increase it to 459MHz.6by9 commentedon Nov 21, 2024
#6483 to fix the link frequency menu having the rogue entry in it.
ranulphus commentedon Nov 21, 2024
I get:
Cannot open device /dev/v4l-subdev0, exitingand...
and...
6by9 commentedon Nov 21, 2024
Grr, typo.
-f(for force), not -t, and in the second case you've removed the 10.ranulphus commentedon Nov 21, 2024
I only have a
/dev/i2c-11and I get...Thanks for helping with this!
Update: sorry ignore the above, the camera wasn't running. However, even though I edited the registers in the kernel source code it is still reading as 0x96
If I change the register with i2ctransfer will it change the link frequency on-the-fly?
I tried this...
# i2ctransfer -y -f 11 w3@0x1a 0x03 0x0f 0x99Then I got:
Then I stopped the camera and started it again and got:
6by9 commentedon Nov 21, 2024
Yes you can change the registers on the fly.
I don't know why you only have an i2c-11 - something weird on your system if that's a standard Pi4.
ranulphus commentedon Nov 26, 2024
I can confirm it's working in the latest Bookworm, but I've not been able to get it work with the old kernel.
Would this same kernel work with Bullseye or would I need to build a custom kernel for Bullseye?
I need legacy camera support and the original picamera library (otherwise I have to change a LOT of code) so need to get this hack into an older kernel somehow!
Any advice appreciated
ranulphus commentedon Nov 26, 2024
Update: On bullseye I was able to pull the new kernel and apply the new link_frequency and it works fine in libcamera - can see 0x97 at 0x030f with i2ctransfer
However, when using legacy camera (raspivid or picamera) the link_frequency is always 0x96 at 0x030f
Does the legacy stack override the registers in the kernel driver??
236 remaining items
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor
media: i2c: imx477: Support for the Sony IMX477 sensor