Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player-url-i2s #24

Closed
podaen opened this issue Oct 25, 2021 · 111 comments
Closed

player-url-i2s #24

podaen opened this issue Oct 25, 2021 · 111 comments

Comments

@podaen
Copy link
Contributor

podaen commented Oct 25, 2021

The player-url-i2s works for changing from one to next. After that it stays on the second channel. It is trying to change to next but for one reason it keeps taking the second url.

@pschatzmann
Copy link
Owner

pschatzmann commented Oct 25, 2021

I pushed the related correction to main. I also extended the example to demo how to debounce the input...

@podaen
Copy link
Contributor Author

podaen commented Oct 25, 2021

in you example you need to change debouncer.debounce to nextBuffonDebouncer.debounce()

I did some tests with player.next and I can not change between other channels than 0 en 1.

@pschatzmann
Copy link
Owner

Is this issue with my example ?
This would happen if the arraySize has not been defined correctly in the constructor of AudioSourceURL.
Anyhow I will retest this tomorrow...

@podaen
Copy link
Contributor Author

podaen commented Oct 26, 2021

I diden't set it right in the AudioSourceURL. I changed it from 5 to 2. I do the test now... and it works.

@pschatzmann
Copy link
Owner

I changed the constructor so that the array size is not needed any more to prevent this problem for others.
Are we ready to close this issue as well ?

@podaen
Copy link
Contributor Author

podaen commented Oct 26, 2021

Good, no I want to select a station over a2dp if this is possible. I am looking now for making this possible...

@pschatzmann
Copy link
Owner

Not sure if I understand your correctly but note the following:
#9

@podaen podaen closed this as completed Oct 26, 2021
@podaen podaen reopened this Oct 28, 2021
@podaen
Copy link
Contributor Author

podaen commented Oct 28, 2021

I have updated the library and now the player doesn't compile anymore...

AudioOutput.h: 575:73: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
} else if (p_info_in->channels = 1 && p_info_out->channels>1){

AudioOutput.h: 579:48: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
} else if (p_info_out->channels = 1){

@pschatzmann
Copy link
Owner

Sorry about that, but I did't not get this when I tested in Arduino...

@podaen
Copy link
Contributor Author

podaen commented Oct 29, 2021

Did you enabled the warnings for compiling?

@pschatzmann
Copy link
Owner

It's set to Default

@podaen
Copy link
Contributor Author

podaen commented Oct 29, 2021

mine too...

@podaen
Copy link
Contributor Author

podaen commented Oct 29, 2021

It is compiling now. Thx

I tried to set the config file back to the settings that worked in the previous topic I have made. But now the music stops. Soo I tried different settings but it keeps chunking.

@podaen
Copy link
Contributor Author

podaen commented Oct 29, 2021

Maybe it was the antenna again. I's running good now with the default settings

@podaen podaen closed this as completed Oct 29, 2021
@podaen podaen reopened this Oct 29, 2021
@podaen
Copy link
Contributor Author

podaen commented Oct 29, 2021

Did you use the resolved links in your examples?

@podaen
Copy link
Contributor Author

podaen commented Oct 29, 2021

I am using now a local http link out of your xml and it's running much better now.

@podaen podaen closed this as completed Oct 29, 2021
@podaen
Copy link
Contributor Author

podaen commented Oct 30, 2021

Could you please add a procedure "select radio station by index number" of the array url?
I have 25 radiostations added and it would be handy if I just could type a number to selected one radio station I want to lissen too.

@podaen podaen reopened this Oct 30, 2021
@podaen
Copy link
Contributor Author

podaen commented Oct 30, 2021

I have made a station select. I will look to upload when I am back.

@pschatzmann
Copy link
Owner

have you tried the following in your sketch:

player.stop();
source.setPos(idx);
player.play(); 

I did not want to provide the direct navigation on the player level because not all AudioSource objects can support this...

@podaen
Copy link
Contributor Author

podaen commented Oct 30, 2021

I know, I did it the same way... It diden't cost me a lot of work to do, but I will take over the latest version.

I also add this...

  Serial.print(RadioPos);
  Serial.print("/");
  Serial.println(sizeof(urls) / sizeof(urls[0]));

it says url 1 of 5 is playing... You could add this to your log if you like.

@podaen
Copy link
Contributor Author

podaen commented Oct 30, 2021

If I want to make a portable radio I was thinking to impliment a small display... For that it will be usefull to have the name of the radio station in that array. You could also add the index to it.

For now I will integrate it in to a existing build in spreaker system without display. But maybe I will make something like a portable in the futer. This is what I had in mind.

@pschatzmann
Copy link
Owner

I just wanted to highlight, that this is the advantage of my design: It is object oriented!
So all you need to do is to create your own subclass from the AudioSourceURL and adding all your additional (e.g. display related) functionality.

Then you can just provide your own implementation as parameter to the AudioPlayer....

@podaen
Copy link
Contributor Author

podaen commented Oct 30, 2021

have you tried the following in your sketch:

player.stop();
source.setPos(idx);
player.play(); 

I did not want to provide the direct navigation on the player level because not all AudioSource objects can support this...

I don't know why this continuesly doesn't work with me and after revise it it does, but it doesn't change the station on index with me. The log says it is changing but nothing ever happend...

@podaen
Copy link
Contributor Author

podaen commented Oct 30, 2021

This doesn't shows up

[W] HttpHeader.h : 226 - Waiting for data...
[W] HttpRequest.h : 141 - no CONTENT_LENGTH found in reply

@podaen
Copy link
Contributor Author

podaen commented Nov 25, 2021

I have tested the url player with these external links.

"http://mp3.streampower.be/sporza-high",//nok
"https://22323.live.streamtheworld.com/TOPRETRO.mp3",//ok//nok on the second time it runs
"http://23553.live.streamtheworld.com:80/RADIO_2_VLAAMSBR_128.mp3",//ok
"http://20723.live.streamtheworld.com/QFOUTERADIO.mp3",//ok
"http://19983.live.streamtheworld.com/QMUSIC.mp3",//ok
"http://22183.live.streamtheworld.com/JOE.mp3",//ok
"http://21303.live.streamtheworld.com/STUDIO_BRUSSEL_128.mp3",//ok
"http://icecast-servers.vrtcdn.be/stubru_tgs-high.mp3",//ok
"http://icecast-servers.vrtcdn.be/stubru_tijdloze-high.mp3",//ok
"http://icecast-servers.vrtcdn.be/ketnetradio-high.mp3",//ok
"http://22353.live.streamtheworld.com/MNM_128.mp3",//ok
"http://icecast-servers.vrtcdn.be/mnm_90s00s-high.mp3",//ok
"http://icecast-servers.vrtcdn.be/mnm_hits-high.mp3",//ok
"http://icecast-servers.vrtcdn.be/mnm_urb-high.mp3",//ok
"http://fred.torontocast.com:1050/stream",//ok
"http://icecast-servers.vrtcdn.be/radio1_classics_high.mp3",//ok
"http://icecast-servers.vrtcdn.be/radio2_benebene-high.mp3",//ok
"http://icecast-servers.vrtcdn.be/radio2_unwind-high.mp3",//ok
"http://icecast-servers.vrtcdn.be/stubru_bruut-high.mp3",//ok
"http://icecast-servers.vrtcdn.be/stubru_untz-high.mp3",//ok
"http://23553.live.streamtheworld.com:80/RADIO_2_VLAAMSBR_128.mp3",//ok
"http://randstad.wirelessbelgie.be:8330/stream.mp3",//ok
"http://21253.live.streamtheworld.com/RADIO1_128.mp3",//ok

The all work but when I run over the second time it crashes on this link below, strange because it worked well on the first time.

"https://22323.live.streamtheworld.com/TOPRETRO.mp3",//ok//nok on the second time it runs

here is my stack description

Exception:Error:
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/list.c:214:::0x4008c2f5:uxListRemove
0x400014fd: ?? ??:0
0x4000150d: ?? ??:0
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:3507:::0x4008adf2:vTaskDelete
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(298): error 0x400d1dc7:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(298): error 0x400d1e03:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(298): error 0x400d1d6b:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(298): error 0x400d20e9:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(298): error 0x400d2082:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(298): error 0x400d6203:NextStation()
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(298): error 0x400d625b:AutoNextStation()
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(298): error 0x400d6269:loop()
C:\Users\Dave2Moon\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32/main.cpp(23): error 0x400de1ac:loopTask(void*)
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1):::0x400899c2:vPortTaskWrapper
0x40078000: ?? ??:0
0x40080400: ?? ??:0
0x400806a8: ?? ??:0

What do you think it could be... I have to say I reased the stack to 68000, because I have tested it for my esp32 with sd card in my shetch and that works.

@podaen podaen reopened this Nov 25, 2021
@podaen podaen closed this as completed Nov 30, 2021
@podaen
Copy link
Contributor Author

podaen commented Dec 12, 2021

@podaen podaen reopened this Dec 12, 2021
@pschatzmann
Copy link
Owner

Most of these links are not working even if you open them in the browser.
For the aac one you just need to use the Helix aac decoder instead of the mp3...

@podaen
Copy link
Contributor Author

podaen commented Dec 12, 2021

could they be merged in to one player?

@pschatzmann
Copy link
Owner

My decoder API is standardized. So all we would need is a combined decoder which determines the data format dynamically and forwards it to the correct implementation.

Are you interested to pick up the challenge ?

@podaen
Copy link
Contributor Author

podaen commented Dec 13, 2021

I am ready... You begin!

@pschatzmann
Copy link
Owner

pschatzmann commented Dec 13, 2021

I will not be able to work on this for the next couple of weeks. But I can give an outline what needs to be done with a couple of hints.

  • Create new Decoder class e.g. public DecoderHelix as subclass of AudioDecoder.

  • add new field content_type with enum { Undefined, MP3, AAC,}

  • In the write() method try to determine the content with the first write (if it has not been determined yet).

  • in begin() method reset the determined content type (content_type=Undefined)

  • determining the content type. I think the following logic might work:

              if (start[0]==0xFF && start[1]==0xF1){
                  content_type = AAC;
              } else if (strncmp(start,"ID3",3) || start[0]==0xFF || start[0]==0xFE ){
                  content_type = MP3;
              } else if (strncmp(start,"RIFF",4)){
    
  • In all methods just forward the calls to AACDecoderHelix or MP3DecoderHelix

@podaen
Copy link
Contributor Author

podaen commented Dec 13, 2021

Most of these links are not working even if you open them in the browser.

Those links won't work with a brower, but with other software...

2021-12-13_132051

For example pls is a windows media player stream

MP3, AAC or OGG

are html5 supported

@pschatzmann
Copy link
Owner

Since this is Windows, it's not in my scope.
Though it should not be too difficult to create AudioSource implementation which parses a pls file. It's just a text property file.

@podaen
Copy link
Contributor Author

podaen commented Dec 13, 2021

I m not interested too. My attention is now to the aac, m3u and mp3.

@pschatzmann
Copy link
Owner

pschatzmann commented Dec 13, 2021

I quickly double checked on github and did not find a single m3u parser in c or c++.
The one in python had 2000 - 3000 lines of code. So that would be a couple of days of work....

update: we could build on vlc
https://github.com/videolan/vlc/blob/master/modules/demux/playlist/m3u.c

@podaen
Copy link
Contributor Author

podaen commented Dec 15, 2021

I don't have much for now because I cann't get the data to work with. Normally for the AudioDecoder I have to give an AudioType in libhelix, but I cann't do that. So I looking for a way to read the bytes from the stream without losing them.

URLStream urlStream(wifi, password);
AudioSourceIcyUrl source(urlStream, urls, "audio/mp3");
I2SStream i2s;
VolumeOutput volume(i2s);
LogarithmicVolumeControl lvc(0.1);
MP3DecoderHelix decoder;
//DecoderHelix test(urlStream, urls, "audio/mp3");
DecoderHelix test(urlStream);
#if defined(USE_HELIX) || defined(USE_DECODERS)

#include "Stream.h"
#include "AudioTools/AudioTypes.h"
#include "AudioCodecs/CodecMP3Helix.h"
#include "AudioCodecs/CodecAACHelix.h"

enum AudioType {
	Undefined,
	MP3,
	AAC,
} content_type;

namespace audio_tools {

class DecoderHelix : public AudioDecoder {
	public:
		DecoderHelix() {
			LOGD(LOG_METHOD);
		}
		DecoderHelix(URLStream source) {
			LOGD(LOG_METHOD);
			source.readBytes(start, 3);//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
		}
		~DecoderHelix() {
                         content_type = Undefined;
		}
		virtual void setOutputStream(Print& outStream) {
		}
		void begin() {
			LOGD(LOG_METHOD);
			content_type = Undefined;
		}
		void end() {
			LOGD(LOG_METHOD);
		}
		MP3FrameInfo audioInfoEx() {
		}
		AudioBaseInfo audioInfo() {
		}
		size_t write(const void* mp3Data, size_t len) {
			LOGD("%s: %zu", LOG_METHOD, len);
			//if (start[0] == 0xFF && start[1] == 0xF1) {
			//	content_type = AAC;
			//	Serial.println("ACC");
			//}
			//else if (strncmp(start, "ID3", 3) || start[0] == 0xFF || start[0] == 0xFE) {
			//	content_type = MP3;
			//	Serial.println("MP3");
			//}
			//else if (strncmp(start, "RIFF", 4)) {
			// content_type = WAVE;
			//}
			//return content_type;
		}
		operator boolean() {
			return content_type != Undefined;
		}
		void setNotifyAudioChange(AudioBaseInfoDependent& bi) {
			LOGD(LOG_METHOD);
		}
	protected:
		uint8_t* start;
};
}
#endif

@pschatzmann
Copy link
Owner

I just committed a draft implementation.
I did not have any time to test it though....

https://github.com/pschatzmann/arduino-audio-tools/blob/main/src/AudioCodecs/CodecHelix.h

@podaen
Copy link
Contributor Author

podaen commented Dec 16, 2021

I diden't test the aac decoder yet... This need to be resolved first before we can continue to a general decoder. I went ahead testing the aac decoder and this is where it stops.

assertion "res == pdTRUE" failed: file "/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/dport_access.c", line 187, function: esp_dport_access_int_init
abort() was called at PC 0x400fed0b on core 0

@podaen
Copy link
Contributor Author

podaen commented Jan 3, 2022

it's a difficuld issue, do you have engough information or just no have the time to sort this out?

@pschatzmann
Copy link
Owner

It is still on my to do list - but not very hight. I remember that AAC was working for me.
Are you sure that this is not just another issue because you don't have enough heap left ?
There are also the AAC_MAX_OUTPUT_SIZE and AAC_MAX_FRAME_SIZE which might not have the right values for your files.

@podaen
Copy link
Contributor Author

podaen commented Jan 12, 2022

Could be, I will look in to that.

I just generated a list of belgium radio station. Here is the list.

"http://22533.live.streamtheworld.com/AFNE_BLX_SC" 
"http://centauri.shoutca.st:9021/;" 
"http://centauri.shoutca.st:9064/;" 
"http://centauri.shoutca.st:9060/;" 
"http://dashitradio-de-hz-fal-stream01-cluster01.radiohost.de/dashitradio_48?listenerrmid=78da8b36343331b43435b7b430d451b234d53334b7d4333406620333251da58c929202ab18fd18fde292a2d4c45cbd94c4e28ccc92a2c494cc7cbd94d4187d247e8c7e6262b2ae89055c6d6e81b1522c0002d41d7b" 
"http://s1.voscast.com:10584/stream" 
"http://ruby.torontocast.com:1040/stream" 
"http://ruby.torontocast.com:1310/stream" 
"https://ruby.torontocast.com:1095/stream" 
"https://streaming.antipode.be/antipode.mp3" 
"http://streams.lazernet.be:2710/" 
"http://arabelfm.ice.infomaniak.ch/arabelprodcastfm.mp3" 
"https://arlradio.ice.infomaniak.ch/poste01.mp3" 
"http://belrtl.ice.infomaniak.ch/belrtl-mp3-192.mp3" 
"http://audiostream.rtl.be/belrtl128" 
"http://streaming.brf.be/brf1-high.mp3" 
"https://streaming.brf.be/brf1-high.mp3" 
"http://streaming.brf.be/brf2-high.mp3" 
"https://streaming.brf.be/brf2-high.mp3" 
"https://powerradio.level27.be/stream" 
"https://ice.cr5.streamzilla.xlcdn.com:8000/sz=fmbrussel=fmb988.mp3?token=e2b508409f69fac30a26ee5938e4501c&time=61de5fa2" 
"http://charlekingradio.ice.infomaniak.ch/ckradio-192.mp3" 
"http://streamingp.shoutcast.com/Cherie-mp3" 
"http://streams.crooze.fm:8006/stream/1/" 
"http://radios.rtbf.be/wr-c21-blues-128.mp3" 
"https://radios.rtbf.be/wr-c21-blues-128.mp3" 
"http://radios.rtbf.be/classic21-128.mp3" 
"http://www.clubfmserver.be:8000/clubfm.mp3" 
"http://www.clubfmserver.be:8000/radioclubfm.mp3" 
"http://s35.myradiostream.com:14472/" 
"http://stream.radioemotion.be/;stream.mp3" 
"http://equinoxefm.ddns.net:8000/stream.ogg" 
"https://www.clubfmserver.be/accent.mp3" 
"http://live.radiostudio.be/enjoyfm" 
"http://www.clubfmserver.be:8000/family.mp3" 
"http://flashfm.ice.infomaniak.ch/flashfm-128" 
"http://stream01.level27.be:8008/" 
"http://stream01.level27.be:8010/" 
"http://sonic.magicdragon.nl:8002/stream" 
"http://frequenceplusandenne.ice.infomaniak.ch/frequenceplusandenne-192" 
"http://funradiobe.ice.infomaniak.ch/funradiobe-high" 
"http://s43.myradiostream.com:18192/" 
"http://stream.goldfm.be:1061/station.mp3" 
"http://178.32.62.167:8565/" 
"http://radio1.streamserver.link/radio/8040/hra-aac" 
"http://radio1.streamserver.link/radio/8000/hrm-aac" 
"http://server1.harmonyradio.be:8052/" 
"http://impactfm.ice.infomaniak.ch/impactfm-64.aac" 
"http://quincy.torontocast.com:1910/stream" 
"http://quincy.torontocast.com:1920/stream" 
"http://23603.live.streamtheworld.com/JOE_80S.mp3" 
"http://25643.live.streamtheworld.com:80/JOE.mp3" 
"http://icecast-servers.vrtcdn.be/ketnetradio-high.mp3" 
"https://kioskradiobxl.out.airtime.pro/kioskradiobxl_b" 
"http://stream2.radiokix.be:10460/live.aac" 
"http://icecast-servers.vrtcdn.be/klara-high.mp3" 
"http://icecast-servers.vrtcdn.be/klaracontinuo-high.mp3" 
"http://stream.laclassica.be:8023/stream" 
"http://stream.laclassica.be:8023/stream2" 
"https://radios.rtbf.be/vivabxl-128.mp3" 
"http://radios.rtbf.be/laprem1erebxl-128.mp3" 
"http://streams.servicehosting.be:3730/;" 
"http://node-17.zeno.fm/my78wz87em0uv?rj-ttl=5&rj-tok=AAABfkxY3X0AuzzOdUB1kkLfIw" 
"http://137.74.205.201/medmuzik/MedStream/playlist.m3u8" 
"http://188.165.35.60:8008/;" 
"http://maxpag.eu:8000/metropole" 
"http://audiostream.rtl.be/mint" 
"https://mint.ice.infomaniak.ch/mint-mp3-128.mp3" 
"http://audiostream.rtl.be/mint192" 
"http://25683.live.streamtheworld.com:80/MNM_128.mp3" 
"http://icecast-servers.vrtcdn.be/mnm_90s00s-high.mp3" 
"http://icecast-servers.vrtcdn.be/mnm_hits-high.mp3" 
"http://icecast-servers.vrtcdn.be/mnm_urb-high.mp3" 
"https://radios.rtbf.be/wr-m3-baroque-128.mp3" 
"http://mustfm.ice.infomaniak.ch/mustfm-192.mp3" 
"http://dronezone-mynoise.radioca.st/stream" 
"http://oceanwaves-mynoise.radioca.st/stream" 
"https://purenature-mynoise.radioca.st/stream" 
"http://rainyday-mynoise.radioca.st/stream" 
"http://sirensongs-mynoise.radioca.st/stream" 
"http://spaceodyssey-mynoise.radioca.st/stream" 
"http://zengarden-mynoise.radioca.st/stream" 
"https://streamingp.shoutcast.com/NostalgiePremium-mp3?gdpr=true&gdpr_consent=BOgFAkAOgFAkAAKAQBENCR-AAAAnB7_______9______9uz_Ov_v_f__33e87_9v_l_7_-___u_-3zd4-_1vf99yfm1-7etr3tp_87ues2_Xur__59__3z3_9phPrsk89r622A&lang=fr-BE&userref=T0rw3ugycCqsY8Ogne6mtWtbEn9Zw41557056982513" 
"https://22673.live.streamtheworld.com/NOSTALGIEWHATAFEELING.mp3" 
"https://22193.live.streamtheworld.com:443/NOSTALGIEWAF80.mp3" 
"https://25493.live.streamtheworld.com:443/NOSTALGIEWAFNEWWAVE.mp3" 
"https://25493.live.streamtheworld.com:443/NOSTALGIEWAFEXTRA.mp3" 
"https://25493.live.streamtheworld.com:443/NOSTALGIEWHATAFEELING.mp3?dist=radiobrowser" 
"https://22673.live.streamtheworld.com/NOSTALGIEWAF6070.mp3" 
"http://streamingp.shoutcast.com/nostaplus-mp3" 
"https://25583.live.streamtheworld.com:443/NRJBELGIE.mp3?dist=radiobrowser" 
"https://streamingp.shoutcast.com/NRJ" 
"https://goeiedag.radiostudio.be/oilsjt" 
"http://stream.radio.co/s5709ea2c0/listen" 
"http://radio.organroxx.com:8000/freestream.mp3" 
"https://behofm.ice.infomaniak.ch/behofm.mp3" 
"https://www.clubfmserver.be/pink.mp3" 
"https://www.clubfmserver.be/pink.mp3" 
"https://www.clubfmserver.be/pink.mp3" 
"https://www.clubfmserver.be/pink.mp3" 
"https://www.clubfmserver.be/pink.mp3" 
"https://flux.proxiradio.be/proxi.mp3" 
"https://radios.rtbf.be/pure-128.mp3" 
"http://radios.rtbf.be/pure-128.mp3" 
"http://25483.live.streamtheworld.com:80/QMUSIC.mp3" 
"http://20723.live.streamtheworld.com/QFOUTERADIO.mp3" 
"http://20723.live.streamtheworld.com/QMAXIMUMHITS.mp3" 
"http://20723.live.streamtheworld.com/QFOUTERADIO.mp3" 
"http://20723.live.streamtheworld.com/QMAXIMUMHITS.mp3" 
"http://21233.live.streamtheworld.com:80/QMUSIC.mp3" 
"http://25703.live.streamtheworld.com:80/QMUSICAAC.aac" 
"http://23623.live.streamtheworld.com:80/RADIO1_128.mp3" 
"http://23553.live.streamtheworld.com:80/RADIO_2_ANTWERP_128.mp3" 
"http://23553.live.streamtheworld.com:80/RADIO_2_LIMBURG_128.mp3" 
"http://23553.live.streamtheworld.com:80/RADIO_2_OOSTVL_128.mp3" 
"http://23553.live.streamtheworld.com:80/RADIO_2_VLAAMSBR_128.mp3" 
"http://streamserver.funkhaus.info:8000/radio700-aacplus" 
"http://streamserver.funkhaus.info/;stream.nsv" 
"http://streaming.domainepublic.net:8000/radioairlibre.ogg" 
"http://www.clubfmserver.be:8000/aktief.mp3" 
"http://shoutcast2.wirelessbelgie.be:8310/;stream.mp3" 
"http://livestream.beverland.info:8009/Beverland?type=.mp3/;stream.mp3" 
"http://streamer.radiocampus.be/stream.mp3" 
"http://streamer.radiocampus.be:8000/stream.aacplus" 
"http://streams.movemedia.eu/centraal" 
"http://streams.movemedia.eu:8530/" 
"http://rcf.streamakaci.com/rcfbe.mp3" 
"http://audiostream.rtl.be/contactfr" 
"http://live.equinoxenamur.be:8000/Equinoxe.mp3" 
"http://hazel.torontocast.com:1310/stream" 
"http://www.clubfmserver.be:8000/expres.mp3" 
"https://n19a-eu.rcs.revma.com/5wesqhfap98uv?rj-ttl=5&rj-tok=AAABfkwskYoAdqoc4cAD4e6nng" 
"http://str01.fluidstream.net/fluid06.mp3" 
"http://ice07.fluidstream.net:8080/fluid713.aac" 
"https://str01.fluidstream.net/ric.mp3" 
"http://radiojudaica.ice.infomaniak.ch/radiojudaica-128.mp3?_=1" 
"http://stream.rlvw.be:8480/stream" 
"http://stream17.shoutcastsolutions.com:8059/" 
"http://stream.radiomaria.be:8000/RadioMaria-96" 
"http://dreamsiteradiocp.com:8042/stream" 
"http://91.121.219.80/minerva" 
"http://radiomol.ice.infomaniak.ch/radiomol-192.mp3" 
"http://radiomusicsambre.ice.infomaniak.ch/radiomusicsambre-128.mp3" 
"http://roa1062fm.ice.infomaniak.ch/roa1062fm-128.mp3" 
"http://s39.myradiostream.com:14494/listen.mp3" 
"http://84.80.98.187:8000/paloma106" 
"https://streaming.domainepublic.net/radiopanik.ogg" 
"http://live.radiostudio.be/plus" 
"http://37.187.114.62:8002/live" 
"http://manager2.streaming-ingenierie.fr:8026/;stream.mp3" 
"http://radiosalamandre.ice.infomaniak.ch/radiosalamandre.aac" 
"http://stream2.radiostad.org:8344/" 
"http://studiooneasbl.ice.infomaniak.ch/studiooneasbl-128.mp3" 
"http://streaming.domainepublic.net:8000/radiosud.ogg" 
"http://178.32.62.163:8411/stream" 
"http://audiostreamen.nl:8006/" 
"http://s43.myradiostream.com:20542/listen.mp3" 
"http://radiojudaica.ice.infomaniak.ch/radiojudaica-128" 
"https://radios.rtbf.be/laprem1ere-128.mp3" 
"http://rcf.streamakaci.com/rcfbruxelles.mp3" 
"http://rcf.streamakaci.com/rcfliege.mp3" 
"http://rcf.streamakaci.com/rcfsudbe.mp3" 
"http://ice.cr1.streamzilla.xlcdn.com:8000/sz=radiosingjaal=radiostream" 
"https://igor.torontocast.com/rgrdance" 
"http://www.clubfmserver.be:8000/roxx.mp3" 
"https://radios.rtbf.be/classic21-128.mp3" 
"https://radios.rtbf.be/classic21-64.aac" 
"https://radios.rtbf.be/wr-c21-60-128.mp3" 
"https://radios.rtbf.be/wr-c21-70-128.mp3" 
"https://radios.rtbf.be/wr-c21-80-128.mp3" 
"https://radios.rtbf.be/wr-c21-90-128.mp3" 
"https://radios.rtbf.be/wr-c21-metal-128.mp3" 
"https://radios.rtbf.be/wr-eventradio-128.mp3" 
"https://radios.rtbf.be/wr-c21-route66-128.mp3" 
"https://radios.rtbf.be/wr-c21-soul-128.mp3" 
"https://radios.rtbf.be/jam-128.mp3" 
"https://radios.rtbf.be/laprem1ere-64.aac" 
"https://radios.rtbf.be/musiq3-128.aac" 
"https://radios.rtbf.be/pure-64.aac" 
"https://radios.rtbf.be/tarmac-128.mp3" 
"https://radios.rtbf.be/vivaplus-128.mp3" 
"https://radios.rtbf.be/vivabxl-64.aac" 
"https://radios.rtbf.be/vivacharleroi-64.aac" 
"https://radios.rtbf.be/vivahainaut-64.aac" 
"https://radios.rtbf.be/vivaliege-64.aac" 
"https://radios.rtbf.be/vivalux-64.aac" 
"https://radios.rtbf.be/vivanamurbw-64.aac" 
"https://stream.radioscorpio.be/stream" 
"http://randstad.wirelessbelgie.be:8330/stream.mp3" 
"http://23613.live.streamtheworld.com:80/STUDIO_BRUSSEL_AAC.aac" 
"http://icecast-servers.vrtcdn.be/stubru_tgs-high.mp3" 
"http://icecast-servers.vrtcdn.be/stubru_untz.aac" 
"http://icecast-servers.vrtcdn.be/stubru_untz-high.mp3" 
"http://21303.live.streamtheworld.com:80/STUDIO_BRUSSEL_128.mp3" 
"http://icecast-servers.vrtcdn.be/stubru_tijdloze-high.mp3" 
"http://sudradio.ice.infomaniak.ch/sudradio-96.aac" 
"http://212.227.73.87:8000/tekxtra.mp3" 
"http://212.227.73.87:8000/tekxtra.mp3" 
"http://thewordradio.out.airtime.pro:8000/thewordradio_a" 
"https://23623.live.streamtheworld.com:443/TOPRETRO.mp3" 
"https://25433.live.streamtheworld.com:443/TOP_RADIO.mp3" 
"https://22193.live.streamtheworld.com/OWR_DAB.mp3" 
"https://eu2-centova.serverse.com/proxy/wiupfvnu?mp=/TradCan" 
"http://stream.trendyfm.be/" 
"http://broadcast.infomaniak.ch/ultrason-high.mp3" 
"http://urgentstream.radiostudio.be:8000/live" 
"http://stream.vbro.be:9400/evergreen" 
"http://stream.vbro.be:9100/vbro" 
"http://versuzradio.live-streams.nl/live" 
"http://fred.torontocast.com:1050/stream" 
"http://progressive-audio.lwc.vrtcdn.be/content/fixed/11_11niws-snip_lo.mp3" 
"http://25433.live.streamtheworld.com:80/RADIO1_128.mp3" 
"http://icecast-servers.vrtcdn.be/radio1_classics_high.mp3" 
"http://23553.live.streamtheworld.com:80/RADIO_2_ANTWERP_AAC.aac" 
"http://icecast-servers.vrtcdn.be/radio2_benebene-high.mp3" 
"http://25493.live.streamtheworld.com:80/RADIO_2_OOSTVL_AAC.aac" 
"http://icecast-servers.vrtcdn.be/radio2_unwind-high.mp3" 
"http://23623.live.streamtheworld.com:80/RADIO_2_VLAAMSBR_AAC.aac" 
"http://23553.live.streamtheworld.com:80/RADIO_2_WESTVL_128.mp3" 
"http://icecast-servers.vrtcdn.be/stubru_bruut-high.mp3" 
"http://icecast-servers.vrtcdn.be/stubru_untz-high.mp3" 
"http://stream05.warm.fm:9002/warm" 
"https://25633.live.streamtheworld.com:443/WILLY.mp3" 
"http://eu2.radioboss.fm:8124/stream" 
"https://23613.live.streamtheworld.com:443/TOPZEN.mp3" 
"http://streams.movemedia.eu:8000/zoefmmp3" 
"https://icecast.movemedia.be/zoe128" 

@podaen
Copy link
Contributor Author

podaen commented Jan 13, 2022

Do do...

  • Player.setPath(char*) must be Player.setpath(const char*) or change const char* urls[] = { ... } to char* urls[] = { ... }
  • don't get icy on select path

@podaen
Copy link
Contributor Author

podaen commented Jan 14, 2022

I am testing now with

https://icecast.radio24.ch/radio24-rc-96-aac

That I found in here

https://bommag.ch/uploads/pdf/Internet-Radio%20direkte%20Streams.pdf

I increased the #define STACK_SIZE to 60000 and #define AAC_MAX_FRAME_SIZE to 2500 , it diden't work

It crashes somewhere in the class before it even starts to the setup();

Here is the exception error descriptor

/Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8):::0x400fee4f:__assert_func
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715:::0x400886f4:invoke_abort
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715:::0x40088971:abort
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/dport_access.c:187 (discriminator 1):::0x40166f3a:esp_dport_access_int_init
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c:409:::0x4008469f:start_cpu0_default
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c:262:::0x400848b0:call_start_cpu0
0x40079247: ?? ??:0
0x400792ad: ?? ??:0
0x400792b8: ?? ??:0
0x40079465: ?? ??:0
0x400806da: ?? ??:0
0x40007c31: ?? ??:0
0x4000073d: ?? ??:0
0x40078000: ?? ??:0
0x40080400: ?? ??:0
0x400806a8: ?? ??:0

I tried even this with the same results

#define AAC_MAX_OUTPUT_SIZE 2048*5//1024 * 5//2048
#define AAC_MAX_FRAME_SIZE 4000//2500//1600

If I increase

#define URL_STREAM_BUFFER_COUNT 30//10

it stops crashing, and I get this.

OOM in SBR, can't allocate 50788 bytes

but still no sound.

@podaen
Copy link
Contributor Author

podaen commented Jan 14, 2022

Here is the complete log. (I have updated my log according to the next changes I have made)

Opening port
Port open
OOM in SBR, can't allocate 50788 bytes
�here
[D] I2SStream.h : 88 - void audio_tools::I2SStream::begin(audio_tools::I2SConfig)
[D] I2SESP32.h : 40 - void audio_tools::I2SBase::begin(audio_tools::I2SConfig)
[D] I2SESP32.h : 101 - void audio_tools::I2SBase::begin(audio_tools::I2SConfig, int, int)
[I] I2SConfig.h : 66 - rx/tx mode: TX
[I] I2SConfig.h : 67 - port_no: 0
[I] I2SConfig.h : 68 - is_master: Master
[I] I2SConfig.h : 69 - sample rate: 44100
[I] I2SConfig.h : 70 - bits per sample: 16
[I] I2SConfig.h : 71 - number of channels: 2
[I] I2SConfig.h : 72 - i2s_format: I2S_LEFT_JUSTIFIED_FORMAT
[I] I2SConfig.h : 80 - pin_bck: 26
[I] I2SConfig.h : 81 - pin_ws: 25
[I] I2SConfig.h : 82 - pin_data: 27
[D] I2SESP32.h : 159 - begin - started
here
[D] AudioPlayer.h : 607 - virtual bool audio_tools::AudioPlayer::begin(int, bool)
[D] AudioOutput.h : 310 - void audio_tools::EncodedAudioStream::begin()
[D] CodecAACHelix.h : 76 - virtual void audio_tools::AACDecoderHelix::begin()
[D] AudioPlayer.h : 401 - virtual void audio_tools::AudioSourceURL::begin()
[I] MetaDataID3.h : 545 - virtual void audio_tools::MetaDataID3::begin()
[I] AudioPlayer.h : 416 - selectStream: 0/2 -> https://icecast.radio24.ch/radio24-rc-96-aac
[D] URLStreamESP32.h : 188 - virtual bool audio_tools::URLStream::begin(const char*, const char*, MethodID, const char*, const char*)
[I] URLStream.h : 65 - virtual bool audio_tools::URLStreamDefault::begin(const char*, const char*, MethodID, const char*, const char*): https://icecast.radio24.ch/radio24-rc-96-aac
[D] Url.h : 59 - setUrl https://icecast.radio24.ch/radio24-rc-96-aac
[D] StrExt.h : 109 - StrExt::grow(44)
[I] Url.h : 73 - Url::parse
[D] StrExt.h : 109 - StrExt::grow(5)
[D] StrExt.h : 109 - StrExt::grow(18)
[D] StrExt.h : 109 - StrExt::grow(18)
[D] StrExt.h : 109 - StrExt::grow(26)
[I] Url.h : 109 - url->https://icecast.radio24.ch/radio24-rc-96-aac
[I] Url.h : 110 - host->icecast.radio24.ch
[I] Url.h : 111 - protocol->https
[I] Url.h : 112 - path->/radio24-rc-96-aac
[I] Url.h : 113 - port->443
[D] URLStream.h : 217 - connectWiFi
.....
[I] URLStream.h : 194 - WiFiClientSecure
[I] URLStream.h : 194 - WiFiClientSecure
[I] HttpRequest.h : 182 - process connecting to host icecast.radio24.ch port 443
[I] HttpRequest.h : 170 - connect icecast.radio24.ch
[I] HttpRequest.h : 193 - Free heap: 129616
[I] HttpHeader.h : 349 - HttpRequestHeader::setValues - path: /radio24-rc-96-aac
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Host
[D] StrExt.h : 109 - StrExt::grow(4)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Host' : 'icecast.radio24.ch'
[D] StrExt.h : 109 - StrExt::grow(18)
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Connection
[D] StrExt.h : 109 - StrExt::grow(10)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Connection' : 'close'
[D] StrExt.h : 109 - StrExt::grow(5)
[D] HttpHeader.h : 107 - HttpHeader::put - value ignored because it is null for User-Agent
[D] HttpHeader.h : 107 - HttpHeader::put - value ignored because it is null for Accept-Encoding
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Accept
[D] StrExt.h : 109 - StrExt::grow(6)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Accept' : 'audio/mpeg'
[D] StrExt.h : 109 - StrExt::grow(10)
[D] HttpHeader.h : 107 - HttpHeader::put - value ignored because it is null for Content-Type
[I] HttpHeader.h : 249 - HttpHeader::write
[I] HttpHeader.h : 358 - HttpRequestHeader::write1stLine
[I] HttpHeader.h : 373 - -> GET /radio24-rc-96-aac HTTP/1.1
[D] HttpHeader.h : 165 - HttpHeader::writeHeaderLine: Host
[I] HttpHeader.h : 186 -  -> Host: icecast.radio24.ch 
[D] HttpHeader.h : 165 - HttpHeader::writeHeaderLine: Connection
[I] HttpHeader.h : 186 -  -> Connection: close 
[D] HttpHeader.h : 165 - HttpHeader::writeHeaderLine: Accept
[I] HttpHeader.h : 186 -  -> Accept: audio/mpeg 
[I] HttpHeader.h : 289 -  -> <CR LF> 
[I] HttpRequest.h : 217 - Request written ... waiting for reply
[I] HttpHeader.h : 219 - HttpHeader::read
[W] HttpHeader.h : 226 - Waiting for data...
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> HTTP/1.0 200 OK
[D] HttpHeader.h : 444 - HttpReplyHeader::parse1stLine: HTTP/1.0 200 OK
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-br: 128
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-br: 128
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for icy-br
[D] StrExt.h : 109 - StrExt::grow(6)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-br' : '128'
[D] StrExt.h : 109 - StrExt::grow(3)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-pub: 0
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-pub: 0
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for icy-pub
[D] StrExt.h : 109 - StrExt::grow(7)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-pub' : '0'
[D] StrExt.h : 109 - StrExt::grow(1)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-description: Radio 24
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-description: Radio 24
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for icy-description
[D] StrExt.h : 109 - StrExt::grow(15)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-description' : 'Radio 24'
[D] StrExt.h : 109 - StrExt::grow(8)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-audio-info: samplerate=44100;channels=2;bitrate=128
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-audio-info: samplerate=44100;channels=2;bitrate=128
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for icy-audio-info
[D] StrExt.h : 109 - StrExt::grow(14)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-audio-info' : 'samplerate=44100;channels=2;bitrate=128'
[D] StrExt.h : 109 - StrExt::grow(39)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-url: www.radio24.ch
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-url: www.radio24.ch
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for icy-url
[D] StrExt.h : 109 - StrExt::grow(7)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-url' : 'www.radio24.ch'
[D] StrExt.h : 109 - StrExt::grow(14)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Instance-id: 31f1d03a2566de4b1248074b4f95007a
[D] HttpHeader.h : 130 - HttpHeader::put -> Instance-id: 31f1d03a2566de4b1248074b4f95007a
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Instance-id
[D] StrExt.h : 109 - StrExt::grow(11)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Instance-id' : '31f1d03a2566de4b1248074b4f95007a'
[D] StrExt.h : 109 - StrExt::grow(32)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Cache-Control: no-cache
[D] HttpHeader.h : 130 - HttpHeader::put -> Cache-Control: no-cache
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Cache-Control
[D] StrExt.h : 109 - StrExt::grow(13)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Cache-Control' : 'no-cache'
[D] StrExt.h : 109 - StrExt::grow(8)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Server: AIS Streaming Server 8.6.5
[D] HttpHeader.h : 130 - HttpHeader::put -> Server: AIS Streaming Server 8.6.5
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Server
[D] StrExt.h : 109 - StrExt::grow(6)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Server' : 'AIS Streaming Server 8.6.5'
[D] StrExt.h : 109 - StrExt::grow(26)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-genre: Pop
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-genre: Pop
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for icy-genre
[D] StrExt.h : 109 - StrExt::grow(9)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-genre' : 'Pop'
[D] StrExt.h : 109 - StrExt::grow(3)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Expires: Mon, 26 Jul 1997 05:00:00 GMT
[D] HttpHeader.h : 130 - HttpHeader::put -> Expires: Mon, 26 Jul 1997 05:00:00 GMT
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Expires
[D] StrExt.h : 109 - StrExt::grow(7)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Expires' : 'Mon, 26 Jul 1997 05:00:00 GMT'
[D] StrExt.h : 109 - StrExt::grow(29)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-metaint: 0
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-metaint: 0
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for icy-metaint
[D] StrExt.h : 109 - StrExt::grow(11)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-metaint' : '0'
[D] StrExt.h : 109 - StrExt::grow(1)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Pragma: no-cache
[D] HttpHeader.h : 130 - HttpHeader::put -> Pragma: no-cache
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Pragma
[D] StrExt.h : 109 - StrExt::grow(6)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Pragma' : 'no-cache'
[D] StrExt.h : 109 - StrExt::grow(8)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-name: Radio 24
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-name: Radio 24
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for icy-name
[D] StrExt.h : 109 - StrExt::grow(8)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-name' : 'Radio 24'
[D] StrExt.h : 109 - StrExt::grow(8)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Connection: close
[D] HttpHeader.h : 130 - HttpHeader::put -> Connection: close
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Connection
[D] StrExt.h : 109 - StrExt::grow(10)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Connection' : 'close'
[D] StrExt.h : 109 - StrExt::grow(5)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Content-Type: audio/mpeg
[D] HttpHeader.h : 130 - HttpHeader::put -> Content-Type: audio/mpeg
[D] HttpHeader.h : 306 - HttpHeader::headerLine - new line created for Content-Type
[D] StrExt.h : 109 - StrExt::grow(12)
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Content-Type' : 'audio/mpeg'
[D] StrExt.h : 109 - StrExt::grow(10)
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> 
[W] HttpRequest.h : 145 - no CONTENT_LENGTH found in reply
[I] URLStream.h : 80 - size: 0
[I] URLStream.h : 232 - Request written ... waiting for reply
[D] URLStreamESP32.h : 34 - virtual void audio_tools::BufferedTaskStream::begin(bool)
[I] AudioOutput.h : 450 - setVolume: 0.100000
end setup
[D] AudioPlayer.h : 692 - virtual bool audio_tools::AudioPlayer::setPath(const char*)
[I] AudioPlayer.h : 445 - selectStream: https://icecast.radio24.ch/radio24-rc-96-aac
[D] URLStreamESP32.h : 228 - virtual void audio_tools::URLStream::end()
[D] URLStreamESP32.h : 42 - virtual void audio_tools::BufferedTaskStream::end()
[I] HttpRequest.h : 63 - stop
[D] URLStreamESP32.h : 188 - virtual bool audio_tools::URLStream::begin(const char*, const char*, MethodID, const char*, const char*)
[I] URLStream.h : 65 - virtual bool audio_tools::URLStreamDefault::begin(const char*, const char*, MethodID, const char*, const char*): https://icecast.radio24.ch/radio24-rc-96-aac
[D] Url.h : 59 - setUrl https://icecast.radio24.ch/radio24-rc-96-aac
[I] Url.h : 73 - Url::parse
[I] Url.h : 109 - url->https://icecast.radio24.ch/radio24-rc-96-aac
[I] Url.h : 110 - host->icecast.radio24.ch
[I] Url.h : 111 - protocol->https
[I] Url.h : 112 - path->/radio24-rc-96-aac
[I] Url.h : 113 - port->443
[D] URLStream.h : 217 - connectWiFi
[I] URLStream.h : 194 - WiFiClientSecure
[I] URLStream.h : 194 - WiFiClientSecure
[I] HttpRequest.h : 182 - process connecting to host icecast.radio24.ch port 443
[I] HttpRequest.h : 170 - connect icecast.radio24.ch
[I] HttpRequest.h : 193 - Free heap: 126540
[I] HttpHeader.h : 349 - HttpRequestHeader::setValues - path: /radio24-rc-96-aac
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Host' : 'icecast.radio24.ch'
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Connection' : 'close'
[D] HttpHeader.h : 107 - HttpHeader::put - value ignored because it is null for User-Agent
[D] HttpHeader.h : 107 - HttpHeader::put - value ignored because it is null for Accept-Encoding
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Accept' : 'audio/mpeg'
[D] HttpHeader.h : 107 - HttpHeader::put - value ignored because it is null for Content-Type
[I] HttpHeader.h : 249 - HttpHeader::write
[I] HttpHeader.h : 358 - HttpRequestHeader::write1stLine
[I] HttpHeader.h : 373 - -> GET /radio24-rc-96-aac HTTP/1.1
[D] HttpHeader.h : 165 - HttpHeader::writeHeaderLine: Host
[I] HttpHeader.h : 186 -  -> Host: icecast.radio24.ch 
[D] HttpHeader.h : 165 - HttpHeader::writeHeaderLine: Connection
[I] HttpHeader.h : 186 -  -> Connection: close 
[D] HttpHeader.h : 165 - HttpHeader::writeHeaderLine: Accept
[I] HttpHeader.h : 186 -  -> Accept: audio/mpeg 
[I] HttpHeader.h : 289 -  -> <CR LF> 
[I] HttpRequest.h : 217 - Request written ... waiting for reply
[I] HttpHeader.h : 219 - HttpHeader::read
[W] HttpHeader.h : 226 - Waiting for data...
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> HTTP/1.0 200 OK
[D] HttpHeader.h : 444 - HttpReplyHeader::parse1stLine: HTTP/1.0 200 OK
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-br: 128
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-br: 128
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-br' : '128'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-pub: 0
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-pub: 0
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-pub' : '0'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-description: Radio 24
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-description: Radio 24
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-description' : 'Radio 24'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-audio-info: samplerate=44100;channels=2;bitrate=128
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-audio-info: samplerate=44100;channels=2;bitrate=128
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-audio-info' : 'samplerate=44100;channels=2;bitrate=128'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-url: www.radio24.ch
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-url: www.radio24.ch
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-url' : 'www.radio24.ch'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Instance-id: 31f1d03a2566de4b1248074b4f95007a
[D] HttpHeader.h : 130 - HttpHeader::put -> Instance-id: 31f1d03a2566de4b1248074b4f95007a
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Instance-id' : '31f1d03a2566de4b1248074b4f95007a'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Cache-Control: no-cache
[D] HttpHeader.h : 130 - HttpHeader::put -> Cache-Control: no-cache
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Cache-Control' : 'no-cache'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Server: AIS Streaming Server 8.6.5
[D] HttpHeader.h : 130 - HttpHeader::put -> Server: AIS Streaming Server 8.6.5
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Server' : 'AIS Streaming Server 8.6.5'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-genre: Pop
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-genre: Pop
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-genre' : 'Pop'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Expires: Mon, 26 Jul 1997 05:00:00 GMT
[D] HttpHeader.h : 130 - HttpHeader::put -> Expires: Mon, 26 Jul 1997 05:00:00 GMT
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Expires' : 'Mon, 26 Jul 1997 05:00:00 GMT'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-metaint: 0
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-metaint: 0
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-metaint' : '0'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Pragma: no-cache
[D] HttpHeader.h : 130 - HttpHeader::put -> Pragma: no-cache
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Pragma' : 'no-cache'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> icy-name: Radio 24
[D] HttpHeader.h : 130 - HttpHeader::put -> icy-name: Radio 24
[D] HttpHeader.h : 97 - HttpHeader::put -> 'icy-name' : 'Radio 24'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Connection: close
[D] HttpHeader.h : 130 - HttpHeader::put -> Connection: close
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Connection' : 'close'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> Content-Type: audio/mpeg
[D] HttpHeader.h : 130 - HttpHeader::put -> Content-Type: audio/mpeg
[D] HttpHeader.h : 97 - HttpHeader::put -> 'Content-Type' : 'audio/mpeg'
[D] HttpLineReader.h : 20 - HttpLineReader readlnInternal
[I] HttpHeader.h : 156 - HttpHeader::readLine -> 
[W] HttpRequest.h : 145 - no CONTENT_LENGTH found in reply
[I] URLStream.h : 80 - size: 0
[I] URLStream.h : 232 - Request written ... waiting for reply
[D] URLStreamESP32.h : 34 - virtual void audio_tools::BufferedTaskStream::begin(bool)
[D] AudioPlayer.h : 642 - virtual void audio_tools::AudioPlayer::end()
[D] AudioOutput.h : 323 - void audio_tools::EncodedAudioStream::end()
[D] CodecAACHelix.h : 85 - virtual void audio_tools::AACDecoderHelix::end()
[I] MetaDataID3.h : 551 - virtual void audio_tools::MetaDataID3::end()
[D] AudioOutput.h : 310 - void audio_tools::EncodedAudioStream::begin()
[D] CodecAACHelix.h : 76 - virtual void audio_tools::AACDecoderHelix::begin()
[D] AudioPlayer.h : 712 - open selected stream
[I] MetaDataID3.h : 545 - virtual void audio_tools::MetaDataID3::begin()
[D] AudioPlayer.h : 755 - virtual void audio_tools::AudioPlayer::copy()
[D] AudioCopy.h : 88 - size_t audio_tools::StreamCopyT<T>::copy() [with T = unsigned char; size_t = unsigned int]
[D] AudioPlayer.h : 755 - virtual void audio_tools::AudioPlayer::copy()
[D] AudioCopy.h : 88 - size_t audio_tools::StreamCopyT<T>::copy() [with T = unsigned char; size_t = unsigned int]
[D] AudioPlayer.h : 755 - virtual void audio_tools::AudioPlayer::copy()
...

@podaen
Copy link
Contributor Author

podaen commented Jan 14, 2022

Ooh, now I see I used this

AudioSourceIcyUrl source(urlStream, urls, "audio/mp3");

and changed to this

AudioSourceIcyUrl source(urlStream, urls, "audio/mpeg");//aac

but still no sound. it just stops copying after some time. I tried different links. All the same.

@podaen
Copy link
Contributor Author

podaen commented Jan 14, 2022

OOM in SBR, can't allocate 50788 bytes

if I comment this line #define USE_URLSTREAM_TASK, the message goos away, but than it starts crashing again. I don't use task in my own shetch for this test. I am out of leads...

I am now testing again the mp3 links and I can tell it works beter without USE_URLSTREAM_TASK.

Out of my experence I know that changing as less as possible gives the best results. There is soo much that can go wrong because the bigger file size. Could you please post your config file for the aac if you have an esp32?

@podaen
Copy link
Contributor Author

podaen commented Jan 14, 2022

And is there something wrong in here?

URLStream urlStream(wifi, password);
//AudioSourceIcyUrl source(urlStream, urls, "audio/mp3");//mp3
AudioSourceIcyUrl source(urlStream, urls, "audio/aac");//aac
I2SStream i2s;
VolumeOutput volume(i2s);
LogarithmicVolumeControl lvc(0.1);
//MP3DecoderHelix decoder;
AACDecoderHelix decoder;

AudioPlayer player(source, volume, decoder);

What I don't understand is when I inspect a link in the browser I get audio/mpeg for the mp3 links, but we fill in audio/mp3 and it works. What do I need to fill in for the aac?

@podaen
Copy link
Contributor Author

podaen commented Jan 14, 2022

I did a lookup in the code of the library and I diden't find an example for the aac. Can you make these work? I have only one that is working.

const char* urls[] = {
//"https://icecast.radio24.ch/radio24-rc-96-aac",
"http://radio1.streamserver.link/radio/8040/hra-aac",
//"http://radio1.streamserver.link/radio/8000/hrm-aac",
//"http://impactfm.ice.infomaniak.ch/impactfm-64.aac",
//"http://stream2.radiokix.be:10460/live.aac",
//"http://25703.live.streamtheworld.com:80/QMUSICAAC.aac",
//"http://streamer.radiocampus.be:8000/stream.aacplus",
//"http://ice07.fluidstream.net:8080/fluid713.aac",
//"http://radiosalamandre.ice.infomaniak.ch/radiosalamandre.aac",
//"https://radios.rtbf.be/laprem1ere-64.aac",
//"https://radios.rtbf.be/musiq3-128.aac",
};

Exception:Error:
E:\Documents\Visual Studio 2019\Projects\Arduino\libraries\arduino-libhelix\src\libhelix-aac/filefmt.c(435): error 0x400d8754:raac_UnpackADTSHeader
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:586 (discriminator 1):::0x400d22dc:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\libraries\arduino-libhelix\src\libhelix-aac/aacdec.c(145): error 0x401967a5:AACFindSyncWord
E:\Documents\Visual Studio 2019\Projects\Arduino\libraries\arduino-libhelix\src\libhelix-aac/aacdec.c(149): error 0x401967b8:AACFindSyncWord
E:\Documents\Visual Studio 2019\Projects\Arduino\libraries\arduino-libhelix\src\libhelix-aac/aacdec.c(338): error 0x400d775d:AACDecode
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:586 (discriminator 1):::0x400d1ad6:libhelix
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:586 (discriminator 1):::0x400d1e36:libhelix
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:586 (discriminator 1):::0x400d1eaa:libhelix
E:\Documents\Visual Studio 2019\Projects\Arduino\libraries\arduino-audio-tools\src/AudioCodecs/CodecAACHelix.h:104 (discriminator 1):::0x40196631:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:586 (discriminator 1):::0x400d2361:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:586 (discriminator 1):::0x400d5c55:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:586 (discriminator 1):::0x400d5da6:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:586 (discriminator 1):::0x400d5e30:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\libraries\arduino-audio-tools\src/AudioTools/AudioPlayer.h:757 (discriminator 1):::(inlined by) audio_tools:
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(535): error 0x400d5f91:NextStation()
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(515): error 0x400d5fcb:AutoNextStation()
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(501): error 0x400d5fd9:loop()
C:\Users\Dave2Moon\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32/main.cpp(23): error 0x400e30b0:loopTask(void*)
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1):::0x400899c2:vPortTaskWrapper
0x40078000: ?? ??:0
0x40080400: ?? ??:0
0x400806a8: ?? ??:0

@podaen
Copy link
Contributor Author

podaen commented Jan 14, 2022

I give up. I have tried the whole day to make the aac work... but it diden't.

Here is my last exception

Exception:Error:
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715:::0x400886f4:invoke_abort
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715:::0x40088971:abort
/Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8):::0x400fe697:__assert_func
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c:232:::0x40081c37:heap_caps_free
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/syscalls.c:42:::0x40086a35:_free_r
0x4000bec7: ?? ??:0
E:\Documents\Visual Studio 2019\Projects\Arduino\libraries\arduino-libhelix\src\libhelix-aac/buffers.c:163 (discriminator 1):::0x400d7845:raac_FreeBuffers
E:\Documents\Visual Studio 2019\Projects\Arduino\libraries\arduino-libhelix\src\libhelix-aac/aacdec.c(267): error 0x400d7532:AACFreeDecoder
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:612 (discriminator 1):::0x400d1ac8:libhelix
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:612 (discriminator 1):::0x400d24c9:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:612 (discriminator 1):::0x400d3c82:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:612 (discriminator 1):::0x400d4d35:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:612 (discriminator 1):::0x400d4c35:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino:612 (discriminator 1):::0x400d242d:audio_tools
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(553): error 0x400d5f37:NextStation()
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(541): error 0x400d5f8f:AutoNextStation()
E:\Documents\Visual Studio 2019\Projects\Arduino\player-url-i2s\player-url-i2s/player-url-i2s.ino(526): error 0x400d6043:Task3URLcode(void*)
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1):::0x400899c2:vPortTaskWrapper
0x40078000: ?? ??:0
0x40080400: ?? ??:0
0x400806a8: ?? ??:0

I have xPortGetFreeHeapSize: 51516, soo I doubt it that could be it. And if is I doubt it, it cann't be done with an esp32.

@pschatzmann
Copy link
Owner

Just published some corrections in the arduino-libhelix library.
The DecoderHelix class which is decoding both AAC and MP3 seem to work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants