ESP32-audioI2S icon indicating copy to clipboard operation
ESP32-audioI2S copied to clipboard

Have library power to SPDIF out?

Open mmar22 opened this issue 1 year ago • 10 comments

What you mean can I2S to SPDIF sw code be used here?

mmar22 avatar Nov 29 '23 08:11 mmar22

No, I don't have the possibility to test this either. Have a look here: https://github.com/earlephilhower/ESP8266Audio/blob/master/src/AudioOutputSPDIF.cpp Maybe you can realise this yourself.

schreibfaul1 avatar Nov 29 '23 08:11 schreibfaul1

Ofcourse i dont ask your code, but your meaning. Too question is how is max samplerates for every your codecs...

mmar22 avatar Nov 29 '23 08:11 mmar22

The samplerates depends on the source, max is 48KHz, bitrate max 320Kbit/s

schreibfaul1 avatar Nov 29 '23 08:11 schreibfaul1

This is clean, but exist hires radio 96kHz/24bit 1300kbit i ask if you have tested ESP32 limits?

mmar22 avatar Nov 29 '23 09:11 mmar22

No, we are not travelling in the Hi End range with this hardware, max is 16 bit/sample

schreibfaul1 avatar Nov 29 '23 09:11 schreibfaul1

I use spdif code on other project, but here for speedup test can you help where in your code i can set data buffer callback for fill spdif instead i2s out.

mmar22 avatar Nov 30 '23 17:11 mmar22

There are two events that can be used to decouple the PCM data: void audio_process_extern(int16_t* buff, uint16_t len, bool *continueI2S) void audio_process_i2s(uint32_t* sample, bool *continueI2S) The latter is used by the ESPuino project for Bluetooth a2dp source

schreibfaul1 avatar Nov 30 '23 20:11 schreibfaul1

Maybe i dont ask clean, but i require spdif INSTEAD i2s, then require in your class replace all part that work with i2s and only send to spdif. Or maybe simpler is implement in the middle converter audio to spdif frames and double sample rate. Because spdif code in real use i2s to output signal.

mmar22 avatar Dec 01 '23 19:12 mmar22

I implement SPDIF and test it now, but i use too lvgl and when i place in loop audio.loop(); lv_timer_handler(); /* let the GUI do its work */ delay( 5 ); then i have issue on any animation audio is corrupted. I mean require dedicated task for audio.loop() , but how stack and other params is optimal ? Can you recommend any

mmar22 avatar Dec 20 '23 10:12 mmar22

@schreibfaul1 i test more and corruption in audio is on AAC station. ANy tip? I use task on core 0 now void task_AAloop(void) { for( ;; ) { audio.loop(); vTaskDelay(5 / portTICK_PERIOD_MS); } } too i see little audio skip when info is show info StreamTitle='Queen - Thank God It's Christmas'

mmar22 avatar Dec 21 '23 07:12 mmar22