Adding an External Volume Control

Hello

I’ve read various posts in the forum about adding volume control to a Picade but I’m hitting a brick wall, so I’m hoping someone could help.

I have the new 10" 2018 Picade and it’s really great and everything but I really need to add an easy way to control the volume as going into the sound settings for every game isn’t great!.

The first thing I tried was to add a audio 3.5mm extension jack to the stereo plug on the Rpi and plugging in some small pc speakers, and obviously stereo output has been disabled so this didn’t work!, I then wired into the + side of the speaker output a logging Potentiometer, which kind of works but the adjustment between normal volume and mute is tiny (less than 3mm of dial turn), so the log pot acts more like a volume mute switch than a volume control.

As I said I’ve been looking at threads on the forum and plenty of online tutorials but nothing seems to work, so any help really would be greatly appreciated, this is my first attempt at “hacking” anything Rpi related so I’m all at sea, I can hold my own with a soldering iron and a multimeter but programming the Pi would be new to me, but I’m willing to learn…

The speaker is only 4 or 8 ohms, and your pot is likely 10,000 or 100,00 ohms. Its meant to be added on the input side of the amplifier. Not on the output side. Thats why a tiny adjustment kills all sound.

You can likely get sound back out of the analog audio jack with a config.txt edit.
dtparam=audio=on I think? Might also have to comment out the line sending it to the X hat.
I could have sworn there was another thread on this but I can’t seem to find it.

Hey alphanumeric thanks for the reply

Yep my pot’s an A10K

I read that the log pot has to be added to the input side of the amp in the Xhat, but I took it that meant you had to solder it to one of the GPIO pins, but there’s nothing on which one that I can find, there’s no obvious way of connecting to the X hat itself unless it could be done to the “hack header” on the board, but apart from connecting the plasma buttons to I don’t know what it’s for.

Ok I tried what you suggested, ie editing the config.txt file to "dtparam=audio=on ", it didn’t work, so I’m assuming that as you suggest I need to comment out the line that sends it to the xhat but I can’t for the life of me work out which bit of code that is, FYI I have backed my sd card up, but I don’t really care if I mess up as I can easily reflash it with retropie anyway.

Boy these Pi’s are fun, who knew?

The input to the X Hat is digital not analog, i2s I think? That pot is meant for an analog signal.
I have a dual logarithmic pot wired to one of my Pi’s as a volume control. The analog out tip ring sleeve audio jack goes to the pot, then that goes to my analog audio amplifier.
![DSCF

0823|666x500]

Ignore the USB stuff in that picture, that bit of perfboard does double duty. That little board with the male header and jumper on it is a 3W stereo analog amplifier. The headphone jack plugs into the Pi’s audio jack.
This is my config.txt with audio set to HDMI

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

Hello you can easily control the volume without adding extra stuff !!! You can Controle the volume with the joystick in retroarch option.
Quick menu > settings > input > input hotkey binds > volume + = joystick up > volume - = joystick down > back > back > back > configurations > save current configuration
Sorry for my english i am french

2 Likes

Keep in mind, that even after editing the config.txt, you may have to switch it from HDMI to Analog out. Either via the toolbar menu or raspi-config. The default is HDMI. I always have to switch it manually after a fresh install, even if I don’t have an HDMI monitor connected. The Pi I have the audio amp on has the Pi Foundation 7 inch touch screen that uses the DSI port.

Thanks for the reply

I know you’re “supposed” to adjust the volume this way, it’s just a pain having to leave a game that’s just started way too loud because it’s annoying people and or cats!, going into retroarch and messing with the volume, coming out of the audio settings, restarting the game realising that you can’t hear anything now and repeating all of the above, it’s not well, FUN! and I really like fun, so I’d very much like to add a simple volume control to the outside of the cabinet, but reading these forums has sort of made me realise that I’m not in the majority, and I can’t for the life of me understand why, it’s not making me want to play with my new Picade and I’m so proud of it, I built it myself and everything, it’s just this sound control issue it’s starting to really annoy me like an itch you can’t scratch!!!..

Also don’t apologise for your English, I’m very ashamed to say it’s way better than my French .

Hi Alphanumeric

Sorry it’s taken me ages to reply to your very helpful posts, I’ve had to spend the morning trying to catch up on real life now the snow has gone.

Yes I was going to post my copy of the config.txt file as it mentions “uncomment the following” before each line but I don’t really understand what that means, I mean do you delete stuff from the file? also there’s no real mention of volume control that I can understand in that file?.

I really don’t want to come across as thick but I’ve studied your photo! again I’m not really sure what’s going on, I can see the two usb sockets and the log pot on the breadboard which is wired to a little breakout board, and I understand now that I have to wire the log pot in before the picade xhat amp but I don’t know where that would be?.

To be honest I think I’ve bitten off more than I can chew here, I thought adding a volume control would be a neat idea as I’d just added side panel mounted usb & power and thought I was some kind of electronics prodigy, I’ve crashed back to earth with quite a bump!.

I really do appreciate you taking time to reply, it’s very kind of you.

In the config.txt, any line with a # in front of it is ignored. Its treated as just a comment if you will.
Delete the # from the front of the line and that line is executed.
So as an example

Uncomment some or all of these to enable the optional hardware interfaces

dtparam=i2c_arm=on (does something)
#dtparam=i2s=on ( is ignored)
#dtparam=spi=on ( is ignored)

You can’t use your analog volume control with the X-Hat. Not and use the X-Hat amplifier and speaker. The signal going from the Pi to the X-Hat DAC is a digital signal, 1’s and 0’s. i2s
What I did was take the analog stereo output that comes out of the Pi’s audio jack and feed it to my dual POT. The signal out of the Pi’s audio jack is a low level analog signal. It will drive earbuds but thats about all. It has to be amplified to drive speakers.
My volume control is two POTs connected to the one shaft. Stereo if you will. I took a stereo cord with a tip ring sleeve jack on one end and wired the other end to my POTs. The adjustable side goes to my stereo amplifier. The center wiper contact of the POT. The amplifier then feeds my speakers, which are not shown.
To do what I did you’d need to switch to a separate analog amplifier. And ditch using the DAC on the X-Hat.
My full build pictures for that Pi are here, https://1drv.ms/f/s!AjOYwiwlwDtpgq9LUHdGiiRpn7dr2Q

DSCF0826

Thanks again

I followed the link:

Which is near the start of the config.txt file, but you made it so much clearer, so all I need do to get retropie to ignore a command is delete the # at the start of the line, brilliant I get that now.

So would I remove (uncomment) the # at the start of this code?:

Enable audio (loads snd_bcm2835)

dtparam=audio=on
gpu_mem_256=128
gpu_mem_512=256
gpu_mem_1024=256
overscan_scale=1
hdmi_force_hotplug=1
dtoverlay=picade
dtparam=audio=off

In order to output the audio back through the Rpi’s audio jack?.

Or is it this line:

uncomment to force a HDMI mode rather than DVI. This can make audio work in

DMT (computer monitor) modes

#hdmi_drive=2

Also would I be better off ditching the supplied X_Hat and using something else?, I see from your pictures which are pretty impressive! that you’re using a gamepad, I like the arcade controls but I know the X_Hat is a new development and that other controller boards are available, and could I be cheeky and ask if any are recommended.

It’s the other way around, add a # at the start to comment it out and have a line ignored, and “remove the #” (uncomment) a line to have it acted on.
dtparam=audio=on is I believe the one that turns on the built in sound chip, the bcm2835.
You don’t want an on and an off, the off at the end will turn it off.

Hi no my friend once it is configured you dont have to go to the retroarch option. In a game you can change the volume without exit

I think we dont understand each other. You dont have to do all this. Send me your mail, Im gonna send you a video of how I do without it. Dont do all these complicated stuff

Well thank you both alphanumeric & VaFank for taking the time to bother to reply I’m quite amazed by this to be honest.

Alphanumeric I’m not going to have time this evening to play with the config.txt file will look at it tomorrow afternoon when I get some “me time” that doesn’t involve bikes or family, I understand the uncommenting now thanks to your reply and me actually looking at the Rpi forums, no bios huh!

VaFank I honestly don’t know how I send you my e-mail address, but will look into that tomorrow as well.

Again a big thank you to you both.

Yeah, it took me a little while to wrap my head around the no BIOS. The confix.txt is sort of kind of the Pi’s equivalent. It reads that first to turn things on off etc. The nice thing about no BIOS is you can’t brick your Pi by messing with the config.txt. Worst case scenario is it just doesn’t boot. Redo your Micro SD card and your back in business.

If you click on VaFank’s avatar you should get a message option. Click that and you can send him a private message only he can see.

Thanks for the “clicking on the avatar” heads up.

No problem glad to help.
Where it is depends on the forum software being used, if its enabled. Some forums have it turned off.
Some times its in plain site some times you have to go look for it.

HI all

Ok VaFank I’ve done what you described in the post above to set up the joystick as a volume control in the " input hotkey binds" sub menu of retroarch and absolutely no luck, I’m obviously going wrong somewhere, but I’ve no idea where!.

FYI I updated everything I could find to the newest version then I had a fun ten minutes trying to work out how to log back in, all sorted now, except for the sound obviously, I still think adding an external volume control is easier than what I’ve been doing for the last five hours of Picade use, perhaps there’s some instructions somewhere, but if there are they’re well hidden.

I have a bit of an update now…

I do still want an external volume control, but at this point I’d be willing to be able to control volume without having to exit out of a game and go into the “ncurses” style volume menu!, I honestly can’t find any other way to control the volume and I’ve re-installed retropie twice and set it up as suggested in the build video.

I’ve tried mapping the joystick & the “select” button to control sound together but retroarch doesn’t allow me to do this and I’ve no idea why, also it only gives me 4 seconds to do it and as soon as I push up and the select button it times out, I think most of the problem is xhat related and specifically it’s stupid sound setup it seems very restricted especially the way it disables the Pi’s on board stereo jack and then doesn’t give an option to re-enable it I realise this isn’t a retropie/retroarch issue but to do with the software you download from pimoroni when you first install the system, I am super tempted to dump it and fit the “zero delay arcade usb encoder” as listed on other sites as I’ve no idea how to get the sound sent through the jack again.

If anyone has any thoughts could you suggest a fix, but at this point dropping £9.00 on the encoder seems like a fair trade to get my sanity back.