Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Spdif produce only clicks and noises #2046

Answered by pschatzmann
dogymem asked this question in Q&A
Discussion options

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

Image

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.

Image

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
You must be logged in to vote

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

Comment options

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

You must be logged in to vote
0 replies
Answer selected by pschatzmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #2045 on May 21, 2025 12:17.

AltStyle によって変換されたページ (->オリジナル) /