ICYStream with hiccups #441
-
Salut Phil, congratulations, these are great libs. Right now I'm playing around with these two libs (VS-Code + Platformio + ESP32-A1S audio-kit).
The basics are working, i.e. the compiler is happy, the application can be flashed and the hardware works so far, the "sinus" test application provides the 1kHz audio at the headphone output as expected. My project idea is an ICYStream based webradio, finally in the end a player alla ESP32/Vue Radio Player. So to get familiar I compiled the simple ICYStream example and flashed it to the ESP32-A1S based audio kit. Everything seems to run normally, the URLs from your example are loaded and in principle the stream is playing somehow. However only short parts are played and interrupted by a pause. It feels like this is about 500ms sound and 100ms pause. I have also read through wiki Performance page and changed the various parameters such as What can be the cause for the hiccups ? Second issue: This is my test environment:
main.cpp, the simple ICYStream example#include "AudioTools.h"
#include "AudioCodecs/CodecMP3Helix.h"
#include "AudioLibs/AudioKit.h"
const char *urls[] = {
"https://stream.srg-ssr.ch/rsc_de/aacp_96.m3u",
"http://liveradio.swr.de/sw890cl/swr3/play.m3u",
"http://stream.srg-ssr.ch/m/rsj/mp3_128",
"http://stream.srg-ssr.ch/m/drs3/mp3_128",
"http://stream.srg-ssr.ch/m/rr/mp3_128",
"http://sunshineradio.ice.infomaniak.ch/sunshineradio-128.mp3",
"http://streaming.swisstxt.ch/m/drsvirus/mp3_128"
};
const char *wifi = "theWlan";
const char *password = "thePass";
ICYStream urlStream(wifi, password);
AudioSourceURL source(urlStream, urls, "audio/mp3");
AudioKitStream kit;
MP3DecoderHelix decoder;
AudioPlayer player(source, kit, decoder);
void next(bool, int, void*) {
player.next();
}
void previous(bool, int, void*) {
player.previous();
}
void stopResume(bool, int, void*){
if (player.isActive()){
player.stop();
} else{
player.play();
}
}
void printMetaData(MetaDataType type, const char* str, int len){
Serial.print("==> ");
Serial.print(toStr(type));
Serial.print(": ");
Serial.println(str);
}
// Arduino setup
void setup() {
Serial.begin(115200);
AudioLogger::instance().begin(Serial, AudioLogger::Error);
// setup output
auto cfg = kit.defaultConfig(TX_MODE);
cfg.sd_active = false;
kit.begin(cfg);
// setup navigation
kit.addAction(PIN_KEY1, next);
kit.addAction(PIN_KEY3, previous);
// setup player
player.setMetadataCallback(printMetaData);
player.setVolume(0.7);
player.begin();
}
// Arduino loop
void loop() {
player.copy();
kit.processActions();
} platformio.ini
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
PSRAM is not used by the audiotools library unless you add the related activation class explicitly. I am not sure why you have this problem. So I suggest the following:
|
Beta Was this translation helpful? Give feedback.
-
The issue is not CPU, but a pin conflict: |
Beta Was this translation helpful? Give feedback.
-
kit.audioActions().setEnabled(int pin, bool enabled) should do the trick... |
Beta Was this translation helpful? Give feedback.
-
The unused buttons can be switched off with this function. So hopefully I remember next time :-) However, I still have a question. What are your experiences when you compare the two audio kits? Which is your favorite? |
Beta Was this translation helpful? Give feedback.
-
The LyraT does not have the microphone bug and you can select properly between Aux in and Microphones. So for anything not needing Aux in I still prefer the AudioKit |
Beta Was this translation helpful? Give feedback.
The issue is not CPU, but a pin conflict:
#define PIN_KEY2 13
Key 2 is assigned to some functionality which is triggered, when you do not deactivate the JTAG and SD