I've used a 3.5mm to RCA cable to connect my computer to external speakers before - is there something about the Raspberry Pi that would make this cable a bad choice, or is using a DAC just an overall better choice for good sound quality?
I've used a 3.5mm to RCA cable to connect my computer to external speakers before - is there something about the Raspberry Pi that would make this cable a bad choice, or is using a DAC just an overall better choice for good sound quality?
As usual, it depends.
In this case on how good the DAC and filtering is on the Pi. All an external DAC does is move the concern away from the computer's built in DAC therefore avoiding any noise and obvious distortion. It costs only a few $ so I'd imagine the DAC/filtering is crap on the Pi.
However, if it sounds ok to you, it probably is ok. This is the main thing as listening is subjective.
You can spend a fortune on making it sound better quality but there is little return on this. Most of it is just prattery and rip off merchants.
From a recording versus listening point of view: don't worry too much. The content is more important than the device reproducing it. Also the device that produced the sound initially and the device that recorded it isn't necessarily all that good quality and neither was the mixer monkey who compressed it to fuck.
Directly connected audio on the Raspberry PI is through a PWM output and connected low-pass filter. It's implemented as a 10-bit timer (or so...) that overflows at the audio sample rate (e.g. 48kHz), and the control value for the PWM are the audio samples that are fed to the PWM block via DMA.
http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM283... (page 138)
http://www.raspberrypi.org/wp-content/uploads/2012/10/Raspbe... (page 2, lower right)
Basially this means that...
1. audio sample rate is limited to 48kHz because of the sample-rate/number-of-bits tradeoff (it is not a real problem at all, but looks weak in a "audio DAC" comparison)
2. dynamic range is limited to 60dB, around the quality of cassette tapes because we only have 10 PWM bits
3. the PWM signal (square-waves) will have many high-order harmonics which are not filtered well by the simple RC lowpass. Some of it might be mixed back into the audible range by nonlinearities in your amplifier or your loudspeakers, or at least waste power and unnecessarily heat up your amplifier. Especially with Class-D (?) switched amplifiers this might be audible.
thanks for the technical information.
I've tested the output with a sound-card (M-Audio Delta 44, via a Yamaha MV12/4 Mixing console as preamp) that has (at the test-settings) a noise-floor of ~-130dB/Hz. If I let the raspberry-pi play a sine-wave, I get harmonics at ~60-66dB down from full-scale.
I suspect that this is unshaped quantization noise, so this would compare the suspicion that the PWM resolution is 11 or 12 bit.
Here's a screenshot of a frequency analyzer plugin running while recording the audio output of the RPI, for comparison I put in the same sine being played by the 16bit DAC of my mobile phone, here the harmonics are down -90dB or more.
https://picasaweb.google.com/lh/photo/fWlV5aan-94e9GOpXJaLm9...
Sinewave has been generated with the command
$ sox -n -t wav - synth 60 sine 1013.0 | aplay
on the raspberry pi.I get the impression that these people are not "golden ear hifi idiots" but are calm, sensible, people reporting actually hearable noise.