sle118 / squeezelite-esp32

ESP32 Music streaming based on Squeezelite, with support for multi-room sync, AirPlay, Bluetooth, Hardware buttons, display and more
1.07k stars 100 forks source link

Radio Paradise flac stream crash #40

Closed ElFishi closed 3 years ago

ElFishi commented 4 years ago

The Radio Paradise flac stream crashes my Squeezelite-esp32 devices. This issue is to document one instance:

ElFishi commented 4 years ago

Same System but

ElFishi commented 4 years ago

Same system

ElFishi commented 4 years ago

Same system

ElFishi commented 4 years ago

Second system

ElFishi commented 4 years ago

Btw, I restarted LMS (which I had done before). Now the v0.5.597-system seems to run longer? It made 30 min before it crashed

ElFishi commented 4 years ago

Btw, the radio paradise FLAC streams do not always stream flac. Sometime songs come as ogg. This may account for variations in the survival times. I found that by clicking on the song in LMS. The title information also contains the file type.

philippe44 commented 4 years ago

That gives me a hint (not perfect) about something happening in the decoder, a buffer alignment issue or similar and the flac_decode method never consumes the streamed frames so decoder keeps knocking it relentlessly. I had a similar issue in pcm.

ElFishi commented 4 years ago

Thx for picking this up. I am happy to try more ways to uncover additional hints if you tell me how.

ElFishi commented 3 years ago

no crashes with fw: v0.5.641-IDFv3.1.5-I2S-4MFlash

alidaf commented 4 months ago

@ElFishi How did you get the ES9018 to work?

ElFishi commented 4 months ago

What is your problem?

alidaf commented 4 months ago

What is your problem?

I'm just getting some low level music overpowered by really bad hiss in one speaker. I just dropped this board in place of a PCM5102 board. Did you ground the MCLK or just leave it unconnected? I've looked through your logs and I seem to have it set up exactly the same but wondered if you used some arcane magic because I can't figure it out. There are 2 variants of the board and I'm wondering whether I was sent the reverse one, i.e. RCA input to I2S. The board says out on the RCA sockets so I'm probably clutching at straws. I've tried resampling as well. Apparently the early problems on the RPi with this board were due to it being configured by default for 384k input.

ElFishi commented 4 months ago

Yes, magic, thats me! Which board are you using? My ES9018 is a Franken-Topping D10: A stock D10 where I broke the PCB traces for DATA, LRCLK and BCLK and rerouted them to a ESP.
So I can't really tell what MCLK is doing. To have it play 16bit you need to send the right command via I2C: dac_controlset {"init":[ {"reg":1,"val":12} ],"poweron":[ {"reg":1,"val":12} ]}

alidaf commented 4 months ago

@ElFishi Wow, and oh dayum that's some serious L337 hackery (I am in awe). I'm at the much cheaper end of the market with one of these, trying to play with the big boys. This board doesn't have an I2C connection so I think I'm stuck with whatever mode it's hard-wired in. It's really aimed at the RPi market where it seems it was as equally frustrating to get to work for a while but they now have an overlay that makes it work for them. Thanks for the input.

ElFishi commented 4 months ago

I try my level best : ) the default input configuration of the ES9018K2M is I2S 32-bit. Have you tried a I2S-4MFlash-32 version of the FW?

alidaf commented 4 months ago

Have you tried a I2S-4MFlash-32 version of the FW? I just beat you to the pip on that one. Quite literally moments ago. Instead of horrible noise, silence. I take that as progress so I'm just looking into the soxr parameters to see if there's anything I can do there. The board I have comes with the recommendation to use the hifiberry-dac overlay for the RPi, but the hifiberry-dac is based on a PCM5102 and I have one of those working well with the ESP32. Sigh, The ES9018 board has lots of stuff on it that looks like it all does something more than the PCM5102 and I'm a sucker for that. If it had anything that periodically went ping on it, I'd have written a blank cheque for it.

ElFishi commented 4 months ago

Not sure I follow. I just switched to I2S-4MFlash.32.1670 and I use "autoexec1": "squeezelite -o I2S -b 500:2000 -d all=info -C 300 -W -n \"Scarlet\"", so no special resampling. What are "soxr parameters"?

alidaf commented 4 months ago

Soxr is the linux code that Squeezelite-esp32 uses for resampling. It's activated using the -R switch in the autoexec1 parameters with various options. I think it's a dead end for this. Oh well, I'll put it on the back burner for now - plenty else to be getting on with. Thanks for the help though. Keep up the magic.

philippe44 commented 4 months ago

Soxr is not in squeezeesp32, I had to build another resampler as it was consuming way too much cpu

alidaf commented 4 months ago

Soxr is not in squeezeesp32, I had to build another resampler as it was consuming way too much cpu

Apologies. The guide says that the format is the same, hence the assumption.