Roger-random / ESP_8_BIT_composite

Color composite video code from ESP_8_BIT as an Arduino library
MIT License
131 stars 17 forks source link

Bluetooth classic stops working after running .begin() #32

Closed alex1115alex closed 2 years ago

alex1115alex commented 2 years ago

I'm trying to use Bluetooth (classic, not BLE) and display composite video at the same time, but it seems as if Bluetooth stops working once the video output starts.

Has anyone run into a similar issue? If so, how did you work around this limitation?

Roger-random commented 2 years ago

Have you looked at ESP_8_BIT's Bluetooth classic input device support? Since ESP_8_BIT had such support, there should be no fundamental reason preventing Bluetooth from working here.

This library extracted only the color composite video generation code from ESP_8_BIT, stripping out everything else. If a project requires Bluetooth, perhaps one of these two approaches would work:

  1. Fork this project and add ESP_8_BIT Bluetooth back in.
  2. Fork ESP_8_BIT and keep color composite and Bluetooth, strip out the rest.
alex1115alex commented 2 years ago

Sorry about the late response. I also found a solution, so feel free to close the issue:

I couldn't get it running on my HiLetGo ESP32, so I tried it on the TinyPICO which has more memory (Chip is ESP32-PICO-D4 (revision 1)). I also freed up the memory pertaining to BLE which seemed to do the trick. Code:

include "BluetoothSerial.h"

include

include

include

include "esp_bt.h"

include "esp32-hal-bt.h"

btStarted(); esp_bt_controller_mem_release(ESP_BT_MODE_BLE); esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); bt_cfg.mode = ESP_BT_MODE_CLASSIC_BT; esp_bt_controller_init(&bt_cfg); esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT); SerialBT.begin("ESP32test"); //start bluetooth videoOut.begin(); //start video

Roger-random commented 2 years ago

Thank you for letting us know. I'll add "ESP32-PICO-D4 (revision 1)" to the list of ESP32 chips known to work with this library.

normen commented 1 year ago

Can confirm the above workaround for disabling BLE is needed on the ESP32-NodeMCU v1 as well.