Page 1 of 1

Touchscreen red & blue colors swapped

Posted: Wed May 01, 2019 4:41 pm
by niksnie
Hi, this is a slightly unusual support request, so I don't know if anyone will be able to help me (especially since I'm a little in over my head).

I'm running NixOS with the raspberry pi linux kernel at 4.19.37. (The reason for NixOS is that it allows me to deploy software to raspberry pi's around my workplace and home using a deployment tool called nixops.)

I was very happy to find that the raspberry pi linux kernel seems to have picked up the official raspberry pi touchscreen display automatically. However, the red & blue colors on the screen are swapped on it (a few other problems too, like touch input, but I'm tackling one thing at a time).

Would someone be able to give me any hint on where to look for the issue?

Re: Touchscreen red & blue colors swapped

Posted: Wed May 01, 2019 8:41 pm
by B.Goode
Welcome to the Raspberry Pi forums.


niksnie wrote:
Wed May 01, 2019 4:41 pm
Hi, this is a slightly unusual support request, so I don't know if anyone will be able to help me (especially since I'm a little in over my head).

I'm running NixOS with the raspberry pi linux kernel at 4.19.37. (The reason for NixOS is that it allows me to deploy software to raspberry pi's around my workplace and home using a deployment tool called nixops.)

I was very happy to find that the raspberry pi linux kernel seems to have picked up the official raspberry pi touchscreen display automatically. However, the red & blue colors on the screen are swapped on it (a few other problems too, like touch input, but I'm tackling one thing at a time).

Would someone be able to give me any hint on where to look for the issue?


For the purpose of troubleshooting and diagnosis (not to insist that you adopt an alternative Operating System), perhaps perform an experimental installation of the Raspberry Pi Foundation recommended and supported Raspbian Stretch Operating System. Because at present you don't know if the problem is related to software (NixOS), or hardware (the display.)

If the misbehaviour is still evident with the supported Raspbian Operating System then you may have a faulty display. But if Raspbian can drive the display correctly then it seems you need to explore the support provided by your selection of NixOS?

Re: Touchscreen red & blue colors swapped

Posted: Wed May 01, 2019 9:04 pm
by niksnie
For the purpose of troubleshooting and diagnosis (not to insist that you adopt an alternative Operating System), perhaps perform an experimental installation of the Raspberry Pi Foundation recommended and supported Raspbian Stretch Operating System. Because at present you don't know if the problem is related to software (NixOS), or hardware (the display.)
Thanks B.Goode. Definitely not a hardware problem since I've got more than one of these and I've also run raspbian on them without a hitch.

Re: Touchscreen red & blue colors swapped

Posted: Wed May 01, 2019 9:09 pm
by DougieLawson
niksnie wrote:
Wed May 01, 2019 9:04 pm
For the purpose of troubleshooting and diagnosis (not to insist that you adopt an alternative Operating System), perhaps perform an experimental installation of the Raspberry Pi Foundation recommended and supported Raspbian Stretch Operating System. Because at present you don't know if the problem is related to software (NixOS), or hardware (the display.)
Thanks B.Goode. Definitely not a hardware problem since I've got more than one of these and I've also run raspbian on them without a hitch.
How can you say that without testing Raspbian on the Raspberry that exhibits the failure with NixOS? It could easily be due to a hardware fault (dry solder joint? or broken ribbon cable, or broken display) on that one only.

Re: Touchscreen red & blue colors swapped

Posted: Thu May 02, 2019 9:00 pm
by niksnie
How can you say that without testing Raspbian on the Raspberry that exhibits the failure with NixOS? It could easily be due to a hardware fault (dry solder joint? or broken ribbon cable, or broken display) on that one only.
Sorry, I think there's a slight miscommunication. I'm saying that I have indeed already booted both the raspberry pi's I'm testing from a different SD card loaded with Raspbian (and they worked fine). Both of these also have their own displays. Finally, both exhibit the color swap problem when deployed with an aarch64 build of NixOS and the raspberry pi, linux 4.19 kernel. (I also tried the raspberry pi linux 5.0 kernel earlier).

PS, I forgot to mention, they are RPi 3B+. I was hoping it might be a problem others have seen in the past.
IMG_20190502_164352.jpg
IMG_20190502_164352.jpg (49.1 KiB) Viewed 1090 times

Re: Touchscreen red & blue colors swapped

Posted: Thu May 02, 2019 9:46 pm
by DougieLawson
Your NixOS clearly has a bug in a driver.

Re: Touchscreen red & blue colors swapped

Posted: Fri May 03, 2019 2:44 am
by niksnie
Your NixOS clearly has a bug in a driver.
I'm a little confused by what this means since I'm building the linux source tree directly from the raspberry pi github repo, but I'd appreciate any pointers or diagnostic methods anyone might be willing to share to track down the issue. (Note: I absolutely don't expect any sort of official support, just asking if a good hearted person out there happens to have any pointers.)

Re: Touchscreen red & blue colors swapped

Posted: Fri May 03, 2019 7:12 am
by 6by9
I suspect that your NixOS image is using the vc4-kms-v3d driver, whilst raspbian will use the firmware driver. It's quite possible that the kms driver has an issue on dsi displays as it is not a path that gets a huge amount of testing.
And please note that we don't officially support 64bit kernels at the present time.

Re: Touchscreen red & blue colors swapped

Posted: Mon May 06, 2019 5:01 am
by niksnie
Thank you very much 6by9, I believe I was using the fake kms driver vc4-fkms-v3d which worked on an HDMI screen I was using before. I can imagine that now that I've introduced the dsi display that is probably not that well tested.
Stubbed my toe on some unrelated problems, but I think that's enough of a hint to get me going again.
And please note that we don't officially support 64bit kernels at the present time.

I could cross compile to armv7 instead, just a little bit of work with my current setup, but will look into it if I have to.