10 Replies Latest reply on May 28, 2018 7:21 AM by LuGi_2890336

    CYBT 343026 with A2DP and BLE


      I have to develop an application with Bluetooth connection with A2DP profile for audio streaming and some BLE services and characteristics for data exchange. The audio streaming should get out in I2S peripheral.


      I'm using CYBT-343026-EVAL, I downloaded WICED Studio and the platform files for this evaluation board (https://community.cypress.com/docs/DOC-13750).


      I created a new project with WICED Bluetooth Designer, I activated A2DP profile, created BLE services and characteristics and generated the code. I removed from this one the unnecessary code and added the functions (copied from "headset" example) "headset_a2dp_init" and  "a2dp_sink_control_cback". In this last function I added:

      • "wiced_bt_a2dp_sink_update_route_config" function for configure the codec (in WICED_BT_A2DP_SINK_CODEC_CONFIG_EVT event)
      • "wiced_bt_a2dp_sink_send_start_response" for response start event (in WICED_BT_A2DP_SINK_START_IND_EVT event)


      All seems ok: I can see the services, characteristics and I can connect with my smartphone to device and see it like a multimedia device for streaming audio. The problem is that when I try to start streaming (with generic app-player) it starts and I can see the signal in I2S pins but, after few seconds, it stops and I'm not never able to starts it again; only way to starts it again it's to reset the device.


      What could be the problem?


      I tried also to start from headset example but it's not so easy to edited this one. I can try also this solution but I need more support.


      There are some documents that explain how to use the libraries and how to use it for create my custom application (with profiles, codecs, services, characteristics, ...)?

        • 1. Re: CYBT 343026 with A2DP and BLE

          It is very difficult to identify the issue from your description. Have you tried the a2dp sink example? First, try this snip and make sure that there are no issues with the connection.

          • 2. Re: CYBT 343026 with A2DP and BLE

            I tried with headset example (apps/demo/headset) and all works fine but, as written in my post, is very difficult modify this example and adapt it to my needs.


            There are some documents that explain the differents parts of examples and how to modify it? For instance, if I adopt the a2dp_sink example and I want to add BLE services and characteristics, how and what I should modify of a2dp_sink snip? Or some guides about libraries?

            • 3. Re: CYBT 343026 with A2DP and BLE

              Now I have tried to program the evaluation with a2dp_sink snip (without modifies) and a similar problem occurred: when I start the music from multimedia device (smartphone or tablet) all works fine and I can see the signal in I2S but if I stop the music the I2S clock continue; now if I try to play the music again, I do not see signal in I2S data, the device is connect but if I try to stop and play again, the device disconnect from cybt-343026 module.



              I don't know if could be related: this morning when I have tried to program the module, I have had some problems and the software show me this message:


              Downloading application...

              ********* Download Failure *************


              | Follow below suggestions and retry. |

              |   1. Verify USB-UART driver is correctly installed |

              |   2. Verify SW4 switches are in ON position (CTS, RTS, RXD, TXD) |

              |   3. Power cycle CYBT-343026-EVAL and retry. |

              | |

              | If this problem persists, the serial flash on the board may be corrupted. |

              | Follow below steps to reset CYBT-343026-EVAL board to factory default state.                |

              | Note: This will erase any user applicaiton in the memory and reset the board to dafulat state |

              |   1. Press and hold RECOVER button (SW2) |

              |   2. Press and hold RESET button (SW1) for 1 second |

              |   3. Release SW1 |

              |   4. Release SW2 |

              |   5. Re-program the board |


              Download failed. This WICED platform of the SDK only supports download to 20706A2 device.


              I have tried to do the operations but only after several trials and with J8 in 2-1 position and J9 and J10 off, I was able to program the module (even if the programmation is very slow). What could be the problem?

              All this seems very strange to me.

              • 4. Re: CYBT 343026 with A2DP and BLE

                Have you connected a codec or any I2S device? Or are you just monitoring the signal?


                With the A2DP example, can you share the logs? Are you receiving the WICED_BT_A2DP_SINK_SUSPEND_EVT event?


                Also can you try by UN-defining the AUDIO_MUTE_UNMUTE_ON_INTERRUPT. The GPIO button (P00) on CYBT-343026 is on the same pad as I2S_WS. That might be causing some issues.

                1 of 1 people found this helpful
                • 5. Re: CYBT 343026 with A2DP and BLE

                  Yes, I have monitored I2S signal and, after few seconds I have started streaming, the OUT signal stops and I'm not never able to starts it again, whereas the clock continue.


                  In this moment I'm not able to debug device because I'm waiting a new board, the previous one broke. As soon as possible I'll share debug results and log file.


                  I have verified and in my application isn't defined AUDIO_MUTE_UNMUTE_ON_INTERRUPT.

                  • 6. Re: CYBT 343026 with A2DP and BLE


                    Ok, now I have a new board and I have mix the code generated with WICED Bluetooth Device for BLE, headset example, a2dp snip and make some modifies.

                    Now I m able to stream audio and see the BLE services and characteristics but not in the same time: if I connect my device and play audio (streaming) and I open an application (for example nRF Connect by Nordic) for discover BLE services and characteristics, I dont see the device.

                    This behawior is the same if I'm streaming with a device and try to discover BLE attributes with another device.


                    In wiced_bt_cfg_settings_t struct the max_simultaneous_links is 4.


                    Is it right or I need a spcific application for audio streaming and BLE attributes discovering?


                    UPDATE: sometime I'm able connect and discover BLE attributes with a device while another device is streaming audio but, after any seconds, the module disconnects, loks and it's necessary one reset. I have the feeling my code-mix is not stable.

                    • 7. Re: CYBT 343026 with A2DP and BLE

                      If you are not streaming, then are you able to connect (BLE) and discover the services and characteristics?

                      Ideally it should have worked fine.


                      Just try one thing. Send a connection parameter update request upon connection. Increase the connection interval to maybe 100 or even 200ms and the supervision timeout to a second or 2.

                      • 8. Re: CYBT 343026 with A2DP and BLE

                        Sorry for delay! Yes, if I'm not streaming, I'm able to discover services and characteristics and write and read these.


                        With connection interval to 200ms and the supervision timeout to 2000ms I can streming and dicovering services and characteristics, thank you!


                        Now I have other problems:

                        1. every time I reset device the mac address is different. If I remember correctly this is a special function but I'm not able to find and disable it.
                        2. the PUART RX pin has an offset about 1,2 V (all SW5 is off). What could be the problem? I tried also to set GPIO and PULL-UP but nothing change.
                        3. when I disconnect the module from my device, it's impossible to reconnect again. I solved this only when I connect and disconnect module for discovering services and characteristics (calling wiced_bt_start_advertisements function in hci_control_le_conn_status_callback when module is disconnects) but not when I connect and disconnect module for streaming. Is it a know issue?
                        • 9. Re: CYBT 343026 with A2DP and BLE
                          2 of 2 people found this helpful
                          • 10. Re: CYBT 343026 with A2DP and BLE

                            Thank you! I have already replied in the new thread.