Picade HAT Volume Control?


#1

Just swapping over to Picade HAT from the non-HAT version and was wondering if someone could tell me how volume up/down now works please?

The GitHub page for the HAT just tells you how to configure volume control, so I was wondering how you now turn volume up/down via software?

Thanks.


#2

Sorry, was thinking out aloud whilst cabling in the new HAT. Now that I have it up and running, I can see that volume level is controlled within Retropie and that this just needs to be set before running games.


#3

if you are swapping the PCB for the HAT version in your Picade I encourage you to wire up the volume buttons to GPIO13 (DOWN) and GPIO 26 (UP) on the right hand side (obviously grounded).

… I’ve just pushed a new feature that should allow you to control the volume via the buttons in-game, similarly to the way your old Picade worked (well, this is software control acting on gpio events, so not quite, but same principle).

to get the latest and greatest, you can just run the setup installer again:

curl https://get.pimoroni.com/picadehat | bash

… or cd ~/Pimoroni/picade/picade-hat/ ; git pull ; setup.sh


#4

Here it it is action:
https://t.co/BOfpYyWOLD

… obviously you don’t have to use terminals (the header pitch does not match), you could just solder them in place, or wire them in any way you like.

currently I’m using a 5% step up or down, please let me know if you think that the granularity is about right (20 steps from min to max is quite a lot, perhaps too many?)


#5

Excellent! Thank you, I shall definitely give that a go!

I shall need to drill another button hole in the cabinet because the software power on/off is very handy (using my vol up button for now).

Given that this will free up the SPKR connectors, can these be repurposed/assigned to extra keys? Looking at “picade-hat/daemon/usr/bin/picadehatd” the volume buttons seem to be directly coded with no easy way to customise them?

if VOLUME_CONTROL:
    gpio.setup(VOLUME_DOWN, gpio.IN, pull_up_down=gpio.PUD_UP)
    gpio.setup(VOLUME_UP, gpio.IN, pull_up_down=gpio.PUD_UP)

However, first I need to get the controls working in game - fine within the Retropie menu, but no response at all in SNES or GBA (but that’s for another topic).

P.S. Yeah I would say perhaps 10%. Is there scope for a separate config file where options such as volume % step and button mappings to keyboard could be configured by the user? I see that these can be edited in the above mentioned file but would these would be overwritten in an update?

Thanks!!!


#6

I’m not sure I follow you… the speaker terminals on the Picade HAT are not inputs, they receive the signals from the on-board amp. You still need to wire a (single) speaker there.

All this does is take the 2 GPIO currently unused (those typically linked to interfaces notwithstanding) and add them to the daemon to watch, and trigger a bash script that issues command to amixer when an event is detected.


#7

ahhh right, yes I see what you mean now. :)

You still need to wire a (single) speaker there.

Do you advise against running both speakers from the speaker terminals on the Picade HAT? I have both cabled into that port…


#8

You are in effect wiring the speakers in parallel I believe, meaning the net impedance is divided by two.

… I don’t know if you can damage the amp but it is meant to drive 4 ohms speakers, so unless yours are 8 ohms (and I’m pretty sure they are not), it’s probably not a good idea.

I’ll probe the engineer to be sure, but for now I recommend you only hook up a single speaker.


#9

The amp chip performance is only defined for speaker impedance of 4 ohms or higher. Thus, if your speakers are our normal 4 ohm Picade speakers, it’s probably not a good idea to wire them in parallel straight to Picade HAT, as that would make the total impedance only 2 ohms. What you could do instead is wire the speakers in series to get a total impedance of 8 ohms, like this:


Can speaker phat power 2 speakers?
#10

Thank you for the advice, i’ll rewire them in series.