-
-
Notifications
You must be signed in to change notification settings - Fork 309
Spdif produce only clicks and noises #2046
-
Problem Description
Hi, I'm having trouble with the SPDIF output. I built the cd changer emulator based on Arduino audio tools library. The emulator runs, but instead of sound, I’m getting clicks and noise. This emulator emulates cd changer (send uart comands) and translate a2dp sound to spdif. I also tried to use sine wave generator to spdif example and I heard some signal, but it was full of artifacts. I use 100n compositor and resistor divider between gpio22 and spdif out. I have some oscillogram.
This is spdif output
Image
This is gpio 22
But when I was trying to zoom I watched any artifacts and I dont really know, is it my signal bad or oscillograph is lying.
I would really appreciate your help with this issue — this project is very important to me.
p.s. video proof - https://drive.google.com/file/d/1ZmsASHZapuVzPrDAN-DI0aGwLvVaqVVY/view?usp=sharing
Device Description
WROOM 32 esp 32 dev kit v1
Sketch
#include <Arduino.h> #include "BluetoothA2DPSink.h" #include "SPDIFOut.h" #include <TLCDCEmu.h> TLCDCEmu emulator; void setup(){ delay(10); emulator.init(); } void loop(){ emulator.talk(); } void TLCDCEmu::init(char *btName){ ESP_LOGI(LOG_TAG,"INIT"); CDC_RX_Ptr = 0; ESP_ERROR_CHECK(uart_param_config(UART_NUM_2, &uart_config)); ESP_ERROR_CHECK(uart_set_pin(UART_NUM_2,15,16,13,14)); //TX RX ESP_ERROR_CHECK(uart_driver_install(UART_NUM_2,BUFF_SIZE,BUFF_SIZE,10,&uart_queue,0)); xTaskCreate(uart_event_task, "uart_event_task", 2048, NULL, 12, NULL); SPDIFOut *out; out = new SPDIFOut(); btSink.start(btName,out); //Timer timer_queue = xQueueCreate(10, sizeof(timer_event_t)); tg0_timer_init(TIMER_0, TEST_WITHOUT_RELOAD, TIMER_INTERVAL0_SEC); tg0_timer_init(TIMER_1, TEST_WITH_RELOAD, TIMER_INTERVAL1_SEC); xTaskCreate(timer_evt_task, "timer_evt_task", 2048, NULL, 5, NULL); }
Other Steps to Reproduce
No response
What is your development environment (incl. core version info)
No response
I have checked existing issues, discussions and online documentation
- I confirm I have checked existing issues, discussions and online documentation
Beta Was this translation helpful? Give feedback.
All reactions
I am not convinced that this is a bug in my software, but the issue seems to be mainly in your code.
I don't really have any hardware to test this, so I suggest that you try to use the sine test exapmle sketch with different sample rates.
Maybe the issue is also with your hardware, so double check if another ESP32 version works better, or if you can reproduce your issue by only connecting the pins to the Oscilloscope (w/o resistors and caps).
You can also double check if this is related to the new IDF I2S driver by downgrading to the ESP32 Core Version 2.17
Replies: 1 comment
-
I am not convinced that this is a bug in my software, but the issue seems to be mainly in your code.
I don't really have any hardware to test this, so I suggest that you try to use the sine test exapmle sketch with different sample rates.
Maybe the issue is also with your hardware, so double check if another ESP32 version works better, or if you can reproduce your issue by only connecting the pins to the Oscilloscope (w/o resistors and caps).
You can also double check if this is related to the new IDF I2S driver by downgrading to the ESP32 Core Version 2.17
Beta Was this translation helpful? Give feedback.