orchardaudio
Posts: 102
Joined: Wed Feb 03, 2016 11:19 pm
Contact: Website Facebook Twitter

Pi4 vs Pi3 Audio Performance

Thu Jul 04, 2019 9:42 pm

Hello,

I was trying out my company's PecanPi DAC (https://orchardaudio.com/pecanpi) on the new Pi4 and the audio performance is much worse than with a Pi3.

Here is what I did:
Pi3B with Raspian Stretch and audacity installed -- THD+N = 110dB
Pi4B with Raspian Buster and audacity installed -- THD+N = 90dB

In both cases the only thing I did was add the
dtoverlay=rpi-dac to config.txt, installed audacity and generated a 1kHz tone.

Why is the Pi4 so much worse here? Is the audio library implemented differently?
~~Orchard Audio~~
How do you like them apples?
www.orchardaudio.com
www.facebook.com/orchardaudio

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7303
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Pi4 vs Pi3 Audio Performance

Fri Jul 05, 2019 11:49 am

Far too many variables.
The first things to check.
- kernel versions. Only the absolute latest Stretch updates bumped it to the 4.19 kernel, whilst Buster is 4.19.
- Test Buster on a Pi3.

AFAIK The I2S block is identical between the two, although implemented in 28nm instead of 40nm.
The clock setup is different, but the PLLs should still be feeding in the same frequency.
There are differences in the PMIC, so if you're powering your DAC from the Pi then what level of filtering have you applied?

From the Pi's side this is all digital audio, so other than potentially jitter on the I2S clocks there is nothing it can do to change the THD+N figure.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

orchardaudio
Posts: 102
Joined: Wed Feb 03, 2016 11:19 pm
Contact: Website Facebook Twitter

Re: Pi4 vs Pi3 Audio Performance

Sun Jul 07, 2019 7:08 pm

6by9 wrote:
Fri Jul 05, 2019 11:49 am
Far too many variables.
The first things to check.
- kernel versions. Only the absolute latest Stretch updates bumped it to the 4.19 kernel, whilst Buster is 4.19.
- Test Buster on a Pi3.

AFAIK The I2S block is identical between the two, although implemented in 28nm instead of 40nm.
The clock setup is different, but the PLLs should still be feeding in the same frequency.
There are differences in the PMIC, so if you're powering your DAC from the Pi then what level of filtering have you applied?

From the Pi's side this is all digital audio, so other than potentially jitter on the I2S clocks there is nothing it can do to change the THD+N figure.
I am not quite sure what is going on but I have tried the latest release of Buster on Pi3B, Pi3B+ and Pi4B, they all have the issue.

I got the last release of stretch before buster came out same thing.

Lastly I downloaded the latest version of Volumio and there are no issues.

In all cases I used the RPI-DAC overlay and just played a 1kHz tone.

Is this because Volumio uses a different kernel?

In all cases DAC backpowers the Pi.
~~Orchard Audio~~
How do you like them apples?
www.orchardaudio.com
www.facebook.com/orchardaudio

pik33
Posts: 182
Joined: Thu Sep 10, 2015 4:26 pm

Re: Pi4 vs Pi3 Audio Performance

Tue Jul 09, 2019 7:52 am

What audio driver drivs the DAC? PulseAudio? Maybe there is resampling/mixing/processing in the background until the audio stream reaches the DAC. Have you tried JACK?

orchardaudio
Posts: 102
Joined: Wed Feb 03, 2016 11:19 pm
Contact: Website Facebook Twitter

Re: Pi4 vs Pi3 Audio Performance

Tue Jul 09, 2019 12:42 pm

pik33 wrote:
Tue Jul 09, 2019 7:52 am
What audio driver drivs the DAC? PulseAudio? Maybe there is resampling/mixing/processing in the background until the audio stream reaches the DAC. Have you tried JACK?
I am not sure what you are asking.

There is clearly a difference between Volumio and Raspian. I don't know what that difference is.

I am not a software / firmware person.

In both cases I used the rpi-dac overlay.
~~Orchard Audio~~
How do you like them apples?
www.orchardaudio.com
www.facebook.com/orchardaudio

HiassofT
Posts: 218
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: Pi4 vs Pi3 Audio Performance

Tue Jul 09, 2019 2:22 pm

Can you check with a WAV file and play it with "aplay -v 1khz.wav"?

Please test this on RPi3 Stretch, RPi3 Buster and RPi4 Buster and post the output of above command and your THD measurements.

Could well be that Audacity in Buster behaves differently to the version from Stretch.

so long,

Hias

wildestpixel
Posts: 20
Joined: Sun May 26, 2019 7:45 pm

Re: Pi4 vs Pi3 Audio Performance

Tue Jul 09, 2019 9:26 pm

orchardaudio wrote:
Tue Jul 09, 2019 12:42 pm
pik33 wrote:
Tue Jul 09, 2019 7:52 am
What audio driver drivs the DAC? PulseAudio? Maybe there is resampling/mixing/processing in the background until the audio stream reaches the DAC. Have you tried JACK?
I am not sure what you are asking.

There is clearly a difference between Volumio and Raspian. I don't know what that difference is.

I am not a software / firmware person.

In both cases I used the rpi-dac overlay.
What are the thoughts of the software and hardware engineers there at Orchard Audio ? I see you charge premium price tags for your products, (it) would be reassuring that there are representatives of the company that do profess to be software savvy in this respect for customers investing their hard earned (money) in the product.

What I’m reading in here is that a representative of the company says this product sucks on new hardware, please don’t buy it. As a Category Manager myself I know my Commercial Director would be not happy had I made a PR blue / gaff in print, social, bulletin board or whatever medium.
To infinity and the pond

Pi4B 4GB heading up the small armada

orchardaudio
Posts: 102
Joined: Wed Feb 03, 2016 11:19 pm
Contact: Website Facebook Twitter

Re: Pi4 vs Pi3 Audio Performance

Wed Jul 10, 2019 2:04 am

HiassofT wrote:
Tue Jul 09, 2019 2:22 pm
Can you check with a WAV file and play it with "aplay -v 1khz.wav"?

Please test this on RPi3 Stretch, RPi3 Buster and RPi4 Buster and post the output of above command and your THD measurements.

Could well be that Audacity in Buster behaves differently to the version from Stretch.

so long,

Hias
Looks like you hit it right on the nose. I used VLC media player to play a 1kHz wav file on both the Pi3 and Pi4 and there are no issues. So Audacity is doing something not quite right.
~~Orchard Audio~~
How do you like them apples?
www.orchardaudio.com
www.facebook.com/orchardaudio

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2094
Joined: Thu Jul 11, 2013 2:37 pm

Re: Pi4 vs Pi3 Audio Performance

Wed Jul 10, 2019 9:40 am

The usual suspects:
- Is audacity generating 16-bit samples and storing as 24-bit?
- Dithering at 16-bit resolution?
- Resampling using a suboptimal filter?
Rockets are loud.
https://astro-pi.org

orchardaudio
Posts: 102
Joined: Wed Feb 03, 2016 11:19 pm
Contact: Website Facebook Twitter

Re: Pi4 vs Pi3 Audio Performance

Wed Jul 10, 2019 10:44 am

jdb wrote:
Wed Jul 10, 2019 9:40 am
The usual suspects:
- Is audacity generating 16-bit samples and storing as 24-bit?
- Dithering at 16-bit resolution?
- Resampling using a suboptimal filter?
I used audacity to generate the wav file that I played in VLC, so it is generating 24 bits.

The audacity team must have changed something because audacity did not use to behave this way.
~~Orchard Audio~~
How do you like them apples?
www.orchardaudio.com
www.facebook.com/orchardaudio

Return to “Advanced users”