Sandbird
Posts: 29
Joined: Tue Feb 10, 2015 12:45 pm

[Solved] Waveshare32b V4 LCD black screen on startx

Fri Mar 11, 2016 9:39 pm

I dont understand why i am having such a hard time using my lcd with an old pi1 running the latest noobs, raspbian.....
I've done everything mentioned here: https://github.com/swkim01/waveshare-dtoverlays on how to get this working.
Adding

Code: Select all

fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
to my cmdline.txt actually allows me to see the boot up text scrolling on the screen, but right when the pi is about to get into startx the screen on the LCD goes black.....no arrow no nothing.

Code: Select all

root@raspberrypi:~# dmesg | grep spi
[   13.112103] spi spi0.1: setting up native-CS1 as GPIO 7
[   13.112382] spi spi0.0: setting up native-CS0 as GPIO 8
[   13.168308] ads7846 spi0.1: touchscreen, irq 411
[   13.169415] input: ADS7846 Touchscreen as /devices/platform/soc/20204000.spi/spi_master/spi0/spi0.1/input/input3
[   13.596167] graphics fb1: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB DMA buffer memory, fps=25, spi0.0 at 16 MHz
I also enabled spi via raspi-config.
What am i doing wrong here?
Thanks
Last edited by Sandbird on Sat Mar 12, 2016 10:48 am, edited 1 time in total.

DirkS
Posts: 10453
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Waveshare32b V4 LCD black screen on startx

Sat Mar 12, 2016 12:51 am

You need to configure X to use the correct framebuffer.

Move /usr/share/X11/xorg.conf.d/99-fbturbo.conf out of the way:

Code: Select all

sudo mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf \ ~/
Create new configuration file

Code: Select all

sudo nano /etc/X11/xorg.conf.d/99-fbdev.conf
with thr content

Code: Select all

Section "Device"
  Identifier "myfb"
  Driver "fbdev"
  Option "fbdev" "/dev/fb1"
EndSection
For the touch panel create the file /etc/X11/xorg.conf.d/99-calibration.conf

Code: Select all

sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
containing

Code: Select all

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "219 3835 3984 219"
        Option  "SwapAxes"      "1"
EndSection

Sandbird
Posts: 29
Joined: Tue Feb 10, 2015 12:45 pm

Re: Waveshare32b V4 LCD black screen on startx

Sat Mar 12, 2016 10:17 am

DirkS wrote:You need to configure X to use the correct framebuffer.
oh crap, i thought this was not necessary anymore (using the new method since i dont have to patch the kernel anymore).
If i am not mistaken i remember leaving 99-fbturbo.conf as it is just change fb0 to fb1 ? Or i should just move it out of the way.
I guess if i ever want to hook up my display again, i have to reverse all the above right?

One final question. I've never figured out how to change resolution to the screen, to make the IDX 'fit' nicely in the display. Is that even an option ? Or because the screen is 320 x 240...thats the best it can do ?

Thanks DirkS for taking the time to answer this.

DirkS
Posts: 10453
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Waveshare32b V4 LCD black screen on startx

Sat Mar 12, 2016 10:37 am

Sandbird wrote:If i am not mistaken i remember leaving 99-fbturbo.conf as it is just change fb0 to fb1 ? Or i should just move it out of the way.
The 'driver' entry in the conf file needs to be changed too. Moving it out of the way is easier to use (especially in scripts)
I guess if i ever want to hook up my display again, i have to reverse all the above right?
You don't need to undo all the changes. If you don't care about the console then you could probably get away with just swapping the 99-xxx.conf files.
One final question. I've never figured out how to change resolution to the screen, to make the IDX 'fit' nicely in the display. Is that even an option ? Or because the screen is 320 x 240...thats the best it can do ?
IIRC someone mentioned here on the forum that you could try to change the framebuffer size and it would then rescale, but I have never looked into it (I don't use X on my small screens)

Sandbird
Posts: 29
Joined: Tue Feb 10, 2015 12:45 pm

Re: Waveshare32b V4 LCD black screen on startx

Sat Mar 12, 2016 10:47 am

Awesome, thanks for the info :)

Sandbird
Posts: 29
Joined: Tue Feb 10, 2015 12:45 pm

Re: [Solved] Waveshare32b V4 LCD black screen on startx

Sat Mar 12, 2016 11:08 am

sudo FRAMEBUFFER=/dev/fb1 startx -- -dpi 60

is the key to change resolution :)

DirkS
Posts: 10453
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: [Solved] Waveshare32b V4 LCD black screen on startx

Sat Mar 12, 2016 2:18 pm

Sandbird wrote:sudo FRAMEBUFFER=/dev/fb1 startx -- -dpi 60

is the key to change resolution :)
That will cause problems at some point.
Running startx as root is not a good idea and should not be necessary.

Maybe you're running out of disk space...

Sandbird
Posts: 29
Joined: Tue Feb 10, 2015 12:45 pm

Re: [Solved] Waveshare32b V4 LCD black screen on startx

Sat Mar 12, 2016 2:21 pm

DirkS wrote:
Sandbird wrote:sudo FRAMEBUFFER=/dev/fb1 startx -- -dpi 60

is the key to change resolution :)
That will cause problems at some point.
Running startx as root is not a good idea and should not be necessary.

Maybe you're running out of disk space...
Adafruit had a trick where you add this at your .profile file, but that didnt work for me...so i have to manually execute startx like this.
My df -h:

Code: Select all

root@raspberrypi:~# df -h
df: β/run/user/0/gvfsβ: Transport endpoint is not connected
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.9G  3.4G  278M  93% /
devtmpfs        214M     0  214M   0% /dev
tmpfs           218M     0  218M   0% /dev/shm
tmpfs           218M  4.7M  213M   3% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           218M     0  218M   0% /sys/fs/cgroup
/dev/mmcblk0p6   63M   20M   44M  31% /boot
tmpfs            44M     0   44M   0% /run/user/1000
tmpfs            44M     0   44M   0% /run/user/0
/dev/mmcblk0p9  2.0G  885M 1017M  47% /media/pi/root-rbp1
/dev/mmcblk0p8   79M   20M   59M  26% /media/pi/boot-rbp1
/dev/mmcblk0p5   30M  669K   28M   3% /media/pi/SETTINGS
tmpfs            44M     0   44M   0% /run/user/109
These last 3 lines are from my osmc partition:

Code: Select all

/dev/mmcblk0p9  2.0G  885M 1017M  47% /media/pi/root-rbp1
/dev/mmcblk0p8   79M   20M   59M  26% /media/pi/boot-rbp1
/dev/mmcblk0p5   30M  669K   28M   3% /media/pi/SETTINGS
I'll remove some crap that raspbian has, like games etc.
Edit: Removed wolfram, minecraft, scratch, sonic and then autoremove and freed at least 800mb :)

User avatar
DougieLawson
Posts: 40244
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: [Solved] Waveshare32b V4 LCD black screen on startx

Sun Mar 13, 2016 8:23 am

Code: Select all

/dev/root       3.9G  3.4G  278M  93% /
How big is your SDCard? Is it really a 4GB card? Or is it an 8GB card that hasn't had the filesystem expanded?
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Sandbird
Posts: 29
Joined: Tue Feb 10, 2015 12:45 pm

Re: [Solved] Waveshare32b V4 LCD black screen on startx

Sun Mar 13, 2016 10:27 am

DougieLawson wrote:

Code: Select all

/dev/root       3.9G  3.4G  278M  93% /
How big is your SDCard? Is it really a 4GB card? Or is it an 8GB card that hasn't had the filesystem expanded?
Its an 8GB sd running oscm and raspbian. But since yesterday removed some unnecessary programs to make some space.

Code: Select all

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.9G  2.4G  1.3G  65% /
devtmpfs        214M     0  214M   0% /dev
tmpfs           218M     0  218M   0% /dev/shm
tmpfs           218M  4.6M  213M   3% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           218M     0  218M   0% /sys/fs/cgroup
/dev/mmcblk0p6   63M   20M   44M  31% /boot
tmpfs            44M     0   44M   0% /run/user/1000
/dev/mmcblk0p9  2.0G  916M  986M  49% /media/pi/root-rbp1
/dev/mmcblk0p8   79M   20M   59M  26% /media/pi/boot-rbp1
/dev/mmcblk0p5   30M  669K   28M   3% /media/pi/SETTINGS
tmpfs            44M     0   44M   0% /run/user/0

User avatar
DougieLawson
Posts: 40244
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: [Solved] Waveshare32b V4 LCD black screen on startx

Sun Mar 13, 2016 1:25 pm

Sandbird wrote: Its an 8GB sd running oscm and raspbian. But since yesterday removed some unnecessary programs to make some space.
OK, so you're suffering from the perils of NOOBS. You've lost nearly 1GB just to have that installed then you're restricting the two OSes.

It's always better to have one OS per SDcard by ditching NOOBS.
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Sandbird
Posts: 29
Joined: Tue Feb 10, 2015 12:45 pm

Re: [Solved] Waveshare32b V4 LCD black screen on startx

Sun Mar 13, 2016 1:32 pm

DougieLawson wrote:
Sandbird wrote: Its an 8GB sd running oscm and raspbian. But since yesterday removed some unnecessary programs to make some space.
OK, so you're suffering from the perils of NOOBS. You've lost nearly 1GB just to have that installed then you're restricting the two OSes.
It's always better to have one OS per SDcard by ditching NOOBS.
Yes, unfortunately...But its ok...1.3something GB for osmc is fine..its plenty of space.

Return to “Interfacing (DSI, CSI, I2C, etc.)”