Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Studio Bluetooth

MaVo_3395126
Level 1
10 sign-ins 5 sign-ins First reply posted
Level 1

I am using a CYW20706 based module (CYBT-343026).  I am using the modus toolbox example Audio_Sink for the CYW920706WCDEVAL platform.  The only changes I've made are to the wiced_platform.h to update the pinout for my PCB.

The problem is I get a periodic click when streaming from ios.  I do not see the issue with android.  The period of the click changes on each bluetooth connection, but stays the same while connected.  Somewhere between 1 and 2 sec.  Some connections do not click at all.

I highlighted in white the click while playing a 20Hz tone using a freq generator app.  The second pic is a zoomed in shot.

MaVo_3395126_0-1642872009268.png

MaVo_3395126_1-1642872116799.png

 

I then captured the i2s data using a logic analyzer and decoded it to see if it was in my audio circuit or in the data.  After decoding I do see the same shapes in the i2s output from the module.

MaVo_3395126_2-1642872232598.png

 

I have verified both android and ios are negotiating the same 44.1kHz, max bitrate=53, joint stereo connections.  I'm not sure what to do from here. 

What settings can I make to fix this?

Thanks,

Mark

 

0 Likes
1 Solution
CoreyW_81
Employee
50 replies posted 25 replies posted 25 sign-ins
Employee

Put the line: 

    BTM_SetAfhChannelAssessment(WICED_FALSE);

In this callback case:

switch( event )
{
/* Bluetooth stack enabled */
case BTM_ENABLED_EVT:

 

See if that works, it works for me.  I also have attempted to force a role switch so that the 20706 is not the HCI master but I'm not sure that is necessary.

View solution in original post

0 Likes
7 Replies
Owen_Zhang123
Moderator
Moderator 500 solutions authored 250 sign-ins 1000 replies posted
Moderator

Please try to add the following code during the initial process:

BTM_SetAfhChannelAssessment(WICED_FALSE);

0 Likes
MaVo_3395126
Level 1
10 sign-ins 5 sign-ins First reply posted
Level 1

The click is still there.  Here is where I put the function call.  Is this correct?

 

/*
 *  Application Start, ie, entry point to the application.
 */
APPLICATION_START()
{
#if defined WICED_BT_TRACE_ENABLE || defined HCI_TRACE_OVER_TRANSPORT
    wiced_transport_init( &transport_cfg );

    // Set the debug uart as WICED_ROUTE_DEBUG_NONE to get rid of prints
    // wiced_set_debug_uart(WICED_ROUTE_DEBUG_NONE);

    // Set to PUART to see traces on peripheral uart(puart)
#ifdef NO_PUART_SUPPORT
#if defined(CYW43012C0)
    wiced_debug_uart = WICED_ROUTE_DEBUG_TO_DBG_UART;
    debug_uart_enable(3000000);
#else // CYW43012C0
    wiced_set_debug_uart(WICED_ROUTE_DEBUG_TO_WICED_UART);
#endif // CYW43012C0
#else
    wiced_set_debug_uart( WICED_ROUTE_DEBUG_TO_PUART );
#if ( defined(CYW20706A2) || defined(CYW20735B0) || defined(CYW20719B0))
    wiced_hal_puart_select_uart_pads( WICED_PUART_RXD, WICED_PUART_TXD, 0, 0);
#endif /* defined(CYW20706A2) || defined(CYW20735B0) || defined(CYW20719B0) */
#endif /* NO_PUART_SUPPORT */
    // Set to HCI to see traces on HCI uart - default if no call to wiced_set_debug_uart()
    // wiced_set_debug_uart( WICED_ROUTE_DEBUG_TO_HCI_UART );

    // Use WICED_ROUTE_DEBUG_TO_WICED_UART to send formatted debug strings over the WICED
    // HCI debug interface to be parsed by ClientControl/BtSpy.
    // wiced_set_debug_uart(WICED_ROUTE_DEBUG_TO_WICED_UART);
#endif /* WICED_BT_TRACE_ENABLE */

    WICED_BT_TRACE( "A2DP SINK APP START\n" );

#ifdef CYW20721B2
    /* Disable secure connection because connection will drop when connecting with Win10 first time */
    wiced_bt_dev_lrac_disable_secure_connection();
#endif

#if BTSTACK_VER >= 0x03000001
    /* Create default heap */
    p_default_heap = wiced_bt_create_heap("default_heap", NULL, BT_STACK_HEAP_SIZE, NULL,
            WICED_TRUE);
    if (p_default_heap == NULL)
    {
        WICED_BT_TRACE("create default heap error: size %d\n", BT_STACK_HEAP_SIZE);
        return;
    }
#endif

#if BTSTACK_VER >= 0x03000001
    /* Register the dynamic configurations */
    wiced_bt_stack_init( a2dp_sink_management_callback , &a2dp_sink_cfg_settings);
#else
    /* Register the dynamic configurations */
    wiced_bt_stack_init( a2dp_sink_management_callback , &a2dp_sink_cfg_settings, a2dp_sink_cfg_buf_pools);
#endif

    /* Configure Audio buffer */
    wiced_audio_buffer_initialize (a2dp_sink_audio_buf_config);

    BTM_SetAfhChannelAssessment(WICED_FALSE);

#if BTSTACK_VER >= 0x03000001
    WICED_BT_TRACE ("Device Class: 0x%02x%02x%02x\n",
            a2dp_sink_cfg_settings.p_br_cfg->device_class[0],
            a2dp_sink_cfg_settings.p_br_cfg->device_class[1],
            a2dp_sink_cfg_settings.p_br_cfg->device_class[2]);
#else
    WICED_BT_TRACE( "Device Class: 0x%02x%02x%02x\n",a2dp_sink_cfg_settings.device_class[0],a2dp_sink_cfg_settings.device_class[1],a2dp_sink_cfg_settings.device_class[2]);
#endif
}

 

0 Likes
Owen_Zhang123
Moderator
Moderator 500 solutions authored 250 sign-ins 1000 replies posted
Moderator

Per our test before, the A2DP audio click is only happen on Android devices. The iOS device should have no problem. But it is opposite per your test.

Could you test the problem on the WICED Studio SDK 6.2.1 to see if the iOS still has the problem? Then we can verify if it is the same problem we have before.

https://www.infineon.com/cms/en/design-support/tools/tools-archive/wiced-studio-archive/

You need to replace some platform files for the Module in the WICED. Please refer the following KBA:

https://community.infineon.com/t5/Knowledge-Base-Articles/Platform-Files-for-CYBT-343026-EVAL-KBA221...

0 Likes
MaVo_3395126
Level 1
10 sign-ins 5 sign-ins First reply posted
Level 1

I have the same result, ios click, android ok with wiced 6.2.

0 Likes
Owen_Zhang123
Moderator
Moderator 500 solutions authored 250 sign-ins 1000 replies posted
Moderator

Could you try the Headset demo which also act as A2DP sink role?

0 Likes
MaVo_3395126
Level 1
10 sign-ins 5 sign-ins First reply posted
Level 1

Same result with audio-headset demo in both wiced 6.2 and MTB

0 Likes
CoreyW_81
Employee
50 replies posted 25 replies posted 25 sign-ins
Employee

Put the line: 

    BTM_SetAfhChannelAssessment(WICED_FALSE);

In this callback case:

switch( event )
{
/* Bluetooth stack enabled */
case BTM_ENABLED_EVT:

 

See if that works, it works for me.  I also have attempted to force a role switch so that the 20706 is not the HCI master but I'm not sure that is necessary.

0 Likes