Closed philippe44 closed 2 years ago
Hi! Great to see you implementing it in that project! I'm currently working on integrating cspot with my own audio player software on esp32, and I'm going to fix the Player commands / events. About stack sizes: It's currently quite a mess, I'm going to soon release a refactor that will make the stack sizes configurable per-task. The few dropped frames are most likely a bug in ChunkedAudioStream, that does not buffer properly at the beginning of a song. Probably preloading beginning chunks moment before they're requested would fix the problem.
I've changed the stack sizes according to what I've measured and see how it goes (there are stats in squeezeESP32).
Re AudioChunks, any hints where I should look?
Something else I forgot to ask: do you gather metadata and is there a way to get them (I have a callback mechanism to display these) and is there a way to feedback commands to the Spotify controller as well (like volume/play/pause/stop)
BTW, it's really good to have the choice of storage backend being left to user and not in the core because, for example, I don't want to use spiffs, so the read/write file is a simple nvs implementation (for config - for auth I'm not storing anything so far).
In your change to your bell core, would I still be able to use "own" libraries for tremor, mbedtls and CJSon. I mean, in squeezeESP32, they are already provided by the rest of "system", so I just did not include them at all, I just took cpot, cpp-reflection, src and protocol. This is why integration was fairly easy. Will it remain the same? I'm also seing that you're adding a HTTP server that I would probably don't need (running short on sockets already)
Resolved, events and player commands are now handled through SpircController: https://github.com/feelfreelinux/cspot/blob/master/cspot/include/SpircController.h#L55
Hi - I've started to integrated cspot in https://github.com/sle118/squeezelite-esp32 and it's starting to work so far, but one thing I'm missing is a player's status/command when playback is started, stopped, paused.... I can add a few methods to the audiosink and call them in Player.cpp, but it seems that spotify does not always send this stop/play event, especially when already playing on one device and transferring to cspot.
It also seems that I'm loosing a few frames regularly, I'm wondering if you have that with the standalone cpsot as well? I've added a sink to feed the backend of squeezelite-esp32. It has plenty of buffer, but there is one specificity which is that when the feedPCMFrames is called and there is no room in that buffer, it will be blocking. Is that a problem? I would assume that the download/stream process does not mind but I might be wrong.
Have you also checked the stack sizes? As you use pthread, they all go into internal RAM which is a pretty scarce resource in my application, and it seems that Mercury and AudioChunk managers can be just 4KB while Player can be 6kB (instead of 8kB each).