pschatzmann / ESP32-A2DP

A Simple ESP32 Bluetooth A2DP Library (to implement a Music Receiver or Sender) that supports Arduino, PlatformIO and Espressif IDF
Apache License 2.0
1.65k stars 270 forks source link

Audio state starts with 'playing', but no Bluetooth Connection exist #564

Closed harryberlin closed 4 months ago

harryberlin commented 4 months ago

Problem Description

It's a bit confuse thing for me. After startup, i have added a simple audio state request a2dp_sink.get_audio_state(), which returns 1 for state play. Bluetooth is not connected at this moment.

Device Description

ESP Wroom 32D

Sketch

//simple state request in setup() 
a2dp_sink.get_audio_state()

Other Steps to Reproduce

No response

Provide your Version of the EP32 Arduino Core (or the IDF Version)

2.0.16

I have checked existing issues, discussions and online documentation

pschatzmann commented 4 months ago

You obviously did not check the documentation: This method is returning a esp_a2d_audio_state_t and when you double check in the IDF documentation you will see that 1 really means ESP_A2D_AUDIO_STATE_STOPPED.

There is also a to_str method that lets you convert the status to a string as demonstrated in the corresponding example

So what exactly is the problem ?

harryberlin commented 4 months ago

sorry for wasting your time. found out what's my mistake. i did use the two examples bt_music_receiver_status_callback and bt_music_receiver_playing_status_callbacks I thought the a2dp_sink.get_audio_state() does return the same state like avrc_rn_playstatus_callback.