raspberry pi 4 sound issues !

"...mid range seems "closed in", the treble is very "harsh" at high volumes..."

This is exactly the PCM5242 sound quality if fed with bad power and bad i2s signal. This DAC HAT suffers even more from the rpi4 emi problems then many others. But yes, 2$ IC, 2$ sound. Don't expect something revolutionary.
 
Rpi4 uses a newer processor, higher clock frequencies and draws more power. It is not the preferred Pi for audio. Also the built in WIFI can cause issues, but it is strange that it is as bad as you describe it.
Myself I use a Pi 2 for audio which is very much fast enough for driving a DAC with Moode or Volumino. It also uses less power (around 300 mA) so it is on more or less 24/7.
I think that you can still buy one from approved resellers.
It has no built in Wifi that can cause problems but connects via an ethernet cable, or a Wifi dongle on an USB extender cable will work just as well or better.
It sounds really nice, even with a resonably cheap HiFiBerry DAC (for around 30-40€).
Second choise is a Rpi 3, again with Wifi turned off.
 
My introduction to Rpi was most recent with the Allo Boss2 Player and Allo Shanti Power Supply.

Playing through a Pass Labs clone Class A amplifier and MLTQWT EnABLD FostexFE168ESigma, I was very disappointed with the sound quality. I made a side by side comparison with the discrete DAC mentioned below, using the same music source.

I decided to keep the Shanti supply. Now I use a Raspberry Pi4 8GB in an ArgonV2 case, running Volumio and a Topping D50s DAC, both powered by Shanti, it sounds incredible. I couldn't ask for better for the given cost.

My observations regarding Rpi are as follows:-

Needs a good metal shield against RFI and EMI.
Needs a good power supply.
Preferably shielded Ethernet cable.
Each OS has its own advantages and disadvantages. For the present I prefer Volumio.
If using I2S signal with a HAT DAC, implementation of the DAC and Clock matters. In fact, this is critical.

Other general observations, not pertaining to HATs but discreet DACs:-

Separate DAC chips for each channel gives better dynamics and channel separation.
Output stage opamps determine overall sound signature.
USB A to B cable cannot be a generic type. After I replaced the Topping supplied USB cable with a Monolith cable, I found that the Sound Stage completely changed for the better in Height and Depth. Tonal quality and definition of instruments with space and air around each instrument/voice is evident. Other cables - Interconnects and Speaker cables can be used to tailor the overall sound signature to quite an extent.

Finally, if the rest of your system is not transparent and revealing to a high degree, many of the descriptions given above will seem fanciful. Welcome to the world of Audiophiles.
 
finally tested the the rpi4 with a battery and sad to report that it made no difference :( one thing of note was that during testing with the battery i noticed that the under voltage symbol(yellow lightning top right of screen) was on constantly? the batteries were brand new!.

@rick pa good idea, i'll have to try that. cheers

@samuel jayaraj thank you for sharing
 
@phofman the reason i purchased the iqaudio dac was because of the already poor sound quality from the rpi4, all the dac has done, is to increase the volume of the poor sound quality !!
This just doesn't add up. Any dac, even the most basic ones, must be a very big step up from the built in headphone jack. Do as phofman suggests and get some simple measurements done. Nothing else makes sense to do at this point.
 
dmesg gave me this output, could this be the issue ?
" 809.829933] pcm512x 1-004c: No SCLK, using BCLK: -2
[ 816.927852] pcm512x 1-004c: No SCLK, using BCLK: -2
[ 1511.043323] pcm512x 1-004c: No SCLK, using BCLK: -2
[ 2809.091077] pcm512x 1-004c: No SCLK, using BCLK: -2"
 
No, this is mine:

Code:
[719647.496680] pcm512x 1-004c: No SCLK, using BCLK: -2
[719920.583137] pcm512x 1-004c: No SCLK, using BCLK: -2
[720121.222556] pcm512x 1-004c: No SCLK, using BCLK: -2
[720326.469105] pcm512x 1-004c: No SCLK, using BCLK: -2
[725371.753193] snd-rpi-iqaudio-dac soc:sound: snd_rpi_iqaudio_gpio_mute: muting amp using GPIO22
 
No need to guess when all source code and datasheets are available. That line is just an info from the pcm512x codec driver linux/pcm512x.c at rpi-5.12.y * raspberrypi/linux * GitHub . It says what I posted in https://www.diyaudio.com/forums/pc-based/373129-raspberry-pi-4-sound-issues-4.html#post6678720 . Because the iqaudio driver switches the RPi I2S controller to master mode (flag SND_SOC_DAIFMT_CBS_CFS means Clock-Bit-Slave and Clock-Frame-Slave from the view of the codec soc-dai.h - include/sound/soc-dai.h - Linux source code (v4.9) - Bootlin ), no master clock is being provided to the codec (= DAC) and the codec must use its internal PLL to generate its master clock from the incoming bitclock. That post has a link to description of the clock arrangement in the codec datasheet too.

Maybe adding a cheap 24.576MHz crystal to the SCLK pin of the PCM5242 and reconfiguring the driver to make the I2S controller slave and DAC master would improve the results for 48kHz samplerates family. The detailed image of the DAC board https://pbs.twimg.com/media/C2JtHD1XUAE06Nt.jpg shows that the SCLK pin is already routed from the DAC chip to R8, going to some via (maybe ground). But considering prices of proper master-clock DACs such tweaking is probably not worth the time, when it is not sure that the result would make any audible difference.
 
@phofman thank you for sharing your intricate knowledge(its impressive)

@jean-paul i could well end up buying a completely different SBC in the near future, but not the rpi3 as this would have to function as my desktop pc(as the rpi4 currently does)

@yatshsiro i mostly play music from youtube using the chrome browser and mp3's/4's that i have stored on the sd-card of the rpi4. it doesnt matter which of these i use, the result is still the same. all of my stuff is rotel (pre & power) with acoustic energy speakers. i have a radio tuner that is able to hit the lows that the rpi4 cannot, this is how i know that the problem is with the rpi4/dac.



i have contacted the company that i purchased the dac from, and will ask for a replacement. it was suggested that the problem lays with the analog part of the rpi/dac, the more i think about this it does seem to make sense.
 
Your DAC board does not have any active output filter nor output buffer. The DAC lines go through 470R serial resistors and LPF clamping capacitors directly to output cinches. That is not a proper DAC output to connect a preamp with regular-length coax cables. The TI recommended design shows the same direct connection, but to an adjacent headphone amp with no coupling capacitor in between. I would not be surprised if this was the reason for the attenuated bass you say to have measured. IMO that DAC board has an extremely compromised design which extra two dollars in BOM could have improved significantly - one crystal for master clock (at least for the 48kHz samplerate family), one output buffer opamp.
 
Last edited: