-
-
Notifications
You must be signed in to change notification settings - Fork 326
Exception unhandled after URL streaming mp3 audio. #2209
-
Hi @pschatzmann .
I have implemented a small player for radio internet. It ́s a independent of the main audio player for wav, flac and mp3 files. After flac, wav or mp3 playing I try to play radio internet and the following message is shown. This occurs when I try play.copy() but if I reset AudioKit and I don't play audio files previously to play radio internet files, ESP32 doesn't crash.
Any idea that what is happening? Something about AudioInfo configuration, but What's?
Thanks in advance.
At the beginning of the Radio player I have coded this
auto cfg = kitStream.defaultConfig(TX_MODE);
cfg.sample_rate = 44100;
cfg.bits_per_sample = 16;
cfg.channels = 2;
kitStream.setAudioInfo(cfg);
URLStream urlStream(ssid.c_str(), password);
AudioSourceURL source(urlStream, urls, "audio/mp3");
MP3DecoderHelix decoder;
AudioPlayer player(source, kitStream, decoder);
decoder.addNotifyAudioChange(kitStream);
...
error message:
... Finish MP3 playing file ...
...
[I] I2SCodecStream.h : 95 - virtual void audio_tools::I2SCodecStream::setAudioInfo(audio_tools::AudioInfo)
[I] AudioTypes.h : 127 - in: sample_rate: 22050 / channels: 2 / bits_per_sample: 16
[I] AudioTypes.h : 127 - out: sample_rate: 22050 / channels: 2 / bits_per_sample: 16
[I] AudioTypes.h : 127 - in: sample_rate: 22050 / channels: 2 / bits_per_sample: 16
[I] AudioTypes.h : 127 - out: sample_rate: 22050 / channels: 2 / bits_per_sample: 16
[I] I2SStream.h : 96 - virtual void audio_tools::I2SStream::setAudioInfo(audio_tools::AudioInfo)
[I] AudioTypes.h : 127 - in: sample_rate: 22050 / channels: 2 / bits_per_sample: 16
[I] AudioTypes.h : 127 - out: sample_rate: 22050 / channels: 2 / bits_per_sample: 16
[I] I2SESP32.h : 43 - i2s_set_sample_rates: 22050
... Now Radio internet ...
Tuning to station: Rave FM -> https://eu1.lhdserver.es:2023/stream
[I] AudioTypes.h : 127 - out: sample_rate: 44100 / channels: 2 / bits_per_sample: 16
[I] MetaDataID3.h : 588 - virtual bool audio_tools::MetaDataID3::begin()
[I] AudioSourceURL.h : 48 - selectStream: 0/0 -> https://eu1.lhdserver.es:2023/stream
[I] URLStream.h : 80 - virtual bool audio_tools::URLStream::begin(const char*, const char*, MethodID, const char*, const char*): https://eu1.lhdserver.es:2023/stream
[I] Url.h : 59 - Url::parse
[I] Url.h : 97 - url->https://eu1.lhdserver.es:2023/stream
[I] Url.h : 98 - host->eu1.lhdserver.es
[I] Url.h : 99 - protocol->https
[I] Url.h : 100 - path->/stream
[I] Url.h : 101 - port->2023
[I] URLStream.h : 360 - WiFiClientSecure
[I] HttpRequest.h : 240 - process connecting to host eu1.lhdserver.es port 2023
[ 82064][D][ssl_client.cpp:176] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[I] HttpRequest.h : 367 - is connected true with timeout 60000
[I] HttpRequest.h : 251 - Free heap: 93212
[I] HttpHeader.h : 262 - HttpHeader::write
[I] HttpHeader.h : 417 - -> GET /stream HTTP/1.1
[I] HttpHeader.h : 196 - -> Host: eu1.lhdserver.es
[I] HttpHeader.h : 196 - -> Connection: keep-alive
[I] HttpHeader.h : 196 - -> Accept-Encoding: identity
[I] HttpHeader.h : 196 - -> Accept: audio/mp3
[I] HttpHeader.h : 338 - -> <CR LF>
[I] HttpRequest.h : 316 - Request written ... waiting for reply
[I] HttpHeader.h : 230 - Waiting for data...
[I] HttpHeader.h : 239 - Data available: 424
[I] HttpHeader.h : 110 - Content-Type: audio/mpeg
[I] HttpRequest.h : 181 - no CONTENT_LENGTH found in reply
[I] URLStream.h : 88 - contentLength: 0
[I] URLStream.h : 231 - Request written ... waiting for reply
[I] URLStream.h : 95 - ==> http status: 200
[I] AudioEncoded.h : 185 - virtual void audio_tools::EncodedAudioOutput::end()
[I] MetaDataID3.h : 595 - virtual void audio_tools::MetaDataID3::end()
[I] AudioPlayer.h : 229 - reset codec
[I] CodecMP3Helix.h : 82 - virtual bool audio_tools::MP3DecoderHelix::begin()
[I] CodecMP3Helix.h : 82 - virtual bool audio_tools::MP3DecoderHelix::begin()
[I] MetaDataID3.h : 588 - virtual bool audio_tools::MetaDataID3::begin()
[I] StreamCopy.h : 63 - buffer_size=1024
[I] StreamCopy.h : 63 - buffer_size=1024
[I] StreamCopy.h : 187 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops
[I] StreamCopy.h : 187 - StreamCopy::copy 376 -> 376 -> 376 bytes - in 1 hops
[I] AudioTypes.h : 127 - MP3DecoderHelix sample_rate: 48000 / channels: 2 / bits_per_sample: 16
[I] AudioPlayer.h : 259 - sample_rate: 48000
[I] AudioPlayer.h : 260 - bits_per_sample: 16
[I] AudioPlayer.h : 261 - channels: 2
[I] AudioTypes.h : 127 - in: sample_rate: 48000 / channels: 2 / bits_per_sample: 16
[I] AudioTypes.h : 127 - out: sample_rate: 48000 / channels: 2 / bits_per_sample: 16
[I] I2SCodecStream.h : 95 - virtual void audio_tools::I2SCodecStream::setAudioInfo(audio_tools::AudioInfo)
[I] AudioTypes.h : 127 - in: sample_rate: 48000 / channels: 2 / bits_per_sample: 16
[I] AudioTypes.h : 127 - out: sample_rate: 48000 / channels: 2 / bits_per_sample: 16
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400d7b54 PS : 0x00060f30 A0 : 0x800d7e01 A1 : 0x3ffe1c30
A2 : 0x3f8071e0 A3 : 0x3ffe1c74 A4 : 0x3f8071e0 A5 : 0x3ffe2098
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x3f8071dc A9 : 0x3ffe1c00
A10 : 0x3ffe1c34 A11 : 0x3ffe1c74 A12 : 0x3f400585 A13 : 0x3ffdee74
A14 : 0x0000bb80 A15 : 0x00000002 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4008d489 LEND : 0x4008d499 LCOUNT : 0xffffffff
Backtrace: 0x400d7b51:0x3ffe1c30 0x400d7dfe:0x3ffe1c60 0x400dddba:0x3ffe1ca0 0x400e7626:0x3ffe1d20 0x400d7b5d:0x3ffe1d50 0x400d7ccd:0x3ffe1d80 0x400de6bb:0x3ffe1dc0 0x400de729:0x3ffe1de0 0x400de59e:0x3ffe1e30 0x401f8d09:0x3ffe1e50 0x400d57aa:0x3ffe1e70 0x400d5b4e:0x3ffe1ea0 0x400ea92e:0x3ffe1ed0 0x400eac3e:0x3ffe1f00 0x400eb12f:0x3ffe1f40 0x400eb281:0x3ffe1f70 0x40103f8d:0x3ffe1f90 0x40112c18:0x3ffe2a70 0x40114579:0x3ffe2bd0 0x40114cab:0x3ffe2d60
#0 0x400d7b51:0x3ffe1c30 in audio_tools::AudioInfoSource::notifyAudioChange(audio_tools::AudioInfo) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/AudioTypes.h:181
(inlined by) audio_tools::AudioInfoSource::notifyAudioChange(audio_tools::AudioInfo) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/AudioTypes.h:178
#1 0x400d7dfe:0x3ffe1c60 in audio_tools::AudioStream::setAudioInfo(audio_tools::AudioInfo) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/BaseStream.h:141
#2 0x400dddba:0x3ffe1ca0 in audio_tools::I2SCodecStream::setAudioInfo(audio_tools::AudioInfo) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/AudioLibs/I2SCodecStream.h:96 (discriminator 2)
#3 0x400e7626:0x3ffe1d20 in audio_tools::AudioPlayer::setAudioInfo(audio_tools::AudioInfo) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/AudioPlayer.h:268 (discriminator 1)
#4 0x400d7b5d:0x3ffe1d50 in audio_tools::AudioInfoSource::notifyAudioChange(audio_tools::AudioInfo) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/AudioTypes.h:181
(inlined by) audio_tools::AudioInfoSource::notifyAudioChange(audio_tools::AudioInfo) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/AudioTypes.h:178
#5 0x400d7ccd:0x3ffe1d80 in audio_tools::MP3DecoderHelix::infoCallback(_MP3FrameInfo&, void*) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/AudioCodecs/CodecMP3Helix.h:140 (discriminator 3)
#6 0x400de6bb:0x3ffe1dc0 in libhelix::MP3DecoderHelix::provideResult(_MP3FrameInfo&) at .pio/libdeps/esp32devCOM/libhelix/src/MP3DecoderHelix.h:154
#7 0x400de729:0x3ffe1de0 in libhelix::MP3DecoderHelix::decode() at .pio/libdeps/esp32devCOM/libhelix/src/MP3DecoderHelix.h:130
#8 0x400de59e:0x3ffe1e30 in libhelix::CommonHelix::writeChunk(void const*, unsigned int) at .pio/libdeps/esp32devCOM/libhelix/src/CommonHelix.h:232
#9 0x401f8d09:0x3ffe1e50 in libhelix::CommonHelix::write(void const*, unsigned int) at .pio/libdeps/esp32devCOM/libhelix/src/CommonHelix.h:82
#10 0x400d57aa:0x3ffe1e70 in audio_tools::MP3DecoderHelix::write(unsigned char const*, unsigned int) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/AudioCodecs/CodecMP3Helix.h:114
#11 0x400d5b4e:0x3ffe1ea0 in audio_tools::EncodedAudioOutput::write(unsigned char const*, unsigned int) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/AudioCodecs/AudioEncoded.h:209
#12 0x400ea92e:0x3ffe1ed0 in audio_tools::StreamCopyT<unsigned char>::write(unsigned int, unsigned int&) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/StreamCopy.h:391
#13 0x400eac3e:0x3ffe1f00 in audio_tools::StreamCopyT<unsigned char>::copyBytes(unsigned int) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/StreamCopy.h:179
#14 0x400eb12f:0x3ffe1f40 in audio_tools::AudioPlayer::copy(unsigned int) at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/AudioPlayer.h:441
#15 0x400eb281:0x3ffe1f70 in audio_tools::AudioPlayer::copy() at .pio/libdeps/esp32devCOM/audio-tools/src/AudioTools/CoreAudio/AudioPlayer.h:414
#16 0x40103f8d:0x3ffe1f90 in RadioPlayer() at src/powadcr.cpp:2490
#17 0x40112c18:0x3ffe2a70 in playingFile() at src/powadcr.cpp:4034 (discriminator 7)
#18 0x40114579:0x3ffe2bd0 in tapeControl() at src/powadcr.cpp:5555 (discriminator 3)
#19 0x40114cab:0x3ffe2d60 in Task1code(void*) at src/powadcr.cpp:5912
Beta Was this translation helpful? Give feedback.
All reactions
Hard to tell w/o knowing the code. Did you eventually allocate objects on the stack, so the notification tries to update objects that dissapeared...
Replies: 1 comment 8 replies
-
Hard to tell w/o knowing the code. Did you eventually allocate objects on the stack, so the notification tries to update objects that dissapeared...
Beta Was this translation helpful? Give feedback.
All reactions
-
But how to recover the i2s configuration, board again?
Beta Was this translation helpful? Give feedback.
All reactions
-
I tried it, but I had SD access problems then.
Beta Was this translation helpful? Give feedback.
All reactions
-
By calling clearNotifyAudioChange () ? That's hard to belive
Beta Was this translation helpful? Give feedback.
All reactions
-
Not really. I'll try this solution. Do you pass me an example or write a few lines of code to demonstrate the use of this method? Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @pschatzmann ,
After do a kitStream.clearNotifyAudioChange(); all works fine.
I had only clearNotify for each local objects but not in kitStream.
eq.end();
// Desvinculamos todas las notificaciones. Importante para evitar problemas
decoderMP3.clearNotifyAudioChange();
decoderWAV.clearNotifyAudioChange();
decoderFLAC.clearNotifyAudioChange();
//
decoderMP3.end();
decoderWAV.end();
decoderFLAC.end();
measureMP3.end();
metadatafilter.end();
// Desvinculamos todas las notificaciones. Importante para evitar problemas
kitStream.clearNotifyAudioChange();
Beta Was this translation helpful? Give feedback.