sle118 / squeezelite-esp32

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

24bit SPDIF output #307

Closed UrbanLienert closed 1 year ago

UrbanLienert commented 1 year ago

This PR adds 24bit support for SPDIF and changes the 16bit version as well. In spdif_convert() the parity bit is set instead of bit 24 of the audio samples.

philippe44 commented 1 year ago

Thanks - Have you measured the CPU impact (make a comparison using high-accuracy esp time measures)? This is a pretty intense part of the app and for example, I had to tweaks things not so long ago with spdif and spotify (not even mentioning equalizer)

UrbanLienert commented 1 year ago

Yes, it seems the 24bit version is about 4% faster than the 20bit version and the new 16bit version gains around 17%.

philippe44 commented 1 year ago

Thanks, that's great! One last thing: I discover recently why there was an issue with left/right inversion and fixed it, I trust you have verified there is no inversion here?

UrbanLienert commented 1 year ago

Yes, double checked right now. And found some unnecessary code, that I forgot to delete. Removed it.

philippe44 commented 1 year ago

Can you hide vucp in the function as a static

UrbanLienert commented 1 year ago

I've put it in the spdif struct.

philippe44 commented 1 year ago

Many thanks - I've made a few changes to add to the optimization game 😄 but people will be happy to have 24 bits

philippe44 commented 11 months ago

There is potentially and issue with that PR, , see https://github.com/sle118/squeezelite-esp32/issues/333. @UrbanLienert, can you chime-in?