From d24f3b812d518301f2d4fc5593ca938fc8d15e9c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 5 Apr 2022 09:07:35 -0500 Subject: [PATCH 1/2] Document TileGrid limitation to tile values 0..255 Closes #6149 --- shared-bindings/displayio/TileGrid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 4cecd0f0f1..2b2526cd84 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -53,6 +53,8 @@ //| convert the value and its location to a display native pixel color. This may be a simple color //| palette lookup, a gradient, a pattern or a color transformer. //| +//| To save RAM usage, tile values are only allowed in the range from 0 to 255 inclusive (single byte values). +//| //| tile_width and tile_height match the height of the bitmap by default. //| //| :param Bitmap,OnDiskBitmap,Shape bitmap: The bitmap storing one or more tiles. From c89af99f5942d3583f6c70d0be921519b9fd5e97 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 5 Apr 2022 09:17:55 -0500 Subject: [PATCH 2/2] Advise about ways to improve mp3 playback Closes: #6133 --- shared-bindings/audiomp3/MP3Decoder.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 4761feacd8..a59d316072 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -44,6 +44,20 @@ //| :param typing.BinaryIO file: Already opened mp3 file //| :param ~circuitpython_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. //| +//| Playback of mp3 audio is CPU intensive, and the +//| exact limit depends on many factors such as the particular +//| microcontroller, SD card or flash performance, and other +//| code in use such as displayio. If playback is garbled, +//| skips, or plays as static, first try using a "simpler" mp3: +//| +//| * Use constant bit rate (CBR) not VBR or ABR (variable or average bit rate) when encoding your mp3 file +//| * Use a lower sample rate (e.g., 11.025kHz instead of 48kHz) +//| * Use a lower bit rate (e.g., 32kbit/s instead of 256kbit/s) +//| +//| Reduce activity taking place at the same time as +//| mp3 playback. For instance, only update small portions of a +//| displayio screen if audio is playing. Disable auto-refresh +//| and explicitly call refresh. //| //| Playing a mp3 file from flash:: //|