7

Hexagon DSP processor allows activate your device while it’s on standby https://qualcomm.com/videos/snapdragon-voice-activation. Some Android devices support this feature, for example Google Pixel reacts to keyphrase "Ok Google". In the source code of the android, I found the code responsible for loading the keyphrase into the DSP processor (The Hexagon DSP processor is built into the Qualcomm processor):

https://android.googlesource.com/platform/hardware/libhardware/+/master/modules/soundtrigger/sound_trigger_hw.c https://android.googlesource.com/platform/system/media/+/master/audio/include/system/sound_trigger.h

The sound model description structure sound_trigger_sound_model pass in the method stdev_load_sound_model. Sound model structure:

/*
 * Base sound model descriptor. This struct is the header of a larger block passed to
 * load_sound_model() and containing the binary data of the sound model.
 * Proprietary representation of users in binary data must match information indicated
 * by users field
 */
struct sound_trigger_sound_model {

    sound_trigger_sound_model_type_t type;        /* model type. e.g. SOUND_MODEL_TYPE_KEYPHRASE */
    sound_trigger_uuid_t             uuid;        /* unique sound model ID. */
    sound_trigger_uuid_t             vendor_uuid; /* unique vendor ID. Identifies the engine the
                                              sound model was build for */
    unsigned int                     data_size;   /* size of opaque model data */
    unsigned int                     data_offset; /* offset of opaque data start from head of struct
                                                (e.g sizeof struct sound_trigger_sound_model) */
};

Does anyone know how to generate a binary data of the sound model or where to find information about it?

You can download the sound model for the keyphrase ''Ok Google" by link: https://drive.google.com/open?id=0B9jcQJRmjR0yaDJhOXN2M2ZLYm8. I loaded it into the DSP processor and it works.

Helpfull Android classes: https://android.googlesource.com/platform/frameworks/base/+/master/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/hardware/soundtrigger/SoundTriggerModule.java https://android.googlesource.com/platform/frameworks/base/+/master/core/jni/android_hardware_SoundTrigger.cpp https://android.googlesource.com/platform/frameworks/av/+/master/soundtrigger/SoundTrigger.cpp https://android.googlesource.com/platform/frameworks/av/+/master/soundtrigger/ISoundTrigger.cpp

Evgeny
  • 193
  • 2
  • 9

0 Answers0