# Framebuffer support for Pirate Audio

**URL:** <https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821>\
**Category:** Support\
**Created:** [January 10, 2021, 8:48pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821 "2021-01-10T20:48:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sindbad6](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sindbad6](https://forums.pimoroni.com/u/sindbad6)\
**Post date:** [January 10, 2021, 8:48pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/1 "2021-01-10T20:48:48Z")

</div>

Hello,  
I have a Pirate Audio working on a RPi 0W. I was also able to run Mopidy succesfully with up to date Raspberry OS Buster. So the connector soldering on the Pi is good.

For my purposes, I need to use it as framebuffer device. Therefore I installed the adafruit software for this device, as described in this [Tutorial](https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/1-3-240x240-kernel-module-install),

Unfortunately after installation, the system hangs during the reboot and I can’t get it working as expected. So my question is, how it is possible to get it working? I mean the ST7789 display implemented on your pirate audio is the same as the one on the adafruit webpage. Can Iconfigure something different on the adafruit software to cooperate with your device?

---

<div class="post-metadata">

**Author:** ![Shoe](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shoe](https://forums.pimoroni.com/u/Shoe)\
**Post date:** [January 10, 2021, 9:04pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/2 "2021-01-10T21:04:46Z")

</div>

At a wild guess, this may be because the Adafruit and Pimoroni screens use different pins, so the framebuffer tutorial might not be setting up the screen properly.

Adafruit’s guide says:

> **GPIO22** - Used to turn the backlight on and off. If you never want to turn the backlight off, cut the small jumper on the bottom of the PiTFT to free up GPIO22  
> **SCK, MOSI, CE0 & GPIO25 -** These are the display control pins. Note that MISO is not connected even though it is a SPI pin because you cannot read back from the display.

[The Pinout.xyz page](https://pinout.xyz/pinout/pirate_audio_speaker#) for Pirate Audio boards says that it uses GPIO13 for the backlight pin, SCK, MOSI, GPIO7 as the chip select, and GPIO9 as the command pin. You’d need to hoke through the files Adafruit gets you to install, see where it defines the pins, and change those.

---

<div class="post-metadata">

**Author:** ![sindbad6](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sindbad6](https://forums.pimoroni.com/u/sindbad6)\
**Post date:** [January 10, 2021, 9:28pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/3 "2021-01-10T21:28:35Z")

</div>

Thanks, I will check this.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 10, 2021, 9:59pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/4 "2021-01-10T21:59:40Z")

</div>

Yeah, SPI0 has two chip selects, CE0 and CE1, and the backlight can be just about any GPIO pin you want to use.

SPI0  
GPIO 7, Pin 26, CE1  
GPIO 8, Pin 24, CE0  
GPIO 9, Pin 21, MISO  
GPIO 10, Pin 19, MOSI  
GPIO 11, Pin 23, SCLK

SPI1  
GPIO 16, Pin 36, CE2  
GPIO 17, Pin 11, CE1  
GPIO 18, Pin 12, CE0  
GPIO 19, Pin 35, MISO  
GPIO 20, Pin 38, MOSI  
GPIO 21, Pin 40, SCLK

/boot/config.txt

dtparam=spi=on

dtoverlay=spi1-1cs #1 chip select  
dtoverlay=spi1-2cs #2 chip select  
dtoverlay=spi1-3cs #3 chip select

SCLK - Serial CLocK  
CE - Chip Enable (often called Chip Select)  
MOSI - Master Out Slave In  
MISO - Master In Slave Out  
MOMI - Master Out Master In

---

<div class="post-metadata">

**Author:** ![sindbad6](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sindbad6](https://forums.pimoroni.com/u/sindbad6)\
**Post date:** [January 11, 2021, 9:53am UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/5 "2021-01-11T09:53:38Z")

</div>

Sorry alphanumeric, I don’t understand what that means. I’m a newbie at this. Is the problem just a question of different GPIO pins used or are there other things to change in the code for the framebuffer software?

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 11, 2021, 10:16am UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/6 "2021-01-11T10:16:40Z")

</div>

The Pi has several SPI buses that can be used. For the most part SPI0 is the one used, and some times SPI1. SPI0 can have two devices connected, one using CE0 and the other using CE1. Or “one” device using “either” one of those two chip selects.  
If your code is looking for something on CE0 for example, but your display is using CE1, it won’t work.  
The Pimoroni python examples will have a screen setup section like this. That is as near as I can tell what the Pirate Audio Screen uses.

```auto
disp = ST7789.ST7789(
    port=0, # 0 is SPI0 and 1 is SPI1
    cs=1, # 0 is CE0 and 1 is CE1
    dc=9, # 9 for SPI0 and 19 for SPI1
    backlight=13, # can be any controllable GPIO pin
    rotation=90,
    spi_speed_hz=10000000
)

```

The Pimoroni screens for the most part use SPI0 but don’t always use CE0. Sometimes they use CE0 sometimes CE1. Likely because of circuit layout and track routing etc.

Anyway, long story made short. You need to edit the Adafruit code so it can access the Pimoroni screen. That is assuming its not already a match. It needs to be setup for SPI0, CE1. Don’t worry about the backlight unless its not on. It should default to on even with no signal of connection to it. You only need it to turn the backlight off, as near as i can tell anyway.

---

<div class="post-metadata">

**Author:** ![sindbad6](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sindbad6](https://forums.pimoroni.com/u/sindbad6)\
**Post date:** [January 11, 2021, 12:21pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/7 "2021-01-11T12:21:20Z")

</div>

Thanks for your explanation. May I can ask directly.  
Do you know where in the [code](https://github.com/adafruit/Raspberry-Pi-Installer-Scripts) I have to do the changes to get the ST7789\_240x240 as frambuffer running? If not, you may can give me some hints, where I could search for it?

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 11, 2021, 12:46pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/8 "2021-01-11T12:46:03Z")

</div>

That I don’t know, my Linux skills are Noob level at best. Somebody on the Adafruit forum may be able to tell you though?

---

<div class="post-metadata">

**Author:** ![sindbad6](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sindbad6](https://forums.pimoroni.com/u/sindbad6)\
**Post date:** [January 11, 2021, 3:17pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/9 "2021-01-11T15:17:23Z")

</div>

Hi alphanumeric,  
I think it’s more a Python thing than a Linux one, but anyway I will ask there for it.  
Thanks for your kindly support.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 11, 2021, 3:46pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/10 "2021-01-11T15:46:37Z")

</div>

That’s the thing whch file and where is it? Find the right file and i may be able to edit it to work.

---

<div class="post-metadata">

**Author:** ![potter-91](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@potter-91](https://forums.pimoroni.com/u/potter-91)\
**Post date:** [January 11, 2021, 4:21pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/11 "2021-01-11T16:21:22Z")

</div>

I like to run squeezelite + Cava at the LCD so I also need frambuffer ^^  
I did not edit the scripts pins so my display is dark atm  
Currently I run the adafruit script and try to fin what it changes  
At boot.txt this was added:

```
hdmi_force_hotplug=0
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=drm-minipitft13,rotation=0

```

It is the first time I try something like this but if I have success I will inform you

Pimoroni should really include framebuffer at there guide…

---

<div class="post-metadata">

**Author:** ![sindbad6](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sindbad6](https://forums.pimoroni.com/u/sindbad6)\
**Post date:** [January 11, 2021, 5:23pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/12 "2021-01-11T17:23:04Z")

</div>

Yeah, hopefully you let us know, if you succeed.  
Independent from this. Did you install the framebuffer software from Adafruit, which I referred to in my first post?

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 11, 2021, 5:31pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/13 "2021-01-11T17:31:35Z")

</div>

Yeah I bet a lot of stuff happens if you run the  
`sudo python3 adafruit-pitft.py --display=st7789_240x240 --rotation=0 --install-type=console`

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 11, 2021, 5:34pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/14 "2021-01-11T17:34:58Z")

</div>

Is there an overlays folder with drm-minipitft13 in it?  
EDIT: Looking at the installer under  
“type”: “st7789\_240x240”,  
it has  
“overlay\_src”: “overlays/minipitft13-overlay.dts”,  
“overlay\_dest”: “/boot/overlays/drm-minipitft13.dtbo”,  
“overlay”: “dtoverlay=drm-minipitft13,rotation={pitftrot}”,  
I’d have a look at the dts and or dtbo files.

[Raspberry-Pi-Installer-Scripts/adafruit-pitft.py at master · adafruit/Raspberry-Pi-Installer-Scripts (github.com)](https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/master/adafruit-pitft.py)

---

<div class="post-metadata">

**Author:** ![potter-91](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@potter-91](https://forums.pimoroni.com/u/potter-91)\
**Post date:** [January 11, 2021, 10:30pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/15 "2021-01-11T22:30:49Z")

</div>

@alphanumeric There is the file

> <https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/master/overlays/minipitft13-overlay.dts>

I have asked at the pimoroni disord if someone tried to setup framebuffer…  
The problem is that pimoroni did not wire the a specific pin (I think the RST) to the GPIO.  
So you need a hardware mod to use framebuffer… that sucks…  
Then it should be possible to set it up like here:

> **[Mirroring Raspberry Pi HDMI Video to a ST7789 1.3 inch LCD Display](https://krystof.io/mirroring-raspberry-pi-hdmi-video-to-a-st7789-1-3-inch-lcd-display/)**
>
> I needed a small display for my Commodore diorama that mirrors the output of my Raspberry Pi - I found one with this 1.3 inch ST7789 driven LCD display. Trouble was, mirroring this wasn't as straight forward as I would have liked.

EDIT: I have sent them the link to the adafruit one and maybe there is hope he said

---

<div class="post-metadata">

**Author:** ![sindbad6](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sindbad6](https://forums.pimoroni.com/u/sindbad6)\
**Post date:** [January 12, 2021, 12:20am UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/16 "2021-01-12T00:20:46Z")

</div>

That would be really nice if this could be get working. Thanks again for your help.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 12, 2021, 9:35am UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/17 "2021-01-12T09:35:17Z")

</div>

I can’t make any sense out of that dts file. =(

---

<div class="post-metadata">

**Author:** ![sindbad6](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sindbad6](https://forums.pimoroni.com/u/sindbad6)\
**Post date:** [January 15, 2021, 4:06pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/18 "2021-01-15T16:06:11Z")

</div>

Sorry, I was not able to care about this project. Unfortunately I have still no idea how to get the pirate audio as framebuffer working. I have still no idea if the problem can be solved with changed entries in the /boot/config.txt, do I need to change the code or is it a question of incompatible wiring?

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 15, 2021, 7:54pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/19 "2021-01-15T19:54:47Z")

</div>

That I don’t know? I have a Pirate Audio Speaker and had thought of trying this. I just never found my round 2it.

---

<div class="post-metadata">

**Author:** ![sindbad6](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sindbad6](https://forums.pimoroni.com/u/sindbad6)\
**Post date:** [January 15, 2021, 11:05pm UTC](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821/20 "2021-01-15T23:05:41Z")

</div>

Seems there is no support from pimoroni for this. Or is there anybody out there?

[Next page](https://forums.pimoroni.com/t/framebuffer-support-for-pirate-audio/15821.md?page=2)
