ANNEX_1.43.2 PLAY.STREAM

Here we can discuss about the problem found
Post Reply
User avatar
PeterN
Posts: 366
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 171 times
Been thanked: 203 times
Contact:

ANNEX_1.43.2 PLAY.STREAM

Post by PeterN »

Hi Francesco

Play.stream seems to cause a problem,at least if the buffer is set to 64.

Code: [Local Link Removed for Guests]

play.setup 1,64 ' external DAC, max Buffer
play.volume 75
PLAY.STREAM"http://91.121.159.124:8000/eko-des-garrigues-128k.mp3"

end


This code plays the webradio in the background. But if you then try to change from "Editor" to "Config"-screen the ws-connection terminates until a reset.

If I use less buffer e.g with PLAY.SETUP 1,32 it seems to be more stable.

I tested this with an ATOM ECHO and it does the job with the prior version
User avatar
cicciocb
Site Admin
Posts: 1900
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1271 times
Contact:

Re: ANNEX_1.43.2 PLAY.STREAM

Post by cicciocb »

Hi Peter,
this is a quite strange problem I observed with the Arduino compiler.
In fact, I discovered that each time I compile Annex or Annex32 I observe a slightly difference in terms of speed.
This is probably caused by the way the compiler optimise the code and/or how the code is optimized internally by the cache memory.
I discovered that, adding some dummy code can speedup the module but this requires a lot of time experimenting the best compromise in terms of speed.

I'll try to do again on both versions.

cicciocb
User avatar
PeterN
Posts: 366
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 171 times
Been thanked: 203 times
Contact:

Re: ANNEX_1.43.2 PLAY.STREAM

Post by PeterN »

Oh, that's one of the problems that's hard to encircle !
Thanks and good luck
User avatar
cicciocb
Site Admin
Posts: 1900
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1271 times
Contact:

Re: ANNEX_1.43.2 PLAY.STREAM

Post by cicciocb »

Hi Peter,
finally I found that the problem comes from the RAM free.
In fact the integration of the bluetooth consumes around 80Kbytes of precious RAM.

When streaming a web radio, the available memory is very very low leaving almost no place for other activities.
I did some tests with an Atom Echo and I can reproduce the problem
As I'm used to work essentially with modules with PSRAM I did not noticed this problem.

Anyway, as reported in the very synthetic documentation about the bluetooth, it is possible to recover around 40KB with the command

Code: [Local Link Removed for Guests]

BLUETOOTH.DELETE
I did some tests with an Atom Echo and I can confirm that this command fixes this issue
User avatar
PeterN
Posts: 366
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 171 times
Been thanked: 203 times
Contact:

Re: ANNEX_1.43.2 PLAY.STREAM

Post by PeterN »

Thanks Francesco

I will test in the afternoon.
Could there be a config -Switch like for the TFT or SD to disable Bluetooth-ability at Boot-time?
User avatar
PeterN
Posts: 366
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 171 times
Been thanked: 203 times
Contact:

Re: ANNEX_1.43.2 PLAY.STREAM

Post by PeterN »

I tested now with BLUETOOTH.DELETE on a ATOM-ECHO and on a NodeMCU-Clone without PSRAM.

That solved the problems that arose while using PLAY.VOICE, PLAY.STREAM together with a long NeoPixel-stripe.

However, I am now asking myself whether Bluetooth use is not a technically appealing, but rather rarer purpose. Therefore, a Bluetooth enable/disable option in the Config page could perhaps be a useful feature (??)
User avatar
cicciocb
Site Admin
Posts: 1900
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1271 times
Contact:

Re: ANNEX_1.43.2 PLAY.STREAM

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Mar 05, 2021 5:51 pm I tested now with BLUETOOTH.DELETE on a ATOM-ECHO and on a NodeMCU-Clone without PSRAM.

That solved the problems that arose while using PLAY.VOICE, PLAY.STREAM together with a long NeoPixel-stripe.

However, I am now asking myself whether Bluetooth use is not a technically appealing, but rather rarer purpose. Therefore, a Bluetooth enable/disable option in the Config page could perhaps be a useful feature (??)
Hi Peter,
yes, I think that is a good idea to include another option to enable / disable the BLE.
Post Reply