MrBuddyCasino / ESP32_MP3_Decoder

A internet radio and bluetooth speaker project for the Espressif ESP32
774 stars 182 forks source link

bt_speaker mode doesn't compile #57

Closed tonyp7 closed 6 years ago

tonyp7 commented 6 years ago

So I've been playing with the code mostly using web radio. Today I wanted to try the bluetooth speaker. I downloaded a fresh copy of the code and got this message:

ESP32_MP3_Decoder_clean/components/bt_speaker/bt_speaker.c:93:9: error: implicit declaration of function 'esp_a2d_sink_register_data_callback' [-Werror=implicit-function-declaration]
         esp_a2d_sink_register_data_callback(bt_app_a2d_data_cb);
         ^
cc1.exe: some warnings being treated as errors
make[1]: *** [/home/tony/esp/esp-idf-v3.0/make/component_wrapper.mk:274: bt_speaker.o] Error 1
make: *** [C:/msys32/home/tony/esp/esp-idf-v3.0/make/project.mk:450: component-bt_speaker-build] Error 2

Seems like you can't compile the code anymore with just "make" you have to change the default esp-idf config (under make/project.mk) and set the following gcc flag:

-Wno-error=implicit-function-declaration

And this is a pretty scary flag to include!

MrBuddyCasino commented 6 years ago

Thanks for the report, looks like that needs to be fixed. PR?

tonyp7 commented 6 years ago

Unfortunately no, I'm not quite sure what is going wrong. I compiled esp-idf bluetooth speaker example (https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/a2dp_sink) to be sure I don't have an issue specific to my setup but this one compiles with no warnings at all.

aliafshar commented 6 years ago

I don't know if what I did was right, but that method doesn't exist in the sdk version I have here. The PR I made works for me, anyway.

mixographer commented 6 years ago

Now I get this one.

/Users/jimmy/git/ESP32_MP3_Decoder/components/bt_speaker/bt_speaker.c: In function 'bt_av_hdl_stack_evt':
/Users/jimmy/git/ESP32_MP3_Decoder/components/bt_speaker/bt_speaker.c:93:9: error: implicit declaration of function 'esp_a2d_register_data_callback' [-Werror=implicit-function-declaration]
         esp_a2d_register_data_callback(bt_app_a2d_data_cb);
         ^
cc1: some warnings being treated as errors
make[1]: *** [bt_speaker.o] Error 1

Is there a mismatch between the SDK and the latest version? If I drop this latest merge, I can compile.

tonyp7 commented 6 years ago

The latest a2dp sink example from esp-idf 3.0.2 (latest stable release) has both:

esp_a2d_register_callback(&bt_app_a2d_cb); esp_a2d_register_data_callback(bt_app_a2d_data_cb);

MrBuddyCasino commented 6 years ago

Yep, I reverted the change because thats not the issue. It seems the build can't see the a2dp headers, I still don't quite understand why.

MrBuddyCasino commented 6 years ago

Turns out you need to separately enable the A2DP option in the bluetooth component in makeconfig, then it works.

MrBuddyCasino commented 6 years ago

added failsafe to kconfig