Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have library power to SPDIF out? #616

Open
mmar22 opened this issue Nov 29, 2023 · 10 comments
Open

Have library power to SPDIF out? #616

mmar22 opened this issue Nov 29, 2023 · 10 comments

Comments

@mmar22
Copy link

mmar22 commented Nov 29, 2023

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

@schreibfaul1
Copy link
Owner

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.

@mmar22
Copy link
Author

mmar22 commented Nov 29, 2023

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

@schreibfaul1
Copy link
Owner

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

@mmar22
Copy link
Author

mmar22 commented Nov 29, 2023

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

@schreibfaul1
Copy link
Owner

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

@mmar22
Copy link
Author

mmar22 commented Nov 30, 2023

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.

@schreibfaul1
Copy link
Owner

schreibfaul1 commented Nov 30, 2023

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

@mmar22
Copy link
Author

mmar22 commented Dec 1, 2023

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
Copy link
Author

mmar22 commented Dec 20, 2023

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
Copy link
Author

mmar22 commented Dec 21, 2023

@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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants