BlueCore ® ADK Peer Device Support User Guide Issue 3 © Cambridge Silicon Radio Limited 2014 Page 1 of 36 CS-316086-UGP3 www.csr.com Document History Revision Date History 1 12 JUN 14 Original publication of this document 2 15 JUN 14 Minor corrections 3 25 JUN 14 Minor editorial corrections Contacts www.csr.com [email protected] www.csrsupport.com [email protected] [email protected] Trademarks, Patents and Licences Unless otherwise stated, words and logos marked with ™ or ® are trademarks registered or owned by CSR plc and/or its affiliates. Bluetooth® and the Bluetooth logos are trademarks owned by Bluetooth SIG, Inc. and licensed to CSR. Other products, services and names used in this document may have been trademarked by their respective owners. The publication of this information does not imply that any licence is granted under any patent or other rights owned by CSR plc or its affiliates. CSR reserves the right to make technical changes to its products as part of its development programme. While every care has been taken to ensure the accuracy of the contents of this document, CSR cannot accept responsibility for any errors. Life Support Policy and Use in Safety-critical Compliance CSR’s products are not authorised for use in life-support or safety-critical applications. Use in such applications is done at the sole discretion of the customer. CSR will not warrant the use of its devices in such applications. Performance and Conformance Refer to www.csrsupport.com for compliance and conformance to standards information. © Cambridge Silicon Radio Limited 2014 Page 2 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide General information Information on this product Customer support for this product More detail on compliance and standards Help with this document Contents Tables, Figures and Equations Table 1.1: PS Keys to Read Using PSTool ................................................................................................................... 5 Table 3.1: DSP Application Build Configurations ........................................................................................................ 10 Table 4.1: TWS Source Selection Modes ................................................................................................................... 20 Table 4.2: ShareMe Pairing Modes ............................................................................................................................ 23 © Cambridge Silicon Radio Limited 2014 Page 3 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Document History ......................................................................................................................................................... 2 Contacts........................................................................................................................................................................ 2 Trademarks, Patents and Licences .............................................................................................................................. 2 Life Support Policy and Use in Safety-critical Compliance............................................................................................ 2 Performance and Conformance .................................................................................................................................... 2 Contents ....................................................................................................................................................................... 3 Tables, Figures and Equations ..................................................................................................................................... 3 1. Introduction ........................................................................................................................................................ 5 1.1. Hardware ........................................................................................................................................................ 5 1.2. Getting Started ............................................................................................................................................... 6 1.3. Making a Bluetooth Connection with Another Device ..................................................................................... 6 2. Peer Device Support .......................................................................................................................................... 7 2.1. ShareMe ......................................................................................................................................................... 7 2.2. True Wireless Stereo (TWS)........................................................................................................................... 7 3. Building the Software in xIDE ............................................................................................................................. 9 3.1. Supported Development Boards..................................................................................................................... 9 3.2. Libraries Used by the Sink Application ........................................................................................................... 9 3.3. To Enable Peer Device Support ..................................................................................................................... 9 3.4. To Enable Peer Device Support in the DSP Decoder................................................................................... 11 3.5. To Enable Extra A2DP Codecs .................................................................................................................... 12 3.6. To Enable Peer Device Support in the VM Sink Application ......................................................................... 17 3.7. To Enable Debug Output for Peer Device .................................................................................................... 18 4. Peer Device Configuration ............................................................................................................................... 19 4.1. General Information ...................................................................................................................................... 19 4.2. Peer Device Support .................................................................................................................................... 20 4.3. Custom Peer Device Service UUID .............................................................................................................. 22 4.4. ShareMe ....................................................................................................................................................... 23 4.5. True Wireless Stereo .................................................................................................................................... 24 4.6. Audio Routing ............................................................................................................................................... 26 4.7. Device Trim .................................................................................................................................................. 28 5. Operation of True Wireless Stereo ................................................................................................................... 31 5.1. Pairing Devices............................................................................................................................................. 31 5.2. Audio Relay Operation ................................................................................................................................. 31 5.3. Ending a TWS Session ................................................................................................................................. 31 5.4. Multiple AGs ................................................................................................................................................. 31 5.5. Codecs ......................................................................................................................................................... 32 5.6. Voice Prompts .............................................................................................................................................. 32 5.7. GAIA ............................................................................................................................................................. 32 Appendix A PTS Qualification ................................................................................................................................... 33 Document References ................................................................................................................................................ 35 Terms and Definitions ................................................................................................................................................. 36 Table 5.3: Default peer session initiation events button mapping ............................................................................... 31 Table 5.4: Configuration for Peer Session End ........................................................................................................... 31 Table A.1: PS Key Settings for Operation Against PTS .............................................................................................. 33 © Cambridge Silicon Radio Limited 2014 Page 4 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Figure 3.1: Default VM Application Compiler Switches for Headset 8670 Release Configuration ................................ 9 Figure 3.2: Project Properties for SBC Decoder DSP Application .............................................................................. 11 Figure 3.3: Complementary VM Project Properties Required for TWS_WIRED_MODE Support ............................... 11 Figure 3.4: Extra Codec Package Installation ............................................................................................................. 12 Figure 3.5: Inserting a New Decoder Application Project into Workspace .................................................................. 13 Figure 3.6: Adding TWS Support for the Apt-X DSP Decoder Application .................................................................. 14 Figure 3.7: Default sink.mak Configuration ................................................................................................................. 15 Figure 3.8: Modified sink.mak File .............................................................................................................................. 15 Figure 3.9: Project Properties to Enable Extra Codec Support ................................................................................... 16 Figure3.10: Peer Device Support Project Property ..................................................................................................... 17 Figure 4.1: Sink Configuration Tool Peer Device Support Settings ............................................................................. 20 Figure 5.2: Analogue input PIO Always Detect ........................................................................................................... 21 Figure 4.3: Sink Configuration Tool Custom Peer Device Service UUID Settings ...................................................... 22 Figure 4.4: Sink Configuration Tool ShareMe Settings ............................................................................................... 23 Figure 4.5: Sink Configuration Tool TWS Settings ...................................................................................................... 24 Figure 5.6: Single Device Operation Enabled ............................................................................................................. 25 Figure 5.7: Single Device Operation Disabled ............................................................................................................ 25 Figure 4.8: Sink Configuration Tool Audio Routing Settings ....................................................................................... 26 Figure 5.9: Audio Routing Settings Sent from Master to Slave: AG1 Playing Audio ................................................... 27 Figure 5.10: Audio Routing Settings After Role Switch: AG2 Playing Audio ............................................................... 28 Figure 4.11: Sink Configuration Tool Device Trim Settings ......................................................................................... 29 1. Introduction This document describes how to configure and use the Peer Device Support provided by the Audio Sink application included in the ADK. The Sink Application runs on CSR8670 IC. This document should be used in conjunction with the ADK Configuration Tool User Guide and ADK Sink Application Configuration documents. The Audio Sink application provides a basis for developing Bluetooth enabled: Headsets Soundbars Speakers Peer Device Support (TrueWireless and ShareMe) The application runs as a Bluetooth Audio Sink that supports: HSP v1.1 HFP v1.6 A2DP v1.3 AVRCP v1.5 MAP v1.0 PBAP v1.0 Additionally it supports: Bluetooth Smart Battery Level Service CSR GAIA. 1.1. Hardware The Peer Device functionality is provided by the Audio Sink application in the ADK. The application is described running on the CSR Bluetooth Headset example design board CNS10001v4 (CSR8670). 1.1.1. Backing Up the Development Board Before flashing the application onto the hardware CSR recommends clearing all the PS Keys from the development board. This places the board into a known good state. All tools are available in the <ADK>\tools\bin sub directory. Alternatively, tools with a GUI (e.g. PSTool, BlueFlash) can be accessed from the Windows Start menu under ADK\Tools. Note: Read the values in the PS Keys listed in Table 1.1 using PSTool and record the values so that they can be restored later. CSR8670 PSKEY_BDADDR PSKEY_ANA_TRIM_OFFSET PSKEY_CHARGER_CURRENT Table 1.1: PS Keys to Read Using PSTool To clear the board’s PS Keys using BlueFlash: 1. Click Stop Processor and select Flash Erase. 2. Check the Erase Persistent Store box and then select OK. 3. Exit BlueFlash. The application is ready to be flashed from the xIDE development environment on to the development board. © Cambridge Silicon Radio Limited 2014 Page 5 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide 1.2. Getting Started 1.2.1. Flash the Sink Application on to Suitable Hardware To flash the Sink application onto the hardware: Connect the interface board to the development board and attach the SPI interface and USB charger. 2. Attach suitable headphones and microphone to the sockets on the development board. 3. Open the xIDE development environment from the ADK program folder. 4. Select Open Workspace from the Project menu and select the sink application from the apps subdirectory. 5. By default the application is setup to run on CSR8670 hardware, to change hardware or audio mode, see section 3. 6. Make sure the Transport is set correctly. Choose Debug >Transport and select the required Debug Transport. 7. Use PSTool to merge the relevant PS Keys onto the device, for basic operation: For CNS10001v4 development board use the files sink_system_csr8670.psr and sink_config_10001v4_stereo.psr. 8. Select Run (F5) from the Debug menu. 9. The application is running on the hardware. Note: The Sink application can also run independently on the xIDE environment by selecting Stop Debugging from the Debug menu when the application is running and then resetting the hardware. 1.3. Making a Bluetooth Connection with Another Device To make a Bluetooth connection with another device: 1. Pair and Connect the Sink Application to an AG device: 1.1. Turn on the Sink device by pressing and holding the VREG_EN button, if it has not been paired before it automatically enters pairing mode and is connectable and discoverable. 1.2. Discover the Sink device with the AG and initiate pairing. If a pin code is requested enter 0000. Note: This may not be required if the AG supports Simple Secure Pairing. 1.3. 2. The Sink device is now paired with the AG. Clear the Sink Paired Device List. Note: In some cases, it is necessary to clear the PDL for successful connection or reconnection. This can be configured to a button press using the Sink Configuration Tool. © Cambridge Silicon Radio Limited 2014 Page 6 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide 1. 2. Peer Device Support The ADK has a feature that allows two ADK based devices to connect to each other and relay A2DP based audio. The two connected ADK devices are known as Peer devices and connect in a Peer session, for the duration of the connection. The Peer device initiating a Peer session establishes both an A2DP Signalling channel and an AVRCP Control channel to the other Peer device. A Peer device acts as both an A2DP Source and Sink. It operates as an A2DP Source to relay audio received from another input source. It acts as an A2DP Sink to render audio received from another Peer or input source. The A2DP codecs supported, for audio relay between two Peer devices, are: SBC MP3 AAC, see section3.3.2 Apt-X Note: The low latency FastStream and Apt-X-LL codecs are not supported. A Peer device acts as an AVRCP Controller and Target for both Category 1 and Category 2 commands. A Peer device relaying audio to another Peer behaves as a Category 1 Target to allow the other Peer to control the stream state between the two Peers. A Peer device receiving relayed audio behaves as a Category 1 Controller, as per normal ADK operation. Both Peers also operate as Category 2 devices to allow volume to be adjusted. SCO based audio connections are not supported between Peer devices, so it is not possible to relay HFP call audio between Peer devices. The ADK provides two modes of Peer Device Support: 1. ShareMe 2. True Wireless Stereo (TWS) 2.1. ShareMe This mode of Peer device operation allows audio received from an A2DP Source to be relayed to another Peer device that also supports ShareMe mode. The same audio is rendered by both devices but rendering is not synchronised between the two Peer devices. The audio input source, when operating in Audio Sharing mode, is restricted to A2DP based sources e.g. a mobile phone. 2.2. True Wireless Stereo (TWS) This mode of Peer Device operation allows audio received from an A2DP, USB or Wired Source to be relayed to another Peer Device that supports TWS mode. The same audio is rendered by both devices and is synchronised between the two Peer devices. When operating in TWS mode the audio input source can be one of the following: Mobile phone USB audio Analogue wired audio. Note: SPDIF and FM input sources are not supported. © Cambridge Silicon Radio Limited 2014 Page 7 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide When operating in TWS mode, vendor specific AVRCP commands are used to assist operation for relaying current user EQ settings etc. Features include: Tightly synchronised audio playback Synchronised volume control Device specific trim gain when operating as a TWS device Flexible audio routing TWS is designed to ensure tight audio playback synchronisation between two peer devices. It does this using timestamps embedded in the relayed audio data, and a combination of synchronisation delays and rate matching to ensure synchronous playback. © Cambridge Silicon Radio Limited 2014 Page 8 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide In addition to synchronised audio playback, TWS provides synchronised volume control on the two peer devices, taking advantage of the digital volume control framework in Music Manager to allow greater control of the timing of volume changes. 3. Building the Software in xIDE Different VM application builds can be made by adding the appropriate compiler switches in the Define symbols field of the Project Properties. Figure 3.1 shows the define symbols used by the default VM application for the Headset-8670-Release configuration. Note: See ADK Audio Sink Application User Guide for guidelines on how to use the different compiler switches in the ADK Sink application. 3.1. Supported Development Boards The Sink application project currently supports the CNS10001v4 (CSR8670) development platform. 3.2. Libraries Used by the Sink Application The libraries used by the sink application are specified in the sink Project Properties. Some libraries have different build variants to enable a different configuration or to exclude unused code to save flash space, see the ADK Audio Sink Application User Guide. 3.3. To Enable Peer Device Support Support for Peer Device functionality needs to be enabled in the VM Sink application project settings as well as the appropriate DSP Decoder applications, see sections 3.3.1 and 3.3.2 . 3.3.1. VM In the VM Sink application project settings, select the Peer Device operation mode supported from the Peer Device Support dropdown. The options available are: Disabled Audio Sharing True Wireless These are used to enable/disable support in the VM application as required and are described in more detail in section 3.6. © Cambridge Silicon Radio Limited 2014 Page 9 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Figure 3.1: Default VM Application Compiler Switches for Headset 8670 Release Configuration 3.3.2. DSP Each DSP Decoder application used by a device must have the appropriate level of Peer Device Support enabled. The VM application assumes that any of the DSP applications used for rendering audio during a Peer session have the correct level of support enabled, see sections 3.4 and 3.5. The SBC, MP3 and Apt-X DSP Decoder applications support: ShareMe ShareMe and TWS The AAC DSP Decoder application supports TWS functionality. Note: The SBC Decoder also supports USB and Analogue wired input sources. Table 3.1 describes the options available for enabling/disabling the four DSP Decoder applications. Configuration Description Debug No Peer Device support Release No Peer Device support ShareMe ShareMe supported only (not supported by AAC Decoder) TWS Both ShareMe and TWS supported TWS_WIRED_MODE ShareMe and TWS with additional USB and Analogue wired input support (only supported by SBC Decoder) Table 3.1: DSP Application Build Configurations © Cambridge Silicon Radio Limited 2014 Page 10 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide AAC is not natively supported by the ShareMe feature. Instead the VM application closes any AAC stream and re-opens it using one of the other available codecs to relay audio. 3.4. To Enable Peer Device Support in the DSP Decoder By default the ADK is configured to use SBC for all AD2P audio connections. To add True Wireless Stereo feature into the SBC DSP application: 1. Right-click on DSP application for SBC, select Project Properties, then modify configuration settings from the drop down menu either for TWS, TWS_WIRED_MODE or ShareMe and click OK: Note: For TWS_WIRED_MODE support, additional configuration is required to enable different wired audio sources, see Figure 3.3. Figure 3.3: Complementary VM Project Properties Required for TWS_WIRED_MODE Support © Cambridge Silicon Radio Limited 2014 Page 11 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Figure 3.2: Project Properties for SBC Decoder DSP Application 3.5. To Enable Extra A2DP Codecs Optionally, alongside SBC, the Sink application can be configured to use: MP3, AAC Apt-X decoders To enable Apt-X codec support: 1. Install the relevant add-on package into the same directory as the ADK installation, see Figure 3.4: BlueCore ADK Peer Device Support User Guide Figure 3.4: Extra Codec Package Installation 2. Add the decoder application into the project workspace. To do this: Select Project->Insert project into workspace from the toolbar, see Figure 3.5. Additional codec applications should be added into the project one by one. © Cambridge Silicon Radio Limited 2014 Page 12 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Figure 3.5: Inserting a New Decoder Application Project into Workspace 3. Enable support for True Wireless Stereo in the DSP application, see Figure 3.6. 3.1. Right-click on the DSP application in xIDE 3.2. Click on Project Properties 3.3. Select the appropriate TWS configuration option from drop down control 3.4. Click OK © Cambridge Silicon Radio Limited 2014 Page 13 of 36 CS-316086-UGP3 www.csr.com 4. Edit the sink.mak file in the VM application to ensure that the relevant .kap file is copied into the Sink image directory. Note: The make file commands for extra codecs in the sink.mak file are commented out by default. If the .kap file is not in the sink image directory, the code crashes when attempting to load the DSP decoder. See Figure 3.7 and Figure 3.8. © Cambridge Silicon Radio Limited 2014 Page 14 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Figure 3.6: Adding TWS Support for the Apt-X DSP Decoder Application BlueCore ADK Peer Device Support User Guide Figure 3.7: Default sink.mak Configuration Figure 3.8: Modified sink.mak File © Cambridge Silicon Radio Limited 2014 Page 15 of 36 CS-316086-UGP3 www.csr.com 5. Enable the compiler switch for Extra Codec in VM application in Project Properties:, see Figure 3.9. BlueCore ADK Peer Device Support User Guide Figure 3.9: Project Properties to Enable Extra Codec Support 6. Run the project (F5), the new decoder is built and installed in the image. © Cambridge Silicon Radio Limited 2014 Page 16 of 36 CS-316086-UGP3 www.csr.com 3.6. To Enable Peer Device Support in the VM Sink Application Support for this feature is enabled by defining the compile time switch ENABLE_PEER. To enable this compile time switch, Project Properties must be modified: 1. Select Project->Properties->Build System From menu bar. 3. Set Peer Device Support property to True Wireless , see Figure3.10. BlueCore ADK Peer Device Support User Guide Figure3.10: Peer Device Support Project Property 4. Click OK. TWS is enabled: © Cambridge Silicon Radio Limited 2014 Page 17 of 36 CS-316086-UGP3 www.csr.com 3.7. To Enable Debug Output for Peer Device Enable and Disable macro definitions for debug output support are managed in sink_debug.h. By default, xDEBUG_PRINT_ENABLED is disabled in the file. Changing this to DEBUG_PRINT_ENABLED turns on debug output support for all individual software components in the Sink application. For Peer Device software debug output to be enabled in xIDE during runtime, DEBUG_PEERx should be changed to DEBUG_PEER. In addition, changing DEBUG_PEER_SMx to DEBUG_PEER_SM outputs changes in TWS system states during debugging. Note: If the debug is enabled in the application or libraries, the application does not run without a debugger attached. BlueCore ADK Peer Device Support User Guide © Cambridge Silicon Radio Limited 2014 Page 18 of 36 CS-316086-UGP3 www.csr.com 4. Peer Device Configuration Sections 4.1 to 4.7 describe the Peer Device configuration. 4.1. General Information This section describes the general settings to features supported by Peer Device operation Note Sections 4.2 to 4.5 describe the PS Key configuration settings available to ShareMe and True Wireless Stereo devices. 4.1.1. Multipoint However, when in a Peer session only one other device, for example an AG, may be connected. By default, multipoint mode is enabled by generating a Short button press of VREG and PIO13. Note: This can be changed using the Sink Configuration Tool. 4.1.2. Device Filtering When a Peer session is initiated, a two stage filtering process is used to determine if a device is a suitable d for connection. Both stages of filtering are optional, they are. Device ID: If selected as a device filter, the first three records of a remote Peer’s Device ID i.e. the Vendor ID Source, Vendor ID and Product ID are matched against the local Peer’s Device ID. If a match is found then a connection is allowed. Peer Device SDP Record: This SDP record contains a 128 bit UUID which is used to identify Peer device support. If selected as a device filter, the remote Peer’s UUID is matched against the local Peer’s UUIID. If a match is found then a connection is allowed. © Cambridge Silicon Radio Limited 2014 Page 19 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Multipoint must be enabled for Peer Device functionality to work correctly. A Peer Device relies on using one of the available Multipoint connections to form the link to another Peer Device. 4.2. Peer Device Support This section describes the Shareme and TWS Peer Device options that are configurable using the Sink Configuration Tool, see Figure 4.1. 4.2.1. Source Selection The Source Selection field determines the default source selected during a TWS session, see Table 4.1. Source Selection Mode Description Auto Automatically switches to an active source based on the following (decreasing) priority order: A2DP, USB and Analogue Analogue Selects Analogue as the current source, regardless of whether audio is present USB Selects USB as the current source, regardless of whether audio is present A2DP Selects A2DP as the current source, regardless of whether audio is present Table 4.1: TWS Source Selection Modes To switch between inputs the SelectAudioSourceNext event can be configured to a button press in the Sink Configuration Tool. The SelectAudioSourceNone event returns the device back to Auto input selection operation. The SelectAudioSourceNext event only works on the master device. When operating in USB mode, play/pause commands are sent using USB HID. These commands are not propagated from the master to slave device. Analogue audio input has no control over the music being played i.e. no AVRCP commands are sent when in analogue mode. When operating in wired mode, calls can still be handled from an AG as expected. © Cambridge Silicon Radio Limited 2014 Page 20 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Figure 4.1: Sink Configuration Tool Peer Device Support Settings A device always streams audio if USB or analogue input is connected when the device is logically off but physically powered (Limbo state). Note: USB audio remains connected even when the audio stream is stopped or paused. It is necessary to close a music playing application in order to switch to an analogue audio source when the device is operating in Auto configuration. 4.2.1.1. Analogue Mode PIO Configuration Using the Always detect configuration means that a TWS session streams analogue audio as soon as it is connected. 4.2.2. Master Device Pages Slave During Link Loss When enabled this setting ensures that the Peer Master device, when relaying audio, pages a Peer Slave device during link loss between the two Peer devices. This is likely to cause audio break-up at the Master device as streaming between the AV Source and Master is not suspended. CSR recommends that this feature is disabled as the Master enables Connectable mode and the Slave then attempts to page the Master during link loss. However, it can be enabled when the Master needs to be able to page the Slave during a link loss situation. 4.2.3. Use Limited Inquiry Access Code This setting controls which access code is used during Peer session initiation. Both the inquiring device and the discoverable device need to use the same access code. By default, the Limited Inquiry access code is used to reduce the number of devices discovered during inquiry. 4.2.4. Use Device ID This enables/disables the use of Device ID filtering, during Peer session initiation. If enabled, the local Vendor ID Source, Vendor Id and Product Id fields are matched against those advertised by the remote device. Only devices with all three fields matching are allowed to connect. © Cambridge Silicon Radio Limited 2014 Page 21 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Figure 5.2: Analogue input PIO Always Detect 4.2.5. Use CSR Peer Device Service UUID This is a CSR defined 128 bit UUID, presented in a Peer Device SDP record, it is used to filter connections to other Peer devices. This same UUID needs to be advertised by the remote device for a connection to be allowed. 4.3. Custom Peer Device Service UUID This is a custom 128 bit UUID, presented in a Peer Device SDP record, it is used to filter connections to other Peer devices. This same UUID needs to be advertised by the remote device for a connection to be allowed. The use of a custom UUID replaces the CSR defined UUID. An all zero custom UUID is invalid and prevents a Peer Device SDP record from being advertised. It also causes UUID filtering to be bypassed. Note: Use CSR Peer Device Service UUID (section 4.2.5) must be disabled in order for a Custom Peer Device Service UUID to be used. © Cambridge Silicon Radio Limited 2014 Page 22 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Figure 4.3: Sink Configuration Tool Custom Peer Device Service UUID Settings 4.4. ShareMe This section describes the ShareMe specific configurable options presented by the Sink Configuration tool, see Figure 4.4. Sections 4.4.1 to4.4.4 describe the configuration fields available 4.4.1. Pairing Mode ShareMe pairings are always deemed temporary or standard. Pairing Mode Description Temporary No pairing information is retained when the Peer session ends. However, attempts to recover from a link loss situation are made. Standard Pairing information is stored in the normal way. An entry is used within the device’s PDL. This entry can drop of the end of the list if too many pairings with other devices are made. Table 4.2: ShareMe Pairing Modes 4.4.2. Audio Source When enabled this setting allows the device to act as a ShareMe source which is able to relay audio from a connected AV Source to another ShareMe device. 4.4.3. Audio Sink When enabled this setting allows the device to act as a ShareMe sink which is able to render audio received from a ShareMe source. © Cambridge Silicon Radio Limited 2014 Page 23 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Figure 4.4: Sink Configuration Tool ShareMe Settings 4.4.4. Remote Peer Controls AV Source When enabled this setting allows AVRCP commands issued by a ShareMe Slave to be routed to the AV Source connected to a ShareMe Master. This is normally disabled by default, but would allow both ShareMe devices in a Peer session to have control of music streaming on the current AV Source. 4.5. True Wireless Stereo This section describes the TWS specific configurable options presented by the Sink Configuration tool. BlueCore ADK Peer Device Support User Guide Figure 4.5: Sink Configuration Tool TWS Settings Sections 4.5.1 to 4.5.3 describe the configuration settings available. 4.5.1. Pairing Mode TWS devices can have different levels of pairing dependant on the required application. Pairing Mode Description Temporary No pairing information is retained when the Peer session ends. However, attempts to recover from a link loss situation are made. Standard Pairing information is stored in the normal way. An entry is used within the device’s PDL. This entry can drop of the end of the list if too many pairings with other devices are made. Permanent Pairing information is retained, even after a clear of the PDL. It can only be overwritten by pairing another TWS device. The paired device always appears as the first device in the PDL. Table 4.3: TWS Pairing Modes © Cambridge Silicon Radio Limited 2014 Page 24 of 36 CS-316086-UGP3 www.csr.com 4.5.2. Audio Source When enabled this allows the device to act as a TWS source which is able to relay audio from a connected AV Source to another TWS device. 4.5.3. Audio Sink When enabled this allows the device to act as a TWS sink which is able to render audio received from a TWS source. 4.5.4. Single Device Operation When operating in a Peer session, AVRCP commands issued on the Slave can be routed, via the Master, to the AV Source. This allows control of media streaming from the Slave device as well as the Master. Master Slave Figure 5.6: Single Device Operation Enabled With single device operation enabled the two TWS peer devices operate as a single device: Both devices act as one with AVRCP commands Powering off Master also powers off Slave Incoming call on AG pauses A2DP streaming audio on both devices while call handling takes place Master Slave RF Figure 5.7: Single Device Operation Disabled With single device operation disabled the two TWS peer devices operate differently with regards to call handling: If incoming call to AG2 (connected to slave) Slave handles call and A2DP relay stops between devices. Master continues to play audio with normal stereo routing. © Cambridge Silicon Radio Limited 2014 Page 25 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide In single device mode, when a call is taken on either Peer Device, audio streaming is suspended on both devices. It is only possible to answer a call on the Peer device that is actually receiving the call. Note: Compatible settings need to be maintained on Master and Slave TWS devices. 4.6. Audio Routing The audio routing modes define how audio is rendered at the TWS device. Audio rendering at both devices in a TWS session are always defined by the device acting as the TWS Master i.e. the device relaying audio from an AV Source to another TWS device. BlueCore ADK Peer Device Support User Guide Figure 4.8: Sink Configuration Tool Audio Routing Settings There are four possible routing modes: Audio Routing Mode Description Stereo Left and right audio channels are rendered on individual DACs. Left Only the left audio channel is rendered on one/both DAC(s). Right Only the right audio channel is rendered on one/both DAC(s) Downmix Left and right audio channels are mixed and rendered on one/both DAC(s) Table 4.4: TWS Audio Routing Modes Sections 4.6.1 to 4.6.2 describe the configuration settings available. 4.6.1. Master Routing This defines how audio is rendered at a TWS Master, when relaying audio to a TWS Slave. 4.6.2. Slave Routing This allows the TWS Master to define how audio is rendered at a TWS Slave, while it is receiving relayed audio. © Cambridge Silicon Radio Limited 2014 Page 26 of 36 CS-316086-UGP3 www.csr.com 4.6.3. Audio Routing Behaviour The master device propagates the slave setting to the slave device at the start of a TWS session i.e. the Slave device ignores the matching configuration settings in its own Configuration Store. Audio Routing settings Master Slave AG1 AG2 Figure 5.9: Audio Routing Settings Sent from Master to Slave: AG1 Playing Audio When a role switch takes place, i.e. when an A2DP audio stream is transmitted from AG2 the Audio Routing settings are sent from the new Master to the new Slave device: © Cambridge Silicon Radio Limited 2014 Page 27 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide RF Audio Routing settings Master Slave RF AG2 Figure 5.10: Audio Routing Settings After Role Switch: AG2 Playing Audio 4.7. Device Trim System Volume is the Master Volume used to change the volume on the Master and Slave Device simultaneously. It is changed with AVRCP commands sent from the AG when a TWS session is established. System volume can be changed from both sides of a TWS session. Trim Volume is used to balance the outputs from the individual speakers When operating in a TWS Peer session, the relative volume levels of each Peer device can be adjusted using the Device Trim mechanism. The parameters in this section allow the default Device Trim gains to be defined along with the range and resolution of adjustment. The device trims used by both devices in a TWS session are defined by the current TWS Master i.e. a TWS Slave's device trim is set by the TWS Master. © Cambridge Silicon Radio Limited 2014 Page 28 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide AG1 BlueCore ADK Peer Device Support User Guide Figure 4.11: Sink Configuration Tool Device Trim Settings Sections 4.7.1 to 4.7.5 describe the configuration settings available. 4.7.1. Master Device Trim Gain This sets the device trim used by a TWS Master on initial connection. 4.7.2. Slave Device Trim Gain This sets the device trim specified by a TWS Master and used by a TWS Slave on initial connection 4.7.3. Device Trim Gain Step Change This sets the step change in gain as a device trim is adjusted. 4.7.4. Minimum Device Trim Gain This sets the lowest possible gain value for a device trim. 4.7.5. Maximum Device Trim Gain This sets the highest possible gain value for a device trim. 4.7.6. Operation of Device Trim The trim settings are propagated from master to slave device at the start of a TWS session. i.e. the slave device ignores the matching settings in its own configuration file. Note: The trim gain settings on the second device need to be swapped between master and slave to maintain consistent output volume in the event of a role switch. © Cambridge Silicon Radio Limited 2014 Page 29 of 36 CS-316086-UGP3 www.csr.com The events EventSysTrimVolumeMax and EventSysTrimVolumeMin are generated when the maximum and minimum trim volumes are reached. BlueCore ADK Peer Device Support User Guide © Cambridge Silicon Radio Limited 2014 Page 30 of 36 CS-316086-UGP3 www.csr.com 5. Operation of True Wireless Stereo 5.1. Pairing Devices When two TWS devices are connected, they are operating in a TWS session. The two TWS devices operating in a TWS session are known as Peer devices. To pair two TWS devices and establish a TWS session between them, the first TWS device must be placed into Peer Inquiry mode and the other TWS device must be placed into Peer Discoverable mode. This is done by generating the application events Peer Session Inquire and Peer Session Conn Disc, respectively. Table 5.3 shows the standard key mappings for the two peer events. These can, however, be changed with the Sink Configuration Tool. Button Mapping Duration Peer Session Inquire VREG + Logical Input 3 (SW4) VLONG (2.5secs) Peer Session Conn Disc VREG + Logical Input 2 (SW3) VLONG (2.5 secs) Table 5.3: Default peer session initiation events button mapping The default operation is for a TWS pairing to be entered into the PDL and also marked as permanent. If the entire PDL is erased, the TWS pairing is retained. However, if another TWS device is paired this overwrites the previous TWS entry in the PDL. Pairing behaviour can be changed using the compile time switches, see section 3. 5.2. Audio Relay Operation Either TWS device may be connected to an AV Source. When streaming is initiated from one AV Source, an A2DP media channel is established between the two TWS devices and used to relay the received audio to the other device. When audio is rendered it is synchronised between both TWS devices to within a few samples. If both TWS devices are connected to separate AV Sources, then both may relay audio to their corresponding Peer. However, audio relay can only occur in one direction at any one time. 5.3. Ending a TWS Session It is possible to terminate the connection between two TWS devices, without affecting the connection to any other device, by generating the application event Peer Session End. Table 5.4 shows the standard key mapping for this event. This can be changed using the Headset configuration tool. Event Button Mapping Duration Peer Session End Logical Input 2 + Logical Input 3 (PIO12 + PIO10) LONG Table 5.4: Configuration for Peer Session End 5.4. Multiple AGs TWS supports multiple AG connections in the following way: With a TWS session in place, it is only possible to connect a single AG to each device. If no TWS session is in place, a device can connect to 2 AGs. With 2 AGs connected to a device it is not possible to initiate a TWS session. © Cambridge Silicon Radio Limited 2014 Page 31 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Event 5.5. Codecs The following codecs are supported when using TWS: SBC MP3 Apt-X AAC It is possible to connect AGs to the two individual TWS devices using different codecs for each connection. 5.6. Voice Prompts Voice prompts are played on the local device only and not propagated over the TWS session. Tones and SCO audio have the same behaviour. 5.7. GAIA The Audio Sink application supports GAIA control of the Music Manager and audio routing including: Turn Bass Boost on or off (propagated to both devices) Control Multi-band User Equaliser (propagated to both devices) Turn 3D Enhancement on or off (propagated to both devices) Adjust volume up or down (propagated to both devices) Trim Master device volume up or down Trim Slave device volume up or down Route Stereo audio to both devices Route Downmixed (Mono) audio to both devices Route Left audio channel to Master device and Right audio channel to Slave device Route Left audio channel to Slave device and Right audio channel to Master device Other routing combinations can be supported by modifying the code, e.g. Route Stereo to Master and Mono to Slave (for a mono extension speaker). © Cambridge Silicon Radio Limited 2014 Page 32 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide Voice prompts are blended into the streaming audio on the device playing them. Appendix A PTS Qualification Because TWS not only makes use of A2DP to receive audio but to also relay audio to another device, it must be qualified in the roles of both an A2DP Source and an A2DP Sink. For A2DP Source qualification purposes, PTS needs to assume the role of a TWS device. Normally, to restrict the type of devices that can connect and be labelled as a TWS (or Peer) device, a certain amount of filtering occurs. By default, the use of the Limited Inquiry Access code is made during pairing. Also, both A2DP and Device ID SDP record searches are performed to ensure that the connection is to another TWS device. It is not possible to configure PTS to advertise the appropriate SDP records so the filtering used in TWS must be relaxed in order to allow PTS to connect. Because TWS does not generate its own audio and only acts as a relay device, to run successfully against PTS the TWS device needs to be connected to an AG when connected to PTS. Finally, while CSR custom codecs ensure correct framing of data no matter the negotiated L2CAP MTU size, the same cannot be said for the SBC Source SEP advertised by TWS. This SEP is only advertised to remain compliant to A2DP and serves no other purpose. Relaying audio without the necessary additional synchronisation data is meaningless in the context of TWS operation. To save writing an audio copy mechanism for standard SBC, purely to maintain framing for qualification purposes, the maximum A2DP Media channel MTU can be adjusted to effectively perform the same function. A.1 Setup The PS Keys listed in Table A.1require setting to allow PTS to connect and operate as a TWS device and thus enable qualification as an A2DP Source. Important Note: These PSKEYs should be left undefined for normal operation. PS Key Setting Description PSKEY_USR43 02A0 To set the maximum L2CAP MTU for A2DP Media channels to 672 bytes PSKEY_USR44 1445 To allow PTS to connect as a TWS device and remove advertising of TWS specific codecs Table A.1: PS Key Settings for Operation Against PTS © Cambridge Silicon Radio Limited 2014 Page 33 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide TWS makes use of custom codecs as a mechanism for synchronising audio rendering between both devices. The current version of PTS (v4.7.0.2) appears to throw an exception when it obtains the capabilities of a custom A2DP codec. It is therefore necessary to prevent these codecs from being advertised to allow PTS to find the appropriate SBC SEP. A.2 Performing tests Before running any of the qualification tests, it is advisable to clear the PDL. Ideally the only two devices that should be paired to the TWS device under test are PTS and an AG, used for generating A2DP audio to relay to PTS. A.2.1 Initial Pairing with PTS Due to most of the qualification tests requiring audio to be streamed to PTS, it is easier to select one test that does not do this for initial pairing of PTS with the TWS device under test. CSR suggest that the A2DP Source test TC_SRC_SDP_BV_01_I be used to perform initial pairing. A.2.2 TWS Initiating Connection to PTS The TWS device connects to its last two known devices, which are PTS and the paired AG. A.2.3 PTS Initiating Connection to TWS A number of the A2DP Source tests require PTS to initiate the connection. This can be done by placing TWS into standard pairing mode before running the test, by using a very long press of MFB from the Powered Off state. When PTS connects, connect the AG within 60secs of PTS connecting, to avoid the default connection timeout. © Cambridge Silicon Radio Limited 2014 Page 34 of 36 CS-316086-UGP3 www.csr.com BlueCore ADK Peer Device Support User Guide A number of the A2DP Source tests require TWS to initiate the connection. This can be done by ensuring both PTS and the AG are connectable then powering up TWS, by using a long press of the MFB from the Powered Off state. Document References Document Reference ADK Sink Application Configuration CS-306726-UG ADK Configuration Tool User Guide CS-309942-UG PS Keys Description CS-306726-UG BlueCore ADK Peer Device Support User Guide © Cambridge Silicon Radio Limited 2014 Page 35 of 36 CS-316086-UGP3 www.csr.com Terms and Definitions Advanced Audio Distribution Profile AAC Advanced Audio Coding ADK Audio or Application Development Kit AG Audio Gateway AVRCP Audio/Video Remote Control Profile BlueCore® Group term for CSR’s range of Bluetooth wireless technology chips Bluetooth® Set of technologies providing audio and data transfer over short-range radio connections CSR Cambridge Silicon Radio DSP Digital Signal Processor e.g. exempli gratia, for example GAIA Generic Application Interface Architecture HFP Handsfree Profile i.e. Id est, that is IC Integrated Circuit ID Identifier LED Light Emitting Diode MAP Message Access Profile PBAP Phone Book Access Profile PC Personal Computer PDL Paired Device List PIO Programmable Input/Output PS Key Persistent Store Key SBC Sub-band Coding SCO Synchronous Connection-Oriented SIG (Bluetooth) Special Interest Group SPI Serial Peripheral Interface TWS True Wireless Stereo USB Universal Serial Bus xIDE CSR’s Integrated Development Environment © Cambridge Silicon Radio Limited 2014 BlueCore ADK Peer Device Support User Guide A2DP Page 36 of 36 CS-316086-UGP3 www.csr.com
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
advertisement