I thought it might be interesting to compare the Rasperry Pico W with the ESP32. While the ESP32 provides faster numeric operations, I did not have any visibility how these two microcontrollers compare in regard of the WIFI speed.

The good news is, that the URLStream from the AudioTools library is working now properly for the Pico W as well, so we can use it to measure the thruput!

Measuring the Speed

I used the following test sketch to measure the download speed of some streaming audio data:

#include "AudioTools.h"

URLStream url("SSID","PASSWORD");  // or replace with ICYStream to get metadata
MeasuringStream out(50, &Serial); // final output of decoded stream
StreamCopy copier(out, url); // copy url to decoder

void setup(){
  Serial.begin(115200);
  AudioLogger::instance().begin(Serial, AudioLogger::Warning);  
  while(!Serial);

  url.begin("http://direct.fipradio.fr/live/fip-midfi.mp3","audio/mp3");
}

void loop(){
  copier.copy();
}

The Result

To my surprise the results are very similar and the ESP32 is only slightly faster.
Here are the results in Bytes per Second:

|     |RP4040W|  ESP32|
|-----|-------|-------|
|     |  15000|  16000|
|     |  15000|  14000|
|     |  15000|  15000|
|     |  19000|  16000|
|     |  14000|  16000|
|     |  16000|  14000|
|     |  14000|  17000|
|     |  16000|  15000|
|     |  16000|  15000|
|     |  15000|  16000|
|     |  16000|  16000|
|     |  15000|  14000|
|     |  15000|  16000|
|     |  16000|  16000|
|     |  15000|  17000|
|     |  16000|  15000|
|     |  16000|  16000|
|     |  15000|  16000|
|     |  15000|  15000|
|     |  15000|  15000|
|Total| 309000| 310000|
|  Avg|  15450|  15500|

So, the speeds are basically the same!

Measuring the Thruput against Github

The fact that the numbers above are so close leads me to the assumption, that the output is throttled on the server side. Therefore I try to download a big file from Github with the same sketch but using the following url: url.begin("https://pschatzmann.github.io/Resources/audio/audio.raw");

After calculating the avg of the last 10 records, the Pico was winning with 168’700 bytes per second over the ESP32 with 148’400!

Testing the Audio Server

Next, I used the Audio Server Test Sketch by increasing the sample rate to 48000 and the channels to 2.

Here as well the Pico passed with flying colors!

Measuring the MP3 Decoding Thruput

The final question, if the Pico can be used as Streaming MP3 player, can be answered by measuring the thruput of the decoded PCM data which can be done with this sketch.

The Pico was providing around 130’000-131’000 decoded bytes per second which is below the 193’300 of the ESP32. The Helix decoder provides 2 channels of int16_t (2 byte) values.

So 130’000 bytes is 65’000 frames per second. This is well above the required 44’100 or 48’000!

Conclusion

The RP2040 Rasperry Pico W is a promising platform for building Streaming Internet Radios and can be used with my AudioTools as a good alternative to the ESP32!


2 Comments

GR8Dane604 · 28. February 2023 at 16:54

That is great news Phil! Love the comparison efforts. Time to try the Pico’s I’ve had sitting on the shelf.

    pschatzmann · 28. February 2023 at 16:56

    I would be interested to hear if these theoretical results are realistic in real live when you use it togheter with an external DAC

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *