The GPIO header allows connection to the PCM audio output signals. These are the digital signals used to generate the analogue audio at the headphone jack using a DAC (apparantly a very cheap implementation using PWM according to the Stack Exchange link).
A quick look on Wikipedia indicates that HDMI also carries PCM audio, so in theory HDMI audio should be equally good as the audio from the GPIO because they're actually the same data (ignoring optional formats over HDMI which might be slightly better in some specific respects than the PCM - no idea if the Pi supports any of those, or how they're any better for that matter).
formatting link
USB sound cards probably use PCM as well, though I don't know if the bitrate limits might be lower, and some apparantly introduce a delay. As far as quality goes it's most likely to be the DAC that really counts, and anything sold as an audio adapter should be better than PWM unless it's a complete rip-off.
When I started to employ my 3B RPi using some leftover parts, I had a VGA monitor and USB kb & mouse, so I needed an HDMI to VGA adapter. There were places that had adapters w/ a 3.5mm for audio, but I opted for an adapter w/o audio plug outlet in favor of just using the RPi's audio outs for some little 'computer speakers'.
But, I'm puzzled about the analog vs digital. I would assume that the HDMI audio is digital, but the 3.5mm plug sounds/looks like an analog audio outlet.
But, I'm sure those HDMI to VGA adapters w/ audio plug aren't converting digital to analog audio. What is the answer to my confusion?
IIUC, the transition from digital to analog audio then occurs in the monitor, if using the HDMI connection, or the Pi itself, if using the headphone jack. Have I got this much right?
I've tried using the audio output on a Dell ST2200L HDMI monitor and the headphone jack, neither showed any obvious defects.
Thanks to all for reading and posting informative links.....
It's NOT a headphone plug because the output level is too low for headphones. It's a "3.5 mm line output". You would need a headphone amplifier.
The Pi has no audio chip (DAC). It uses a simple(*) filter circuit controlled by PWM. Sort of a manual 1-bit digital to analogue conversion by the CPU.
The analogue out sounds horrible. But, they improved the circuitry for the Pi3 and greatly improved the driver at some point. With that, it sounds pretty good. I don't know if the improved driver is now standard, I guess it might by. To be sure, add "audio_pwm_mode=2" to /boot/config.txt
HDMI output is digital. Quality of the sound on that end depends on where you plug it in.
You might (I do) still get some noise/hiss/beep even when using the hdmi. Annoying when quiet, not noticeable by me even at low music level, so I put up with it. Not sure of the source. Maybe the whole setup is not grounded well, maybe the power adapter of the Pi sucks, maybe the lcd display+control board I plugged on top adds noise.
I get perfect quality from a Pi Zero with IQaudIO DACzero board and a good old cinch cable.
-- If you tell a lie big enough and keep repeating it, people will eventually come to believe it. The lie can be maintained only for such time as the State can shield the people from the political, economic and/or military consequences of the lie. It thus becomes vitally important for the State to use all of its powers to repress dissent, for the truth is the mortal enemy of the lie, and thus by extension, the truth is the greatest enemy of the State.
-- If you tell a lie big enough and keep repeating it, people will eventually come to believe it. The lie can be maintained only for such time as the State can shield the people from the political, economic and/or military consequences of the lie. It thus becomes vitally important for the State to use all of its powers to repress dissent, for the truth is the mortal enemy of the lie, and thus by extension, the truth is the greatest enemy of the State.
Actually 1 bit DAC PWN can be amongst the lowest distortion and highest quality ... the errors are down to timing issues rather than voltage issues as it were.
But you should be clocking pretty fast. and that makes timing harder
I used a HifiBerry DAC board. Its pretty good
--
You can get much farther with a kind word and a gun than you can with a
kind word alone.
Al Capone
There are some surprisingly good (not great) op-amp based ones (Cmoy derivatives) that aren't too expensive especially as kits.
That they are.
Depending on the DAC it meets.
Or start analogue and keep it that way which is *much* more expensive and doesn't work when a computer is involved.
--
Steve O'Hara-Smith | Directable Mirror Arrays
C:\>WIN | A better way to focus the sun
The computer obeys and wins. | licences available see
You lose and Bill collects. | http://www.sohara.org/
Just got a cheap HDMI to VGA adapter with audio from CPC:
AV27363 - UNBRANDED 77HDMIVGCBL033 HDMI to VGA Lead with Audio, Gold
As HDMI has no analog audio it must be converting the HDMI digital audio stream to stereo analog on its 3.5 mm jack plug. Not sure if it or omxplayer on a Raspberry Pi is doing a basic 5.1 or 7.1 mix down to stereo. All I know is that if I play a channel check video file with only a 5.1 or 7.1 sound track I do hear all the channels on the correct side (and center) and at various levels. Except the .1 (LFE) which is to be expected.
Quality is pretty good, the level might be a bit on the high side.
Mostly proprietary SoC, Broadcom ARM version with their VideoCore GPU. I have no idea what's in there, but the Pi doesn't have hardware PWM or analogue gpio pins.
--
"I am inclined to tell the truth and dislike people who lie consistently.
This makes me unfit for the company of people of a Left persuasion, and
all women"
Yes. That's why I said "audio DAC chip" in an effort to be more precise. Obviously there is always Digital to Analog Conversion but in the context of computer audio output circuitry, how I think most people understand it, the Pi does not have "a DAC".
Anyway, with that new driver the output seems to be entirely acceptable.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.