joba-1 / PicoW_A2DP

Bluetooth A2DP Sink to I2S/DAC on a Raspberry Pico W
5 stars 2 forks source link

Auto-Reconnect / Windows Compatibility #1

Closed rohanb1216 closed 4 months ago

rohanb1216 commented 8 months ago

I've been using this mostly seamlessly, apart from 2 issues related to reconnecting.

  1. It doesn't auto-reconnect to the last connected device.
  2. In Windows (I'm on Win11), only for the pico, there's no connect/disconnect button for it once paired.

If you happen to know what needs to be done, or can point me the right way, it'd be greatly appreciated. I've tried without success to pinpoint the problem and fix it on my own.

joba-1 commented 8 months ago

Thanks for your feedback. Great to hear it basically works for you as well.

I know about reconnect issues. That is why I reboot the pico once connection is lost instead of just going back to listening mode. Fixing that would be the first step.

There is a mode in the original a2dp example where you give a bt address and then the pico is supposed to automatically reconnect to that address. I did not test it, probably even thrown out related code, because I don’t want that behaviour in my use case.

Regarding Win11: I basically only use linux, so no idea how to track this down. But I have tested a bit with windows client and didn’t see something similar. I‘ll recheck…

rohanb1216 commented 8 months ago

There is a mode in the original a2dp example where you give a bt address and then the pico is supposed to automatically reconnect to that address. I did not test it, probably even thrown out related code, because I don’t want that behaviour in my use case.

Ah okay, that was what I needed to get it working for myself, thank you.

Regarding Win11: I basically only use linux, so no idea how to track this down. But I have tested a bit with windows client and didn’t see something similar. I‘ll recheck…

If there's any way I can help, any device info, logs, or whatnot, I'd be more than happy to provide it. Likewise, if there's anything I can find on my side, I'll try to create a pull request.

joba-1 commented 8 months ago

Nice to know you git the reconnect working. If you want it in this repo, feel free to send a PR with #defines so it is not active per default.

I'm afraid there are no logs on the pico side (so far I just used the picoprobe for debugging) and I don't know how to get bt related logs from windows. I also don't know what windows would require to display the connect/disconnect button. I can disconnect just fine on linux and iphone. Maybe it doesn't like the device class I use?

rohanb1216 commented 8 months ago

I did try changing the device class, with no luck. I'll work on the PR once I clean it up and get it up to a standard I'm fine with sharing. As for now, the functionality I want is more or less there, and your repo made it a breeze to set up what I needed.

Edit: I just retried with a device class used by another pair of bluetooth headphones I had (0x240404), it's working as intended now. Thanks Microsoft. You've been a ton of help on this, thanks for the assistance :)