-
-
Notifications
You must be signed in to change notification settings - Fork 279
Url player stops playing music. #180
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
Comments
I suspect you have to define in the config whether it is used or not. However player.stop is referring to it soo please do. ps: I am testing so the whole audio tools library soo please help! Because i make some extra logings and because there are a lot of classes that are inherted it is no easy task to do. And make on top of that with all notifications to make a pull request is unpossible... |
these three links are remarkable... http://icecast-servers.vrtcdn.be/mnm_urb-high.mp3 the player end
and sometimes the connection fails Here the complete test resluts of 78 radio stations
All links that did work before and now they don't http://22183.live.streamtheworld.com/JOE.mp3, |
I once started with 250 links... |
For debugging it would help a lot for debuging if I could see all the data that is comming in and going out. That request we know [I] HttpRequest.h : 182 - process connecting to host www.clubfmserver.be port 8000 The header of the respons we know
The things I miss...
PS: I read once that for https the time on the machine needs to be time sync.
|
Five of the links I tested where connection failed these are the links 2/ https://23623.live.streamtheworld.com:443/TOPRETRO.mp3 |
The reason is the same as the correction we made before with the mbed. During the cleanup of the previous ssl connection, the new http connection that has ben made runs in timout. 3000ms is to low, It has to be much more.
This is the solution for those five links. But when the links are not the same order (https and http scrambled) you will get a lot more connection fails! And eventually it will not make sens why sometimes it connects and sometimes it don't. And if this happens there is a memorie issue. The timout connection stays in the memorie... Now every next https connection fails!!! Normaly I have more than 100.000 free hape available when I start with a http that doesn't run in to a timout. When I start with a https where the connection failed than I have 60000 left but the next https needs around 90000, so allocated memory fail. I think this has to be solved first before solving the other issue. otherwise you cover this error more and it will be harder to find. I hope it cheered you all out. |
OK. I setted the timout to 10000, but it dident work for this link. It is jus a bad link that diden't work before. But it's not bad to increase it the have less failures. I am selecting the esp doit devkit board again and see what it does The link I am now test should work, it worked before without a problem http://23603.live.streamtheworld.com/JOE_80S.mp3 when there is audio output
when it stops playing music
end last working cyclus: The output from the helix is 61 instead of my default buffer size (I will decrease it the next run)
I2SStream.h : 124 is not called after I2SESP32.h : 82 Now what is actualy the problem... The input or the output? I think the input because when I change settings of the urlstream things run longer or shorter. And the timings! I'm sorry I post a lot of working settings that later on seems to be not working for other streams that but, now I will test stream by stream and see what the ultimated settings are. These settings doesn't break the stream anymore, at leasted for one hour testing. Before changing the settings it was only a minute...
|
The second link stops after a minute with the same working settings form the previous comment I have made here. http://22183.live.streamtheworld.com/JOE.mp3 With //#define USE_URLSTREAM_TASK commented the link works for an halve an hour. it has some difficulty some times. It falters... and than it stops |
what I am thinking is that it can't handle the in input. I am testing now if I can get the right settings in #183 |
Doing the test now with one channel and double speed... #define DEFAULT_SAMPLE_RATE 88200//44100 And I have still two channels... Now running for 10 minutes and still active. :-) |
it still breaks :-/ |
it is very strang that it starts playing again after some time. It is like he has find its begin back... |
Soo I set the settings back to the originals, and it's outputting sometimes empty pieces
and it stops at 1min and 6 seconds, and a bit later it stops... Now I am going to time it and watch the end E2 7 D5 2E 73 42 1D 7D - D5 18 1A 1E 5B C5 D3 21 This is not a random stop! 6B FE 7D 7F F4 D6 58 D - 25 73 37 8A 83 AA 31 15 The second test with same settings, the input stream cutoff at almost the same time it stops at exactly 161 bytes And I did set the esp_wifi_set_ps(WIFI_PS_NONE); power mode to non sleep. |
I found this in my header:
But the server uses:
I tried, but it keeps cutting off. these I found In my browser But some setting I can not find Accept-Language The last one is a resent update of mozilla, This could be it... It apply to an insecure connection. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade-Insecure-Requests |
I did the test over and set the library power saving to true, but still it cuttoff. Now I tried to set decrease the audio output in the serial monitor by comment this in the AudioOutput.h
And now it still running after 10 minutes, I see some that the buffer isn't always full... But it keeps running.
I run an other shetch WITH audio autoput and it still breaks. Decreasing the buffersize to 512 does have also uncomplete buffers. The internet breaks are just to long. |
Did you know there is a maximum on the header length |
My current impression is this is an issue of your specific URL. I think after some time they start to send silence. We could double check this by sending the data to a MultiOutput which consists of I2SStream and a VolumeStream. In the loop we can print the actual volume and I expect this to be 0 when we receive silence |
In the beginning yeah, but after a few seconds, those are in between
I am going to see what a working link does but I think it is always the size of the default buffer |
OK - I have the issue with other URLs as well: Have you already tried to deactivate the USE_URLSTREAM_TASK? |
yes, your links doing beter dan mine.
|
Did you already check that the issue is not a broken I2S functionality: Is the player from files working stable ? |
I m using no output to the I2S
Diden't test it yet. |
I think my link is a DAB+ radio. and with a leak of performance during the update it slowed down. Even with improved setting we won't get there. Is there a we have to give priority to the input to get default buffer full. I don' t see a way to test the sd player without outputting something to the i2s. |
I think I misstaking here because I don't outputing something. Only to my serial monitor. |
HexDumpStream doesn't accept in streamcopy |
I deactivated the task and added the MeasuringStream on the receiving side with the following result: I have more the impression now that the I2S functionality is broken because it should stall the processing. I will play some music from the SD card to double check. |
How do you you know that 15kbs-88kbs is enough? I suspect that the input is between 128 and 192kb/s... But yeah, I think also that the I2S breaks. Because I still see there is audio, but won't come out. |
15000 is enough because if you monitor the data consumption that's the value that is constantly used. |
I think we have the issue also playing files: after some (long) time we have the same effect. Just with the difference that we reach the end of the file quickly and when we switch to the next file the error is corrected by the file change logic, so the next file is playing fine again... |
diden' t see anything that was higher. I let you do now and I would happy to test it. Yes switching between url-streams makes a difference. That I can tell. |
My mistake, I was mixing is up with WifiClient... |
I left the httpclient and setup my own client. Same results
I notest that in the beginning of the url-player too, but than somehow it changes and the result start to come through. |
This is how it changes
[I] HttpHeader.h : 161 - HttpHeader::readLine -> Server: MediaGateway 5.7.2-0453.el6 |
Stupid of me, think I have found it. //size_t read = stream->readBytes(buffer, size); Still reading one byte before it's connected, but after that it reads the package size I have set.. Now I starting to interpreter the data.
|
Phil could you please see what's wrong? I'm using now your link but data comes in slowly after some time... It is my shetch because with the url-player it doesn't happen.
|
Not sure if it related to this but it is a bad idea to do result = stream->available(); before the loop. It should really be in the loop... |
it keeps running now but it isn't stable. the buffer isn't allways filled. I think it is because it is emptyted to quick. When I put a delay in it it crashes after some time. How could this be handled that the buffer is always full but doesn't slow down so much?
Sounds like a task. But not sure how we could check this, because it would be allready be filled if checking. Complete or not complete... |
oh maybe with availible like you said maybe. The RX buffer need to be two times the size of the default buffer, because it runs the read two times before complete. I'm going to try something see how it works... |
I am confused now, because we add this to the player and it diden't end up wel sometimes. I cam out with the righbuffer, but we steped off of that... Not sure what the reason was but I think it had something to do with the application or the output to the I2S. Three things to do... If the buffer not empty in time data is missing. if we don't do the application in time, thinks don't get further and if we don't output it, we don't have sound... I thinks the task have to comunicate with eachother to know that we could proceed. This can only be done in the shetch... is this somehow possible? |
I was thinking out loud. For the simple shetch I had to check if there was two times the size of the buffer availible and now it is allways filled. The timeout in the player is for the stream to get empty and that's allready there... The timeout in the copy would say we don't receive anything in time and just bailout. There could be still in bug in the uncompleted receive of the arduino-esp, but avoiding it will cause a lot less trouble. |
I don't think this is an issue: we just need to receive data in a speed where the decoded result is catching up with the playing: Maybe you should even change you sketch to receive the full buffer size - and not check for the available bytes... |
Can the data outputed directly to a spreaker with the internal dac? Or need it to be converted some how... |
If it is mp3 it needs to be decoded into PCM |
I think I found the issue: I completely forgot that I have added a metadata filter to libhelix which might be the source of the trouble. I deactivated the functionality and so far it's looking good. Can you verify ? ps. my using #define CHECK_MEMORY() checkMemory(true) - in the AudioConfig.h - you can activate additional memory checks and logging |
Wait - what? I have been monitoring the conversation but got a bit lost in the fragments. |
Me as well: I propose to close this issue and if it is not resolved to open a new one which only contains the relevant information. After all it this one is starting with AudioMozzi... I was testing with one of the mentioned links: https://25493.live.streamtheworld.com:443/NOSTALGIEWAFEXTRA.mp3 |
I don't think this is it, because the last time I test it, I didn't activate //#define USE_HELIX... I'm creating now a library so they can test and I countering a few issues to make it work. but I still need to add the to simple pcm decoder so I could hear that data is stil valid. What I learned for now it that I used the wrong datatypes for the included library of ESP. But there is still a variation in response of the read function. |
We are starting to get lost on this one, so I guess there is no agreement what the issue exactly is: I propose to open a new one with a description and a example sketch, so that we can reproduce it. |
I am lost, so which issue should I be following to get music to play without stopping? |
Do you have any such case with the latest corrections ? |
I'm trying but can't check out the latest for some reason. Cloning into 'C:\Users\james.platformio.cache\tmp\pkg-installing-p6ncwnrg'... there is a space at the end of the filename in the repo which is invalid. So the error is correct. But I don't know a quick way to fix. |
You can't. I am not a member of this repo so I can't help you. You need to wait untill the owner delete the blank space of that directory. |
Oops, I didn't notice: I just committed the correction |
I broke my project now. :( |
OK, I builds now.... I will test it in a bit |
Please note that the biggest change is that I have commented out USE_URLSTREAM_TASK in AudioConfig.h as default setting. I came to the conclusion that this is leaner and better and leaves more free RAM... |
Left it playing all weekend, it didn't stop playing. |
Cool, this is matching with the results of my tests |
Update: I had an power suffering issue that has been solved now. I detected that the protocol that was selected was B, that limits the data transfer to 10Mbs and that was maybe been flashed and restored. At least we did more here brothers J and H :-) Now I have the latest for my board N. Here is my code to test it. Be sure you place this after esp_wifi_start();
|
Phill
I m investaging to work with arduino espressif 2.0.2 and look what could be the reason why the URL player does turn as not active. I found a something...
in AudioMozzi.h those files can not be found...
#include "mozzi_config.h"
#include "hardware_defines.h"
#include "mozzi_analog.h"
#include "Mozzi.h"
I did a lookup, but the are not in hierarchy
The text was updated successfully, but these errors were encountered: