luma.oled icon indicating copy to clipboard operation
luma.oled copied to clipboard

SSD1322: Python 3.7 to 3.9-3.11 upgrade fail

Open majuss opened this issue 5 years ago • 17 comments

Hi guys, I'am in the process of upgrading my project from Python 3.7 to 3.9 but the Luma.oled library is spazzing out.. In the attached picture you see a scrolling text. With 3.7 everything works fine but with Python 3.9 the scrolling text is completely broken. Minimal static examples all work.

RPI 3B+
5.4.79-v7+
Version: luma.oled 3.8.1 (luma.core 2.2.0)
Python3.9.1 completely fresh venv

Package                          Version
-------------------------------- ---------
Adafruit-Blinka                  5.9.1
adafruit-circuitpython-bme280    2.5.1
adafruit-circuitpython-bme680    3.3.0
adafruit-circuitpython-busdevice 5.0.1
Adafruit-GPIO                    1.0.3
Adafruit-PlatformDetect          2.23.0
Adafruit-PureIO                  1.1.8
cbor2                            5.2.0
certifi                          2020.12.5
chardet                          3.0.4
Cython                           0.29.21
dbus-python                      1.2.16
Deprecated                       1.2.10
idna                             2.10
luma.core                        2.2.0
luma.oled                        3.8.1
mock                             4.0.3
pi-ina219                        1.3.0
pi-rc522                         2.2.1
Pillow                           8.0.1
pip                              20.3.2
pycairo                          1.20.0
pyftdi                           0.52.0
PyGObject                        3.38.0
pyserial                         3.5
python-lirc                      1.2.3
python-mpv                       0.5.2
pyusb                            1.1.0
requests                         2.25.0
rpi-ws281x                       4.2.5
RPi.GPIO                         0.7.0
setuptools                       49.2.1
smbus2                           0.4.0
spidev                           3.5
sysv-ipc                         1.0.1
urllib3                          1.26.2
wheel                            0.36.2
wrapt                            1.12.1
xmltodict                        0.12.0

Expected behaviour

Scrolling text without artifacts. Code can be found here: https://github.com/majuss/wladio/blob/master/radio/display.py

Actual behaviour

Scrolling text with haevy glitches.

The runner example is also broken, if I don't stretch it across the whole screen. index

index

I will update this issue with my findings.

majuss avatar Dec 15 '20 15:12 majuss

can you doublecheck if the installed package versions for 3.7 vs 3.9 are the same?

thijstriemstra avatar Dec 15 '20 15:12 thijstriemstra

luma.core                        2.2.0
luma.oled                        3.8.1
Pillow                           8.0.1

Just tested it with the same versions in Python3.7. No problems there.

majuss avatar Dec 15 '20 15:12 majuss

Hi @majuss , which oled driver is it? I experienced some odd glitches recently with pillow > 7.1.2 & python 3.8 when using the ssd1309 driver. Could you try python 3.9 with pillow 7.1.2 and report back please?

rm-hull avatar Dec 15 '20 20:12 rm-hull

I use a SSD1322 and no same glitches with 7.1.2.

majuss avatar Dec 16 '20 01:12 majuss

smbus2 recently had a big update as well, but probably unrelated to glitches..

thijstriemstra avatar Dec 16 '20 14:12 thijstriemstra

Tried again with most recent packages. Exactly the same :(

majuss avatar Jan 23 '21 00:01 majuss

@majuss so it doesn't work with Pillow 8.x on Python 3.9 but Pillow 7.1.2 on Python 3.9 is ok? And Python 3.7 is always ok?

Tried again with most recent packages. Exactly the same :(

Please specify which ones and version nrs.

thijstriemstra avatar Jan 24 '21 17:01 thijstriemstra

Python3.9 never works pillow version doesn't matter. Python3.7 is always okay.

majuss avatar Jan 24 '21 18:01 majuss

Well the interesting thing here is that the tests target python 3.6, 3.7, 3.8 and 3.9, and while they generally substitute the interface (I2C / SPI) for a mock, they do check to make sure the correct sequence of bytes is being produced for all the different displays across all versions of Python (albeit on Ubuntu / intel rather than Raspian / arm)

So that leads me to the following questions:

  • How have you installed Python 3.9 ? From source or a specific binary?
  • Which OS are you using?
  • Have you tried Python 3.8?

Everything you've said (and not said so far) points to it being a local issue, so we really need to know more about your setup

rm-hull avatar Jan 26 '21 16:01 rm-hull

I use the latest version of Raspbian on a RPI 3B+. Didn't tried Python3.8 yet. I installed Python directly from source.

majuss avatar Jan 26 '21 16:01 majuss

I switched to a Pi 4 and now everything works with Python3.9

majuss avatar Sep 01 '21 14:09 majuss

@rm-hull The exact same behaviour is back again with Python 3.11 latest raspberry pi os bookworm. I already freshly installed everything.

majuss avatar Oct 30 '23 16:10 majuss

@majuss what version of Pillow are you using? Can you test with latest (10.1.0)?

thijstriemstra avatar Oct 31 '23 12:10 thijstriemstra

Here you go: image

majuss avatar Oct 31 '23 13:10 majuss

@thijstriemstra how can I debug this? Even the runner example etc. is showing these artefacts again :/

majuss avatar Dec 04 '23 12:12 majuss

The pillow version doesnt matter. The bug is there even with 9.4

majuss avatar Jul 14 '24 17:07 majuss

Can you reproduce it on other devices?

rm-hull avatar Jul 14 '24 20:07 rm-hull