BLE to Bluetooth audio receiver to smart phone

Posted on
  • Hey everyone,

    Working on a concept and I’m having a difficult time wrapping my head around the logic behind this design pattern.

    Ideally what I’m looking to accomplish is to have a device, which has physical buttons, which control playback of Bluetooth audio originating from a smart phone.

    -Smart phone connects to Bluetooth receiver
    -Music plays over Bluetooth
    -Music from smart phone can be controlled by physical buttons on a MDBT42Q

    The blocker I run into is that the phone can only be connected to one Bluetooth device at a time and even if it could be connected to multiple, that’s not a good user experience to have to connect to the controller and then connect to the receiver.

    What I believe needs to happen is that the smart phone needs to connect to the Bluetooth receiver first and then the Bluetooth receiver would have to somehow connect to the BLE device, in my case a MDBT42Q which will control the smart phone playback using BLE HID.

    The issue is that the commands from the MDBT42Q would have to be passed through the receiver to the smart phone in order to actually execute commands since the MDBT42Q is not directly connected to the smart phone in this case, so BLE HID direct to the smart phone wouldn’t be an option from what I can gather.

    Looking for some clarification, any thoughts would be very appreciated.

  • Phone can connect to multiple devices, otherwise you couldn't have bluetooth keyboard, mouse and headphones connected concurrently.

    Can that 'bluetooth audio receiver' do BLE? Typical bluetooth speakers/headphones can't so you can't connect MDBT42Q to it. nrf52 can only do BLE not classic Bluetooth, audio is classic bluetooth. There is audio over BLE but it is still very new and needs few years to replace classic bluetooth.

  • My wife is using a puck.js everyday in the car to play/pause/next/previous songs she is streaming on the car audio system through Bluetooth. The phone connects automatically to both Bluetooth devices (car's audio system and puck.js through BLE).
    The code which is running on the puck.js is this one:

    var controls = require("ble_hid_controls");
    NRF.setAdvertising({},{name:"MediaButton­",interval:500});
    NRF.setServices({
      0x180F : { // Battery Service
        0x2A19: {  // Battery Level
          readable: true,
          notify: true,
          value : [Puck.getBatteryPercentage()]
    }}}, { hid : controls.report });
    
    
    setInterval(function(){
      NRF.updateServices({
        0x180F: {
          0x2A19: {
            value : [Puck.getBatteryPercentage()]
          }
        }
      });
    }, 60000);
    
    setWatch(function(e) {
      var len = e.time - e.lastTime;
      if(len>0.7)
      {
        controls.playpause();
        digitalPulse(LED1,1,100);
      }
      else if (len > 0.3) {
        controls.prev();
        digitalPulse(LED2,1,100);
      } else {
        controls.next();
        digitalPulse(LED3,1,100);
      }
    }, BTN, { edge:"falling",repeat:true,debounce:50})­;
    

    I think recent phones are always trying to connect to local Bluetooth/BLE devices that have previously been registered and allowed by the user

  • @fanoush thanks for your reply. I guess my concern is that both the audio receiver and the MDBT42Q are contained within the same enclosure, so having a user connect to both seems like bad UX.

    I think you’ve pretty much reached where I ended up. BLE audio isn’t sufficient, audio receiver would need to handle the audio portion. That part works out of the box, it’s really just the external control that becomes the blocker.

    It seems like an order of operations issue, ie: if I connect to the receiver first, can I then power on the MDBT42Q and immediately have it connect to whatever phone the receiver is connected to? Likely no, seems like a leap to think the receiver would have that connection available to poach the MAC address of the phone.

    But you’re saying if the receiver can handle BLE, then I may be able to do something like that? ie: pass commands through the receiver to the master phone?

  • @Jean-Philippe_Rey thanks for your reply, you’re exactly correct, my issue is that both the Bluetooth receiver/speakers AND the MDBT42Q are contained within the same enclosure. So the UX becomes odd to have the user connect to 2 devices in order to use one device.

  • I don't think you will be able to make it through only 1 Bluetooth connection... Espruino cannot handle audio stream and usually Bluetooth audio receivers are closed solution without any way of hacking them.

  • But you’re saying if the receiver can handle BLE, then I may be able to do something like that? ie: pass commands through the receiver to the master phone?

    Well, I just pointed at technical limitations that makes your idea complicated/impossible. If the bluetooth receiver would be something custom made by you based on e.g. ESP32 then it is doable as it can do both BLE and classic bluetooth. But still it is complicated both technically and IMO also conceptually.

    I don't see anything wrong with the idea that device with buttons connects to the phone, because it needs to control some app on the the phone (like keyboard, mouse or finger does). And if phone outputs audio over bluetooth then so be it. If the phone is in the center of all that then I see nothing wrong that both devices are connected to the phone.

    For 'better UX' maybe you could remove some part out of it to make is simpler - phone or MDBT42Q or both. Or keep just the phone.

  • Thanks @fanoush, guess I have to rethink this model. I know there are some Bluetooth receivers out there that have buttons already embedded/soldered to the board, maybe that’s the play, obviously sounds better (and more fun to build) to decouple the receiver from the controller and have them communicate wirelessly, but I guess we’re not quite there yet.

    I appreciate the back and forth, a sanity check goes a long way.

  • Thanks @Jean-Philippe_Rey, I’m realizing that now, unfortunate. A wireless solution to decouple control from receiving just sounded like a worthwhile project, back to the drawing board.

  • @fanoush coming back to this. I just realized the receivers are Bluetooth 5.0 and they DO support BLE, so maybe some light at the end of the tunnel here. In this case, I could likely use nrf52 to communicate between the modules, I guess it just comes down to figuring out what commands need to be sent in order to have the receiver interact, ie: play, pause, next.

  • Well you did not explain much what the 'bluetooth receiver' and 'device, which has physical buttons' actually is. If it is not simple bluetooth speaker but some type of programmable computer with bluetooth on board than indeed it can possibly do BLE.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

BLE to Bluetooth audio receiver to smart phone

Posted by Avatar for Zinke89 @Zinke89

Actions