Full duplex Bluetooth

4 posts / 0 new
Last post
billythekid
Offline
Last seen: 6 days 21 hours ago
Joined: 29 Sep 2010 - 16:33
Full duplex Bluetooth

Using JUCE, I can only select bluetooth as an option from the MPVolumeView when the audio inputs are disabled. How do I get full duplex operation (I don't mind if the sample rate drops to 8kHz).

billythekid
Offline
Last seen: 6 days 21 hours ago
Joined: 29 Sep 2010 - 16:33
Re: Full duplex Bluetooth

Fixed it. There is a small error in the juce iOS code. You need to set kAudioSessionProperty_OverrideCategoryEnableBluetoothInput after the kAudioSessionCategory_PlayAndRecord has been set, otherwise it will not register . .

        UInt32 audioCategory = kAudioSessionCategory_MediaPlayback;

        if (numInputChannels > 0 && audioInputIsAvailable)
        {
            audioCategory = kAudioSessionCategory_PlayAndRecord;

//            UInt32 allowBluetoothInput = 1;
//            AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput,
//                                     sizeof (allowBluetoothInput), &allowBluetoothInput);
        }

        AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (audioCategory), &audioCategory);
        
        if (numInputChannels > 0 && audioInputIsAvailable) 
        {            
            UInt32 allowBluetoothInput = 1;
            AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput,
                                     sizeof (allowBluetoothInput), &allowBluetoothInput);     
        }
jules
Online
Last seen: 4 min 26 sec ago
Joined: 29 Apr 2013 - 18:37
Re: Full duplex Bluetooth

Ah! Thanks so much for spotting that! I'll get it sorted out..

billythekid
Offline
Last seen: 6 days 21 hours ago
Joined: 29 Sep 2010 - 16:33
Re: Full duplex Bluetooth

The problem with this is that the deviceManager will not fire a change message when bluetooth is selected, and so I cannot see a way of getting a notification about the sample rate change.

One option is to fire off an audioDeviceError on routing change to stop the audio device, but this blows a bit.

Any suggestions? I see a similar thread talking about external rate changes in this section of the forum.