I am using the Raspberry Pi for a portable project which uses headphones. The audio quality from the HDMI output is much better than the built-in audio jack. From what I have seen, this is due to the HDMI having filters the audio jack does not. Is there a way I could modify the Pi to get clean audio, maybe by splitting the HDMI output or soldering something onto the board?
My go-to for headphone output from the Pi is these Tendak HDMI adapters, which include a 3.5mm jack output. They run fine off bus power (no need for an external power supply) and produce reasonable (not exceptional) quality audio. From the look of them they're just rebadged Chinese mass manufactured things, so I'd imagine there's likely to be an internationally available equivalent.
The quality difference between the HDMI port audio is that the HDMI port utilizes a digital output which practically guarantees a 1 to 1 reproduction of sound from the audio source. Where as on the 3.5mm headphone jack analog audio is utilized which is not perfect as there may be minute interferences in the signal, it is also substantially more difficult to produce a high quality analog sign. Although in the newer Pi models such as revision 3 the analog audio on the Pi has become substantially better.
To produce a higher quality audio output I would recommend that you use a USB sound card. But if oh would like to instead use the audio from the HDMI port you would need to purchase something such as this which is an HDMI audio extractor, which will convert the HDMI audio signal to an analog one, although for this particular model you would still need to buy an RCA to 3.5mm adapter to be able to connect headphones.