-
-
Notifications
You must be signed in to change notification settings - Fork 309
I2S to Bluetooth bridge #1780
-
First of all, many thanks for this great project, Phil!!
I built a webradio on ESP32 basis and it works fine outputting I2S data to a PCM5102. Using the same signals to another ESP32 which works as a I2S to Bluetooth bridge works as well, using your A2DPBluetooth source. But: the sound is perfect, but this depends on the bitrate of the radio station. All bitrates above 128000 work perfect, 128000 works, but with regularly tic-sounds, maybe 8 times a second.
The I2S to Bleuttooth bridge works in RX mode, so the sender controls all three lines I guess. I played with the sample_rate with strange results. In my opinion the sample_rate and data rate should be controlled by the master controller clk. This seems not to be true. May somebody has an idea to solve this problem?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 11 replies
-
I don't quite understand what your problem is ?
Is it a I2S connection between 2 ESP32 ?
Beta Was this translation helpful? Give feedback.
All reactions
-
The problem is, that the sound is disturbed by frequent, regularly tic-sounds. This happenes with radio stations <=128000 bit/s (MP3).
Yes, it is an I2S connection between two ESP32.
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for the link to the discussion.
Unfortunately, there seems to be no solution for this issue. It seems to be a bug the I2S receiver.
BTW:
Why does a the slave (receiver) needs to have a sample frequency on a synchronous clock driven bus at all? Reading in the data could be realized with a two simple shift registers, selected by ws_pin as DACs will probably do it. If we do not have a clock line, we have to know the frequency like baudrate on asynchonous UARTs.
Beta Was this translation helpful? Give feedback.
All reactions
-
I investigated a litte bit more, the result is:
The samplerate from the incoming I2s stream has always to be converted to 44100, because the A2DP output seems to be fixed at this bitrate. The tic-sound were buffer overflows, because of the difference between 48000 (i2s in) and 44100 (A2DP out).
I use as mentioned before a webradio streamer s a source on a separate ESP32 and the sample rate of the output depends on the quality of the web radio station. This is no problem when using a DAC like PCM5102 at all.
I saw a sample about resampling but I did not manage it work for my purpose.
I need I2S (48000) -> resample -> 44100 -> A2DPSource.
I viewed a lot of examples, I do not understand the differences between them fully. Sometimes you use a copier, sometimes not. The arguments of the constructors are not self-explaining (for me) and how the objects are to be used together.
Is there something like a general manual how to use the library?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions
-
What's wrong with the Wiki ?
Beta Was this translation helpful? Give feedback.
All reactions
-
Nothing wrong with it. It is well explained but covers the basics only.
The difference might be, that you work on these codes for years and I for three days.
I do not understand, why in the resample example there is not copier.copy() instruction.
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh, I must apologize. I just saw the first chapter and thought this was the whole Wiki - sorry.
I now understand a lot more a got my application to work as intended.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi Prog32aw, How you solved this can you share your code please
Beta Was this translation helpful? Give feedback.
All reactions
-
What do you mean?
ESP32->I2S->ESP32 ?
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello [Prog32aw],
As Wi-Fi and BT not work together hence this logic of using two ESP32. meaning for example Wi-Fi URL fetch at one ESP32 outputting I2S (TX) data to another I2S(RX) ESP32 which works Bluetooth bridge for A2DP output .
Beta Was this translation helpful? Give feedback.
All reactions
-
What do you mean?
ESP32->I2S->ESP32 ?
Are you still sending audio from one ESP32 to another using an I2S connection between them? If so and it's working can you please share your code with us?
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 2
-
как Вам это удалось? я разработал устройство с экраном и кнопками, может сканировать устройства и записывать их в память, 4 устройства на выбор с возможностью их заменить. но тоже мучает вопрос с низким битрейтом.
Beta Was this translation helpful? Give feedback.