Player SetIndex problem when using I2s #1774
-
I am having a problem changing internet radio url stations from an I2s output setup. I am trying to use an IR remote to change the index number and then pass the new index number to player.setIndex(idx). On my system the player appears to be trying to switch the metadata stream to the correct index, but the audio output is not changing from station 0. Similar code worked when using a Thinker board with the audiokit so think the problem is with my i2s implementation. If I use player.next() and player.previous() functions to move up or down a single step those functions work. The Ir control of volume works well. I am just having trouble with the setIndex function. Would like suggestions as I have a tried several variants including trying to change at the source without success and I see no problems in my look at the library codes. Audio output does play the startup station and that station resumes playing after trying to make a change. """
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
Look up in the class documentation what begin is doing ! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
You were supposed to read the class documentation and not search for examples! Also are you sure that you are connnecting to an Icecast/Shoutcast Server ? I think it is not, so the system just let's you know. |
Beta Was this translation helpful? Give feedback.
-
Did read the class documentation but did not comprehend "start" so started to look for an example. I did try to drop the player.setIndex line as thought unnecessary. The station changed but I did not get any audio song metadata from the stations after the station change. I added the line back and the metadata started to stream in addition to the audio out. I am getting the Error message: But after a moment or two the station metadata streams out followed by Title song information steams when new song. This is what I wanted. FYI urlSteam was defined as as an ICYStream type. I am not unhappy at this point but do not understand the error message. I wonder if I should add a flush statement but thought the player.stop or player.end would have handled the left overs in the buffer from the previous station and am not surprised that changing to a new station might not detect the metadata on startup. I do have a couple more issues with changing and playing stations. Stations with poor or slow steam often include momentary pause in the play. I am using the default buffer but have wondered if changing it might help. It looked like I could set buffer size using player.copy(buffer) option but I saw several other ways in the documentation and not sure what is preferred. I assume it should change by power of 2 Correct, i.e. 512, 1024, 2048 etc.. Another issue is a failed connection. I think the error code is 223. The timeout seems too long to me. I think it is 60 seconds and the IR remote is just frozen until that timeout passes. Can I use a define to override the default wait? |
Beta Was this translation helpful? Give feedback.
-
You did not provide any url which gives this error. But you can test them yourself with wget;
You should get a response that contains an icy-metaint line. E.g icy-metaint:16000 Maybe you must call end() to close the connection properly before opening a new one. I think you talk about the amount of data that is copied to the decoder with each copy command, and that should not make any difference. You can try the buffered implementation by changing the class, but I never had any need to do this. You can change the timeouts via the API: please check the class documentation. |
Beta Was this translation helpful? Give feedback.
-
fyi - my current setup is simple ESP S3 WROOM1 w N16R8, a PCM 5102 module, and IR remote. I am not using the SDMMC module on this test setup but have another version that puts the net login info, mp3 folders, and url lists into folders on a SD card using the fast mmc protocol and sends the metadata out to a 1306 digital display instead of the serial monitor. Current setup seeks to improve station switch and use of the Ir remote. I am sending the headphone out to an external amplifier but have also used the MAX98375 module to the logitech speaker with no problems. |
Beta Was this translation helpful? Give feedback.
Look up in the class documentation what begin is doing !
The system does exactly what you tell it to do...