audio spatializer: more resource usage optimizations

Enable the spatializer effect, only when active AND spatialized tracks
are present on the spatializer mixer.
This is useful for the case where only one output mixer is available to
reach a particular device (e.g. A2DP) and this mixer is a spatializer
mixer. In this case, non spatialized tracks are the majority of the activity
on this mixer.

Also only create the head pose controller when the desired head tracking
mode is not static and there is a head pose sensor registered. The max
calculation interval is also changed so that no calculation happens
unless explicitely requested by the spatializer.

Bug: 227740874
Test: regular and spatial audio playback on a Bluetooth headphone with
LDAC codec.

Change-Id: Ib3197da54f47fca63f0e4a6c95546b56a7065b6f
diff --git a/services/audiopolicy/service/Spatializer.h b/services/audiopolicy/service/Spatializer.h
index 0c9efdd..a36ba61 100644
--- a/services/audiopolicy/service/Spatializer.h
+++ b/services/audiopolicy/service/Spatializer.h
@@ -284,6 +284,12 @@
     void checkSensorsState_l() REQUIRES(mLock);
 
     /**
+     * Checks if the head pose controller should be created or destroyed according
+     * to desired head tracking mode.
+     */
+    void checkPoseController_l() REQUIRES(mLock);
+
+    /**
      * Checks if the spatializer effect should be enabled based on
      * playback activity and requested level.
      */