corsairetc
Posts: 8
Joined: Wed Nov 04, 2020 12:25 pm

Raspberry Pi 400 3,5mm jack

Wed Nov 04, 2020 2:54 pm

Hello all,
It is possible to get 3,5mm jack on Raspberry Pi 400 via GPIO ?
Thank you.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31815
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 8:27 am

Yes, but would require some extra electronics.

https://learn.adafruit.com/introducing- ... io-outputs
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4721
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 8:44 am

From a software perspective you just need to add "dtoverlay=audremap" to config.txt, which will enable the audio outputs on GPIOs 12 & 13 (header pins 32 and 33). "dtoverlay=audremap,pins_18_19" will send the output to GPIOs 18 & 19 (header pins 12 & 35) . But as James says, you really need some external circuitry to turn it into a usable audio signal.

cleverca22
Posts: 6812
Joined: Sat Aug 18, 2012 2:33 pm

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 9:01 am

ahh, i see how it works
the `compatible = "brcm,bcm2835-audio"` in the device-tree handles both the ALT muxing, and presenting a vchiq service as an alsa device

but i dont see the code in `drivers/staging/vc04_services/bcm2835-audio/bcm2835.c` that is responsible for setting the pins to the chosen set from the gpio block in the dts
and how does the firmware know if it should use pwm0 or pwm1?
i notice a swap_lr in the overlay, but the driver never reads it, is the firmware peeking at the dtb after applying overlays and then acting on that?

LTolledo
Posts: 6657
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 9:34 am

AFAIK, extracting audio from GPIO using passive circuity does not really give a good high quality audio...

so if I were to venture into doing that...I'd rather:
a. use a USB audio dongle with 3.5mm jack, or
b. make my own I2S audio adapter to be plugged to the 40 pin header
audio will be directed to a 3.5mm jack that I will install (on the I2S adapter)

I still have a few PCM5102A modules with me...

enabling the USB audio dongle or the I2S module are much easier to do...
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

cleverca22
Posts: 6812
Joined: Sat Aug 18, 2012 2:33 pm

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 9:47 am

LTolledo wrote:
Thu Nov 05, 2020 9:34 am
AFAIK, extracting audio from GPIO using passive circuity does not really give a good high quality audio...
except, that is exactly what the 3.5mm jack on every existing pi model is doing

so its more a question of if the old quality is good enough, or if you want to go for something better

LTolledo
Posts: 6657
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 9:56 am

cleverca22 wrote:
Thu Nov 05, 2020 9:47 am
LTolledo wrote:
Thu Nov 05, 2020 9:34 am
AFAIK, extracting audio from GPIO using passive circuity does not really give a good high quality audio...
except, that is exactly what the 3.5mm jack on every existing pi model is doing

so its more a question of if the old quality is good enough, or if you want to go for something better
you have a very good point there...everyone has their preferences...
"tinker for good.... or tinker for even better...."

well anyway what will eventually be done will be sort of a "pluggable module" to the GPIO header...
that may be swapped according the the user's use case...
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

cleverca22
Posts: 6812
Joined: Sat Aug 18, 2012 2:33 pm

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 10:05 am

LTolledo wrote:
Thu Nov 05, 2020 9:56 am
cleverca22 wrote:
Thu Nov 05, 2020 9:47 am
LTolledo wrote:
Thu Nov 05, 2020 9:34 am
AFAIK, extracting audio from GPIO using passive circuity does not really give a good high quality audio...
except, that is exactly what the 3.5mm jack on every existing pi model is doing

so its more a question of if the old quality is good enough, or if you want to go for something better
you have a very good point there...everyone has their preferences...
"tinker for good.... or tinker for even better...."

well anyway what will eventually be done will be sort of a "pluggable module" to the GPIO header...
that may be swapped according the the user's use case...
i'm thinking that a hat (with the overlay eeprom) and a 3.5mm jack would be a pretty easy board to design, and would make upgrades trivial for the end-user

gordon77
Posts: 6881
Joined: Sun Aug 05, 2012 3:12 pm

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 10:25 am

cleverca22 wrote:
Thu Nov 05, 2020 10:05 am
LTolledo wrote:
Thu Nov 05, 2020 9:56 am
cleverca22 wrote:
Thu Nov 05, 2020 9:47 am


except, that is exactly what the 3.5mm jack on every existing pi model is doing

so its more a question of if the old quality is good enough, or if you want to go for something better
you have a very good point there...everyone has their preferences...
"tinker for good.... or tinker for even better...."

well anyway what will eventually be done will be sort of a "pluggable module" to the GPIO header...
that may be swapped according the the user's use case...
i'm thinking that a hat (with the overlay eeprom) and a 3.5mm jack would be a pretty easy board to design, and would make upgrades trivial for the end-user
I'd prefer fitting the audio interface internally, soldered to the back of the GPIO connector. Leaving the outside gpio clear.

cleverca22
Posts: 6812
Joined: Sat Aug 18, 2012 2:33 pm

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 10:26 am

gordon77 wrote:
Thu Nov 05, 2020 10:25 am
I'd prefer fitting the audio interface internally, soldered to the back of the GPIO connector. Leaving the outside gpio clear.
that could also be done, and id argue that there was already room for that, but the RPT says there wasnt

you just need to make sure the end-user doesnt try to use those pins for something else, and then drill a hole somewhere for the headphone jack

LTolledo
Posts: 6657
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 10:29 am

those new and upcoming devices may not be called HATs anymore as it wont be on "top" of the board ;)
HATs as defined in raspberry.org.jpg
HATs as defined in raspberry.org.jpg (39.32 KiB) Viewed 4145 times

it might be a bit awkward to call it HAB (as in Hardware Attached to Back) :mrgreen:
I wonder how the RPi folks will name those..... :geek:
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

PiGraham
Posts: 5120
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 11:11 am

I think the simplest, easiest, cheapest pluggable audio connection is a USBaudio card.

Or USB speakers with single USB connection

[Edited to remove info on speakers that, it turns out, require 3.5mm socket]
Last edited by PiGraham on Fri Nov 06, 2020 1:45 pm, edited 1 time in total.

User avatar
thagrol
Posts: 8171
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 4:53 pm

cleverca22 wrote:
Thu Nov 05, 2020 10:05 am
i'm thinking that a hat (with the overlay eeprom) and a 3.5mm jack would be a pretty easy board to design, and would make upgrades trivial for the end-user
You mean like the many that already exist?
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

trejan
Posts: 5113
Joined: Tue Jul 02, 2019 2:28 pm

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 5:00 pm

LTolledo wrote:
Thu Nov 05, 2020 10:29 am
it might be a bit awkward to call it HAB (as in Hardware Attached to Back) :mrgreen:
HATS - Hardware Attached to The Side

PiGraham
Posts: 5120
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 8:31 pm

...beret?

LTolledo
Posts: 6657
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 9:18 pm

trejan wrote:
Thu Nov 05, 2020 5:00 pm
LTolledo wrote:
Thu Nov 05, 2020 10:29 am
it might be a bit awkward to call it HAB (as in Hardware Attached to Back) :mrgreen:
HATS - Hardware Attached to The Side
"back side"... yes...
confusion may arise if thought to be as "left side" or "right side"

maybe better wait for any "official announcement" from RPF folks on this matter.....

anyways.... it seems that RPi400 may not be powered via GPIO headers..(read from another forum topic).
may dampen some of my upcoming audio projects with the RPi400..

thus in the meantime... USB audio dongles or USB attached speakers are the only option at the moment
good thing though... my Sound Blaster XiFi Go is available for use....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

W. H. Heydt
Posts: 16093
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 10:00 pm

LTolledo wrote:
Thu Nov 05, 2020 9:18 pm
thus in the meantime... USB audio dongles or USB attached speakers are the only option at the moment
good thing though... my Sound Blaster XiFi Go is available for use....
Not *quite* the only options...one could use Bluetooth attached speakers as an option.

LTolledo
Posts: 6657
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Raspberry Pi 400 3,5mm jack

Thu Nov 05, 2020 10:04 pm

W. H. Heydt wrote:
Thu Nov 05, 2020 10:00 pm
LTolledo wrote:
Thu Nov 05, 2020 9:18 pm
thus in the meantime... USB audio dongles or USB attached speakers are the only option at the moment
good thing though... my Sound Blaster XiFi Go is available for use....
Not *quite* the only options...one could use Bluetooth attached speakers as an option.
yeah... forgot about that...sorry :(
being used to physically wired connections only... ;)
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

cleverca22
Posts: 6812
Joined: Sat Aug 18, 2012 2:33 pm

Re: Raspberry Pi 400 3,5mm jack

Fri Nov 06, 2020 8:23 am

thagrol wrote:
Thu Nov 05, 2020 4:53 pm
cleverca22 wrote:
Thu Nov 05, 2020 10:05 am
i'm thinking that a hat (with the overlay eeprom) and a 3.5mm jack would be a pretty easy board to design, and would make upgrades trivial for the end-user
You mean like the many that already exist?
i mean a new shape/design, that fits the shape of the pi400, and wont stick out like an old hat that perfectly fit the pi4b

User avatar
thagrol
Posts: 8171
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: Raspberry Pi 400 3,5mm jack

Fri Nov 06, 2020 12:54 pm

cleverca22 wrote:
Fri Nov 06, 2020 8:23 am
thagrol wrote:
Thu Nov 05, 2020 4:53 pm
cleverca22 wrote:
Thu Nov 05, 2020 10:05 am
i'm thinking that a hat (with the overlay eeprom) and a 3.5mm jack would be a pretty easy board to design, and would make upgrades trivial for the end-user
You mean like the many that already exist?
i mean a new shape/design, that fits the shape of the pi400, and wont stick out like an old hat that perfectly fit the pi4b
I see. Personally I think RPT missed a trick by not rotating the GPIO connector 180 degrees. Existing boards would then plug in vertically. I guess the desire to have the pins in the same orientation as all other models and all those internet diagrams won out.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

hippy
Posts: 12693
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Raspberry Pi 400 3,5mm jack

Fri Nov 06, 2020 1:28 pm

thagrol wrote:
Fri Nov 06, 2020 12:54 pm
Personally I think RPT missed a trick by not rotating the GPIO connector 180 degrees. Existing boards would then plug in vertically.
I am not sure how you mean because it seems to me they do. Admittedly the keyboard user would be looking at the underside of a HAT when plugged in rather than the top.

I have to admit the official RPF "You can connect HAT hardware directly to the 40-pin GPIO header, but it will be pointing backwards and down" makes no sense to me. The 400 looks to be using a right-angle header set against a normal Pi. HAT's which covered a Pi would therefore pivot about the header, facing backwards but up.

Maybe I'm missing something.
Last edited by hippy on Fri Nov 06, 2020 1:41 pm, edited 1 time in total.

User avatar
thagrol
Posts: 8171
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: Raspberry Pi 400 3,5mm jack

Fri Nov 06, 2020 1:40 pm

hippy wrote:
Fri Nov 06, 2020 1:28 pm
thagrol wrote:
Fri Nov 06, 2020 12:54 pm
Personally I think RPT missed a trick by not rotating the GPIO connector 180 degrees. Existing boards would then plug in vertically.
I am not sure how you mean because it seems to me they do. Admittedly the keyboard user would be looking at the underside of a HAT when plugged in rather than the top.

Is that what you are meaning; put the HAT connector on its top, adjust the 400 header to suit ?

That would work but they'd have to find a connector with some means of preventing existing HAT's being plugged in and I can foresee problems when ribbon cable gets used.
Sorry for the lack of clarity. What I meant was leave it where it is but instead of having physical pin one in the top right have it in the bottom left. HATs would then plug in directly with the board extending upwards not downwards as they would now.

Edit:
Scratch that. I think I've visualised it incorrectly.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

hippy
Posts: 12693
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Raspberry Pi 400 3,5mm jack

Fri Nov 06, 2020 1:43 pm

thagrol wrote:
Fri Nov 06, 2020 1:40 pm
Sorry for the lack of clarity. What I meant was leave it where it is but instead of having physical pin one in the top right have it in the bottom left. HATs would then plug in directly with the board extending upwards not downwards as they would now.
I edited my post, but will repeat here as it better facilitates flow ...

I have to admit the official RPF "You can connect HAT hardware directly to the 40-pin GPIO header, but it will be pointing backwards and down" makes no sense to me. The 400 looks to be using a right-angle header set against a normal Pi. HAT's which covered a Pi would therefore pivot about the header, facing backwards but up.

Maybe I'm missing something.

gordon77
Posts: 6881
Joined: Sun Aug 05, 2012 3:12 pm

Re: Raspberry Pi 400 3,5mm jack

Fri Nov 06, 2020 2:37 pm

hippy wrote:
Fri Nov 06, 2020 1:43 pm
thagrol wrote:
Fri Nov 06, 2020 1:40 pm
Sorry for the lack of clarity. What I meant was leave it where it is but instead of having physical pin one in the top right have it in the bottom left. HATs would then plug in directly with the board extending upwards not downwards as they would now.
I edited my post, but will repeat here as it better facilitates flow ...

I have to admit the official RPF "You can connect HAT hardware directly to the 40-pin GPIO header, but it will be pointing backwards and down" makes no sense to me. The 400 looks to be using a right-angle header set against a normal Pi. HAT's which covered a Pi would therefore pivot about the header, facing backwards but up.

Maybe I'm missing something.
They should have removed one pin (an earth) to make a key to prevent the connector being connected the wrong way round.

cleverca22
Posts: 6812
Joined: Sat Aug 18, 2012 2:33 pm

Re: Raspberry Pi 400 3,5mm jack

Fri Nov 06, 2020 3:38 pm

gordon77 wrote:
Fri Nov 06, 2020 2:37 pm
They should have removed one pin (an earth) to make a key to prevent the connector being connected the wrong way round.
its already using the standard 0.1" keyed shroud, where the ribbon cables will only fit in one way
but no past model had that key, so nobody has been making keyed hats

Return to “Troubleshooting”