This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Disconnect issue while A3DP streaming

Other Parts Discussed in Thread: TM4C1290NCPDT

(Note 11/26: I edited the title of the thread to more accurately reflect the issue. The problem in the initial post was solved by sending GAVD_Start_Stream_Request prior to starting the A3DP streamer, and I then happened upon a problem with disconnection while streaming. Original post left here for posterity)

I am attempting to stream from a CC2564B to two sink devices. I am using the Bluetopia 1.2 R2 release and a Panasonic PAN1326B. The CC256xB 1.0 patch included with 1.2 R2 is being used. (Do I still need the multiroom version of the patch installed for this to work?)

The I2S format going to the module is 16-bit left justified, coming from a DSP. The LRCLK is running at around 48,077 hz (being driven by a TM4C1290 PWM - system clock is 120 mhz). Thus, I have changed VS_PCM_Codec_Config to slave/input/I2S with the following parameters (changes highlighted in bold):

/* PCM clock rate (kHz) and direction (0 = output, 1 = input) */
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[0], PCMFreq);
CommandBuffer[2] = 0x01;

/* Frame-sync freq (Hz) and duty cycle. For duty cycle, 0 will */
/* generate 50% duty cycle, >= 1 uses number of PCM clock cycles. */
ASSIGN_HOST_DWORD_TO_LITTLE_ENDIAN_UNALIGNED_DWORD(&CommandBuffer[3], FSyncFreq);
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[7], 0x0000);

/* Frame-sync edge: 0 = rising edge, 1 = falling edge */
CommandBuffer[9] = 0x00;

/* Frame-sync polarity: 0 = active high, 1 = active low */
CommandBuffer[10] = 0x00;

/* channel 1 data out size, offset, and edge (0 = rise, 1 = fall) */
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[12], 16);
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[14], 0);
CommandBuffer[16] = 0x00;

/* channel 1 data in size, offset, and edge (0 = rise, 1 = fall) */
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[17], 16);
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[19], 0);
CommandBuffer[21] = 0x00;

/* channel 2 data out size, offset, and edge (0 = rise, 1 = fall) */
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[23], 16);
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[25], 16);
CommandBuffer[27] = 0x01;

/* channel 2 data in size, offset, and edge (0 = rise, 1 = fall) */
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[28], 16);
ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&CommandBuffer[30], 16);
CommandBuffer[32] = 0x01;

 

Here is the rough sequence of relevant startup events

BSC_EnableFeature BSC_FEATURE_A3DP_SOURCE

[Each of the following for both devices:]

GAVD_Connect

Connect confirmation

Discover endpoints

Get capabilities

Connect remote endpoint

Open endpoint confirmation

Role change to become master

Everything works up to this point, and if I'm doing the encoding on the MCU, with standard GAVD_Start_Stream_Request, SBC_Encode, and GAVD_Write_Data rather than the A3DP stuff, I do hear the audio. The I2S output line from the DSP is going to the MCU as well as to the CC2564B, and the MCU can read it with two SPIs forming a hackjob I2S

So, when I try to set up the assisted mode, here's what I do: (MaxBitpool is a number determined by the lowest common denominator - either my maximum bitpool, the first device's maximum bitpool, or the second device's maximum bitpool, whichever is lowest)

VS_A3DP_Open_Stream(stackid, Handle1, RemoteCID1, OutMTU1);

VS_A3DP_Open_Stream(stackid, Handle2, RemoteCID2, OutMTU2);

VS_PCM_Codec_Config(stackid, 1538, 48077);

AudioFormat = (AVRP_AUDIO_FORMAT_SBC_SAMPLE_RATE_48K | AVRP_AUDIO_FORMAT_PCM_SAMPLE_RATE_48K | AVRP_AUDIO_FORMAT_SBC_MODE_STEREO);

SBCFormat = (AVRP_SBC_FORMAT_ALLOCATION_METHOD_LOUDNESS | AVRP_SBC_FORMAT_BLOCK_LENGTH_16);

VS_A3DP_Codec_Configuration(stackid, AudioFormat, SBCFormat, MaxBitpool);

This all returns success the first time I call it.

When I try to start the assisted streams, the function calls return success but I hear no audio in the sinks.

VS_A3DP_Start_Stream(stackid, Handle1);

VS_A3DP_Start_Stream(stackid, Handle2);

Furthermore, although I don't know if this is relevant to finding out why starting it seems to do nothing, I get a vendor specific debug event with 3 bytes 0x00 0x03 0x01 after sending stop stream commands for both handles. After that, most of my commands in the VS_A3DP_* category fail with -512, -518, or block for 5 seconds and then return -57. e.g.

VS_A3DP_Close_Stream(stackid, Handle1); // returns 0

VS_A3DP_Close_Stream(stackid, Handle2); // returns -518 aka HCI error code 18 aka INVALID_HCI_COMMAND_PARAMETERS

VS_A3DP_Open_Stream(stackid, Handle1); // returns 0

VS_A3DP_Open_Stream(stackid, Handle2); // returns -518

VS_A3DP_Start_Stream(stackid, Handle1); // returns 0

VS_A3DP_Start_Stream(stackid, Handle2); // returns -518

VS_A3DP_Stop_Stream(stackid, Handle1); // blocks 5 seconds, returns -57

VS_A3DP_Stop_Stream(stackid, Handle2); // blocks 5 seconds, returns -57

I assume this funky behavior is mostly just due to me messing something up in the setup/starting of the streams and therefore it's left in some limbo state.

I have tried with the original offsets of 1 and 17 in VS_PCM_Codec_Config, but from what I understand with left justified mode the offset is supposed to be 0 and 16

I have also tried setting the Fsync multiplier parameter to 32, but to no avail.

CommandBuffer[22] = 32;

So, where do I look for where I went wrong?

Any other information needed? I have complete logs of all function calls, the return codes, event data, etc., so just let me know what would help figure it out.

Thanks :)

  • Hi,

    As far as I know the The A3DP Source demo does not work with to sinks simultaneously. you might have to make some tweeking to make it work. Also please have a look at the code as well it is called only when we have a open confirmation .

    "VS_A3DP_Open_Stream" is just a HCI command, see the below link for the per-condition 

    http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_A3DP_Open_Stream_.280xFD8C.29

    Also make sure that the flags __SUPPORT_CC256XB_PATCH__ and __SUPPORT_MULTIROOM_PATCH__ are defined.

    Anyway I am simultaneously checking this internally, I will let you know If I have any other inputs.

     

  • Correct, the a3dp source demo project only connects to one sink. I used that as a guideline for setting up a two sink scenario on my application. However, it still does not produce audio even if I only connect to one sink.

    The following is a log of an attempt to connect to one sink and stream to it.

    HCI_VS_InitializeAfterHCIReset
    VS_Update_UART_Baud_Rate success.
    HCI_VS_InitializeAfterHCIReset Success
    BSC Initialize worked, yay: 1
    Device Chipset: 4.1
    Bluetooth Address: 0x0017E9D4F415
    BSC Enable Feature (Assisted A2DP source) worked, yay!
    GAP Set Inquiry Mode worked, yay!
    GAVD Initialize worked, yay!
    GAVD_Register_End_Point worked, yay!
    GAVD_Register_SDP_Record worked, yay!
    AVCTP Initialize worked, yay!
    AVCTP Enable Browsing Channel Support worked, yay!
    AVRCP Register Profile (Controller) worked, yay: 1
    AVRCP Register SDP Record (Controller) worked, yay!
    AVRCP Register Profile (Target) worked, yay: 2
    AVRCP Register SDP Record (Target) worked, yay!
    HFRE_Open_HandsFree_Server_Port worked, yay: 1
    HFRE_Register_HandsFree_SDP_Record worked, yay!
    HFRE_Open_HandsFree_Server_Port worked, yay: 2
    HFRE_Register_HandsFree_SDP_Record worked, yay!
    HFRE_Open_Audio_Gateway_Server_Port worked, yay: 3
    HFRE_Register_HandsFree_SDP_Record worked, yay!
    HFRE_Open_Audio_Gateway_Server_Port worked, yay: 4
    HFRE_Register_HandsFree_SDP_Record worked, yay!
    VS Set Max Output Power worked, yay!
    VS Write SCO Configuration worked, yay!
    GAP Set Local Device Name worked, yay!
    GAP Write Extended Inquiry Information worked, yay!
    GAP Set Connectability Mode worked, yay!
    GAP Set Pairability Mode worked, yay!
    GAP Register Remote Authentication worked, yay!
    HCI Register Event Callback worked, yay: 6
    Stack initialized in 413 ticks
    
    <HCI Connection Request Event>
    	BD_ADDR: 0x0001950EA9BF
    	Type ACL
    	Class 0x240404
    <HCI Connection Complete Event>
    	0x0001950EA9BF
    		Handle: 1
    		Encryption Disabled
    		Type ACL
    		Status: Success
    <HCI Page Scan Repetition Mode Change Event>
    	0x0001950EA9BF
    	Mode: 1
    <HCI Max Slots Change Event>
    	Handle 1 max slots changed to 5
    <HCI Read Remote Extended Features Complete Event>
    	Connection 1 remote extended features page 1 / 1
    	3 slot packets
    		Status: Success
    <GAP Authentication>
    	atLinkKeyRequest: 0x0001950EA9BF
    	Link Key is 0xA48C8A108B35732CAEE94AC73BA4B5A2 (Sena SMH10)
    	GAP_Authentication_Response worked, yay!
    <HCI Encryption Change Event>
    	Handle 1
    	Encryption enabled: 1
    	Status: Success
    <HCI Link Supervision Timeout Changed Event>
    	Handle 1
    	Timeout 8064
    Attempting to connect to headset 0x0001950EA9BF
    <GAVD Connect Confirmation>
    	GAVD Instance 2
    	Address: 0x0001950EA9BF
    	Connected; GAVDID: 0x1
    	Requesting discovery of endpoints: 0
    GAVD_Connect worked, yay: 1
    <GAVD Discover Confirmation>
    	GAVD Instance 2
    	Error Code 0
    	GAVDID 1
    	Number of Endpoints: 1
    		0: RSEID 1 (audio sink, available)
    		Getting capabilities of endpoint: 0
    <GAVD Get Capabilities Confirmation>
    	GAVD Instance 2
    	Error Code 0
    	GAVDID 1
    	RSEID 1
    	Service 0
    		scMediaTransport
    	Service 1
    		scMediaCodec
    			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    			Block Length      : 4, 8, 12, 16
    			Number Sub Bands  : 4, 8
    			Allocation Method : SNR, Loudness
    			Min/Max Bit Pool  : 2/45
    	Service 2
    		scContentProtection: 2 0
    	SetGAVDConfiguration
    		Sampling Frequency: 48KHz
    		Channel Mode      : Stereo
    		Block Length      : 16
    		Number Sub Bands  : 8
    		Allocation Method : Loudness
    		Min/Max Bit Pool  : 2/45
    	Trying to connect LSEID 3 to RSEID 1 on 0x0001950EA9BF. Function result: 3 / 0x3
    <HCI Link Supervision Timeout Changed Event>
    	Handle 1
    	Timeout 32000
    <HCI Role Change Event>
    	Device: 0x0001950EA9BF
    	Status: Success
    	Current role: Master
    <HCI Max Slots Change Event>
    	Handle 1 max slots changed to 5
    <GAVD Open End Point Confirmation>
    	GAVD Instance 2
    	LSEID 3
    	Opened successfully
    	Media Out MTU 895
    	Local CID 65, in MTU 1000
    	Remote CID 24641, out MTU 895
    		Initializing SBC encoder using parameters:
    			Freq:         48000
    			Block Size:   16
    			Channel Mode: Stereo
    			Allocation:   Loudness
    			Subbands:     8
    			Bit Pool:     45
    		Timing Parameters:
    			MTU:                894
    			Frame Size:         102
    			Frames per Packet:  8
    			Packet Delay (MS):  21
    			Extra Time/Pkt:     333333
    <HCI Role Change Event>
    	Device: 0x0001950EA9BF
    	Status: Success
    	Current role: Slave
    <HCI Max Slots Change Event>
    	Handle 1 max slots changed to 5
    <AVCTP Connect Indication>
    	[0] Profile 1 Opened by 0x0001950EA9BF
    <AVCTP Connect Indication>
    	[1] Profile 2 Opened by 0x0001950EA9BF
    <AVCTP Message Indication>
    	[0] 0x0001950EA9BF
    	Message: Register notification command
    		Playback Status Changed
    		Playback Interval 0
    // start enabling assisted mode:
    VS_A3DP_Open_Stream worked, yay: 0
    VS_PCM_Codec_Config worked, yay: 0
    Setting assisted A2DP codec configuration with max bitpool 45
    VS_A3DP_Codec_Configuration worked, yay: 0
    Encoder setting 3
    // start stream (HCI role discovery / switch to master)
    HCI_Switch_Role worked, yay: 0
    VS_A3DP_Start_Stream worked, yay: 0
    <HCI Role Change Event>
    	Device: 0x0001950EA9BF
    	Status: Success
    	Current role: Master
    <HCI Max Slots Change Event>
    	Handle 1 max slots changed to 5
    VS_A3DP_Stop_Stream worked, yay: 0

  • Hi dwf,

    Which platform are you using to evaluate this functionality? Are providing the correct audio to the PCM DIN?

    Miguel

  • I am currently running on a TM4C1290NCPDT.

    I am providing audio to the module, observed by putting a scope on the audio in pin.

    And in fact, I have taken a Bluetooth packet analyzer and examined the packets going over the air, and the audio that I expect to be hearing is going over the air, but for some reason the headset is not playing it when it's coming from A3DP.

    Comparing it with the normal A2DP operation, I see that there is no AVDTP_START signal when using A3DP but it is sending the media packets. Do I need to send GAVD_Start_Stream_Request prior to sending VS_A3DP_Start_Stream?

    edit: looks like that is the answer, as I hear audio when I send the GAVD_Start_Stream_Request and wait for the start confirmation before sending VS_A3DP_Start_Stream.

    I'm still not quite sure how to stop the stream when done or clean it up in the event of a disconnect - does VS_A3DP_Stop_Stream with STOP_STREAM_FLAG_GENERATE_STOP_EVENT also cause the GAVD suspend to be sent? What does the 0x00 0x03 0x01 data mean in the vendor specific debug event?

    If a device I'm streaming to goes out of range, I appear to lose connection with the CC256x shortly thereafter, e.g. if I try to reconnect with the device, I get an HCI connection complete event but no GAVD connect confirmation, and any further command sent to the module results in blocking 5 seconds and returning HCI driver error. See the last half of this log:

    (854 ms) Database ready
    (854 ms) Initializing SBC decoder
    (854 ms) 	1820 bytes decoder memory
    (854 ms) 	2048 bytes read buffer
    (854 ms) 	512 bytes write buffer
    (1071 ms) HCI_VS_InitializeAfterHCIReset
    (1073 ms) VS_Update_UART_Baud_Rate success.
    (1111 ms) HCI_VS_InitializeAfterHCIReset Success
    (1120 ms) BSC Initialize worked, yay: 1
    (1120 ms) Device Chipset: 4.1
    (1120 ms) Bluetooth Address: 0x0017E9D4F415
    (1224 ms) BSC Enable Feature (Assisted A2DP source) worked, yay!
    (1224 ms) GAP Set Inquiry Mode worked, yay!
    (1225 ms) GAVD Initialize worked, yay!
    (1225 ms) GAVD_Register_End_Point worked, yay!
    (1225 ms) GAVD_Register_SDP_Record worked, yay!
    (1225 ms) AVCTP Initialize worked, yay!
    (1225 ms) AVCTP Enable Browsing Channel Support worked, yay!
    (1225 ms) AVRCP Register Profile (Controller) worked, yay: 1
    (1226 ms) AVRCP Register SDP Record (Controller) worked, yay!
    (1226 ms) AVRCP Register Profile (Target) worked, yay: 2
    (1226 ms) AVRCP Register SDP Record (Target) worked, yay!
    (1228 ms) HFRE_Open_HandsFree_Server_Port worked, yay: 1
    (1229 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1230 ms) HFRE_Open_HandsFree_Server_Port worked, yay: 2
    (1231 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1232 ms) HFRE_Open_Audio_Gateway_Server_Port worked, yay: 3
    (1232 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1233 ms) HFRE_Open_Audio_Gateway_Server_Port worked, yay: 4
    (1234 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1239 ms) VS Set Max Output Power worked, yay!
    (1243 ms) VS Write SCO Configuration worked, yay!
    (1248 ms) GAP Set Local Device Name worked, yay!
    (1249 ms) GAP Write Extended Inquiry Information worked, yay!
    (1250 ms) GAP Set Connectability Mode worked, yay!
    (1251 ms) GAP Set Pairability Mode worked, yay!
    (1251 ms) GAP Register Remote Authentication worked, yay!
    (1251 ms) HCI Register Event Callback worked, yay: 6
    (1251 ms) Stack initialized in 397 ticks
    (24336 ms) <HCI Connection Request Event>
    (24336 ms) 	BD_ADDR: 0x0001950F6D84
    (24336 ms) 	Type ACL
    (24336 ms) 	Class 0x240404
    (24359 ms) <HCI Connection Complete Event>
    (24359 ms) 	0x0001950F6D84
    (24359 ms) 		Handle: 1
    (24359 ms) 		Encryption Disabled
    (24359 ms) 		Type ACL
    (24359 ms) 		Status: Success
    (24359 ms) <HCI Page Scan Repetition Mode Change Event>
    (24359 ms) 	0x0001950F6D84
    (24359 ms) 	Mode: 1
    (24360 ms) <HCI Max Slots Change Event>
    (24360 ms) 	Handle 1 max slots changed to 5
    (24384 ms) <HCI Read Remote Extended Features Complete Event>
    (24384 ms) 	Connection 1 remote extended features page 1 / 1
    (24384 ms) 	3 slot packets
    (24384 ms) 		Status: Success
    (24415 ms) <GAP Authentication>
    (24415 ms) 	atLinkKeyRequest: 0x0001950F6D84
    (24419 ms) 	Link Key is 0xBF285D71BC3552EA917DFB464C21A6EC (Sena SMH10)
    (24420 ms) GAP_Authentication_Response worked, yay!
    (24492 ms) <HCI Encryption Change Event>
    (24492 ms) 	Handle 1
    (24492 ms) 	Encryption enabled: 1
    (24492 ms) 	Status: Success
    (24555 ms) <HCI Link Supervision Timeout Changed Event>
    (24555 ms) 	Handle 1
    (24555 ms) 	Timeout 8064
    (26595 ms) <AVCTP Connect Indication>
    (26596 ms) 	[0] Profile 1 Opened by 0x0001950F6D84
    (26596 ms) <AVCTP Connect Indication>
    (26596 ms) 	[1] Profile 2 Opened by 0x0001950F6D84
    (26701 ms) <AVCTP Message Indication>
    (26702 ms) 	[0] 0x0001950F6D84
    (26702 ms) 	Message: Register notification command
    (26702 ms) 		Playback Status Changed
    (26702 ms) 		Playback Interval 0
    (123824 ms) Attempting to connect to headset 0x0001950EA9BF
    (123825 ms) GAVD_Connect worked, yay: 1
    (124926 ms) <HCI Connection Complete Event>
    (124927 ms) 	0x0001950EA9BF
    (124927 ms) 		Handle: 2
    (124927 ms) 		Encryption Disabled
    (124927 ms) 		Type ACL
    (124927 ms) 		Status: Success
    (124951 ms) <HCI Max Slots Change Event>
    (124951 ms) 	Handle 2 max slots changed to 5
    (124974 ms) <HCI Read Remote Extended Features Complete Event>
    (124974 ms) 	Connection 2 remote extended features page 1 / 1
    (124974 ms) 	3 slot packets
    (124974 ms) 		Status: Success
    (124975 ms) <GAP Authentication>
    (124976 ms) 	atLinkKeyRequest: 0x0001950EA9BF
    (124977 ms) 	Link Key is 0xA48C8A108B35732CAEE94AC73BA4B5A2 (Sena SMH10)
    (124977 ms) GAP_Authentication_Response worked, yay!
    (125013 ms) <GAP Authentication>
    (125013 ms) 	atAuthenticationStatus: 0 for 0x0001950EA9BF
    (125079 ms) <GAP Encryption Change Result>
    (125079 ms) 	BD_ADDR: 0x0001950EA9BF
    (125079 ms) 	Status: 0x00
    (125079 ms) 	Mode: Enabled
    (125079 ms) <HCI Encryption Change Event>
    (125079 ms) 	Handle 2
    (125079 ms) 	Encryption enabled: 1
    (125079 ms) 	Status: Success
    (125136 ms) <GAVD Connect Confirmation>
    (125136 ms) 	GAVD Instance 2
    (125136 ms) 	Address: 0x0001950EA9BF
    (125136 ms) 	Connected; GAVDID: 0x1
    (125137 ms) 	Requesting discovery of endpoints: 0
    (125181 ms) <GAVD Discover Confirmation>
    (125181 ms) 	GAVD Instance 2
    (125181 ms) 	Error Code 0
    (125181 ms) 	GAVDID 1
    (125181 ms) 	Number of Endpoints: 1
    (125181 ms) 		0: RSEID 1 (audio sink, available)
    (125182 ms) 		Getting capabilities of endpoint: 0
    (125209 ms) <GAVD Get Capabilities Confirmation>
    (125209 ms) 	GAVD Instance 2
    (125209 ms) 	Error Code 0
    (125209 ms) 	GAVDID 1
    (125209 ms) 	RSEID 1
    (125209 ms) 	Service 0
    (125209 ms) 		scMediaTransport
    (125209 ms) 	Service 1
    (125209 ms) 		scMediaCodec
    (125209 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (125209 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (125209 ms) 			Block Length      : 4, 8, 12, 16
    (125209 ms) 			Number Sub Bands  : 4, 8
    (125209 ms) 			Allocation Method : SNR, Loudness
    (125209 ms) 			Min/Max Bit Pool  : 2/45
    (125209 ms) 	Service 2
    (125209 ms) 		scContentProtection: 2 0
    (125209 ms) 	SetGAVDConfiguration
    (125210 ms) 		Sampling Frequency: 48KHz
    (125210 ms) 		Channel Mode      : Stereo
    (125210 ms) 		Block Length      : 16
    (125210 ms) 		Number Sub Bands  : 8
    (125210 ms) 		Allocation Method : Loudness
    (125210 ms) 		Min/Max Bit Pool  : 2/45
    (125210 ms) 	Trying to connect LSEID 3 to RSEID 1 on 0x0001950EA9BF. Function result: 3 / 0x3
    (125506 ms) <HCI Role Change Event>
    (125506 ms) 	Device: 0x0001950EA9BF
    (125506 ms) 	Status: Success
    (125506 ms) 	Current role: Slave
    (125538 ms) <HCI Max Slots Change Event>
    (125538 ms) 	Handle 2 max slots changed to 5
    (125594 ms) <GAVD Open End Point Confirmation>
    (125595 ms) 	GAVD Instance 2
    (125595 ms) 	LSEID 3
    (125595 ms) 	Opened successfully
    (125595 ms) 	Media Out MTU 895
    (125595 ms) 	Local CID 69, in MTU 1000
    (125595 ms) 	Remote CID 3329, out MTU 895
    (125596 ms) HCI_Switch_Role worked, yay: 0
    (125596 ms) 		Initializing SBC encoder using parameters:
    (125596 ms) 			Freq:         48000
    (125596 ms) 			Block Size:   16
    (125596 ms) 			Channel Mode: Stereo
    (125596 ms) 			Allocation:   Loudness
    (125596 ms) 			Subbands:     8
    (125596 ms) 			Bit Pool:     45
    (125596 ms) 		Timing Parameters:
    (125596 ms) 			MTU:                894
    (125596 ms) 			Frame Size:         102
    (125596 ms) 			Frames per Packet:  8
    (125596 ms) 			Packet Delay (MS):  21
    (125596 ms) 			Extra Time/Pkt:     333333
    (125805 ms) <HCI Role Change Event>
    (125805 ms) 	Device: 0x0001950EA9BF
    (125805 ms) 	Status: Success
    (125805 ms) 	Current role: Master
    (125806 ms) <HCI Max Slots Change Event>
    (125806 ms) 	Handle 2 max slots changed to 5
    (127264 ms) <AVCTP Connect Indication>
    (127264 ms) 	[0] Profile 1 Opened by 0x0001950EA9BF
    (127264 ms) <AVCTP Connect Indication>
    (127264 ms) 	[1] Profile 2 Opened by 0x0001950EA9BF
    (127400 ms) <AVCTP Message Indication>
    (127400 ms) 	[0] 0x0001950EA9BF
    (127400 ms) 	Message: Register notification command
    (127400 ms) 		Playback Status Changed
    (127400 ms) 		Playback Interval 0
    (127661 ms) Attempting to connect to headset 0x0001950F6D84
    (127661 ms) <GAVD Connect Confirmation>
    (127661 ms) 	GAVD Instance 3
    (127661 ms) 	Address: 0x0001950F6D84
    (127669 ms) 	Connected; GAVDID: 0x2
    (127669 ms) 	Requesting discovery of endpoints: 0
    (127675 ms) GAVD_Connect worked, yay: 2
    (127703 ms) <GAVD Discover Confirmation>
    (127703 ms) 	GAVD Instance 3
    (127703 ms) 	Error Code 0
    (127703 ms) 	GAVDID 2
    (127703 ms) 	Number of Endpoints: 1
    (127703 ms) 		0: RSEID 1 (audio sink, available)
    (127703 ms) 		Getting capabilities of endpoint: 0
    (127726 ms) <GAVD Get Capabilities Confirmation>
    (127726 ms) 	GAVD Instance 3
    (127726 ms) 	Error Code 0
    (127726 ms) 	GAVDID 2
    (127727 ms) 	RSEID 1
    (127727 ms) 	Service 0
    (127727 ms) 		scMediaTransport
    (127727 ms) 	Service 1
    (127727 ms) 		scMediaCodec
    (127727 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (127727 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (127727 ms) 			Block Length      : 4, 8, 12, 16
    (127727 ms) 			Number Sub Bands  : 4, 8
    (127727 ms) 			Allocation Method : SNR, Loudness
    (127727 ms) 			Min/Max Bit Pool  : 2/45
    (127727 ms) 	Service 2
    (127727 ms) 		scContentProtection: 2 0
    (127727 ms) 	SetGAVDConfiguration
    (127727 ms) 		Sampling Frequency: 48KHz
    (127727 ms) 		Channel Mode      : Stereo
    (127727 ms) 		Block Length      : 16
    (127727 ms) 		Number Sub Bands  : 8
    (127727 ms) 		Allocation Method : Loudness
    (127727 ms) 		Min/Max Bit Pool  : 2/45
    (127728 ms) 	Trying to connect LSEID 4 to RSEID 1 on 0x0001950F6D84. Function result: 4 / 0x4
    (127784 ms) <HCI Link Supervision Timeout Changed Event>
    (127784 ms) 	Handle 1
    (127784 ms) 	Timeout 32000
    (128017 ms) <HCI Role Change Event>
    (128017 ms) 	Device: 0x0001950F6D84
    (128017 ms) 	Status: Success
    (128018 ms) 	Current role: Master
    (128018 ms) <HCI Max Slots Change Event>
    (128018 ms) 	Handle 1 max slots changed to 5
    (128043 ms) <GAVD Open End Point Confirmation>
    (128043 ms) 	GAVD Instance 3
    (128043 ms) 	LSEID 4
    (128043 ms) 	Opened successfully
    (128043 ms) 	Media Out MTU 895
    (128043 ms) 	Local CID 73, in MTU 1000
    (128043 ms) 	Remote CID 4866, out MTU 895
    (128044 ms) 		Initializing SBC encoder using parameters:
    (128044 ms) 			Freq:         48000
    (128044 ms) 			Block Size:   16
    (128044 ms) 			Channel Mode: Stereo
    (128044 ms) 			Allocation:   Loudness
    (128044 ms) 			Subbands:     8
    (128044 ms) 			Bit Pool:     45
    (128044 ms) 		Timing Parameters:
    (128044 ms) 			MTU:                894
    (128044 ms) 			Frame Size:         102
    (128044 ms) 			Frames per Packet:  8
    (128044 ms) 			Packet Delay (MS):  21
    (128044 ms) 			Extra Time/Pkt:     333333
    (128273 ms) <HCI Role Change Event>
    (128273 ms) 	Device: 0x0001950F6D84
    (128273 ms) 	Status: Success
    (128273 ms) 	Current role: Slave
    (128284 ms) <HCI Max Slots Change Event>
    (128284 ms) 	Handle 1 max slots changed to 5
    (137248 ms) Attempting to connect to phone 0x006171CA5B8B
    (137249 ms) GAVD_Connect worked, yay: 3
    (137533 ms) <HCI Connection Complete Event>
    (137533 ms) 	0x006171CA5B8B
    (137533 ms) 		Handle: 3
    (137533 ms) 		Encryption Disabled
    (137533 ms) 		Type ACL
    (137533 ms) 		Status: Success
    (137552 ms) <HCI Max Slots Change Event>
    (137552 ms) 	Handle 3 max slots changed to 5
    (137565 ms) <HCI Read Remote Extended Features Complete Event>
    (137565 ms) 	Connection 3 remote extended features page 1 / 2
    (137565 ms) 	3 slot packets
    (137565 ms) 	5 slot packets
    (137565 ms) 	Encryption
    (137565 ms) 		Status: Success
    (137566 ms) <GAP Authentication>
    (137566 ms) 	atLinkKeyRequest: 0x006171CA5B8B
    (137567 ms) 	Link Key is 0xD8D1261E95EB80ED4EE4CBFA2860CC5A (iPhone )
    (137568 ms) GAP_Authentication_Response worked, yay!
    (137592 ms) <GAP Authentication>
    (137592 ms) 	atAuthenticationStatus: 0 for 0x006171CA5B8B
    (137639 ms) <GAP Encryption Change Result>
    (137639 ms) 	BD_ADDR: 0x006171CA5B8B
    (137639 ms) 	Status: 0x00
    (137639 ms) 	Mode: Enabled
    (137639 ms) <HCI Encryption Change Event>
    (137639 ms) 	Handle 3
    (137639 ms) 	Encryption enabled: 1
    (137639 ms) 	Status: Success
    (137662 ms) <GAVD Connect Confirmation>
    (137662 ms) 	GAVD Instance 0
    (137662 ms) 	Address: 0x006171CA5B8B
    (137662 ms) 	Connected; GAVDID: 0x3
    (137662 ms) 	Requesting discovery of endpoints: 0
    (137672 ms) <GAVD Discover Confirmation>
    (137672 ms) 	GAVD Instance 0
    (137672 ms) 	Error Code 0
    (137672 ms) 	GAVDID 3
    (137672 ms) 	Number of Endpoints: 6
    (137672 ms) 		0: RSEID 1 (audio source, available)
    (137672 ms) 		1: RSEID 2 (audio source, available)
    (137672 ms) 		2: RSEID 3 (audio source, available)
    (137672 ms) 		3: RSEID 4 (audio source, available)
    (137672 ms) 		4: RSEID 5 (audio source, available)
    (137672 ms) 		5: RSEID 6 (audio source, available)
    (139723 ms) <GAVD Set Configuration Indication>
    (139723 ms) 	GAVD Instance 0
    (139723 ms) 	LSEID 1
    (139723 ms) 	RSEID 2
    (139723 ms) 	Address: 0x006171CA5B8B
    (139724 ms) 	SetGAVDConfiguration
    (139724 ms) 		Sampling Frequency: 44.1 KHz
    (139724 ms) 		Channel Mode      : Stereo
    (139724 ms) 		Block Length      : 16
    (139724 ms) 		Number Sub Bands  : 8
    (139724 ms) 		Allocation Method : Loudness
    (139724 ms) 		Min/Max Bit Pool  : 2/53
    (139724 ms) 	Set configuration result: 44100
    (139724 ms) 	<GAVD config>
    (139724 ms) 	Service 0
    (139724 ms) 		scMediaTransport
    (139724 ms) 	Service 1
    (139724 ms) 		scMediaCodec
    (139724 ms) 			Sampling Frequency: 44.1 KHz, 
    (139724 ms) 			Channel Mode      : Stereo, 
    (139724 ms) 			Block Length      : 16
    (139724 ms) 			Number Sub Bands  : 8
    (139724 ms) 			Allocation Method : Loudness
    (139724 ms) 			Min/Max Bit Pool  : 2/53
    (139724 ms) 	</GAVD config>
    (139762 ms) <GAVD Open End Point Indication>
    (139762 ms) 	GAVD Instance 0
    (139762 ms) 	LSEID 1
    (139762 ms) 	Media Out MTU 672
    (139762 ms) 	Local CID 75, in MTU 1000
    (139762 ms) 	Remote CID 7430, out MTU 672
    (142991 ms) <AVCTP Connect Indication>
    (142991 ms) 	[0] Profile 1 Opened by 0x006171CA5B8B
    (142991 ms) <AVCTP Connect Indication>
    (142991 ms) 	[1] Profile 2 Opened by 0x006171CA5B8B
    (142992 ms) <AVCTP Message Indication>
    (142992 ms) 	[0] 0x006171CA5B8B
    (142992 ms) 	Message: get capabilities
    (143007 ms) <HFRE Open Port Indication>
    (143007 ms) 	ID: 0x0002
    (143007 ms) 	Address: 0x006171CA5B8B
    (143160 ms) <HFRE Control Indicator Status Confirmation>
    (143160 ms) 	ID: 0x0002
    (143160 ms) 	SERVICE TRUE
    (143160 ms) <HFRE Control Indicator Status Confirmation>
    (143160 ms) 	ID: 0x0002
    (143160 ms) 	CALL FALSE
    (143160 ms) <HFRE Control Indicator Status Confirmation>
    (143160 ms) 	ID: 0x0002
    (143160 ms) 	CALLSETUP 0
    (143160 ms) <HFRE Control Indicator Status Confirmation>
    (143160 ms) 	ID: 0x0002
    (143160 ms) 	BATTCHG 3
    (143160 ms) <HFRE Control Indicator Status Confirmation>
    (143160 ms) 	ID: 0x0002
    (143160 ms) 	SIGNAL 2
    (143160 ms) <HFRE Control Indicator Status Confirmation>
    (143160 ms) 	ID: 0x0002
    (143160 ms) 	ROAM FALSE
    (143203 ms) <HFRE Open Service Level Connection Indication>
    (143203 ms) 	ID: 0x0002
    (143203 ms) 	RemoteSupportedFeaturesValid: TRUE
    (143203 ms) 	RemoteSupportedFeatures: 0x000003ef
    (143204 ms) 	RemoteCallHoldMultipartySupport: 0x0000006f
    (143209 ms) <HFRE Command Result>
    (143209 ms) 	ID: 0x0002
    (143209 ms) 	Type 0 Code 0
    (163045 ms) BTPIF_AVRCP_RemotePressRelease worked, yay: 0
    (163074 ms) <AVCTP Message Indication>
    (163074 ms) 	[0] 0x006171CA5B8B
    (163074 ms) 	Message: Pass-through response
    (163074 ms) 		Response code Accepted
    (163074 ms) 		Subunit Type Panel
    (163074 ms) 		Subunit ID 0
    (163074 ms) 		Button Play Pressed
    (163075 ms) <AVCTP Message Indication>
    (163076 ms) 	[0] 0x006171CA5B8B
    (163076 ms) 	Message: Pass-through response
    (163076 ms) 		Response code Accepted
    (163076 ms) 		Subunit Type Panel
    (163076 ms) 		Subunit ID 0
    (163076 ms) 		Button Play Released
    (163095 ms) <GAVD Start Indication>
    (163096 ms) 	GAVD Instance 0
    (163159 ms) Got new payload type 0x60
    (163159 ms) GAVD Instance 0 SBC Frame Length changed: 118 (frames per packet: 8)
    (168665 ms) VS_A3DP_Open_Stream worked, yay: 0
    (168665 ms) VS_A3DP_Open_Stream worked, yay: 0
    (168666 ms) VS_PCM_Codec_Config worked, yay: 0
    (168672 ms) Setting assisted A2DP codec configuration with max bitpool 45
    (168672 ms) VS_A3DP_Codec_Configuration worked, yay: 0
    (168678 ms) Encoder setting 3
    (172701 ms) GAVD_Start_Stream_Request worked, yay: 0
    (172702 ms) HCI_Switch_Role worked, yay: 0
    (172703 ms) GAVD_Start_Stream_Request worked, yay: 0
    (172772 ms) <GAVD Start Confirmation>
    (172772 ms) 	GAVD Instance 2
    (172772 ms) 	Error Code 0 / 0x0
    (172772 ms) VS_A3DP_Start_Stream worked, yay: 0
    (172989 ms) <HCI Role Change Event>
    (172989 ms) 	Device: 0x0001950F6D84
    (172989 ms) 	Status: Success
    (172989 ms) 	Current role: Master
    (172989 ms) <HCI Max Slots Change Event>
    (172989 ms) 	Handle 1 max slots changed to 5
    (173016 ms) <GAVD Start Confirmation>
    (173016 ms) 	GAVD Instance 3
    (173016 ms) 	Error Code 0 / 0x0
    (173017 ms) VS_A3DP_Start_Stream worked, yay: 0
    (213473 ms) 1: 0x0001950F6D84	TX power -20 / 0	Role: Master
    (213474 ms) Query result: 0x0001950F6D84 - Sena SMH10 (class: 0x240404)
    (213474 ms) 	Sena SMH10
    (213474 ms) 	Type: headset (0x240404)
    (213480 ms) 2: 0x0001950EA9BF	TX power 0 / 0	Role: Master
    (213487 ms) Query result: 0x0001950EA9BF - Sena SMH10 (class: 0x240404)
    (213487 ms) 	Sena SMH10
    (213487 ms) 	Type: headset (0x240404)
    (213523 ms) 3: 0x006171CA5B8B	TX power 0 / 0	Role: Master
    (213530 ms) Query result: 0x006171CA5B8B - iPhone  (class: 0x7A020C)
    (213530 ms) 	iPhone 
    (213530 ms) 	Type: phone (0x7A020C)
    // Headset goes out of range, endpoint/connections close: (291759 ms) <GAVD Close End Point Indication> (291759 ms) GAVD Instance 2 (291760 ms) VS_A3DP_Stop_Stream failed: -502 / 0xfffffe0a (291761 ms) VS_A3DP_Close_Stream failed: -502 / 0xfffffe0a (291761 ms) <GAVD Disconnect Indication> (291761 ms) GAVD Instance 2 / GAVDID 1 (291761 ms) Address: 0x0001950EA9BF (291761 ms) Reason 8 / 0x08. (291761 ms) <AVCTP Disconnect Indication> (291761 ms) [0] Profile 1 Closed (0x0001950EA9BF) (291761 ms) Disconnect: Connection Timeout (291761 ms) <AVCTP Disconnect Indication> (291761 ms) [1] Profile 2 Closed (0x0001950EA9BF) (291761 ms) Disconnect: Connection Timeout (291761 ms) <HCI Disconnection Complete Event> (291761 ms) Reason: Connection Timeout (291761 ms) Handle 2 (291761 ms) Status: Success (291761 ms) Connection 2 freed
    // Headset is back in range, attempt to reconnect: (391884 ms) Attempting to connect to headset 0x0001950EA9BF (391885 ms) GAVD_Connect worked, yay: 4 (392254 ms) <HCI Connection Complete Event> (392254 ms) 0x0001950EA9BF (392254 ms) Handle: 2 (392254 ms) Encryption Disabled (392254 ms) Type ACL (392254 ms) Status: Success (392299 ms) <HCI Max Slots Change Event> (392299 ms) Handle 2 max slots changed to 5
    // No GAVD connect confirmation event (435236 ms) Attempting to connect to headset 0x0001950EA9BF (435236 ms) Couldn't find an instance to connect the headset to (474827 ms) Attempting to connect to headset 0x0001950EA9BF (474827 ms) Couldn't find an instance to connect the headset to
    // Attempt to read current connection list (involves sending read transmit power level for each connection ID known to exist) (626342 ms) HCI_Read_Transmit_Power_Level failed: -14 / 0xfffffff2 (631342 ms) HCI_Read_Transmit_Power_Level failed: -14 / 0xfffffff2
    // at this point, my watchdog has triggered a processor reset after the thread has not responded for 10 seconds

  • Hi,

    I think you need to close the audio stream AUD_Close_Stream (which will intern call GAVD_Close_End_Point).
    Once the above is successfull, you can call VS_A3DP_Sink_Close_Stream (just before calling this you can check if the music is streaming, If so stop steraming VS_A3DP_Stop_Stream).

    Also when you receive close stream indication or disconnect indication, in your callback you need to do the same. So there will not be any state mismatch when you start next time.

  • OK, I think I'm getting close now. I can stream to two devices and stop/restart the streams.

    I am using GAVD directly, rather than AUD, since I am more familiar with it, but if AUD should work better than GAVD for the purposes of the assisted A2DP operation, then I suppose I should go ahead and switch. Are there any limitations to using AUD as opposed to operating GAVD + AVCTP separately?

    I use VS_A3DP_Stop_Stream upon notification of an abort, and that seems to work. I use VS_A3DP_Close_Stream during close endpoint indication, and that works sometimes (I can then later reconnect to the device and start the stream again).

    However, on some occasions, shortly after this close endpoint notification, I lose connection with the module completely. It never finishes sending me the expected disconnect events (GAVD disconnect indication, HCI disconnection...)

    It stops sending me any events (so I stop receiving any incoming data), it stops responding to commands (blocks 5 seconds, responds HCI driver error), and is no longer streaming to the other device.

    Here is a log of a successful disconnection while doing an assisted stream (see at 136000 ms for the beginning of the disconnect), as well as a disconnect which resulted in the lockup (see at 288000 ms). It's a very verbose log but I went ahead and included everything in case there were any setup steps I did incorrectly that might have contributed to it (though I would hope a misconfiguration of the stream would never result in a hard module lockup)

    // set up codec
    (10185 ms) VS_PCM_Codec_Config worked, yay: 0
    (10185 ms) Setting assisted A2DP codec configuration with max bitpool 53
    (10185 ms) VS_A3DP_Codec_Configuration worked, yay: 0
    (10185 ms) Encoder setting 3
    // connect to the headsets
    (25213 ms) Attempting to connect to headset 0x0001950EA9BF
    (25214 ms) GAVD_Connect worked, yay: 1
    (30336 ms) <GAVD Connect Confirmation>
    (30336 ms) 	GAVD Instance 2
    (30336 ms) 	Address: 0x0001950EA9BF
    (30336 ms) 	Connection timed out
    (30336 ms) Invalid Pointer
    (30336 ms) <HCI Connection Complete Event>
    (30336 ms) 	0x0001950EA9BF
    (30336 ms) 		Status: Page Timeout
    (37156 ms) Attempting to connect to headset 0x0001950F6D84
    (37157 ms) GAVD_Connect worked, yay: 2
    (37552 ms) <HCI Connection Complete Event>
    (37552 ms) 	0x0001950F6D84
    (37552 ms) 		Handle: 1
    (37552 ms) 		Encryption Disabled
    (37552 ms) 		Type ACL
    (37552 ms) 		Status: Success
    (37579 ms) <HCI Max Slots Change Event>
    (37579 ms) 	Handle 1 max slots changed to 5
    (37592 ms) <HCI Read Remote Extended Features Complete Event>
    (37592 ms) 	Connection 1 remote extended features page 1 / 1
    (37592 ms) 	3 slot packets
    (37592 ms) 		Status: Success
    (37593 ms) <GAP Authentication>
    (37593 ms) 	atLinkKeyRequest: 0x0001950F6D84
    (37597 ms) 	Link Key is 0xBF285D71BC3552EA917DFB464C21A6EC (Sena SMH10)
    (37598 ms) GAP_Authentication_Response worked, yay!
    (37627 ms) <GAP Authentication>
    (37627 ms) 	atAuthenticationStatus: 0 for 0x0001950F6D84
    (37691 ms) <GAP Encryption Change Result>
    (37691 ms) 	BD_ADDR: 0x0001950F6D84
    (37691 ms) 	Status: 0x00
    (37691 ms) 	Mode: Enabled
    (37691 ms) <HCI Encryption Change Event>
    (37691 ms) 	Handle 1
    (37691 ms) 	Encryption enabled: 1
    (37691 ms) 	Status: Success
    (37746 ms) <GAVD Connect Confirmation>
    (37746 ms) 	GAVD Instance 2
    (37746 ms) 	Address: 0x0001950F6D84
    (37746 ms) 	Connected; GAVDID: 0x2
    (37746 ms) 	Requesting discovery of endpoints: 0
    (37814 ms) <GAVD Discover Confirmation>
    (37814 ms) 	GAVD Instance 2
    (37814 ms) 	Error Code 0
    (37814 ms) 	GAVDID 2
    (37814 ms) 	Number of Endpoints: 1
    (37815 ms) 		0: RSEID 1 (audio sink, available)
    (37815 ms) 		Getting capabilities of endpoint: 0
    (37833 ms) <GAVD Get Capabilities Confirmation>
    (37833 ms) 	GAVD Instance 2
    (37833 ms) 	Error Code 0
    (37833 ms) 	GAVDID 2
    (37833 ms) 	RSEID 1
    (37833 ms) 	Service 0
    (37833 ms) 		scMediaTransport
    (37833 ms) 	Service 1
    (37833 ms) 		scMediaCodec
    (37833 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (37834 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (37834 ms) 			Block Length      : 4, 8, 12, 16
    (37834 ms) 			Number Sub Bands  : 4, 8
    (37834 ms) 			Allocation Method : SNR, Loudness
    (37834 ms) 			Min/Max Bit Pool  : 2/45
    (37834 ms) 	Service 2
    (37834 ms) 		scContentProtection: 2 0
    (37834 ms) 	SetGAVDConfiguration
    (37834 ms) 		Sampling Frequency: 48KHz
    (37834 ms) 		Channel Mode      : Stereo
    (37834 ms) 		Block Length      : 16
    (37834 ms) 		Number Sub Bands  : 8
    (37834 ms) 		Allocation Method : Loudness
    (37834 ms) 		Min/Max Bit Pool  : 2/45
    (37835 ms) 	Trying to connect LSEID 3 to RSEID 1 on 0x0001950F6D84. Function result: 3 / 0x3
    (38144 ms) <HCI Role Change Event>
    (38144 ms) 	Device: 0x0001950F6D84
    (38144 ms) 	Status: Success
    (38144 ms) 	Current role: Slave
    (38159 ms) <HCI Max Slots Change Event>
    (38160 ms) 	Handle 1 max slots changed to 5
    (38184 ms) <GAVD Open End Point Confirmation>
    (38184 ms) 	GAVD Instance 2
    (38184 ms) 	LSEID 3
    (38184 ms) 	Opened successfully
    (38184 ms) 	Media Out MTU 895
    (38184 ms) 	Local CID 66, in MTU 1000
    (38184 ms) 	Remote CID 21569, out MTU 895
    (38186 ms) HCI_Switch_Role worked, yay: 0
    (38186 ms) 		Initializing SBC encoder using parameters:
    (38186 ms) 			Freq:         48000
    (38186 ms) 			Block Size:   16
    (38186 ms) 			Channel Mode: Stereo
    (38186 ms) 			Allocation:   Loudness
    (38186 ms) 			Subbands:     8
    (38186 ms) 			Bit Pool:     45
    (38186 ms) 		Timing Parameters:
    (38186 ms) 			MTU:                894
    (38186 ms) 			Frame Size:         102
    (38186 ms) 			Frames per Packet:  8
    (38186 ms) 			Packet Delay (MS):  21
    (38186 ms) 			Extra Time/Pkt:     333333
    (38386 ms) <HCI Role Change Event>
    (38387 ms) 	Device: 0x0001950F6D84
    (38387 ms) 	Status: Success
    (38387 ms) 	Current role: Master
    (38387 ms) <HCI Max Slots Change Event>
    (38387 ms) 	Handle 1 max slots changed to 5
    (39847 ms) <AVCTP Connect Indication>
    (39847 ms) 	[0] Profile 1 Opened by 0x0001950F6D84
    (39848 ms) <AVCTP Connect Indication>
    (39848 ms) 	[1] Profile 2 Opened by 0x0001950F6D84
    (39971 ms) <AVCTP Message Indication>
    (39971 ms) 	[0] 0x0001950F6D84
    (39971 ms) 	Message: Register notification command
    (39971 ms) 		Playback Status Changed
    (39971 ms) 		Playback Interval 0
    (46100 ms) <HCI Connection Request Event>
    (46100 ms) 	BD_ADDR: 0x0001950EA9BF
    (46101 ms) 	Type ACL
    (46101 ms) 	Class 0x240404
    (46124 ms) <HCI Connection Complete Event>
    (46124 ms) 	0x0001950EA9BF
    (46124 ms) 		Handle: 2
    (46124 ms) 		Encryption Disabled
    (46124 ms) 		Type ACL
    (46124 ms) 		Status: Success
    (46125 ms) <HCI Page Scan Repetition Mode Change Event>
    (46125 ms) 	0x0001950EA9BF
    (46125 ms) 	Mode: 1
    (46128 ms) <HCI Max Slots Change Event>
    (46128 ms) 	Handle 2 max slots changed to 5
    (46158 ms) <HCI Read Remote Extended Features Complete Event>
    (46158 ms) 	Connection 2 remote extended features page 1 / 1
    (46158 ms) 	3 slot packets
    (46158 ms) 		Status: Success
    (46182 ms) <GAP Authentication>
    (46182 ms) 	atLinkKeyRequest: 0x0001950EA9BF
    (46183 ms) 	Link Key is 0xA48C8A108B35732CAEE94AC73BA4B5A2 (Sena SMH10)
    (46184 ms) GAP_Authentication_Response worked, yay!
    (46256 ms) <HCI Encryption Change Event>
    (46256 ms) 	Handle 2
    (46256 ms) 	Encryption enabled: 1
    (46256 ms) 	Status: Success
    (46316 ms) <HCI Link Supervision Timeout Changed Event>
    (46316 ms) 	Handle 2
    (46316 ms) 	Timeout 8064
    (48353 ms) <AVCTP Connect Indication>
    (48353 ms) 	[0] Profile 1 Opened by 0x0001950EA9BF
    (48353 ms) <AVCTP Connect Indication>
    (48353 ms) 	[1] Profile 2 Opened by 0x0001950EA9BF
    (48461 ms) <AVCTP Message Indication>
    (48461 ms) 	[0] 0x0001950EA9BF
    (48461 ms) 	Message: Register notification command
    (48461 ms) 		Playback Status Changed
    (48461 ms) 		Playback Interval 0
    (57741 ms) <GAVD Abort Indication>
    (57741 ms) 	GAVD Instance 2
    (57741 ms) 	LSEID 3
    (57741 ms) <GAVD Close End Point Indication>
    (57741 ms) 	GAVD Instance 2
    (57864 ms) <AVCTP Disconnect Indication>
    (57864 ms) 	[0] Profile 1 Closed (0x0001950F6D84)
    (57865 ms) 		Disconnect: Success
    (57865 ms) <AVCTP Disconnect Indication>
    (57865 ms) 	[1] Profile 2 Closed (0x0001950F6D84)
    (57865 ms) 		Disconnect: Success
    (57874 ms) <GAVD Disconnect Indication>
    (57874 ms) 	GAVD Instance 2 / GAVDID 2
    (57874 ms) 	Address: 0x0001950F6D84
    (57874 ms) 	Reason 0 / 0x00.
    (57874 ms) <GAVD Disconnect Indication>
    (57874 ms) 	GAVD Instance 3 / GAVDID 3
    (57874 ms) 	Address: 0x0001950F6D84
    (57874 ms) 	Reason 0 / 0x00.
    (57883 ms) <HCI Disconnection Complete Event>
    (57883 ms) 		Reason: Connection Terminated By Local Host
    (57883 ms) 	Handle 1
    (57883 ms) 	Status: Success
    (57883 ms) 	Connection 1 freed
    (65557 ms) Attempting to connect to headset 0x0001950EA9BF
    (65557 ms) <GAVD Connect Confirmation>
    (65557 ms) 	GAVD Instance 2
    (65557 ms) 	Address: 0x0001950EA9BF
    (65565 ms) 	Connected; GAVDID: 0x4
    (65565 ms) 	Requesting discovery of endpoints: 0
    (65571 ms) GAVD_Connect worked, yay: 4
    (65589 ms) <GAVD Discover Confirmation>
    (65589 ms) 	GAVD Instance 2
    (65589 ms) 	Error Code 0
    (65589 ms) 	GAVDID 4
    (65589 ms) 	Number of Endpoints: 1
    (65589 ms) 		0: RSEID 1 (audio sink, available)
    (65589 ms) 		Getting capabilities of endpoint: 0
    (65615 ms) <GAVD Get Capabilities Confirmation>
    (65615 ms) 	GAVD Instance 2
    (65615 ms) 	Error Code 0
    (65615 ms) 	GAVDID 4
    (65615 ms) 	RSEID 1
    (65615 ms) 	Service 0
    (65615 ms) 		scMediaTransport
    (65615 ms) 	Service 1
    (65615 ms) 		scMediaCodec
    (65615 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (65616 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (65616 ms) 			Block Length      : 4, 8, 12, 16
    (65616 ms) 			Number Sub Bands  : 4, 8
    (65616 ms) 			Allocation Method : SNR, Loudness
    (65616 ms) 			Min/Max Bit Pool  : 2/45
    (65616 ms) 	Service 2
    (65616 ms) 		scContentProtection: 2 0
    (65616 ms) 	SetGAVDConfiguration
    (65616 ms) 		Sampling Frequency: 48KHz
    (65616 ms) 		Channel Mode      : Stereo
    (65616 ms) 		Block Length      : 16
    (65616 ms) 		Number Sub Bands  : 8
    (65616 ms) 		Allocation Method : Loudness
    (65616 ms) 		Min/Max Bit Pool  : 2/45
    (65617 ms) 	Trying to connect LSEID 3 to RSEID 1 on 0x0001950EA9BF. Function result: 3 / 0x3
    (65669 ms) <HCI Link Supervision Timeout Changed Event>
    (65669 ms) 	Handle 2
    (65669 ms) 	Timeout 32000
    (65896 ms) <HCI Role Change Event>
    (65896 ms) 	Device: 0x0001950EA9BF
    (65896 ms) 	Status: Success
    (65896 ms) 	Current role: Master
    (65896 ms) <HCI Max Slots Change Event>
    (65896 ms) 	Handle 2 max slots changed to 5
    (65919 ms) <GAVD Open End Point Confirmation>
    (65920 ms) 	GAVD Instance 2
    (65920 ms) 	LSEID 3
    (65920 ms) 	Opened successfully
    (65920 ms) 	Media Out MTU 895
    (65920 ms) 	Local CID 74, in MTU 1000
    (65920 ms) 	Remote CID 25986, out MTU 895
    (65920 ms) 		Initializing SBC encoder using parameters:
    (65920 ms) 			Freq:         48000
    (65920 ms) 			Block Size:   16
    (65920 ms) 			Channel Mode: Stereo
    (65920 ms) 			Allocation:   Loudness
    (65920 ms) 			Subbands:     8
    (65920 ms) 			Bit Pool:     45
    (65921 ms) 		Timing Parameters:
    (65921 ms) 			MTU:                894
    (65921 ms) 			Frame Size:         102
    (65921 ms) 			Frames per Packet:  8
    (65921 ms) 			Packet Delay (MS):  21
    (65921 ms) 			Extra Time/Pkt:     333333
    (66148 ms) <HCI Role Change Event>
    (66148 ms) 	Device: 0x0001950EA9BF
    (66148 ms) 	Status: Success
    (66148 ms) 	Current role: Slave
    (66159 ms) <HCI Max Slots Change Event>
    (66159 ms) 	Handle 2 max slots changed to 5
    (75762 ms) Attempting to connect to headset 0x0001950F6D84
    (75763 ms) GAVD_Connect worked, yay: 5
    (77895 ms) <HCI Connection Complete Event>
    (77895 ms) 	0x0001950F6D84
    (77895 ms) 		Handle: 1
    (77895 ms) 		Encryption Disabled
    (77895 ms) 		Type ACL
    (77895 ms) 		Status: Success
    (77925 ms) <HCI Max Slots Change Event>
    (77925 ms) 	Handle 1 max slots changed to 5
    (77952 ms) <HCI Read Remote Extended Features Complete Event>
    (77952 ms) 	Connection 1 remote extended features page 1 / 1
    (77952 ms) 	3 slot packets
    (77952 ms) 		Status: Success
    (77953 ms) <GAP Authentication>
    (77953 ms) 	atLinkKeyRequest: 0x0001950F6D84
    (77954 ms) 	Link Key is 0xBF285D71BC3552EA917DFB464C21A6EC (Sena SMH10)
    (77955 ms) GAP_Authentication_Response worked, yay!
    (77986 ms) <GAP Authentication>
    (77987 ms) 	atAuthenticationStatus: 0 for 0x0001950F6D84
    (78064 ms) <GAP Encryption Change Result>
    (78064 ms) 	BD_ADDR: 0x0001950F6D84
    (78064 ms) 	Status: 0x00
    (78064 ms) 	Mode: Enabled
    (78064 ms) <HCI Encryption Change Event>
    (78064 ms) 	Handle 1
    (78064 ms) 	Encryption enabled: 1
    (78064 ms) 	Status: Success
    (78143 ms) <GAVD Connect Confirmation>
    (78143 ms) 	GAVD Instance 3
    (78143 ms) 	Address: 0x0001950F6D84
    (78143 ms) 	Unknown error
    (78143 ms) Invalid Pointer
    (78152 ms) <HCI Disconnection Complete Event>
    (78152 ms) 		Reason: Connection Terminated By Local Host
    (78152 ms) 	Handle 1
    (78152 ms) 	Status: Success
    (78152 ms) 	Connection 1 freed
    (80557 ms) Attempting to connect to headset 0x0001950F6D84
    (80558 ms) GAVD_Connect worked, yay: 6
    (83997 ms) <HCI Connection Complete Event>
    (83997 ms) 	0x0001950F6D84
    (83997 ms) 		Handle: 1
    (83997 ms) 		Encryption Disabled
    (83998 ms) 		Type ACL
    (83998 ms) 		Status: Success
    (84029 ms) <HCI Max Slots Change Event>
    (84029 ms) 	Handle 1 max slots changed to 5
    (84054 ms) <HCI Read Remote Extended Features Complete Event>
    (84054 ms) 	Connection 1 remote extended features page 1 / 1
    (84054 ms) 	3 slot packets
    (84054 ms) 		Status: Success
    (84056 ms) <GAP Authentication>
    (84056 ms) 	atLinkKeyRequest: 0x0001950F6D84
    (84057 ms) 	Link Key is 0xBF285D71BC3552EA917DFB464C21A6EC (Sena SMH10)
    (84058 ms) GAP_Authentication_Response worked, yay!
    (84102 ms) <GAP Authentication>
    (84102 ms) 	atAuthenticationStatus: 0 for 0x0001950F6D84
    (84161 ms) <GAP Encryption Change Result>
    (84161 ms) 	BD_ADDR: 0x0001950F6D84
    (84161 ms) 	Status: 0x00
    (84161 ms) 	Mode: Enabled
    (84161 ms) <HCI Encryption Change Event>
    (84161 ms) 	Handle 1
    (84161 ms) 	Encryption enabled: 1
    (84161 ms) 	Status: Success
    (84188 ms) Invalid Pointer
    (84251 ms) <GAVD Connect Confirmation>
    (84251 ms) 	GAVD Instance 3
    (84251 ms) 	Address: 0x0001950F6D84
    (84251 ms) 	Connected; GAVDID: 0x6
    (84251 ms) 	Requesting discovery of endpoints: 0
    (84332 ms) <GAVD Discover Confirmation>
    (84332 ms) 	GAVD Instance 3
    (84332 ms) 	Error Code 0
    (84332 ms) 	GAVDID 6
    (84332 ms) 	Number of Endpoints: 1
    (84332 ms) 		0: RSEID 1 (audio sink, available)
    (84332 ms) 		Getting capabilities of endpoint: 0
    (84368 ms) <GAVD Get Capabilities Confirmation>
    (84368 ms) 	GAVD Instance 3
    (84368 ms) 	Error Code 0
    (84368 ms) 	GAVDID 6
    (84368 ms) 	RSEID 1
    (84368 ms) 	Service 0
    (84368 ms) 		scMediaTransport
    (84368 ms) 	Service 1
    (84368 ms) 		scMediaCodec
    (84368 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (84368 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (84368 ms) 			Block Length      : 4, 8, 12, 16
    (84368 ms) 			Number Sub Bands  : 4, 8
    (84368 ms) 			Allocation Method : SNR, Loudness
    (84369 ms) 			Min/Max Bit Pool  : 2/45
    (84369 ms) 	Service 2
    (84369 ms) 		scContentProtection: 2 0
    (84369 ms) 	SetGAVDConfiguration
    (84369 ms) 		Sampling Frequency: 48KHz
    (84369 ms) 		Channel Mode      : Stereo
    (84369 ms) 		Block Length      : 16
    (84369 ms) 		Number Sub Bands  : 8
    (84369 ms) 		Allocation Method : Loudness
    (84369 ms) 		Min/Max Bit Pool  : 2/45
    (84369 ms) 	Trying to connect LSEID 4 to RSEID 1 on 0x0001950F6D84. Function result: 4 / 0x4
    (84705 ms) <HCI Role Change Event>
    (84705 ms) 	Device: 0x0001950F6D84
    (84705 ms) 	Status: Success
    (84705 ms) 	Current role: Slave
    (84720 ms) <HCI Max Slots Change Event>
    (84720 ms) 	Handle 1 max slots changed to 5
    (84767 ms) <GAVD Open End Point Confirmation>
    (84767 ms) 	GAVD Instance 3
    (84767 ms) 	LSEID 4
    (84767 ms) 	Opened successfully
    (84767 ms) 	Media Out MTU 895
    (84767 ms) 	Local CID 78, in MTU 1000
    (84767 ms) 	Remote CID 11841, out MTU 895
    (84768 ms) HCI_Switch_Role worked, yay: 0
    (84768 ms) 		Initializing SBC encoder using parameters:
    (84768 ms) 			Freq:         48000
    (84769 ms) 			Block Size:   16
    (84769 ms) 			Channel Mode: Stereo
    (84769 ms) 			Allocation:   Loudness
    (84769 ms) 			Subbands:     8
    (84769 ms) 			Bit Pool:     45
    (84769 ms) 		Timing Parameters:
    (84769 ms) 			MTU:                894
    (84769 ms) 			Frame Size:         102
    (84769 ms) 			Frames per Packet:  8
    (84769 ms) 			Packet Delay (MS):  21
    (84769 ms) 			Extra Time/Pkt:     333333
    (85014 ms) <HCI Role Change Event>
    (85014 ms) 	Device: 0x0001950F6D84
    (85014 ms) 	Status: Success
    (85014 ms) 	Current role: Master
    (85015 ms) <HCI Max Slots Change Event>
    (85015 ms) 	Handle 1 max slots changed to 5
    (86382 ms) <AVCTP Connect Indication>
    (86382 ms) 	[0] Profile 1 Opened by 0x0001950F6D84
    (86382 ms) <AVCTP Connect Indication>
    (86382 ms) 	[1] Profile 2 Opened by 0x0001950F6D84
    (86540 ms) <AVCTP Message Indication>
    (86541 ms) 	[0] 0x0001950F6D84
    (86541 ms) 	Message: Register notification command
    (86541 ms) 		Playback Status Changed
    (86541 ms) 		Playback Interval 0
    // OK, now the headsets are connected, start connecting to a phone too
    (92506 ms) Attempting to connect to phone 0x006171CA5B8B
    (92507 ms) GAVD_Connect worked, yay: 7
    (96358 ms) <HCI Connection Complete Event>
    (96358 ms) 	0x006171CA5B8B
    (96358 ms) 		Handle: 3
    (96358 ms) 		Encryption Disabled
    (96358 ms) 		Type ACL
    (96358 ms) 		Status: Success
    (96386 ms) <HCI Max Slots Change Event>
    (96386 ms) 	Handle 3 max slots changed to 5
    (96397 ms) <HCI Read Remote Extended Features Complete Event>
    (96398 ms) 	Connection 3 remote extended features page 1 / 2
    (96398 ms) 	3 slot packets
    (96398 ms) 	5 slot packets
    (96398 ms) 	Encryption
    (96398 ms) 		Status: Success
    (96399 ms) <GAP Authentication>
    (96399 ms) 	atLinkKeyRequest: 0x006171CA5B8B
    (96400 ms) 	Link Key is 0xD8D1261E95EB80ED4EE4CBFA2860CC5A (iPhone )
    (96401 ms) GAP_Authentication_Response worked, yay!
    (96407 ms) <GAP Authentication>
    (96407 ms) 	atAuthenticationStatus: 0 for 0x006171CA5B8B
    (96446 ms) <GAP Encryption Change Result>
    (96446 ms) 	BD_ADDR: 0x006171CA5B8B
    (96447 ms) 	Status: 0x00
    (96447 ms) 	Mode: Enabled
    (96447 ms) <HCI Encryption Change Event>
    (96447 ms) 	Handle 3
    (96447 ms) 	Encryption enabled: 1
    (96447 ms) 	Status: Success
    (96482 ms) <GAVD Connect Confirmation>
    (96482 ms) 	GAVD Instance 0
    (96483 ms) 	Address: 0x006171CA5B8B
    (96483 ms) 	Connected; GAVDID: 0x7
    (96483 ms) 	Requesting discovery of endpoints: 0
    (96502 ms) <GAVD Discover Confirmation>
    (96502 ms) 	GAVD Instance 0
    (96502 ms) 	Error Code 0
    (96502 ms) 	GAVDID 7
    (96502 ms) 	Number of Endpoints: 6
    (96502 ms) 		0: RSEID 1 (audio source, available)
    (96502 ms) 		1: RSEID 2 (audio source, available)
    (96502 ms) 		2: RSEID 3 (audio source, available)
    (96503 ms) 		3: RSEID 4 (audio source, available)
    (96503 ms) 		4: RSEID 5 (audio source, available)
    (96503 ms) 		5: RSEID 6 (audio source, available)
    (98555 ms) <GAVD Set Configuration Indication>
    (98555 ms) 	GAVD Instance 0
    (98555 ms) 	LSEID 1
    (98555 ms) 	RSEID 2
    (98555 ms) 	Address: 0x006171CA5B8B
    (98555 ms) 	SetGAVDConfiguration
    (98555 ms) 		Sampling Frequency: 44.1 KHz
    (98555 ms) 		Channel Mode      : Stereo
    (98555 ms) 		Block Length      : 16
    (98555 ms) 		Number Sub Bands  : 8
    (98555 ms) 		Allocation Method : Loudness
    (98555 ms) 		Min/Max Bit Pool  : 2/53
    (98555 ms) 	Set configuration result: 44100
    (98555 ms) 	<GAVD config>
    (98555 ms) 	Service 0
    (98555 ms) 		scMediaTransport
    (98555 ms) 	Service 1
    (98555 ms) 		scMediaCodec
    (98556 ms) 			Sampling Frequency: 44.1 KHz, 
    (98556 ms) 			Channel Mode      : Stereo, 
    (98556 ms) 			Block Length      : 16
    (98556 ms) 			Number Sub Bands  : 8
    (98556 ms) 			Allocation Method : Loudness
    (98556 ms) 			Min/Max Bit Pool  : 2/53
    (98556 ms) 	</GAVD config>
    (98596 ms) <GAVD Open End Point Indication>
    (98596 ms) 	GAVD Instance 0
    (98596 ms) 	LSEID 1
    (98596 ms) 	Media Out MTU 672
    (98596 ms) 	Local CID 83, in MTU 1000
    (98596 ms) 	Remote CID 33542, out MTU 672
    (101761 ms) <AVCTP Connect Indication>
    (101761 ms) 	[0] Profile 1 Opened by 0x006171CA5B8B
    (101761 ms) <AVCTP Connect Indication>
    (101761 ms) 	[1] Profile 2 Opened by 0x006171CA5B8B
    (101762 ms) <AVCTP Message Indication>
    (101762 ms) 	[0] 0x006171CA5B8B
    (101762 ms) 	Message: get capabilities
    (101770 ms) <HFRE Open Port Indication>
    (101770 ms) 	ID: 0x0002
    (101770 ms) 	Address: 0x006171CA5B8B
    (101862 ms) <HFRE Control Indicator Status Confirmation>
    (101862 ms) 	ID: 0x0002
    (101862 ms) 	SERVICE TRUE
    (101862 ms) <HFRE Control Indicator Status Confirmation>
    (101862 ms) 	ID: 0x0002
    (101862 ms) 	CALL FALSE
    (101862 ms) <HFRE Control Indicator Status Confirmation>
    (101862 ms) 	ID: 0x0002
    (101862 ms) 	CALLSETUP 0
    (101862 ms) <HFRE Control Indicator Status Confirmation>
    (101862 ms) 	ID: 0x0002
    (101862 ms) 	BATTCHG 2
    (101862 ms) <HFRE Control Indicator Status Confirmation>
    (101862 ms) 	ID: 0x0002
    (101862 ms) 	SIGNAL 3
    (101862 ms) <HFRE Control Indicator Status Confirmation>
    (101862 ms) 	ID: 0x0002
    (101862 ms) 	ROAM FALSE
    (101897 ms) <HFRE Open Service Level Connection Indication>
    (101898 ms) 	ID: 0x0002
    (101898 ms) 	RemoteSupportedFeaturesValid: TRUE
    (101898 ms) 	RemoteSupportedFeatures: 0x000003ef
    (101898 ms) 	RemoteCallHoldMultipartySupport: 0x0000006f
    (101903 ms) <HFRE Command Result>
    (101903 ms) 	ID: 0x0002
    (101903 ms) 	Type 0 Code 0
    // tell the phone to play
    (109417 ms) BTPIF_AVRCP_RemotePressRelease worked, yay: 0
    (109448 ms) <AVCTP Message Indication>
    (109448 ms) 	[0] 0x006171CA5B8B
    (109448 ms) 	Message: Pass-through response
    (109448 ms) 		Response code Accepted
    (109448 ms) 		Subunit Type Panel
    (109448 ms) 		Subunit ID 0
    (109448 ms) 		Button Play Pressed
    (109449 ms) <AVCTP Message Indication>
    (109449 ms) 	[0] 0x006171CA5B8B
    (109449 ms) 	Message: Pass-through response
    (109449 ms) 		Response code Accepted
    (109449 ms) 		Subunit Type Panel
    (109449 ms) 		Subunit ID 0
    (109449 ms) 		Button Play Released
    (109578 ms) <GAVD Start Indication>
    (109578 ms) 	GAVD Instance 0
    (109621 ms) Got new payload type 0x60
    (109621 ms) GAVD Instance 0 SBC Frame Length changed: 118 (frames per packet: 8)
    // now start headset streams
    (117430 ms) HCI_Switch_Role worked, yay: 0
    (117430 ms) GAVD_Start_Stream_Request worked, yay: 0
    (117431 ms) GAVD_Start_Stream_Request worked, yay: 0
    (117467 ms) <GAVD Start Confirmation>
    (117467 ms) 	GAVD Instance 3
    (117467 ms) 	Error Code 0 / 0x0
    (117468 ms) VS_A3DP_Open_Stream worked, yay: 0
    (117468 ms) VS_A3DP_Start_Stream worked, yay: 0
    (117665 ms) <HCI Role Change Event>
    (117665 ms) 	Device: 0x0001950EA9BF
    (117665 ms) 	Status: Success
    (117665 ms) 	Current role: Master
    (117666 ms) <HCI Max Slots Change Event>
    (117666 ms) 	Handle 2 max slots changed to 5
    (117691 ms) <GAVD Start Confirmation>
    (117691 ms) 	GAVD Instance 2
    (117691 ms) 	Error Code 0 / 0x0
    (117692 ms) VS_A3DP_Open_Stream worked, yay: 0
    (117693 ms) VS_A3DP_Start_Stream worked, yay: 0
    // turn one of the headsets off
    (136023 ms) <GAVD Abort Indication>
    (136023 ms) 	GAVD Instance 2
    (136023 ms) 	LSEID 3
    (136040 ms) 	VS_A3DP_Stop_Stream worked, yay: 0
    (136040 ms) <GAVD Close End Point Indication>
    (136040 ms) 	GAVD Instance 2
    (136041 ms) VS_A3DP_Stop_Stream failed: -518 / 0xfffffdfa
    (136041 ms) VS_A3DP_Close_Stream worked, yay: 0
    (136051 ms) <AVCTP Disconnect Indication>
    (136052 ms) 	[0] Profile 1 Closed (0x0001950EA9BF)
    (136052 ms) 		Disconnect: Success
    (136052 ms) <AVCTP Disconnect Indication>
    (136052 ms) 	[1] Profile 2 Closed (0x0001950EA9BF)
    (136052 ms) 		Disconnect: Success
    (136103 ms) <GAVD Disconnect Indication>
    (136103 ms) 	GAVD Instance 2 / GAVDID 4
    (136103 ms) 	Address: 0x0001950EA9BF
    (136103 ms) 	Reason 0 / 0x00.
    (136529 ms) <HCI Disconnection Complete Event>
    (136529 ms) 		Reason: Remote User Terminated Connection
    (136529 ms) 	Handle 2
    (136529 ms) 	Status: Success
    (136529 ms) 	Connection 2 freed
    // that worked, and the other headset is still getting audio
    
    // turn the headset back on, now try to connect back to it
    (161783 ms) Attempting to connect to headset 0x0001950EA9BF
    (161790 ms) GAVD_Connect worked, yay: 8
    (164244 ms) <HCI Connection Request Event>
    (164244 ms) 	BD_ADDR: 0x0001950EA9BF
    (164244 ms) 	Type ACL
    (164244 ms) 	Class 0x240404
    (166912 ms) <GAVD Connect Confirmation>
    (166912 ms) 	GAVD Instance 2
    (166912 ms) 	Address: 0x0001950EA9BF
    (166912 ms) 	Connection timed out
    (166913 ms) Invalid Pointer
    (166913 ms) <HCI Connection Complete Event>
    (166913 ms) 	0x0001950EA9BF
    (166913 ms) 		Status: Page Timeout
    (169343 ms) <HCI Connection Complete Event>
    (169343 ms) 	0x0001950EA9BF
    (169343 ms) 		Status: Connection Accept Timeout Exceeded
    (172465 ms) Attempting to connect to headset 0x0001950EA9BF
    (172470 ms) GAVD_Connect worked, yay: 9
    (177601 ms) <GAVD Connect Confirmation>
    (177601 ms) 	GAVD Instance 2
    (177601 ms) 	Address: 0x0001950EA9BF
    (177601 ms) 	Connection timed out
    (177601 ms) Invalid Pointer
    (177601 ms) <HCI Connection Complete Event>
    (177601 ms) 	0x0001950EA9BF
    (177601 ms) 		Status: Page Timeout
    (189371 ms) Attempting to connect to headset 0x0001950EA9BF
    (189372 ms) GAVD_Connect worked, yay: 10
    (193108 ms) <HCI Connection Complete Event>
    (193108 ms) 	0x0001950EA9BF
    (193108 ms) 		Handle: 2
    (193108 ms) 		Encryption Disabled
    (193108 ms) 		Type ACL
    (193108 ms) 		Status: Success
    (193142 ms) <HCI Max Slots Change Event>
    (193142 ms) 	Handle 2 max slots changed to 5
    (193162 ms) <HCI Read Remote Extended Features Complete Event>
    (193162 ms) 	Connection 2 remote extended features page 1 / 1
    (193162 ms) 	3 slot packets
    (193162 ms) 	SSP Host Support
    (193162 ms) 		Status: Success
    (193163 ms) <GAP Authentication>
    (193164 ms) 	atLinkKeyRequest: 0x0001950EA9BF
    (193165 ms) 	Link Key is 0xA48C8A108B35732CAEE94AC73BA4B5A2 (Sena SMH10)
    (193165 ms) GAP_Authentication_Response worked, yay!
    (193205 ms) <GAP Authentication>
    (193205 ms) 	atAuthenticationStatus: 0 for 0x0001950EA9BF
    (193292 ms) <GAP Encryption Change Result>
    (193293 ms) 	BD_ADDR: 0x0001950EA9BF
    (193293 ms) 	Status: 0x00
    (193293 ms) 	Mode: Enabled
    (193293 ms) <HCI Encryption Change Event>
    (193293 ms) 	Handle 2
    (193293 ms) 	Encryption enabled: 1
    (193293 ms) 	Status: Success
    (193367 ms) <GAVD Connect Confirmation>
    (193367 ms) 	GAVD Instance 2
    (193367 ms) 	Address: 0x0001950EA9BF
    (193367 ms) 	Connected; GAVDID: 0xa
    (193367 ms) 	Requesting discovery of endpoints: 0
    (193417 ms) <GAVD Discover Confirmation>
    (193417 ms) 	GAVD Instance 2
    (193417 ms) 	Error Code 0
    (193417 ms) 	GAVDID 10
    (193417 ms) 	Number of Endpoints: 1
    (193417 ms) 		0: RSEID 1 (audio sink, available)
    (193417 ms) 		Getting capabilities of endpoint: 0
    (193459 ms) <GAVD Get Capabilities Confirmation>
    (193459 ms) 	GAVD Instance 2
    (193459 ms) 	Error Code 0
    (193459 ms) 	GAVDID 10
    (193459 ms) 	RSEID 1
    (193459 ms) 	Service 0
    (193459 ms) 		scMediaTransport
    (193459 ms) 	Service 1
    (193459 ms) 		scMediaCodec
    (193459 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (193459 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (193459 ms) 			Block Length      : 4, 8, 12, 16
    (193459 ms) 			Number Sub Bands  : 4, 8
    (193459 ms) 			Allocation Method : SNR, Loudness
    (193459 ms) 			Min/Max Bit Pool  : 2/45
    (193459 ms) 	Service 2
    (193460 ms) 		scContentProtection: 2 0
    (193460 ms) 	SetGAVDConfiguration
    (193460 ms) 		Sampling Frequency: 48KHz
    (193460 ms) 		Channel Mode      : Stereo
    (193460 ms) 		Block Length      : 16
    (193460 ms) 		Number Sub Bands  : 8
    (193460 ms) 		Allocation Method : Loudness
    (193460 ms) 		Min/Max Bit Pool  : 2/45
    (193460 ms) 	Trying to connect LSEID 3 to RSEID 1 on 0x0001950EA9BF. Function result: 3 / 0x3
    (193770 ms) <HCI Role Change Event>
    (193770 ms) 	Device: 0x0001950EA9BF
    (193770 ms) 	Status: Success
    (193770 ms) 	Current role: Slave
    (193805 ms) <HCI Max Slots Change Event>
    (193805 ms) 	Handle 2 max slots changed to 5
    (193853 ms) <GAVD Open End Point Confirmation>
    (193853 ms) 	GAVD Instance 2
    (193853 ms) 	LSEID 3
    (193853 ms) 	Opened successfully
    (193853 ms) 	Media Out MTU 895
    (193853 ms) 	Local CID 90, in MTU 1000
    (193853 ms) 	Remote CID 513, out MTU 895
    (193854 ms) HCI_Switch_Role worked, yay: 0
    (193854 ms) 		Initializing SBC encoder using parameters:
    (193854 ms) 			Freq:         48000
    (193854 ms) 			Block Size:   16
    (193854 ms) 			Channel Mode: Stereo
    (193854 ms) 			Allocation:   Loudness
    (193854 ms) 			Subbands:     8
    (193854 ms) 			Bit Pool:     45
    (193854 ms) 		Timing Parameters:
    (193854 ms) 			MTU:                894
    (193854 ms) 			Frame Size:         102
    (193854 ms) 			Frames per Packet:  8
    (193854 ms) 			Packet Delay (MS):  21
    (193854 ms) 			Extra Time/Pkt:     333333
    (193855 ms) VS_A3DP_Open_Stream worked, yay: 0
    (193856 ms) HCI_Switch_Role worked, yay: 0
    (193856 ms) GAVD_Start_Stream_Request worked, yay: 0
    (194082 ms) <HCI Role Change Event>
    (194082 ms) 	Device: 0x0001950EA9BF
    (194082 ms) 	Status: Success
    (194082 ms) 	Current role: Master
    (194082 ms) <HCI Role Change Event>
    (194082 ms) 	Device: 0x0001950EA9BF
    (194082 ms) 	Status: Success
    (194082 ms) 	Current role: Master
    (194082 ms) <HCI Max Slots Change Event>
    (194082 ms) 	Handle 2 max slots changed to 5
    (194108 ms) <GAVD Start Confirmation>
    (194108 ms) 	GAVD Instance 2
    (194108 ms) 	Error Code 0 / 0x0
    (194109 ms) VS_A3DP_Start_Stream worked, yay: 0
    (195507 ms) <AVCTP Connect Indication>
    (195507 ms) 	[0] Profile 1 Opened by 0x0001950EA9BF
    (195507 ms) <AVCTP Connect Indication>
    (195507 ms) 	[1] Profile 2 Opened by 0x0001950EA9BF
    (195711 ms) <AVCTP Message Indication>
    (195711 ms) 	[0] 0x0001950EA9BF
    (195711 ms) 	Message: Register notification command
    (195711 ms) 		Playback Status Changed
    (195711 ms) 		Playback Interval 0
    // took a little doing, but now it's connected back up and streaming again
    
    // now turn it off again
    (288332 ms) <GAVD Abort Indication>
    (288332 ms) 	GAVD Instance 3
    (288332 ms) 	LSEID 4
    (288350 ms) 	VS_A3DP_Stop_Stream worked, yay: 0
    (288350 ms) <GAVD Close End Point Indication>
    (288350 ms) 	GAVD Instance 3
    (288351 ms) VS_A3DP_Stop_Stream failed: -518 / 0xfffffdfa
    (288351 ms) VS_A3DP_Close_Stream worked, yay: 0
    (288352 ms) <AVCTP Disconnect Indication>
    (288352 ms) 	[0] Profile 1 Closed (0x0001950F6D84)
    (288352 ms) 		Disconnect: Success
    (288352 ms) <AVCTP Disconnect Indication>
    (288352 ms) 	[1] Profile 2 Closed (0x0001950F6D84)
    (288352 ms) 		Disconnect: Success
    // but this time, I stopped receiving notification of any incoming SBC frames, and there is now no audio going to the other headset
    
    // and any commands to the module no longer work
    (453831 ms) HCI_Read_Transmit_Power_Level failed: -14 / 0xfffffff2
    (458831 ms) HCI_Read_Transmit_Power_Level failed: -14 / 0xfffffff2
    

  • I just ran into a new instance where the module will completely stop streaming & stop responding over the UART during A3DP streaming. It doesn't coincide with a device disconnect, instead it seems to coincide with doing pretty much anything over the UART, including receiving an HFRE event or trying to connect to another device

    A log of this:

    (1069 ms) HCI_VS_InitializeAfterHCIReset
    (1071 ms) VS_Update_UART_Baud_Rate success.
    (1109 ms) HCI_VS_InitializeAfterHCIReset Success
    (1118 ms) BSC Initialize worked, yay: 1
    (1118 ms) Device Chipset: 4.1
    (1118 ms) Bluetooth Address: 0x0017E9D4F415
    (1221 ms) BSC Enable Feature (Assisted A2DP source) worked, yay!
    (1222 ms) GAP Set Inquiry Mode worked, yay!
    (1223 ms) GAVD Initialize worked, yay!
    (1223 ms) GAVD_Register_End_Point worked, yay!
    (1223 ms) GAVD_Register_SDP_Record worked, yay!
    (1223 ms) AVCTP Initialize worked, yay!
    (1223 ms) AVCTP Enable Browsing Channel Support worked, yay!
    (1223 ms) AVRCP Register Profile (Controller) worked, yay: 1
    (1224 ms) AVRCP Register SDP Record (Controller) worked, yay!
    (1224 ms) AVRCP Register Profile (Target) worked, yay: 2
    (1224 ms) AVRCP Register SDP Record (Target) worked, yay!
    (1226 ms) HFRE_Open_HandsFree_Server_Port worked, yay: 1
    (1226 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1228 ms) HFRE_Open_HandsFree_Server_Port worked, yay: 2
    (1229 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1229 ms) HFRE_Open_Audio_Gateway_Server_Port worked, yay: 3
    (1230 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1231 ms) HFRE_Open_Audio_Gateway_Server_Port worked, yay: 4
    (1231 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1237 ms) VS Set Max Output Power worked, yay!
    (1241 ms) VS Write SCO Configuration worked, yay!
    (1245 ms) GAP Set Local Device Name worked, yay!
    (1247 ms) GAP Write Extended Inquiry Information worked, yay!
    (1248 ms) GAP Set Connectability Mode worked, yay!
    (1249 ms) GAP Set Pairability Mode worked, yay!
    (1249 ms) GAP Register Remote Authentication worked, yay!
    (1249 ms) HCI Register Event Callback worked, yay: 6
    (1249 ms) Stack initialized in 396 ticks
    // set up codec
    (5476 ms) VS_PCM_Codec_Config worked, yay: 0
    (5477 ms) Setting assisted A2DP codec configuration with max bitpool 53
    (5477 ms) VS_A3DP_Codec_Configuration worked, yay: 0
    (5477 ms) Encoder setting 3
    // connect to phone
    (8094 ms) Attempting to connect to phone 0x006171CA5B8B
    (8095 ms) GAVD_Connect worked, yay: 1
    (8376 ms) <HCI Connection Complete Event>
    (8376 ms) 	0x006171CA5B8B
    (8376 ms) 		Handle: 1
    (8376 ms) 		Encryption Disabled
    (8376 ms) 		Type ACL
    (8376 ms) 		Status: Success
    (8377 ms) <HCI Max Slots Change Event>
    (8377 ms) 	Handle 1 max slots changed to 5
    (8383 ms) <HCI Read Remote Extended Features Complete Event>
    (8383 ms) 	Connection 1 remote extended features page 1 / 2
    (8383 ms) 	3 slot packets
    (8383 ms) 	5 slot packets
    (8383 ms) 	Encryption
    (8383 ms) 		Status: Success
    (8384 ms) <GAP Authentication>
    (8384 ms) 	atLinkKeyRequest: 0x006171CA5B8B
    (8388 ms) 	Link Key is 0xD8D1261E95EB80ED4EE4CBFA2860CC5A (iPhone )
    (8389 ms) GAP_Authentication_Response worked, yay!
    (8396 ms) <GAP Authentication>
    (8396 ms) 	atAuthenticationStatus: 0 for 0x006171CA5B8B
    (8423 ms) <GAP Encryption Change Result>
    (8423 ms) 	BD_ADDR: 0x006171CA5B8B
    (8423 ms) 	Status: 0x00
    (8423 ms) 	Mode: Enabled
    (8423 ms) <HCI Encryption Change Event>
    (8423 ms) 	Handle 1
    (8423 ms) 	Encryption enabled: 1
    (8423 ms) 	Status: Success
    (8440 ms) <GAVD Connect Confirmation>
    (8440 ms) 	GAVD Instance 0
    (8440 ms) 	Address: 0x006171CA5B8B
    (8440 ms) 	Connected; GAVDID: 0x1
    (8440 ms) 	Requesting discovery of endpoints: 0
    (8449 ms) <GAVD Discover Confirmation>
    (8449 ms) 	GAVD Instance 0
    (8449 ms) 	Error Code 0
    (8449 ms) 	GAVDID 1
    (8449 ms) 	Number of Endpoints: 6
    (8449 ms) 		0: RSEID 1 (audio source, available)
    (8449 ms) 		1: RSEID 2 (audio source, available)
    (8449 ms) 		2: RSEID 3 (audio source, available)
    (8449 ms) 		3: RSEID 4 (audio source, available)
    (8449 ms) 		4: RSEID 5 (audio source, available)
    (8449 ms) 		5: RSEID 6 (audio source, available)
    (10525 ms) <GAVD Set Configuration Indication>
    (10525 ms) 	GAVD Instance 0
    (10525 ms) 	LSEID 1
    (10525 ms) 	RSEID 2
    (10525 ms) 	Address: 0x006171CA5B8B
    (10525 ms) 	SetGAVDConfiguration
    (10525 ms) 		Sampling Frequency: 44.1 KHz
    (10525 ms) 		Channel Mode      : Stereo
    (10525 ms) 		Block Length      : 16
    (10525 ms) 		Number Sub Bands  : 8
    (10525 ms) 		Allocation Method : Loudness
    (10526 ms) 		Min/Max Bit Pool  : 2/53
    (10526 ms) 	Set configuration result: 44100
    (10526 ms) 	<GAVD config>
    (10526 ms) 	Service 0
    (10526 ms) 		scMediaTransport
    (10526 ms) 	Service 1
    (10526 ms) 		scMediaCodec
    (10526 ms) 			Sampling Frequency: 44.1 KHz, 
    (10526 ms) 			Channel Mode      : Stereo, 
    (10526 ms) 			Block Length      : 16
    (10526 ms) 			Number Sub Bands  : 8
    (10526 ms) 			Allocation Method : Loudness
    (10526 ms) 			Min/Max Bit Pool  : 2/53
    (10526 ms) 	</GAVD config>
    (10550 ms) <GAVD Open End Point Indication>
    (10550 ms) 	GAVD Instance 0
    (10550 ms) 	LSEID 1
    (10550 ms) 	Media Out MTU 672
    (10550 ms) 	Local CID 65, in MTU 1000
    (10550 ms) 	Remote CID 36102, out MTU 672
    // connect to headsets
    (10856 ms) Attempting to connect to headset 0x0001950EA9BF
    (10857 ms) GAVD_Connect worked, yay: 2
    (11883 ms) <HCI Connection Complete Event>
    (11883 ms) 	0x0001950EA9BF
    (11883 ms) 		Handle: 2
    (11883 ms) 		Encryption Disabled
    (11883 ms) 		Type ACL
    (11883 ms) 		Status: Success
    (11917 ms) <HCI Max Slots Change Event>
    (11917 ms) 	Handle 2 max slots changed to 5
    (11930 ms) <HCI Read Remote Extended Features Complete Event>
    (11930 ms) 	Connection 2 remote extended features page 1 / 1
    (11930 ms) 	3 slot packets
    (11930 ms) 		Status: Success
    (11932 ms) <GAP Authentication>
    (11932 ms) 	atLinkKeyRequest: 0x0001950EA9BF
    (11933 ms) 	Link Key is 0xA48C8A108B35732CAEE94AC73BA4B5A2 (Sena SMH10)
    (11934 ms) GAP_Authentication_Response worked, yay!
    (11960 ms) <GAP Authentication>
    (11961 ms) 	atAuthenticationStatus: 0 for 0x0001950EA9BF
    (12014 ms) <GAP Encryption Change Result>
    (12014 ms) 	BD_ADDR: 0x0001950EA9BF
    (12014 ms) 	Status: 0x00
    (12014 ms) 	Mode: Enabled
    (12014 ms) <HCI Encryption Change Event>
    (12014 ms) 	Handle 2
    (12014 ms) 	Encryption enabled: 1
    (12014 ms) 	Status: Success
    (12069 ms) <GAVD Connect Confirmation>
    (12069 ms) 	GAVD Instance 2
    (12069 ms) 	Address: 0x0001950EA9BF
    (12069 ms) 	Connected; GAVDID: 0x2
    (12069 ms) 	Requesting discovery of endpoints: 0
    (12139 ms) <GAVD Discover Confirmation>
    (12139 ms) 	GAVD Instance 2
    (12139 ms) 	Error Code 0
    (12139 ms) 	GAVDID 2
    (12139 ms) 	Number of Endpoints: 1
    (12139 ms) 		0: RSEID 1 (audio sink, available)
    (12139 ms) 		Getting capabilities of endpoint: 0
    (12158 ms) <GAVD Get Capabilities Confirmation>
    (12158 ms) 	GAVD Instance 2
    (12158 ms) 	Error Code 0
    (12158 ms) 	GAVDID 2
    (12158 ms) 	RSEID 1
    (12158 ms) 	Service 0
    (12158 ms) 		scMediaTransport
    (12158 ms) 	Service 1
    (12158 ms) 		scMediaCodec
    (12158 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (12158 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (12158 ms) 			Block Length      : 4, 8, 12, 16
    (12158 ms) 			Number Sub Bands  : 4, 8
    (12158 ms) 			Allocation Method : SNR, Loudness
    (12158 ms) 			Min/Max Bit Pool  : 2/45
    (12158 ms) 	Service 2
    (12158 ms) 		scContentProtection: 2 0
    (12158 ms) 	SetGAVDConfiguration
    (12158 ms) 		Sampling Frequency: 48KHz
    (12158 ms) 		Channel Mode      : Stereo
    (12158 ms) 		Block Length      : 16
    (12158 ms) 		Number Sub Bands  : 8
    (12158 ms) 		Allocation Method : Loudness
    (12158 ms) 		Min/Max Bit Pool  : 2/45
    (12159 ms) 	Trying to connect LSEID 3 to RSEID 1 on 0x0001950EA9BF. Function result: 3 / 0x3
    (12464 ms) <HCI Role Change Event>
    (12464 ms) 	Device: 0x0001950EA9BF
    (12464 ms) 	Status: Success
    (12464 ms) 	Current role: Slave
    (12479 ms) <HCI Max Slots Change Event>
    (12479 ms) 	Handle 2 max slots changed to 5
    (12509 ms) <GAVD Open End Point Confirmation>
    (12509 ms) 	GAVD Instance 2
    (12509 ms) 	LSEID 3
    (12509 ms) 	Opened successfully
    (12509 ms) 	Media Out MTU 895
    (12509 ms) 	Local CID 67, in MTU 1000
    (12509 ms) 	Remote CID 29249, out MTU 895
    (12510 ms) HCI_Switch_Role worked, yay: 0
    (12510 ms) 		Initializing SBC encoder using parameters:
    (12510 ms) 			Freq:         48000
    (12510 ms) 			Block Size:   16
    (12510 ms) 			Channel Mode: Stereo
    (12510 ms) 			Allocation:   Loudness
    (12510 ms) 			Subbands:     8
    (12510 ms) 			Bit Pool:     45
    (12510 ms) 		Timing Parameters:
    (12510 ms) 			MTU:                894
    (12510 ms) 			Frame Size:         102
    (12510 ms) 			Frames per Packet:  8
    (12510 ms) 			Packet Delay (MS):  21
    (12510 ms) 			Extra Time/Pkt:     333333
    (12714 ms) <HCI Role Change Event>
    (12714 ms) 	Device: 0x0001950EA9BF
    (12714 ms) 	Status: Success
    (12714 ms) 	Current role: Master
    (12714 ms) <HCI Max Slots Change Event>
    (12714 ms) 	Handle 2 max slots changed to 5
    (13674 ms) <AVCTP Connect Indication>
    (13674 ms) 	[0] Profile 1 Opened by 0x006171CA5B8B
    (13674 ms) <AVCTP Connect Indication>
    (13674 ms) 	[1] Profile 2 Opened by 0x006171CA5B8B
    (13675 ms) <AVCTP Message Indication>
    (13675 ms) 	[0] 0x006171CA5B8B
    (13675 ms) 	Message: get capabilities
    (13690 ms) <HFRE Open Port Indication>
    (13690 ms) 	ID: 0x0002
    (13690 ms) 	Address: 0x006171CA5B8B
    (13754 ms) <HFRE Control Indicator Status Confirmation>
    (13754 ms) 	ID: 0x0002
    (13754 ms) 	SERVICE TRUE
    (13754 ms) <HFRE Control Indicator Status Confirmation>
    (13754 ms) 	ID: 0x0002
    (13754 ms) 	CALL FALSE
    (13754 ms) <HFRE Control Indicator Status Confirmation>
    (13754 ms) 	ID: 0x0002
    (13755 ms) 	CALLSETUP 0
    (13755 ms) <HFRE Control Indicator Status Confirmation>
    (13755 ms) 	ID: 0x0002
    (13755 ms) 	BATTCHG 2
    (13755 ms) <HFRE Control Indicator Status Confirmation>
    (13755 ms) 	ID: 0x0002
    (13755 ms) 	SIGNAL 2
    (13755 ms) <HFRE Control Indicator Status Confirmation>
    (13755 ms) 	ID: 0x0002
    (13755 ms) 	ROAM FALSE
    (13773 ms) <HFRE Open Service Level Connection Indication>
    (13773 ms) 	ID: 0x0002
    (13773 ms) 	RemoteSupportedFeaturesValid: TRUE
    (13773 ms) 	RemoteSupportedFeatures: 0x000003ef
    (13773 ms) 	RemoteCallHoldMultipartySupport: 0x0000006f
    (13778 ms) <HFRE Command Result>
    (13778 ms) 	ID: 0x0002
    (13778 ms) 	Type 0 Code 0
    (14181 ms) <AVCTP Connect Indication>
    (14181 ms) 	[0] Profile 1 Opened by 0x0001950EA9BF
    (14181 ms) <AVCTP Connect Indication>
    (14181 ms) 	[1] Profile 2 Opened by 0x0001950EA9BF
    (14299 ms) <AVCTP Message Indication>
    (14299 ms) 	[0] 0x0001950EA9BF
    (14299 ms) 	Message: Register notification command
    (14299 ms) 		Playback Status Changed
    (14299 ms) 		Playback Interval 0
    (15221 ms) Attempting to connect to headset 0x0001950F6D84
    (15222 ms) GAVD_Connect worked, yay: 3
    (18274 ms) <HCI Connection Complete Event>
    (18274 ms) 	0x0001950F6D84
    (18274 ms) 		Handle: 3
    (18274 ms) 		Encryption Disabled
    (18274 ms) 		Type ACL
    (18274 ms) 		Status: Success
    (18307 ms) <HCI Max Slots Change Event>
    (18307 ms) 	Handle 3 max slots changed to 5
    (18318 ms) <HCI Read Remote Extended Features Complete Event>
    (18318 ms) 	Connection 3 remote extended features page 1 / 1
    (18318 ms) 	3 slot packets
    (18318 ms) 		Status: Success
    (18319 ms) <GAP Authentication>
    (18319 ms) 	atLinkKeyRequest: 0x0001950F6D84
    (18320 ms) 	Link Key is 0xBF285D71BC3552EA917DFB464C21A6EC (Sena SMH10)
    (18322 ms) GAP_Authentication_Response worked, yay!
    (18347 ms) <GAP Authentication>
    (18347 ms) 	atAuthenticationStatus: 0 for 0x0001950F6D84
    (18406 ms) <GAP Encryption Change Result>
    (18406 ms) 	BD_ADDR: 0x0001950F6D84
    (18406 ms) 	Status: 0x00
    (18406 ms) 	Mode: Enabled
    (18406 ms) <HCI Encryption Change Event>
    (18406 ms) 	Handle 3
    (18406 ms) 	Encryption enabled: 1
    (18406 ms) 	Status: Success
    (18466 ms) <GAVD Connect Confirmation>
    (18466 ms) 	GAVD Instance 3
    (18466 ms) 	Address: 0x0001950F6D84
    (18466 ms) 	Connected; GAVDID: 0x3
    (18466 ms) 	Requesting discovery of endpoints: 0
    (18537 ms) <GAVD Discover Confirmation>
    (18537 ms) 	GAVD Instance 3
    (18537 ms) 	Error Code 0
    (18537 ms) 	GAVDID 3
    (18537 ms) 	Number of Endpoints: 1
    (18537 ms) 		0: RSEID 1 (audio sink, available)
    (18537 ms) 		Getting capabilities of endpoint: 0
    (18556 ms) <GAVD Get Capabilities Confirmation>
    (18556 ms) 	GAVD Instance 3
    (18556 ms) 	Error Code 0
    (18556 ms) 	GAVDID 3
    (18556 ms) 	RSEID 1
    (18556 ms) 	Service 0
    (18556 ms) 		scMediaTransport
    (18556 ms) 	Service 1
    (18556 ms) 		scMediaCodec
    (18556 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (18556 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (18556 ms) 			Block Length      : 4, 8, 12, 16
    (18556 ms) 			Number Sub Bands  : 4, 8
    (18556 ms) 			Allocation Method : SNR, Loudness
    (18556 ms) 			Min/Max Bit Pool  : 2/45
    (18556 ms) 	Service 2
    (18556 ms) 		scContentProtection: 2 0
    (18556 ms) 	SetGAVDConfiguration
    (18556 ms) 		Sampling Frequency: 48KHz
    (18556 ms) 		Channel Mode      : Stereo
    (18556 ms) 		Block Length      : 16
    (18556 ms) 		Number Sub Bands  : 8
    (18556 ms) 		Allocation Method : Loudness
    (18556 ms) 		Min/Max Bit Pool  : 2/45
    (18557 ms) 	Trying to connect LSEID 4 to RSEID 1 on 0x0001950F6D84. Function result: 4 / 0x4
    (18874 ms) <HCI Role Change Event>
    (18874 ms) 	Device: 0x0001950F6D84
    (18874 ms) 	Status: Success
    (18874 ms) 	Current role: Slave
    (18890 ms) <HCI Max Slots Change Event>
    (18890 ms) 	Handle 3 max slots changed to 5
    (18921 ms) <GAVD Open End Point Confirmation>
    (18921 ms) 	GAVD Instance 3
    (18921 ms) 	LSEID 4
    (18921 ms) 	Opened successfully
    (18921 ms) 	Media Out MTU 895
    (18921 ms) 	Local CID 75, in MTU 1000
    (18921 ms) 	Remote CID 65, out MTU 895
    (18922 ms) HCI_Switch_Role worked, yay: 0
    (18922 ms) 		Initializing SBC encoder using parameters:
    (18922 ms) 			Freq:         48000
    (18922 ms) 			Block Size:   16
    (18923 ms) 			Channel Mode: Stereo
    (18923 ms) 			Allocation:   Loudness
    (18923 ms) 			Subbands:     8
    (18923 ms) 			Bit Pool:     45
    (18923 ms) 		Timing Parameters:
    (18923 ms) 			MTU:                894
    (18923 ms) 			Frame Size:         102
    (18923 ms) 			Frames per Packet:  8
    (18923 ms) 			Packet Delay (MS):  21
    (18923 ms) 			Extra Time/Pkt:     333333
    (19124 ms) <HCI Role Change Event>
    (19124 ms) 	Device: 0x0001950F6D84
    (19124 ms) 	Status: Success
    (19124 ms) 	Current role: Master
    (19125 ms) <HCI Max Slots Change Event>
    (19125 ms) 	Handle 3 max slots changed to 5
    (20576 ms) <AVCTP Connect Indication>
    (20576 ms) 	[0] Profile 1 Opened by 0x0001950F6D84
    (20576 ms) <AVCTP Connect Indication>
    (20576 ms) 	[1] Profile 2 Opened by 0x0001950F6D84
    (20703 ms) <AVCTP Message Indication>
    (20703 ms) 	[0] 0x0001950F6D84
    (20703 ms) 	Message: Register notification command
    (20703 ms) 		Playback Status Changed
    (20703 ms) 		Playback Interval 0
    // start playing from the phone
    (22700 ms) BTPIF_AVRCP_RemotePressRelease worked, yay: 0
    (22731 ms) <AVCTP Message Indication>
    (22731 ms) 	[0] 0x006171CA5B8B
    (22731 ms) 	Message: Pass-through response
    (22731 ms) 		Response code Accepted
    (22731 ms) 		Subunit Type Panel
    (22731 ms) 		Subunit ID 0
    (22731 ms) 		Button Play Pressed
    (22732 ms) <AVCTP Message Indication>
    (22732 ms) 	[0] 0x006171CA5B8B
    (22732 ms) 	Message: Pass-through response
    (22732 ms) 		Response code Accepted
    (22732 ms) 		Subunit Type Panel
    (22732 ms) 		Subunit ID 0
    (22732 ms) 		Button Play Released
    // phone starts streaming
    (22850 ms) <GAVD Start Indication>
    (22850 ms) 	GAVD Instance 0
    (22930 ms) Got new payload type 0x60
    (22930 ms) GAVD Instance 0 SBC Frame Length changed: 118 (frames per packet: 8)
    (23086 ms) Cycles to decode 8 packets: 9315423
    (24086 ms) Cycles to decode 43 packets: 49813486
    (25086 ms) Cycles to decode 43 packets: 49908938
    (26086 ms) Cycles to decode 43 packets: 49949706
    (27086 ms) Cycles to decode 43 packets: 49811167
    // now set the headsets to stream
    (27219 ms) GAVD_Start_Stream_Request worked, yay: 0
    (27220 ms) GAVD_Start_Stream_Request worked, yay: 0
    (27247 ms) <GAVD Start Confirmation>
    (27247 ms) 	GAVD Instance 2
    (27247 ms) 	Error Code 0 / 0x0
    (27248 ms) VS_A3DP_Open_Stream worked, yay: 0
    (27248 ms) VS_A3DP_Start_Stream worked, yay: 0
    (27249 ms) <GAVD Start Confirmation>
    (27249 ms) 	GAVD Instance 3
    (27250 ms) 	Error Code 0 / 0x0
    (27250 ms) VS_A3DP_Open_Stream worked, yay: 0
    (27251 ms) VS_A3DP_Start_Stream worked, yay: 0
    (28086 ms) Cycles to decode 43 packets: 48570060
    (29086 ms) Cycles to decode 43 packets: 50362275
    (30086 ms) Cycles to decode 43 packets: 49825493
    (31086 ms) Cycles to decode 43 packets: 49937162
    (32091 ms) Cycles to decode 44 packets: 51054091
    (33090 ms) Cycles to decode 43 packets: 49860417
    (34087 ms) Cycles to decode 43 packets: 50056169
    (35086 ms) Cycles to decode 43 packets: 49959782
    (36092 ms) Cycles to decode 43 packets: 50334143
    (37086 ms) Cycles to decode 43 packets: 49842807
    (38086 ms) Cycles to decode 43 packets: 49941630
    (39086 ms) Cycles to decode 43 packets: 50292856
    (40086 ms) Cycles to decode 43 packets: 49883341
    (41086 ms) Cycles to decode 43 packets: 49660027
    (42086 ms) Cycles to decode 43 packets: 49722448
    (43086 ms) Cycles to decode 43 packets: 49739942
    (44095 ms) Cycles to decode 44 packets: 51372656
    (45094 ms) Cycles to decode 43 packets: 49909508
    (46097 ms) Cycles to decode 43 packets: 49890893
    (47091 ms) Cycles to decode 43 packets: 50268761
    (48092 ms) Cycles to decode 43 packets: 50377768
    (49087 ms) Cycles to decode 43 packets: 49797760
    (50088 ms) Cycles to decode 43 packets: 49907910
    (51086 ms) Cycles to decode 43 packets: 49862568
    (52086 ms) Cycles to decode 43 packets: 49771953
    (53088 ms) Cycles to decode 43 packets: 49929556
    (54086 ms) Cycles to decode 43 packets: 49898125
    (55086 ms) Cycles to decode 43 packets: 49824613
    (56086 ms) Cycles to decode 43 packets: 49898598
    (57086 ms) Cycles to decode 43 packets: 49912965
    (58086 ms) Cycles to decode 43 packets: 49785593
    (59086 ms) Cycles to decode 43 packets: 50748664
    (60095 ms) Cycles to decode 44 packets: 50926129
    (61092 ms) Cycles to decode 43 packets: 49782361
    (62092 ms) Cycles to decode 43 packets: 49831014
    (63086 ms) Cycles to decode 42 packets: 48711543
    (64088 ms) Cycles to decode 44 packets: 50978508
    (65089 ms) Cycles to decode 43 packets: 49843661
    (66086 ms) Cycles to decode 43 packets: 50012442
    (67086 ms) Cycles to decode 43 packets: 49960116
    (68086 ms) Cycles to decode 43 packets: 50891335
    (69086 ms) Cycles to decode 43 packets: 50326900
    (70086 ms) Cycles to decode 43 packets: 49806711
    (71086 ms) Cycles to decode 43 packets: 49793758
    (72086 ms) Cycles to decode 43 packets: 50328059
    (73086 ms) Cycles to decode 43 packets: 49795549
    (74086 ms) Cycles to decode 43 packets: 49713536
    (75086 ms) Cycles to decode 43 packets: 49963076
    (76093 ms) Cycles to decode 44 packets: 51398497
    (77091 ms) Cycles to decode 43 packets: 50358850
    (78094 ms) Cycles to decode 43 packets: 50233882
    (79088 ms) Cycles to decode 43 packets: 49795680
    (80093 ms) Cycles to decode 43 packets: 49857561
    (81087 ms) Cycles to decode 43 packets: 49888412
    (82086 ms) Cycles to decode 43 packets: 49783101
    (83086 ms) Cycles to decode 43 packets: 49852701
    (84086 ms) Cycles to decode 43 packets: 49789525
    (85086 ms) Cycles to decode 43 packets: 49738086
    (86086 ms) Cycles to decode 43 packets: 49872045
    (87086 ms) Cycles to decode 43 packets: 49793732
    (88086 ms) Cycles to decode 43 packets: 49798216
    (89094 ms) Cycles to decode 44 packets: 50926410
    (90092 ms) Cycles to decode 43 packets: 49844504
    (91093 ms) Cycles to decode 43 packets: 49787234
    (92094 ms) Cycles to decode 43 packets: 49800813
    (93088 ms) Cycles to decode 43 packets: 49832264
    (94088 ms) Cycles to decode 43 packets: 49845655
    (95086 ms) Cycles to decode 43 packets: 49804960
    (96090 ms) Cycles to decode 43 packets: 49805405
    (96270 ms) <HFRE Control Indicator Status Indication>
    (96270 ms) 	ID: 0x0002
    (96270 ms) 	SIGNAL 3
    // lost communication with module right around here
    (97086 ms) Cycles to decode 9 packets: 10445160
    (605317 ms) HCI_Read_Transmit_Power_Level failed: -14 / 0xfffffff2
    (610317 ms) HCI_Read_Transmit_Power_Level failed: -14 / 0xfffffff2
    

    An additional log, where I'm not yet connected to the phone and start streaming audio from a different source, then I decide to connect the phone - this also results in a lockup

    (1113 ms) HCI_VS_InitializeAfterHCIReset
    (1115 ms) VS_Update_UART_Baud_Rate success.
    (1153 ms) HCI_VS_InitializeAfterHCIReset Success
    (1162 ms) BSC Initialize worked, yay: 1
    (1162 ms) Device Chipset: 4.1
    (1162 ms) Bluetooth Address: 0x0017E9D4F415
    (1266 ms) BSC Enable Feature (Assisted A2DP source) worked, yay!
    (1266 ms) GAP Set Inquiry Mode worked, yay!
    (1267 ms) GAVD Initialize worked, yay!
    (1267 ms) GAVD_Register_End_Point worked, yay!
    (1267 ms) GAVD_Register_SDP_Record worked, yay!
    (1267 ms) AVCTP Initialize worked, yay!
    (1267 ms) AVCTP Enable Browsing Channel Support worked, yay!
    (1268 ms) AVRCP Register Profile (Controller) worked, yay: 1
    (1268 ms) AVRCP Register SDP Record (Controller) worked, yay!
    (1268 ms) AVRCP Register Profile (Target) worked, yay: 2
    (1268 ms) AVRCP Register SDP Record (Target) worked, yay!
    (1270 ms) HFRE_Open_HandsFree_Server_Port worked, yay: 1
    (1271 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1272 ms) HFRE_Open_HandsFree_Server_Port worked, yay: 2
    (1273 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1274 ms) HFRE_Open_Audio_Gateway_Server_Port worked, yay: 3
    (1274 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1275 ms) HFRE_Open_Audio_Gateway_Server_Port worked, yay: 4
    (1276 ms) HFRE_Register_HandsFree_SDP_Record worked, yay!
    (1281 ms) VS Set Max Output Power worked, yay!
    (1285 ms) VS Write SCO Configuration worked, yay!
    (1289 ms) GAP Set Local Device Name worked, yay!
    (1291 ms) GAP Write Extended Inquiry Information worked, yay!
    (1292 ms) GAP Set Connectability Mode worked, yay!
    (1293 ms) GAP Set Pairability Mode worked, yay!
    (1293 ms) GAP Register Remote Authentication worked, yay!
    (1293 ms) HCI Register Event Callback worked, yay: 6
    (1293 ms) Stack initialized in 396 ticks
    (40829 ms) VS_PCM_Codec_Config worked, yay: 0
    (40829 ms) Setting assisted A2DP codec configuration with max bitpool 53
    (40830 ms) VS_A3DP_Codec_Configuration worked, yay: 0
    (40830 ms) Encoder setting 3
    // Connect to the headsets
    (43517 ms) Attempting to connect to headset 0x0001950EA9BF
    (43519 ms) GAVD_Connect worked, yay: 1
    (46412 ms) <HCI Connection Complete Event>
    (46412 ms) 	0x0001950EA9BF
    (46412 ms) 		Handle: 1
    (46412 ms) 		Encryption Disabled
    (46412 ms) 		Type ACL
    (46412 ms) 		Status: Success
    (46440 ms) <HCI Max Slots Change Event>
    (46440 ms) 	Handle 1 max slots changed to 5
    (46452 ms) <HCI Read Remote Extended Features Complete Event>
    (46452 ms) 	Connection 1 remote extended features page 1 / 1
    (46452 ms) 	3 slot packets
    (46452 ms) 		Status: Success
    (46453 ms) <GAP Authentication>
    (46454 ms) 	atLinkKeyRequest: 0x0001950EA9BF
    (46459 ms) 	Link Key is 0xA48C8A108B35732CAEE94AC73BA4B5A2 (Sena SMH10)
    (46460 ms) GAP_Authentication_Response worked, yay!
    (46486 ms) <GAP Authentication>
    (46486 ms) 	atAuthenticationStatus: 0 for 0x0001950EA9BF
    (46550 ms) <GAP Encryption Change Result>
    (46550 ms) 	BD_ADDR: 0x0001950EA9BF
    (46550 ms) 	Status: 0x00
    (46550 ms) 	Mode: Enabled
    (46550 ms) <HCI Encryption Change Event>
    (46550 ms) 	Handle 1
    (46550 ms) 	Encryption enabled: 1
    (46550 ms) 	Status: Success
    (46606 ms) <GAVD Connect Confirmation>
    (46606 ms) 	GAVD Instance 2
    (46606 ms) 	Address: 0x0001950EA9BF
    (46606 ms) 	Connected; GAVDID: 0x1
    (46606 ms) 	Requesting discovery of endpoints: 0
    (46651 ms) <GAVD Discover Confirmation>
    (46651 ms) 	GAVD Instance 2
    (46651 ms) 	Error Code 0
    (46651 ms) 	GAVDID 1
    (46651 ms) 	Number of Endpoints: 1
    (46651 ms) 		0: RSEID 1 (audio sink, available)
    (46651 ms) 		Getting capabilities of endpoint: 0
    (46681 ms) <GAVD Get Capabilities Confirmation>
    (46681 ms) 	GAVD Instance 2
    (46681 ms) 	Error Code 0
    (46681 ms) 	GAVDID 1
    (46681 ms) 	RSEID 1
    (46681 ms) 	Service 0
    (46681 ms) 		scMediaTransport
    (46681 ms) 	Service 1
    (46681 ms) 		scMediaCodec
    (46681 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (46681 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (46681 ms) 			Block Length      : 4, 8, 12, 16
    (46682 ms) 			Number Sub Bands  : 4, 8
    (46682 ms) 			Allocation Method : SNR, Loudness
    (46682 ms) 			Min/Max Bit Pool  : 2/45
    (46682 ms) 	Service 2
    (46682 ms) 		scContentProtection: 2 0
    (46682 ms) 	SetGAVDConfiguration
    (46682 ms) 		Sampling Frequency: 48KHz
    (46682 ms) 		Channel Mode      : Stereo
    (46682 ms) 		Block Length      : 16
    (46682 ms) 		Number Sub Bands  : 8
    (46682 ms) 		Allocation Method : Loudness
    (46682 ms) 		Min/Max Bit Pool  : 2/45
    (46683 ms) 	Trying to connect LSEID 3 to RSEID 1 on 0x0001950EA9BF. Function result: 3 / 0x3
    (46980 ms) <HCI Role Change Event>
    (46980 ms) 	Device: 0x0001950EA9BF
    (46980 ms) 	Status: Success
    (46980 ms) 	Current role: Slave
    (46997 ms) <HCI Max Slots Change Event>
    (46997 ms) 	Handle 1 max slots changed to 5
    (47024 ms) <GAVD Open End Point Confirmation>
    (47024 ms) 	GAVD Instance 2
    (47024 ms) 	LSEID 3
    (47024 ms) 	Opened successfully
    (47024 ms) 	Media Out MTU 895
    (47024 ms) 	Local CID 65, in MTU 1000
    (47024 ms) 	Remote CID 5633, out MTU 895
    (47026 ms) HCI_Switch_Role worked, yay: 0
    (47026 ms) 		Initializing SBC encoder using parameters:
    (47026 ms) 			Freq:         48000
    (47026 ms) 			Block Size:   16
    (47026 ms) 			Channel Mode: Stereo
    (47026 ms) 			Allocation:   Loudness
    (47026 ms) 			Subbands:     8
    (47026 ms) 			Bit Pool:     45
    (47026 ms) 		Timing Parameters:
    (47026 ms) 			MTU:                894
    (47026 ms) 			Frame Size:         102
    (47026 ms) 			Frames per Packet:  8
    (47026 ms) 			Packet Delay (MS):  21
    (47026 ms) 			Extra Time/Pkt:     333333
    (47233 ms) <HCI Role Change Event>
    (47233 ms) 	Device: 0x0001950EA9BF
    (47233 ms) 	Status: Success
    (47233 ms) 	Current role: Master
    (47234 ms) <HCI Max Slots Change Event>
    (47234 ms) 	Handle 1 max slots changed to 5
    (47852 ms) Attempting to connect to headset 0x0001950F6D84
    (47853 ms) GAVD_Connect worked, yay: 2
    (48713 ms) <AVCTP Connect Indication>
    (48713 ms) 	[0] Profile 1 Opened by 0x0001950EA9BF
    (48713 ms) <AVCTP Connect Indication>
    (48713 ms) 	[1] Profile 2 Opened by 0x0001950EA9BF
    (48873 ms) <AVCTP Message Indication>
    (48873 ms) 	[0] 0x0001950EA9BF
    (48873 ms) 	Message: Register notification command
    (48874 ms) 		Playback Status Changed
    (48874 ms) 		Playback Interval 0
    (52792 ms) <HCI Connection Complete Event>
    (52792 ms) 	0x0001950F6D84
    (52792 ms) 		Handle: 2
    (52792 ms) 		Encryption Disabled
    (52792 ms) 		Type ACL
    (52792 ms) 		Status: Success
    (52833 ms) <HCI Max Slots Change Event>
    (52833 ms) 	Handle 2 max slots changed to 5
    (52845 ms) <HCI Read Remote Extended Features Complete Event>
    (52845 ms) 	Connection 2 remote extended features page 1 / 1
    (52845 ms) 	3 slot packets
    (52845 ms) 		Status: Success
    (52846 ms) <GAP Authentication>
    (52847 ms) 	atLinkKeyRequest: 0x0001950F6D84
    (52848 ms) 	Link Key is 0xBF285D71BC3552EA917DFB464C21A6EC (Sena SMH10)
    (52849 ms) GAP_Authentication_Response worked, yay!
    (52879 ms) <GAP Authentication>
    (52879 ms) 	atAuthenticationStatus: 0 for 0x0001950F6D84
    (52939 ms) <GAP Encryption Change Result>
    (52939 ms) 	BD_ADDR: 0x0001950F6D84
    (52939 ms) 	Status: 0x00
    (52939 ms) 	Mode: Enabled
    (52939 ms) <HCI Encryption Change Event>
    (52939 ms) 	Handle 2
    (52940 ms) 	Encryption enabled: 1
    (52940 ms) 	Status: Success
    (52995 ms) <GAVD Connect Confirmation>
    (52995 ms) 	GAVD Instance 3
    (52995 ms) 	Address: 0x0001950F6D84
    (52995 ms) 	Connected; GAVDID: 0x2
    (52996 ms) 	Requesting discovery of endpoints: 0
    (53065 ms) <GAVD Discover Confirmation>
    (53065 ms) 	GAVD Instance 3
    (53065 ms) 	Error Code 0
    (53065 ms) 	GAVDID 2
    (53065 ms) 	Number of Endpoints: 1
    (53065 ms) 		0: RSEID 1 (audio sink, available)
    (53066 ms) 		Getting capabilities of endpoint: 0
    (53085 ms) <GAVD Get Capabilities Confirmation>
    (53085 ms) 	GAVD Instance 3
    (53085 ms) 	Error Code 0
    (53085 ms) 	GAVDID 2
    (53085 ms) 	RSEID 1
    (53085 ms) 	Service 0
    (53085 ms) 		scMediaTransport
    (53085 ms) 	Service 1
    (53085 ms) 		scMediaCodec
    (53085 ms) 			Sampling Frequency: 48 KHz, 44.1 KHz, 32 KHz, 16 KHz
    (53085 ms) 			Channel Mode      : Joint Stereo, Stereo, Dual Channel
    (53085 ms) 			Block Length      : 4, 8, 12, 16
    (53086 ms) 			Number Sub Bands  : 4, 8
    (53086 ms) 			Allocation Method : SNR, Loudness
    (53086 ms) 			Min/Max Bit Pool  : 2/45
    (53086 ms) 	Service 2
    (53086 ms) 		scContentProtection: 2 0
    (53086 ms) 	SetGAVDConfiguration
    (53086 ms) 		Sampling Frequency: 48KHz
    (53086 ms) 		Channel Mode      : Stereo
    (53086 ms) 		Block Length      : 16
    (53086 ms) 		Number Sub Bands  : 8
    (53086 ms) 		Allocation Method : Loudness
    (53086 ms) 		Min/Max Bit Pool  : 2/45
    (53087 ms) 	Trying to connect LSEID 4 to RSEID 1 on 0x0001950F6D84. Function result: 4 / 0x4
    (53389 ms) <HCI Role Change Event>
    (53389 ms) 	Device: 0x0001950F6D84
    (53389 ms) 	Status: Success
    (53389 ms) 	Current role: Slave
    (53406 ms) <HCI Max Slots Change Event>
    (53406 ms) 	Handle 2 max slots changed to 5
    (53433 ms) <GAVD Open End Point Confirmation>
    (53433 ms) 	GAVD Instance 3
    (53433 ms) 	LSEID 4
    (53433 ms) 	Opened successfully
    (53433 ms) 	Media Out MTU 895
    (53434 ms) 	Local CID 70, in MTU 1000
    (53434 ms) 	Remote CID 20481, out MTU 895
    (53435 ms) HCI_Switch_Role worked, yay: 0
    (53435 ms) 		Initializing SBC encoder using parameters:
    (53435 ms) 			Freq:         48000
    (53435 ms) 			Block Size:   16
    (53435 ms) 			Channel Mode: Stereo
    (53435 ms) 			Allocation:   Loudness
    (53435 ms) 			Subbands:     8
    (53435 ms) 			Bit Pool:     45
    (53435 ms) 		Timing Parameters:
    (53435 ms) 			MTU:                894
    (53435 ms) 			Frame Size:         102
    (53435 ms) 			Frames per Packet:  8
    (53435 ms) 			Packet Delay (MS):  21
    (53435 ms) 			Extra Time/Pkt:     333333
    (53640 ms) <HCI Role Change Event>
    (53640 ms) 	Device: 0x0001950F6D84
    (53640 ms) 	Status: Success
    (53640 ms) 	Current role: Master
    (53640 ms) <HCI Max Slots Change Event>
    (53640 ms) 	Handle 2 max slots changed to 5
    (55125 ms) <AVCTP Connect Indication>
    (55125 ms) 	[0] Profile 1 Opened by 0x0001950F6D84
    (55125 ms) <AVCTP Connect Indication>
    (55126 ms) 	[1] Profile 2 Opened by 0x0001950F6D84
    (55247 ms) <AVCTP Message Indication>
    (55248 ms) 	[0] 0x0001950F6D84
    (55248 ms) 	Message: Register notification command
    (55248 ms) 		Playback Status Changed
    (55248 ms) 		Playback Interval 0
    // Start streaming to the headsets
    (56838 ms) GAVD_Start_Stream_Request worked, yay: 0
    (56839 ms) GAVD_Start_Stream_Request worked, yay: 0
    (56866 ms) <GAVD Start Confirmation>
    (56866 ms) 	GAVD Instance 2
    (56866 ms) 	Error Code 0 / 0x0
    (56867 ms) VS_A3DP_Open_Stream worked, yay: 0
    (56868 ms) VS_A3DP_Start_Stream worked, yay: 0
    (56870 ms) <GAVD Start Confirmation>
    (56870 ms) 	GAVD Instance 3
    (56870 ms) 	Error Code 0 / 0x0
    (56871 ms) VS_A3DP_Open_Stream worked, yay: 0
    (56872 ms) VS_A3DP_Start_Stream worked, yay: 0
    // Start connecting to the phone
    (65926 ms) Attempting to connect to phone 0x006171CA5B8B
    (65928 ms) GAVD_Connect worked, yay: 3
    (68873 ms) <HCI Connection Complete Event>
    (68873 ms) 	0x006171CA5B8B
    (68873 ms) 		Handle: 3
    (68873 ms) 		Encryption Disabled
    (68873 ms) 		Type ACL
    (68873 ms) 		Status: Success
    (68881 ms) <HCI Max Slots Change Event>
    (68881 ms) 	Handle 3 max slots changed to 5
    (68898 ms) <HCI Read Remote Extended Features Complete Event>
    (68898 ms) 	Connection 3 remote extended features page 1 / 2
    (68898 ms) 	3 slot packets
    (68899 ms) 	5 slot packets
    (68899 ms) 	Encryption
    (68899 ms) 		Status: Success
    (68900 ms) <GAP Authentication>
    (68900 ms) 	atLinkKeyRequest: 0x006171CA5B8B
    (68902 ms) 	Link Key is 0xD8D1261E95EB80ED4EE4CBFA2860CC5A (iPhone )
    (68902 ms) GAP_Authentication_Response worked, yay!
    // Lost it - not hearing any audio in the headsets, no further events received from CC256x

  • Tried lowering UART baud rate (from 3000000 to 921600)

    Tried immediately sending suspend/stop commands as soon as the issue occurred. Blocked 5 seconds and returned -57 / device HCI error

    (112524 ms) VS_A3DP_Stop_Stream failed: -57 / 0xffffffc7
    (112524 ms) GAVD_Suspend_Stream_Request worked, yay: 0
    (117524 ms) VS_A3DP_Stop_Stream failed: -57 / 0xffffffc7
    (117524 ms) GAVD_Suspend_Stream_Request worked, yay: 0
    (118524 ms) <GAVD Suspend Confirmation>
    (118524 ms) GAVD Instance 2
    (118524 ms) LSEID 3
    (118524 ms) First Failing LSEID 3
    (118524 ms) Error Code 255 / 0xff
    (123524 ms) <GAVD Suspend Confirmation>
    (123524 ms) GAVD Instance 3
    (123524 ms) LSEID 4
    (123524 ms) First Failing LSEID 3
    (123524 ms) Error Code 0 / 0x0
    (305762 ms) HCI_Read_Transmit_Power_Level failed: -14 / 0xfffffff2
    (310762 ms) HCI_Read_Transmit_Power_Level failed: -14 / 0xfffffff2

    last but not least edit to recap:

    When streaming to two headsets and something else happens (one headset disconnects, or I connect to a phone, or I receive an HFP notification from an already connected phone), the CC256x locks up and stops streaming and stops responding to commands sent over the UART (or at least, responds very, very slowly)

    This happens when streaming to two sinks. I don't encounter it when only streaming to one.

  • Hi,

    I think it maybe related to one of the below. as you are using GAVD directly.

    • I hope you already know as per the bluetopia stack, You can run all the Bluetooth operations in a single thread but multiple threads cannot make Bluetooth calls. make sure you are processing only one operation at a time.
    • are all the initialization taken care properly?
    • are you handling all the events ( connection request, disconnection request, AVRCP commands...) in the application callback you have registered?

    I still think it is better to use AUDAPI's instead of using the GAVD directly. also AUDAPI's are documented well in AudioProfileSubsystemAPI.pdf (as part of the SDK documentation folder)

  • Sundeep and team,

    Thanks for the reply

    1. I have two threads in the system which may call Bluetopia (normally only one, but when I am manually sending commands, it comes from a different thread).

      I am wrapping a mutex around all calls to Bluetopia so that only one thread can access it at a time

      1. If the main thread is making a Bluetopia function call as a result of one of my manual commands, the Bluetooth thread has to wait until the call has returned and the caller has released the mutex before it can run the main state machine (which includes BTPS_ProcessScheduler and the callbacks)
      2. Conversely, if the Bluetooth thread is running the main state machine, the main thread has to wait before making any Bluetopia function calls.

      Is this sufficient, or do I need to force it to always only call from a single thread (buffer a command in the other thread then yield to have the work performed in the Bluetooth thread)?

    2. As far as I know based on the wiki page, I am doing all initialization steps as described: http://tiprocessors.com/index.php/CC256x_Advanced_Voice_and_Audio_Features#Enabling_and_Disabling_A3DP

      (using VS_A3DP_Open_Stream rather than VS_A3DP_Sink_Open_Stream, etc.)

    3. I am handling all GAP, GAVD, HFRE, SDP, and AVCTP events, and most HCI events (ignoring packets completed event and a couple of others that are already handled by GAP). I am currently allowing all connections automatically (I do not have to send a connect accept).

    What is 0xFD77 / "Set LE Test Mode Parameters" supposed to do with regard to assisted A2DP? This command does not exist in the BTVS.c that I have nor in the sample projects, so I'm not sure whether this is required. I am not using LE.

    I will look into switching to AUDAPI

  • Hi,

    1. It looks fine to me. I hope you are handling it in application.

    NOTE : BSC_LockBluetoothStack() should not be used from the application as menctioned in the "BluetopiaCoreAPI.pdf" document. usually the AUD layer takes care of this part.

    2. you can see the difference between this commands here http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands

    3. 0xFD77 is no were related. It was mistake. I have removed it from my previous post.