Zik Bluetooth Protocol

The protocol is pretty simple, XML based and easy to read from the HCI dumps and with the help of the API extraction from the firmware it is pretty easy to play around with. For first tests the tool zik2ctrl is really a good starting point. It allows to control quite some aspects already – from a commandline, my favorite! But most importantly it also allows to send almost arbitrary commands to the Zik which is very cool for testing. Using this and some dump reads etc. I found quite some interesting things.

I was pretty shocked when I saw in the dumps that the Zik application pushes my whole address book onto the headphones!? WTF? I assume this is for speech synthesis and caller notification, but hey, I did not authorize this shit? Another reason to get rid of the Zik app.

Thumb Equalizer

This is the sound equalizer that can be controlled by a thumb in the GUI interface of the Zik app. One can shift a control point within a circle and thus emphasis or deemphasis certain sound colors, from Cristal to Vocal, Pop, Deep, Punchy to Club. These are arranged in a circle. When the Zik App starts up it queries the setting from the headphones

/api/audio/thumb_equalizer/value/get

Which the Zik answers with

 thumb_equalizer r="0" theta="0"

Where r = [0 – 100] and theta = [0 – 359]. The valid values can be extracted from the firmware string dump. So theta is the angle of the selected setting within the circle and r is the radius. So far so nice but I was disappointed to find that setting the thumb equalizer works pretty differently:

/api/audio/thumb_equalizer/value/set?arg=f1.f,f2.f,f3.f,f4.f,f5.f,i1,i2

But this does not seem to be a major drawback! As you can see there are five float parameters, f1.f to f5.f and two integers. The two integers represent i1=r and i2=theta – ah, ah, here they are. But playing around with them I found they do not have any influence on the sound, they are just there for the user interface to figure out where to position the selection dot. The values that have influence on sound are f1.f to f5.f which effectively form a simple 5-band equalizer with a gain from -12.0 to +12.0.

Using zik2ctrl this can be nicely tested:

# neutral
zik2ctl --request-method=set --request-path=/api/audio/thumb_equalizer/value --request-args="0.0,0.0,0.0,0.0,0.0,0,0"
# heavy base
zik2ctl --request-method=set --request-path=/api/audio/thumb_equalizer/value --request-args="12.0,0.0,0.0,0.0,0.0,0,0"
# flat & dull
zik2ctl --request-method=set --request-path=/api/audio/thumb_equalizer/value --request-args="0.0,0.0,0.0,0.0,-12.0,0,0"

As you can see, r and theta are always 0. As long as you don’t need the Zik Gui app, they do not matter. In fact this works even better than setting through the GUI since you can reach an achieve settings which would not be possible by pushing the puck.

Sound Effect

Actually I do not like the sound effect processor, which Parrot claim to be so unique and to produce a perfect concert hall and other effects. Well, for me all settings rather sound like sitting in a cardboard box or an underground parking lot. Neither places I would to be staying. But anyway, the sound effects are easy to read and to configure

sound_effect enabled="false" room_size="living" angle="120"
 angle = 30 - 180
 room_size = living, silent, jazz, concert
 /api/audio/sound_effect/angle/set?arg=<angle>
 /api/audio/sound_effect/room_size/set?arg=<name-id>

The angle can be set in 5 steps, 30, 60, 90, 120, 180. Valid rooms sizes are „living“, „silent“, „jazz“ and concert. Both parameters can be set independently by separate API calls.

/system/anc_phone_mode_enabled ?

/api/appli_version/set?arg=1.4.2

color value 1 = black

Username – hu?

The API contains calls to query and store a user name, hu? This is the username that you use in the Zik app to register with Parrot online services. I guess this is used to address and/or identify presets:

/api/account/username/get
 account username="<string>"
 set?arg="<string>"

Parametric Equalizer – Presets

I am not yet sure how the parametric equalizer works and especially how the presets are stored and retrieved, There seem to be preset archives in the headphone and they can be selected using an ID:

/api/audio/preset/activate?id=2&enable=1

The equalizer settings themselves are pretty easy, e.g.:

/api/param_equalizer/value/set?arg=20,605,1982,5677,19999,0.92,0.40,0.82,0.40,0.0,0.0,0.0,0.0,-0.6

A preset consists of 15 parameters:

f1,f2,f3,f4,f5,q1,q2,q3,q4,q5,g1,g2,g3,g4,g5

These are:

  • Middle Frequency of one parameter’s band, integer
    fn = 20 – 20000
  • The gain, float
    gn = -12.0 – +12.0
  • The diameter / range, in the GUI the diameter of the parameter circle, the smaller the value the narrower the range
    qn = 4,0 – 0,4

Now that I know how the thumb equalizer works or can work from a commandline I think I do not have any interest in the parametric equalizer anymore. Its advantage would be that the position of the five equalizers can be chosen and the range can be influences. But honestly, whenever I tried to create my own preset I always ended up distributing the five settings pretty evenly across the spectrum and having all ranges at maximum (q=4.0). So what’s the advantage then?

volume 330 – 360

Dump Of /api/ From Firmware Update

The firmware update file is a very nice source of information, it contains quite a number of pretty readable strings. Here are the ones concerned about the „api“, you will recognise quite some from the above descriptions:

/api/audio/track/metadata/get
/api/audio/noise_control/enabled/get
/api/audio/noise_control/enabled/set?arg
/api/audio/noise_control/get
/api/audio/noise_control/set?arg
/api/audio/noise_control/phone_mode/get
/api/audio/noise_control/phone_mode/set?arg
/api/audio/noise_cancellation/enabled/get
/api/audio/noise_cancellation/enabled/set?arg
/api/audio/thumb_equalizer/value/set?arg
/api/audio/thumb_equalizer/value/get
/api/audio/equalizer/enabled/get
/api/audio/equalizer/enabled/set?arg
/api/audio/param_equalizer/value/set?arg
/api/audio/smart_audio_tune/set?arg
/api/audio/smart_audio_tune/get
/api/audio/preset/bypass/set?arg
/api/audio/preset/bypass/get
/api/audio/preset/download?name
/api/audio/preset/activate?id
/api/audio/preset/save?name
/api/audio/preset/remove?id
/api/audio/preset/counter/get
/api/audio/preset/clear_all
/api/audio/preset/synchro/start
/api/audio/preset/synchro/stop
/api/audio/preset/current/get
/api/audio/preset/cancel_producer
/api/audio/sound_effect/enabled/get
/api/audio/sound_effect/enabled/set?arg
/api/audio/sound_effect/angle/get
/api/audio/sound_effect/angle/set?arg
/api/audio/sound_effect/room_size/get
/api/audio/sound_effect/room_size/set?arg
/api/audio/sound_effect/get
/api/audio/noise/get
/api/audio/volume/get
/api/software/version/get
/api/software/version_checking/get
/api/bluetooth/friendlyname/get
/api/bluetooth/friendlyname/set?arg
/api/software/download_size/set?arg
/api/software/download_check_state/get
/api/system/battery/forecast/get
/api/system/battery/get
/api/audio/track/metadata/get
/api/audio/track/metadata/force?artist
/api/audio/source/get
/api/system/auto_connection/enabled/get
/api/system/auto_connection/enabled/set?arg
/api/system/factory_reset
/api/system/anc_phone_mode/enabled/get
/api/system/anc_phone_mode/enabled/set?arg
/api/system/device_type/get
/api/system/color/get
/api/system/pi/get
/api/system/auto_power_off/presets_list/get
/api/system/auto_power_off/get
/api/system/auto_power_off/set?arg
/api/system/head_detection/enabled/get
/api/system/head_detection/enabled/set?arg
/api/audio/specific_mode/enabled/get
/api/audio/specific_mode/enabled/set?arg
/api/system/bt_address/get
/api/appli_version/set?arg
/api/system/calibrate
/api/account/username/get
/api/account/username/set?arg
/api/audio/equalizer/preset_id/set?arg
/api/audio/equalizer/preset_value/set?arg
/api/software/tts/enable
/api/software/tts/disable
/api/software/tts/get
/api/flight_mode/enable
/api/flight_mode/disable
/api/flight_mode/get
GET /api/

A2DP Audio

Well, I have to destroy some high hopes here, the AVDTP tells pretty uncompromisingly that only SBC and AAC are supported, audio sink SEID2:

Bluetooth AVDTP Protocol
 Signal: GetCapabilities (ResponseAccept)
 0011 .... = Transaction: 0x03
 .... 00.. = Packet Type: Single (0x00)
 .... ..10 = Message Type: ResponseAccept (0x02)
 00.. .... = RFA: 0x00
 ..00 0010 = Signal: GetCapabilities (0x02)
 Capabilities
 Service: Media Transport
 Service Category: Media Transport (0x01)
 Length of Service Category: 0x00
 Service: Content Protection
 Service Category: Content Protection (0x04)
 Length of Service Category: 0x02
 Type: SCMS-T (0x0002)
 Service: Media Codec - Audio MPEG-2,4 AAC
 Service Category: Media Codec (0x07)
 Length of Service Category: 0x08
 0000 .... = Media Type: Audio (0x00)
 .... 0000 = RFA: 0x00
 Media Codec Audio Type: MPEG-2,4 AAC (0x02)
 1... .... = MPEG2 ACC LC: 0x01
 .0.. .... = MPEG4 ACC LC: 0x00
 ..0. .... = MPEG4 ACC LTP: 0x00
 ...0 .... = MPEG4 ACC Scalable: 0x00
 .... 0000 = RFA: 0x00
 0... .... = Sampling Frequency 8000 Hz: False
 .0.. .... = Sampling Frequency 11025 Hz: False
 ..0. .... = Sampling Frequency 12000 Hz: False
 ...0 .... = Sampling Frequency 16000 Hz: False
 .... 0... = Sampling Frequency 22050 Hz: False
 .... .0.. = Sampling Frequency 24000 Hz: False
 .... ..0. = Sampling Frequency 32000 Hz: False
 .... ...1 = Sampling Frequency 44100 Hz: True
 1... .... = Sampling Frequency 48000 Hz: True
 .0.. .... = Sampling Frequency 64000 Hz: False
 ..0. .... = Sampling Frequency 88200 Hz: False
 ...0 .... = Sampling Frequency 96000 Hz: False
 .... 1... = Channels 1: True
 .... .1.. = Channels 2: True
 .... ..00 = RFA: 0x00
 1... .... .... .... .... .... = VBR Supported: True
 .000 0110 0100 0000 0000 0000 = Bit Rate: 0x064000

and audio sink SEID4:

Bluetooth AVDTP Protocol
 Signal: GetCapabilities (ResponseAccept)
 0100 .... = Transaction: 0x04
 .... 00.. = Packet Type: Single (0x00)
 .... ..10 = Message Type: ResponseAccept (0x02)
 00.. .... = RFA: 0x00
 ..00 0010 = Signal: GetCapabilities (0x02)
 Capabilities
 Service: Media Transport
 Service Category: Media Transport (0x01)
 Length of Service Category: 0x00
 Service: Media Codec - Audio MPEG-2,4 AAC
 Service Category: Media Codec (0x07)
 Length of Service Category: 0x08
 0000 .... = Media Type: Audio (0x00)
 .... 0000 = RFA: 0x00
 Media Codec Audio Type: MPEG-2,4 AAC (0x02)
 1... .... = MPEG2 ACC LC: 0x01
 .0.. .... = MPEG4 ACC LC: 0x00
 ..0. .... = MPEG4 ACC LTP: 0x00
 ...0 .... = MPEG4 ACC Scalable: 0x00
 .... 0000 = RFA: 0x00
 0... .... = Sampling Frequency 8000 Hz: False
 .0.. .... = Sampling Frequency 11025 Hz: False
 ..0. .... = Sampling Frequency 12000 Hz: False
 ...0 .... = Sampling Frequency 16000 Hz: False
 .... 0... = Sampling Frequency 22050 Hz: False
 .... .0.. = Sampling Frequency 24000 Hz: False
 .... ..0. = Sampling Frequency 32000 Hz: False
 .... ...1 = Sampling Frequency 44100 Hz: True
 1... .... = Sampling Frequency 48000 Hz: True
 .0.. .... = Sampling Frequency 64000 Hz: False
 ..0. .... = Sampling Frequency 88200 Hz: False
 ...0 .... = Sampling Frequency 96000 Hz: False
 .... 1... = Channels 1: True
 .... .1.. = Channels 2: True
 .... ..00 = RFA: 0x00
 1... .... .... .... .... .... = VBR Supported: True
 .000 0110 0100 0000 0000 0000 = Bit Rate: 0x064000

So this means that there is, besides SBC support, also support for MPEG-2,4 4 AAC, audio frequencies 44100Hz and 48000Hz, one and two channels and variable bitrate (VBR) support. Well, OK. I think I do not have any AAC audio files yet, oh well.