niksnie
Posts: 5
Joined: Wed May 01, 2019 3:47 pm

Touchscreen red & blue colors swapped

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?

User avatar
B.Goode
Posts: 7876
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Touchscreen red & blue colors swapped

Wed May 01, 2019 8:41 pm

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?

niksnie
Posts: 5
Joined: Wed May 01, 2019 3:47 pm

Re: Touchscreen red & blue colors swapped

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.

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Touchscreen red & blue colors swapped

Wed May 01, 2019 9:09 pm

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.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

niksnie
Posts: 5
Joined: Wed May 01, 2019 3:47 pm

Re: Touchscreen red & blue colors swapped

Thu May 02, 2019 9:00 pm

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 920 times

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Touchscreen red & blue colors swapped

Thu May 02, 2019 9:46 pm

Your NixOS clearly has a bug in a driver.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

niksnie
Posts: 5
Joined: Wed May 01, 2019 3:47 pm

Re: Touchscreen red & blue colors swapped

Fri May 03, 2019 2:44 am

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.)

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

Re: Touchscreen red & blue colors swapped

Fri May 03, 2019 7:12 am

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.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

niksnie
Posts: 5
Joined: Wed May 01, 2019 3:47 pm

Re: Touchscreen red & blue colors swapped

Mon May 06, 2019 5:01 am

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.

Return to “Official Foundation Display”