pygame displaying on /dev/fb0

I have a ili9341 2.4" TFT display wired to SP1 on my BeagleBone Black and it’s working fine when I run fbi to display images, or mplayer to play movies.

I’m unable to get pygame to display on it. I’m trying to get my[1] to work and all I get is:

pygame 1.9.4.post1
Hello from the pygame community.
Driver: fbcon failed.
Driver: directfb failed.
Driver: svgalib failed.
Traceback (most recent call last):
File “./”, line 142, in
clock = pyclock()
File “./”, line 38, in init
raise Exception(‘No suitable video driver found!’)
Exception: No suitable video driver found!

/opt/scripts/tools/ is here[2]. There are no messages in dmesg.

This worked a couple of years ago. Any ideas how to get this pup running again?




dogtag:[ Debian Buster IoT Image 2020-08-31]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gc9b3922522]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
/boot/uEnv.txt Settings:
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
groups:[debian : debian adm tty kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input bluetooth netdev i2c gpio admin spi iio docker tisdk weston-launch xenomai cloud9ide pwm eqep remoteproc]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 67.629755] remoteproc remoteproc0: wkup_m3 is available
[ 67.697686] remoteproc remoteproc0: powering up wkup_m3
[ 67.697720] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 67.697999] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 69.600373] remoteproc remoteproc1: is available
[ 69.602641] remoteproc remoteproc2: is available
dmesg | grep pru
[ 69.600373] remoteproc remoteproc1: is available
[ 69.600538] pru-rproc PRU rproc node pru@4a334000 probed successfully
[ 69.602641] remoteproc remoteproc2: is available
[ 69.602818] pru-rproc PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[ 0.925809] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 0.939434] gpio-of-helper ocp:cape-universal: ready
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I'd expect it to use fbcon..

But why didn't it pick it up...


Yup, I think before it would grap fbcon, but not now.


Are you running it as sudo?


Yes, I’ve tried it with and without sudo. Same results.


Have you checked the output of the following command?

“**fbset -i -fb /dev/**fb0

Have you tried to force the video driver to fbcon as an environment variable such as:

I suppose you could try to force it in your pygame code as such:
os.putenv(‘SDL_VIDEODRIVER’, ‘fbcon’)



Was it with v4.14.x before? i wonder if the new tinydrm driver in
v4.19.x is causing a fun issue?


I tried the 4.14 and 5.6 kernels, but no luck.


Have you tried running it as root? Not ‘sudo’ but su to root and try it there. It could still be a permission issue.



Just a thought, is your user part of the ‘video’ group? I would suspect it is since you were able to run the fbi stuff but it wouldn’t hurt to check.



su gives the same results.

Good idea, but I’m in group video.

If you run 'lsmod" does the fbcon module show in the output?

If not, try to load it manually:

modprobe fbcon

Does this show an error?


bone$ lsmod
Module Size Used by
fb_ili9341 16384 3
fbtft_device 49152 0
fbtft 45056 2 fbtft_device,fb_ili9341
pru_rproc 28672 0
irq_pruss_intc 20480 1 pru_rproc
pruss 16384 1 pru_rproc
pm33xx 16384 0
wkup_m3_ipc 16384 1 pm33xx
wkup_m3_rproc 16384 1
remoteproc 57344 3 pru_rproc,wkup_m3_rproc,wkup_m3_ipc
virtio 16384 1 remoteproc
virtio_ring 28672 1 remoteproc
pruss_soc_bus 16384 0
usb_f_acm 16384 2
u_serial 20480 3 usb_f_acm
usb_f_ncm 28672 2
uio_pdrv_genirq 16384 0
usb_f_mass_storage 53248 2
uio 20480 1 uio_pdrv_genirq
usb_f_rndis 32768 4
u_ether 20480 2 usb_f_ncm,usb_f_rndis
libcomposite 65536 18 usb_f_acm,usb_f_ncm,usb_f_mass_storage,usb_f_rndis
spidev 20480 0

bone$ sudo modprobe fbcon
sudo: unable to resolve host ece434: No address associated with hostname
modprobe: FATAL: Module fbcon not found in directory /lib/modules/4.19.94-ti-r50

Are you sure there is a fbcon module?

... seems to imply it may not have been built for the standard release BBB

There is a fbcon module as is referenced in the pygame script you listed from Adafruit. I would suspect that none of the drivers listed in the script (‘fbcon’, ‘directfb’, ‘svgalib’) would be loadable on your system. From what I have gathered, fbcon is enabled by enabling the Framebuffer console feature in the kernel as in the .config. I’m not 100% sure how to do this with the BB kernel.

When my BBBlue was still alive (R.I.P.), I did connect a ili9341 display to it and had to run the following to get a QT app to run on the screen:

<qt_program> -platform linuxfb:fb=/dev/fb0

This is the example I followed which was posted by Jason.

Perhaps something similar would work for the BB Black and pygame.



It's enabled:

│ ┌───────────────────────────────────────────────────────────────────────┐ │
  │ │ [*] Framebuffer Console support
     │ │
  │ │ -*- Map the console to the primary display device
     │ │
  │ │ [*] Framebuffer Console Rotation
     │ │
  │ │ [ ] Framebuffer Console Deferred Takeover │


In my config, BBAI running 4.14 kernel, I found two instances of fbcon:
$ sudo find / -name fbcon


The framebuffer console seems to be attached to the console layer.

$ cat /sys/class/vtconsole/vtcon1/bind
$ cat /sys/class/vtconsole/vtcon0/bind

Info on fbcon:

Not sure if this helps at all.



Well… su does give different results than sudo. I tried su again and it works!

So, how can I set permissions so I don’t have to su or sudo?


p.s. Thanks for all the suggestions.

I now have it working with sudo. I just added

I needed to set SDL_NOMOUSE to 1.