question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Help with speed difference between SBCs

See original GitHub issue

To be clear, this is not any actual problem with luma.lcd. I’m filing it as a means of asking for help in how to debug a speed difference I’ve observed between two SBCs. Pointers or suggestions would be appreciated, after which this issue can just be closed.

Note that one of the marketing points for the C4 is improved SPI frequency.

Also recall, from one of my earlier filings, that RPi SPI frequency appears to be constrained to an even frequency, rather than a frequency that is a power-of-2. Opening that up in luma.core’s serial.py would permit a wider set of usable frequencies. I have locally hacked on the installed serial.py for the experiment below.

Type of SBCs

Raspberry Pi 3 Model B v1.2 Odroid C4

Linux Kernel version

RPi: Linux raspberrypi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux C4: Linux C4 4.9.113 #1 SMP PREEMPT Fri Aug 14 20:30:41 UTC 2020 aarch64 GNU/Linux

Other versions

luma.core: 1.17.1 on both luma.lcd: 2.5.0 on both luma.examples: commit ceb01960 on both (from Wed Oct 21 16:53:13) spidev: 3.4 on both Pillow: 7.2.0 on both RPi.GPIO: 0.7.0 on RPi, 0.6.3post1 (the RPi.GPIO-Odroid version) on C4

Both displays are ILI9341, connected as the sole device on each SBC’s spi0 outputs.

Expected behaviour

On both SBCs I am trying the following demo from luma.examples:

python bounce.py \
  --interface spi --display ili9341 \
  --width 320 --height 240 \
  --backlight-active high \
  --gpio-reset-hold-time 0.2 --gpio-reset-release-time 0.2 \
  --spi-bus-speed 48000000

Actual behaviour

On RPi, the bounce demonstration noticeably increases in FPS as the SPI frequency is increased. The attached photo shows the results when running with a 50 MHz spi-bus-speed, getting almost 19 FPS. (It varies over time, with the photo showing 18.9. Most of the time it is running just a bit over 19.)

The second photo shows the C4, running with 48 MHz. Its FPS is behaving identically to when the bounce demo is invoked with an 8 MHz speed.

RPi: rpi_bounce_speed

C4: odroidC4_bounce_speed

The command line option is certainly getting parsed on the C4, for specifying spi-bus-speeds lower than 8 MHz has a definite effect. I can get it go far slower!

I’m trying to understand where the “bottleneck” is, given the lack of any error responses from spidev when speeds >8 MHz are specified. Any suggestions?

As I mentioned at the start, this issue is just a request for assistance. If we can’t dream up any debug ideas, I’ll just close it out.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mattblovellcommented, Oct 24, 2020

@rm-hull, the change to serial.py is indeed quite a small one:

@ -294,7 +292,7 @@ class spi(bitbang):
                  bus_speed_hz=8000000, transfer_size=4096,
                  gpio_DC=24, gpio_RST=25, spi_mode=None,
                  reset_hold_time=0, reset_release_time=0, **kwargs):
-        assert(bus_speed_hz in [mhz * 1000000 for mhz in [0.5, 1, 2, 4, 8, 16, 32]])
+        assert(bus_speed_hz in [mhz * 1000000 for mhz in [0.5, 1, 2, 4, 8, 16, 20, 24, 28, 32, 36, 40, 44, 48, 50, 52]])

All of those (well, the higher ones, I didn’t try going extremely slow) worked with the ILI9341 display I have. I tested 60 MHz as well, and it did work! Of course, bounce.py performance does not keep increasing with increasing SPI frequency (maxing out in the 18.5 to 20 FPS range).

@thijstriemstra, I’ll see about upgrading Pillow. On RPi, I’ve just been using what pip provides. On the Odroid, I used the package that entware provides.

Thanks, Matt

Update: I just tried the 500 kHz speed. It works as well, if you want to call ~0.7 FPS working. 😃

0reactions
mattblovellcommented, Nov 3, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

session border controller (SBC) By - TechTarget
A session border controller (SBC) is a dedicated hardware device or software application that governs the manner in which phone calls are initiated, ......
Read more >
What is Session Border Controller (SBC)? - GetVoIP
A session border controller is hardware or software that provides a secure connection between two or more IP networks. Learn more here.
Read more >
Firewalls SIP Servers and SBCs - What's the difference?
There are a lot of building blocks that make up a reliable and secure voice network. Firewalls, SIP Servers and Session Border Controllers ......
Read more >
What Are Bluetooth Codecs? A Guide to Everything From AAC ...
In brief, SBC is the most basic codec with the lowest bitrate and, therefore, the lowest sound quality. AAC and AptX are both...
Read more >
SBC vs aptX: Which Bluetooth Codec is the best? - RTINGS.com
Our comparison will focus on the differences between SBC and aptX. ... as both your Bluetooth transmitter and receiver support the aptX-LL.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found