BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Noise Issues with DPI

Tue Oct 03, 2023 6:15 am

Hi,
Im running a 15.6 inch lcd with 18BIT DPI to LVDS hat. There is some very faint noise in the display.

The issue is sort of similar to the issue discussed in this topic
viewtopic.php?t=244266

Im using raspberry pi Zero W and Zero 2W and the issue occurs in both the models.

When viewed directly there is no issue with the display but when looking closely we can notice the faint noise like grains
on the image. It is more prominently visible when viewed at an angle like 45 degrees etc.

Can observice the sparkling type noise in the display.

https://youtu.be/rE76U6_SSPI

https://youtu.be/3J9LcFsr2XE

https://youtu.be/gccnN1YIeaU



Here are the images showing normal direct view


Image

Image

Configuration details:

Code: Select all

dtoverlay = dpi18cpadhi
framebuffer_width=1366
framebuffer_height=768
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=458790
dpi_timings=1366 1 32 96 128 768 1 3 10 8 0 0 0 60 2 62945280 1 

I also tried

Code: Select all

gpio=0-9=a2
gpio=12-17=a2
gpio=20-25=a2

To isolate design issue I also tried with 24bit dpi - lvds model, but still the noise issue persists.

Any help regarding this issue is appreciated. Thanks

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Tue Oct 03, 2023 6:33 am

Once you've changed to KMS driver I might be willing to answer.

Legacy and FKMS are deprecated!

Are you sure your noise is not related to noise from the DPI interface? How do you connect your LVDS transmitter to the Pi?
Your third video also shows incorrect color mapping.

Enable KMS, make use of https://github.com/raspberrypi/linux/bl ... verlay.dts , https://github.com/raspberrypi/linux/bl ... ADME#L4601 tells you how and then report back.

Note: Pi4 does not support your displays resolution. If you've wired your transmitter for MEDIA_BUS_FMT_RGB666_1X18 or MEDIA_BUS_FMT_BGR666_1X18 you will not be able to use your board on Pi5 because of viewtopic.php?p=2140758#p2140649 (sure, will basically work but only 4-bit per color).

BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Re: Noise Issues with DPI

Tue Oct 03, 2023 8:52 am

aBUGSworstnightmare wrote:
Tue Oct 03, 2023 6:33 am
Once you've changed to KMS driver I might be willing to answer.

Legacy and FKMS are deprecated!

Are you sure your noise is not related to noise from the DPI interface? How do you connect your LVDS transmitter to the Pi?
Your third video also shows incorrect color mapping.

Enable KMS, make use of https://github.com/raspberrypi/linux/bl ... verlay.dts , https://github.com/raspberrypi/linux/bl ... ADME#L4601 tells you how and then report back.

Note: Pi4 does not support your displays resolution. If you've wired your transmitter for MEDIA_BUS_FMT_RGB666_1X18 or MEDIA_BUS_FMT_BGR666_1X18 you will not be able to use your board on Pi5 because of viewtopic.php?p=2140758#p2140649 (sure, will basically work but only 4-bit per color).
Bugs,
Thanks for the valuable input.

I switched to KMS , here is the config Im using now.

Code: Select all

dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dpi-generic
dtparam=hactive=1366,hfp=32,hsync=96,hbp=128
dtparam=vactive=768,vfp=3,vsync=10,vbp=8
dtparam=clock-frequency=62945280
dtparam=bgr666-padhi
Im still getting the same noise issue.
https://youtu.be/rlNIeXagNzg


Also there is a wave like noise moving across the screen while using this current kms setup
its hard to capture it with phone camera, I had to tilt the display to capture them so the colors wont look correct as its a tn display.
https://youtu.be/2LnqDBxWA0U

The 3rd video looks like wrong color mapping because Its from a TN display. When viewing directly perpendicular the color looks correct.

The 2nd picture shows the same.

Using this KMS setup Im not getting the Raspberry logo on boot , or the Boot messages . Rpi goes directly into the desktop.

Thanks for the PI5 headsup, I hope the DPI24 modes work well, and hopefully PI zero upto pi 4 continues to support DPI18 modes.

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Tue Oct 03, 2023 8:55 am

which LVDS transmitter do you use? how it your HW connected?
In case of an SN75LVDS83BDGGR make sure you've also tested with triggering on the other edge (CLKSEL input; used to select falling or rising edge trigger).

Which display to you use? Want to check your timing.

BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Re: Noise Issues with DPI

Tue Oct 03, 2023 12:17 pm

aBUGSworstnightmare wrote:
Tue Oct 03, 2023 8:55 am
which LVDS transmitter do you use? how it your HW connected?
In case of an SN75LVDS83BDGGR make sure you've also tested with triggering on the other edge (CLKSEL input; used to select falling or rising edge trigger).

Which display to you use? Want to check your timing.

You guessed it right, Im using SN75LVDS83B, Im using it in the falling edge mode
BGR 666 format

Image

Image

Im using N156BGE-L41 LCD panel.

Im getting the same problem in other lcds as well.

im using 40 pin lvds fpc cable


on a side note, I see the new kms dpi overlay offers dtparm for pwm gpio pins, can we use this to adjust the brightness from gui applets?

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Tue Oct 03, 2023 2:03 pm

What else is connected to GPIO5_R3? Looks strange from your schematic.

Change the trigger level to see it it makes a difference.

Make use of the typical timing as listed in the data sheet.

Yes, you can use a PWM for backlight control (or a GPIO for simple on/off of the backlight).

BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Re: Noise Issues with DPI

Wed Oct 04, 2023 12:57 pm

aBUGSworstnightmare wrote:
Tue Oct 03, 2023 2:03 pm
What else is connected to GPIO5_R3? Looks strange from your schematic.

Change the trigger level to see it it makes a difference.

Make use of the typical timing as listed in the data sheet.

Yes, you can use a PWM for backlight control (or a GPIO for simple on/off of the backlight).
Bugs,
thats just the kicad mouse curose. nothing else is connected to the GPIO5_R3

Could you throw some more light on what is the trigger level and how to adjust it?

I will update the timing from the datasheet and update you.

Regarding the pwm, can this be adjusted with GUI applets or through terminal commands? I m searching for such solution but couldnt find any.

User avatar
rpiMike
Posts: 2706
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Noise Issues with DPI

Wed Oct 04, 2023 1:42 pm

I had a problem with an official Pi 7 inch display, interference appeared to come from a Waveshare 4G Hat.

Wrapped the ribbon cable in aluminium foil tape - problem solved.

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Wed Oct 04, 2023 2:21 pm

BalajiNarasimhan wrote: ..
Could you throw some more light on what is the trigger level and how to adjust it?

I will update the timing from the datasheet and update you.

Regarding the pwm, can this be adjusted with GUI applets or through terminal commands? I m searching for such solution but couldnt find any.
SN75LVDS83B will tell you the details on trigger level! Either pulled high or low, easy to test.

I'm using CLI, there might be some GUI as well but never cared.

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Wed Oct 04, 2023 2:24 pm

rpiMike wrote:
Wed Oct 04, 2023 1:42 pm
I had a problem with an official Pi 7 inch display, interference appeared to come from a Waveshare 4G Hat.

Wrapped the ribbon cable in aluminium foil tape - problem solved.
asked two times already to shiw your setup, no answer yet.
So signal interference from DPI is the reason why clever people invented differential signaling fro displays...
Your LVDS cable can be an issue as well. Nobody else than you knows your pin assignment (clock especially).

BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Re: Noise Issues with DPI

Wed Oct 04, 2023 3:40 pm

aBUGSworstnightmare wrote:
Wed Oct 04, 2023 2:21 pm
BalajiNarasimhan wrote: ..
Could you throw some more light on what is the trigger level and how to adjust it?

I will update the timing from the datasheet and update you.

Regarding the pwm, can this be adjusted with GUI applets or through terminal commands? I m searching for such solution but couldnt find any.
SN75LVDS83B will tell you the details on trigger level! Either pulled high or low, easy to test.

I'm using CLI, there might be some GUI as well but never cared.
Hi, i fixed the issue by changing the clock trigger to rising edge.

So the issue is solved.

New thing is im trying to use pwm in dtparameters but its not working

Code: Select all

dtparam=backlight-pwm=1,backlight-pwm-chan=1,backlight-pwm-gpio=18

BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Re: Noise Issues with DPI

Wed Oct 04, 2023 4:07 pm

rpiMike wrote:
Wed Oct 04, 2023 1:42 pm
I had a problem with an official Pi 7 inch display, interference appeared to come from a Waveshare 4G Hat.

Wrapped the ribbon cable in aluminium foil tape - problem solved.
I solved the problem by changing the clock trigger on the lvds hat.

Wrapping the aluminium tape on the cable is a good idea. I will try it

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Wed Oct 04, 2023 5:16 pm

BalajiNarasimhan wrote: ....

New thing is im trying to use pwm in dtparameters but its not working

Code: Select all

dtparam=backlight-pwm=1,backlight-pwm-chan=1,backlight-pwm-gpio=18
you've posted your schematic, so check what GPIO18 is in your design - not a HW PWM output for sure
Last edited by aBUGSworstnightmare on Thu Oct 05, 2023 5:26 am, edited 2 times in total.

BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Re: Noise Issues with DPI

Thu Oct 05, 2023 2:56 am

aBUGSworstnightmare wrote:
Wed Oct 04, 2023 5:16 pm
BalajiNarasimhan wrote: ....

New thing is im trying to use pwm in dtparameters but its not working

Code: Select all

dtparam=backlight-pwm=1,backlight-pwm-chan=1,backlight-pwm-gpio=18
you've posted your schematic, so check what GPIO18 is in your design - not a HW PWM output for sure

So think about what you're doing and why things may not work as expected.
As far i checked GPIO 18 is listed as hardware pwm pin along with GPIO 12,13 and 19.

I am able to change the brightness with this command

Code: Select all

sudo pigpiod
pigs hp 20000 1000000 //100% brightness 
pigs hp 20000 100000  // 10% brightness
As per my design GPIO 18 is not connected with anything else other than the PWM pin of the lcd

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Thu Oct 05, 2023 5:25 am

BalajiNarasimhan wrote:
Thu Oct 05, 2023 2:56 am
.

As far i checked GPIO 18 is listed as hardware pwm pin along with GPIO 12,13 and 19.

I am able to change the brightness with this command.


As per my design GPIO 18 is not connected with anything else other than the PWM pin of the lcd
sorry, misread your schematic; sure, pin12 in GPIO18.

O.k. So you're able to change brightness.
Backlight control is usually in (for a backlight device which name is 'backlight_pwm')

Code: Select all

/sys/class/backlight/backlight_pwm/brightness

BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Re: Noise Issues with DPI

Thu Oct 05, 2023 6:43 am

aBUGSworstnightmare wrote:
Thu Oct 05, 2023 5:25 am
BalajiNarasimhan wrote:
Thu Oct 05, 2023 2:56 am
.

As far i checked GPIO 18 is listed as hardware pwm pin along with GPIO 12,13 and 19.

I am able to change the brightness with this command.


As per my design GPIO 18 is not connected with anything else other than the PWM pin of the lcd
sorry, misread your schematic; sure, pin12 in GPIO18.

O.k. So you're able to change brightness.
Backlight control is usually in (for a backlight device which name is 'backlight_pwm')

Code: Select all

/sys/class/backlight/backlight_pwm/brightness
I am able to control the backlight pwm now

Im using

Code: Select all

dtparam=backlight-pwm=1,backlight-pwm-chan=0,backlight-pwm-gpio=18
and able to set brightness with this command

Code: Select all

echo 1  > /sys/class/backlight/backlight_pwm/brightness  // lowest setting 

echo 15  > /sys/class/backlight/backlight_pwm/brightness // highest setting


But now im encountering a new problem with the pwm frequency.

Earlier i used to use pigpiod commands to run pwm on gpio 18

when i used software pwm , i used to hear a ringing noise from the 5v-12v boost converter for any brightness below 95%

Code: Select all

sudo pigpiod
pigs p 18 200       // range 1-255, 1 lowest, 255 highest
then when i used hardware pwm on gpio 18 , the noise issue was gone.

Code: Select all

sudo pigpiod 
pigs hp 18 1000  50000    // 1000 hz with 1hz minimum and 40000hz maximum


//duty cycle at 50000 , 100000 lowest - 1000000 highest 
so now when i use the pwm backlight dtparameter im getting the same ringing noise as when i used software pwm.

How to change the pwm frequency ?

I tried

Code: Select all

dtparam=backlight-pwm-func=clock=10 // 10 hertz bassically the led backlight must blink
But no changes was noticed.

How to change the pwm brightness in the dpi generic overlay?

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Thu Oct 05, 2023 7:05 am

As there is no override for PWM frequency in https://github.com/raspberrypi/linux/bl ... s-dpi.dtsi
You will either have to get that changed or simply have yoir custom overlay (which you should have anyhow as you're on a custom CM4 baseboard).

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 15308
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Noise Issues with DPI

Thu Oct 05, 2023 11:49 am

aBUGSworstnightmare wrote:
Thu Oct 05, 2023 7:05 am
As there is no override for PWM frequency in https://github.com/raspberrypi/linux/bl ... s-dpi.dtsi
PRs welcome if there are useful changes that can be made. Please remember to update the README file too.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Re: Noise Issues with DPI

Thu Oct 05, 2023 1:06 pm

6by9 wrote:
Thu Oct 05, 2023 11:49 am
aBUGSworstnightmare wrote:
Thu Oct 05, 2023 7:05 am
As there is no override for PWM frequency in https://github.com/raspberrypi/linux/bl ... s-dpi.dtsi
PRs welcome if there are useful changes that can be made. Please remember to update the README file too.
6by9,
Im new to this. Got no idea where to start, But Im interested to contribute to bring this pwm frequency override fuction to the overlay. Please give me some pointers about how to do this.

Also it will be amazing if we can bring a configurable backlight control applet for raspbian.

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Fri Oct 06, 2023 10:20 am

BalajiNarasimhan wrote:
Thu Oct 05, 2023 1:06 pm
6by9 wrote:
Thu Oct 05, 2023 11:49 am
aBUGSworstnightmare wrote:
Thu Oct 05, 2023 7:05 am
As there is no override for PWM frequency in https://github.com/raspberrypi/linux/bl ... s-dpi.dtsi
PRs welcome if there are useful changes that can be made. Please remember to update the README file too.
Im new to this. Got no idea where to start, But Im interested to contribute to bring this pwm frequency override fuction to the overlay. Please give me some pointers about how to do this.

Also it will be amazing if we can bring a configurable backlight control applet for raspbian.
look at the device tree sources then you should see how this works. You'll only have to add the PWM frequency as the other paramters are there already.
Then make a pull request on git to get the overlay changed that way.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 15308
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Noise Issues with DPI

Fri Oct 06, 2023 10:50 am

You're looking to make a change along similar lines to https://github.com/raspberrypi/linux/pu ... 87ccce7873

You need to add an override to the overrides section of vc4-kms-dpi.dtsi, which will be along the lines of

Code: Select all

backlight-pwm-freq = <&backlight_pwm>, "pwms:8"
(The PWM frequency is the third 32bit value in the pwms entry, so is at an offset of 8 bytes).

Add details of the override to README for the overlays that include vc4-kms-dpi.dtsi (vc4-kms-dpi-generic-overlay.dts, vc4-kms-dpi-panel-overlay.dts, and vc4-kms-kippah-7inch-overlay.dts)

You'll need to learn a little about git to be able to make the commit.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

BalajiNarasimhan
Posts: 45
Joined: Sun Sep 01, 2019 7:20 am

Re: Noise Issues with DPI

Sat Oct 07, 2023 3:49 am

6by9 wrote:
Fri Oct 06, 2023 10:50 am
You're looking to make a change along similar lines to https://github.com/raspberrypi/linux/pu ... 87ccce7873

You need to add an override to the overrides section of vc4-kms-dpi.dtsi, which will be along the lines of

Code: Select all

backlight-pwm-freq = <&backlight_pwm>, "pwms:8"
(The PWM frequency is the third 32bit value in the pwms entry, so is at an offset of 8 bytes).

Add details of the override to README for the overlays that include vc4-kms-dpi.dtsi (vc4-kms-dpi-generic-overlay.dts, vc4-kms-dpi-panel-overlay.dts, and vc4-kms-kippah-7inch-overlay.dts)

You'll need to learn a little about git to be able to make the commit.
6by9,
I looked into /boot/overlays section and couldnt find vc4-kms-dpi.dtbo

I could only find vc4-kms-dpi-generic, which is also the dtoverlay im using as per the manual https://pip.raspberrypi.com/categories/ ... isplay.pdf

So how do i proceed at this point ?

It will be helpful if you explain what is the function of "pwms:8"

Code: Select all

backlight-pwm-freq = <&backlight_pwm>, "pwms:8"

aBUGSworstnightmare
Posts: 8411
Joined: Tue Jun 30, 2015 1:35 pm

Re: Noise Issues with DPI

Sun Oct 08, 2023 10:30 am

BalajiNarasimhan wrote:
Sat Oct 07, 2023 3:49 am
6by9 wrote:
Fri Oct 06, 2023 10:50 am
You're looking to make a change along similar lines to https://github.com/raspberrypi/linux/pu ... 87ccce7873

You need to add an override to the overrides section of vc4-kms-dpi.dtsi, which will be along the lines of

Code: Select all

backlight-pwm-freq = <&backlight_pwm>, "pwms:8"
(The PWM frequency is the third 32bit value in the pwms entry, so is at an offset of 8 bytes).

Add details of the override to README for the overlays that include vc4-kms-dpi.dtsi (vc4-kms-dpi-generic-overlay.dts, vc4-kms-dpi-panel-overlay.dts, and vc4-kms-kippah-7inch-overlay.dts)

You'll need to learn a little about git to be able to make the commit.
6by9,
I looked into /boot/overlays section and couldnt find vc4-kms-dpi.dtbo

I could only find vc4-kms-dpi-generic, which is also the dtoverlay im using as per the manual https://pip.raspberrypi.com/categories/ ... isplay.pdf

So how do i proceed at this point ?

It will be helpful if you explain what is the function of "pwms:8"

Code: Select all

backlight-pwm-freq = <&backlight_pwm>, "pwms:8"
a link was provided here viewtopic.php?p=2142114#p2141456

Return to “Advanced users”