# Pirate Audio - GPIO 20 and i2s

**URL:** <https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332>\
**Category:** Support\
**Created:** [December 4, 2019, 4:13pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332 "2019-12-04T16:13:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulWebster](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/paulwebster/32/6045_2.png) [@PaulWebster](https://forums.pimoroni.com/u/PaulWebster)\
**Post date:** [December 4, 2019, 4:13pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/1 "2019-12-04T16:13:42Z")

</div>

I am trying to help someone who has the Pirate Audio device (with mini screen and speaker) but wants to run it on something other than Raspbian (and not with Mopidy).

He has everything working apart from the volume up button on GPIO20.

The error he is getting implies to me that he cannot use GPIO20 for input rom the pin while it is also being used as part of the i2s subsystem used by the amp.

Is there something magic that allows this to work in the standard Pimoroni set-up?

---

<div class="post-metadata">

**Author:** ![jqw](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@jqw](https://forums.pimoroni.com/u/jqw)\
**Post date:** [December 6, 2019, 11:48am UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/2 "2019-12-06T11:48:02Z")

</div>

I’m having similar problems. I’m attempting to map the buttons using dtoverlay=gpio-keys. Three map fine, but if i attempt to map the bottom right one, snd-bcm2835 fails to load, which the sound driver requires.

---

<div class="post-metadata">

**Author:** ![Crackerjb](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Crackerjb](https://forums.pimoroni.com/u/Crackerjb)\
**Post date:** [September 15, 2020, 4:31pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/3 "2020-09-15T16:31:01Z")

</div>

I have the same issue after using the Pirate Audio 3W speaker version and the Bob Rathbone software. Does anyone have any info or a fix for this as it seems to be a general issue not related the what SW is being run ?

---

<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:** [September 15, 2020, 5:13pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/4 "2020-09-15T17:13:32Z")

</div>

As far as I can see GPIO20 is only used as an I2S input, which the Pirate Audio boards don’t have (?). How are you enabling the I2S/the board?

Pimoroni generally don’t support other OSes, so I’m not certain you’ll get an official answer from them.

---

<div class="post-metadata">

**Author:** ![PaulWebster](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/paulwebster/32/6045_2.png) [@PaulWebster](https://forums.pimoroni.com/u/PaulWebster)\
**Post date:** [September 15, 2020, 6:22pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/5 "2020-09-15T18:22:16Z")

</div>

Check that the GPIO number is really what you think it is because Pimoroni moved things around with later versions of the board I think.

This post for a non-Raspbian system (PiCorePlayer for LMS) might help

> **[Jivelite on a Pirate Audio 240x240 screen - Page 35](https://forums.slimdevices.com/showthread.php?111502-Jivelite-on-a-Pirate-Audio-240x240-screen%2Fpage35)**

---

<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:** [September 15, 2020, 7:30pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/6 "2020-09-15T19:30:27Z")

</div>

Good call, [this Github issue](https://github.com/pimoroni/pirate-audio/issues/29) apparently used GPIO24 for Y, not 20, which matches what Chill said in your link.

" **N.B. Pimoroni now seem to be shipping boards which use a different GPIO for the Y button. If the Y button on your board does not work with this script, it may be necessary to change the line ‘SW4=20’ to ‘SW4=24’**"

I don’t know why they wouldn’t note that somewhere.

---

<div class="post-metadata">

**Author:** ![PaulWebster](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/paulwebster/32/6045_2.png) [@PaulWebster](https://forums.pimoroni.com/u/PaulWebster)\
**Post date:** [September 15, 2020, 7:50pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/7 "2020-09-15T19:50:01Z")

</div>

See this github issue … I’m in it as well.

> <https://github.com/pimoroni/pirate-audio/issues/16>
>
> On new versions of the Pirate Audio boards (after 23 January 2020), the button previously connected to BCM20 is now connected...

---

<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:** [September 16, 2020, 12:08pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/8 "2020-09-16T12:08:27Z")

</div>

Ah, the joy of hiding closed issues which might actually be helpful.

Again though, I’ve no idea why Pimoroni didn’t mark this on the board or in the product description. I really do wish they were better with their documentation.

---

<div class="post-metadata">

**Author:** ![johnsboyd](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@johnsboyd](https://forums.pimoroni.com/u/johnsboyd)\
**Post date:** [December 10, 2020, 10:22am UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/9 "2020-12-10T10:22:40Z")

</div>

I’m having the same issue on the pirate audio headphone device. If I try to use the ‘Y’ button (gpio20), then the dac (audio dev) fails to load. I’m running on raspian buster (kernel 4.19.97+). Using the dtoverlay in /boot/config.txt like so:

// emulate keyboard with buttons  
dtoverlay=gpio-key,gpio=16,active\_low=1,gpio\_pull=up,label=GPIO\_RET,keycode=28  
dtoverlay=gpio-key,gpio=5,active\_low=1,gpio\_pull=up,label=GPIO\_Up,keycode=103  
dtoverlay=gpio-key,gpio=6,active\_low=1,gpio\_pull=up,label=GPIO\_Down,keycode=108  
dtoverlay=gpio-key,gpio=20,active\_low=1,gpio\_pull=up,label=GPIO\_Esc,keycode=1

---

<div class="post-metadata">

**Author:** ![PaulWebster](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/paulwebster/32/6045_2.png) [@PaulWebster](https://forums.pimoroni.com/u/PaulWebster)\
**Post date:** [December 10, 2020, 5:20pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/10 "2020-12-10T17:20:06Z")

</div>

Have you tried changing the 20 to 24?

---

<div class="post-metadata">

**Author:** ![johnsboyd](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@johnsboyd](https://forums.pimoroni.com/u/johnsboyd)\
**Post date:** [December 10, 2020, 9:25pm UTC](https://forums.pimoroni.com/t/pirate-audio-gpio-20-and-i2s/12332/11 "2020-12-10T21:25:00Z")

</div>

Yes I tried that, but then the ‘Y’ button doesn’t work because it looks like I have the older version of the hat. I purchased mine earlier this year but apparently it was built before Jan.
