judge2005 / ESP32BT

A C++ implementation of the A2DP bluetooth profile on the ESP32
5 stars 1 forks source link

Connecting DAC #1

Open palsbo opened 4 years ago

palsbo commented 4 years ago

Hi This looks great. First step - getting the program to run on an ESP32 and flash was no problem, but I need to know more about connecting ampllifier or DAC. I looked in the code, but cannot find any clues.

What to do to get sound out of it? Best regards Erik

Almost resolved! After checking a bit further in the code and ESP32 documentation I solved the problem. Now it sorks fine when connecting as a bluetooth speaker to my phone.

But when trying to attach as a bluetooth speaker for google home mini, ESP_SPEAKER is not recognized. I asume it has to do with the Bluetooth class?? Can it be fixed?

judge2005 commented 4 years ago

Did you get sound out of it when connected to your iPhone? If not, look at this, which is what I used https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp

I’m a little confused why you would connect a Bluetooth speaker, like the google home mini, to this? This is a Bluetooth speaker, so you would be connecting one Bluetooth speaker to another one.

palsbo commented 4 years ago

Thank you for your quick answer. Yes I got sound when connected from the iPhone or to the PC.

I want to use the device as a bluetooth speaker connected from the google home mini. This can be configured from the google home app, and works with other BT-speakers. google home appp does not use the 'general' bluetooth setup (which can recognize the ESP_BLUETOOTH) but have its own bluetooth connection scheme, which will not recognize the ESP_BLUETOOTH, but other BT speakers are ok. I think the problem is the class (or sink) supported??

judge2005 commented 4 years ago

The short answer is: I don't know. Have you tried 'forgetting' ESP_BLUETOOTH in your other sources first? Also, try compiling the code with all the ESP32 debug turned on so you can see what comes out on the console. Is ESP_BLUETOOTH discoverable at all by google home mini, or does it not even appear as a device that can be connected to?

palsbo commented 4 years ago

Thanks for your patience. I have removed/forgotten from other devices before trying to connect to Google home mini. ESP_BLUETOOTH dos not even appear on Google home mini. With debug(info) I get the following on connecting to the PC: [I][A2DPEventSink.cpp:45] eventCallback(): Connecting [I][A2DPEventSink.cpp:98] eventCallback(): Audio codec SBC, sample rate 44100 [I][A2DPEventSink.cpp:104] eventCallback(): Configure audio player 21-15-2-35 [I][A2DPEventSink.cpp:49] eventCallback(): Connected [I][A2DPEventSink.cpp:66] eventCallback(): Audio started [I][A2DPDataSink.cpp:64] dataCallback(): Audio packet count 100 [I][A2DPEventSink.cpp:74] eventCallback(): Audio suspended [I][A2DPEventSink.cpp:66] eventCallback(): Audio started [I][A2DPDataSink.cpp:64] dataCallback(): Audio packet count 100 [I][A2DPEventSink.cpp:74] eventCallback(): Audio suspended When disconnecting from PC and trying to search on Google home mini, nothing happens.

Regards Erik