kfatehi / pi-phone-dock

Raspberry Pi Bluetooth Mobile Phone Dock with features derived from the exposing of audio signals such as call recording and real-time translation (also known as consecutive interpretation).
2 stars 0 forks source link

Just some resources. #1

Open kfatehi opened 3 years ago

kfatehi commented 3 years ago

https://github.com/pschatzmann/ESP32-A2DP

https://github.com/pschatzmann/arduino-audio-tools/wiki/Examples

https://github.com/atomic14/esp32_audio

https://www.reddit.com/r/esp32/comments/nmwugf/how_to_connect_esp32_to_bluetooth_headphones/

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/esp_hf_ag.html

https://www.reddit.com/r/esp32/comments/mvgrwf/bluetooth_micheadset_to_eps32/

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/classic_bt.html

https://github.com/espressif/esp-idf/tree/c69f0ec/examples/bluetooth/bluedroid/classic_bt/a2dp_sink

https://github.com/espressif/esp-adf/issues/648

https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles#Hands-Free_Profile_(HFP)

kfatehi commented 3 years ago

Jumping off https://github.com/pschatzmann/ESP32-A2DP

We see a link to classic BT section https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/classic_bt

In which we see two very relevant examples:

Hands-Free Audio Gateway -- the Audio Gateway makes your device act as a phone, i.e. connectable to a headset.

Hands-Free Unit -- the Unit means headset.

So if we merge these two examples we should be able to prototype this

kfatehi commented 3 years ago

First let's get the HF Unit code installed and see if we can pair to it with the phone as though it's a headset!

kfatehi commented 3 years ago

image

Looks like we will need to dedicate an ESP32 for each role.

kfatehi commented 3 years ago

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/esp_hf_client.html

https://stackoverflow.com/questions/6482798/a2dp-sco-pcm-hci

kfatehi commented 3 years ago

https://www.youtube.com/watch?v=At8PDQ3g7FQ - audio output instructions

https://www.youtube.com/watch?v=0jR-QNTfydA - bluetooth hfp microphone easier to understrand hopefully than idf

and his code:

https://github.com/atomic14/esp32-hsp-hf

kfatehi commented 3 years ago

https://github.com/search?q=hands-free+profile

https://github.com/heinervdm/nohands https://github.com/bsmr-c-cpp/Bluetooth-Hands-Free-Profile-for-Linux

kfatehi commented 3 years ago

https://scribles.net/enabling-hands-free-profile-on-raspberry-pi-raspbian-stretch-by-using-pulseaudio/

kfatehi commented 3 years ago

closest we got is with a raspberry pi! actually managed to pair my galaxy buds and my iphone using two radios. the problem lies in:

https://unix.stackexchange.com/questions/175930/change-default-port-for-pulseaudio-line-out-not-headphones https://stackoverflow.com/questions/52791992/connect-and-use-multiple-bluetooth-dongles-on-linux (select)

ofono is also related. this code doesn't seem that hard to read frankly https://git.kernel.org/pub/scm/network/ofono/ofono.git/tree/btio/btio.c

https://www.toolbox.com/tech/how-to/blogs/howto-capture-specific-pulse-audio-streams-021017/ https://wiki.archlinux.org/title/Bluetooth_headset#Configuration_via_CLI

kfatehi commented 3 years ago

Device DC:52:85:E1:60:48 DFH Phone Device D8:55:75:B9:5C:72 Galaxy Buds (5C72)

kfatehi commented 3 years ago

Linux audio bluetooth is pretty shit. Nice recap of how I am feeling now here given my galaxy buds are piping audio fine from calls (after the BCM2070 patch file was added) yet do not provide any mic to linux. https://www.reddit.com/r/galaxybuds/comments/g4so4t/using_the_microphone_on_ubuntu_1804/fpk5ego/