text
stringlengths
1
112
figure the cig state mach ine
theres a fairly straightforward state machine used to configure and establish a cig and its
constituent cises which is shown i n figure it contains three states
the configurable cig state which is where all of the cises that make up a cig
are defined thats done through a set of hci commands called the le set cig
hci host controller interface commands are defined to provide the link between the host stack
section connected isochronous streams
parameters command once these are sent to the controller the initiator has all
the information that it needs to work out the scheduling and to optimise its airtime
usage
the active cig state in which one o r more of the configured cises is enabled
the ci g moves to the active state by enabling at least one of its configured cises
using the le create cis hci command it doesnt need to enable all of the
configured cises once the cig is in the active state it can disconnect individual
cises and it can u se the le create cis command to enable other cises which it
has previously configured in theory that allows it to swap cises whilst that cig is
active this can be useful i f there is only an occasional need for a cis such as a
return path for voice co mmands the cis could be turned on and off depending
on when it is needed once a cig is in the active state you cannot configure
additional cises that can only be done by disconnecting all cises deactivating
the cig and starting again
the inactive cig state a cig move s to the inactive state by disconnecting all of
its established cises it cannot change the configuration of any cis in this state
nor add new ones but it can return to the active state by using the le create cis
hci command to reestablish a cis this allows a cig to be reactivated without
the need for the controller to go back to the start and reschedule one or more of its
configured cises
when all of the established cises have been disconnected the cig can be removed by issuin g
the le remove cig hci command
hci commands for cises
the core specification defines five hci commands which are used to inform the controller
about each cig the first is the le set cig parameters command vol part e
which creates a cig and configures an array of cises within it each cis within the cig can
be unidirectional or bidirectional each one can use a different phy for each direction
the first use of the le set cig parameters command creates the cig moving it to the
config ured cig state with the number of cises defined in the array the command can be
used multiple time s to add more cises to the cig or modify cises which have already been
defined each cis is assigned a connection handle
each time the command is issued the controller should attempt to calculate a schedule for
all of the cises in the cig which meets the requirements specified by the hci parameters
and the controller they are used for prototype testing and provide an interoperable interface where
the host stack and controller silicon come from different manufacturers generally opera ting
systems do not make them available providing a higher level api for developers
chapter isochronous streams
and if successful will confirm this with an hci complete command note that two of the
parameters sent by the host packing and rtn the number of retransmissions are only
recommendations the controller should try to accommodate them when working out the
schedule but can ignore them or attempt a best case schedule that is guided by them the
link layer parameters of burst number flush timeout and nse are determined by the
controller s scheduling algorithm and cannot be explicitly set by a higher layer specification
some of the profile specifications provide recommen dations that suggest optimal settings for
specific use cases but it is up to a specific chip implementation as to whether these are
accessible by an application or are part of a schedulers choice
this mismatch between the hci parameters sent from the host and those set by the
controller may seem odd but there is a good reason which is to prevent a top level profile or
application from trying to prioritise the overall radio operation many bluetooth chips include
wifi and they typically share an ant enna hence the controller needs to work out how to
fit in the demands of both the bluetooth technology implementation may also be running
multiple profiles there is no reason a smart phone cant receive a bluetooth le audio
broadcast stream and then retransmit it to a pair of hearing aids as a pair of connected
isochronous stream s other than the physical constraints of available airtime and processing
resources however at a profile level none of these applications may know that the other
exists if each one could dictate the exact values of bn ft and nse it would be very likely
that they would be unable to coexist with the constraints of other applications thats why
the hci commands prevent this level of control allowing the controller to work out how
best to fit everything together the scheduling algorithms are not accessible to application
developers they are a critical part of the bluetooth chip however its important to
understand why you cant dictate what you want and to be awa re of the dangers of over
specifying the needs of your audio application
once all of the cises have been configured the le create cis command is used to create
each cis which is required which causes the cig to move to the active cig state not all
cises need to be created at this point a cis can be disconnected and another cis created
at any point which may be useful when an application decides to move from using a
microphone in an earbud to the microphone on a smartph one however this does assume
that the controller managed to schedule all of the cises
the cig remains in the active cig state until the last cis is disconnected at this point it
moves to the inactive cig state it can either be permanently removed with the le remove
cig command or returned to the active cig state by using the le create command a gain
on at least one of the cises
as each cis is created by the initiator each acceptor will be informed of the connection
parameters via link layer commands leading to an hci le cis request event
being sent to its host if it accepts the r equest it will respond with an hci le accept cis
request command leading to both initiator and acceptor host s receiving an hci
section broadcast isochronous streams
le cis established event when we get to the ascs well see how th ese work
with the isochronous stream state machines
that completes a review of all of the component parts of a cig and cis and how we put
unicast connected isochronous stream s together now well look at the analogues for
broadcast where we have to do the same thing but without the luxury of having a connection
between the two devices to allow them to negotiate what theyre doing
broadcast isochronous streams
broadcast audio is a totally new concept for bluetooth technology in the past audio has
always been streamed directly from one device to another device as we saw in the previous