Skip to content
RC3 edited this page Jul 22, 2013 · 3 revisions

.

Miracast Enabler Flag

-    <bool name="config_enableWifiDisplay">false</bool>
+    <bool name="config_enableWifiDisplay">true</bool>

"config_enableWifiDisplay"'s comment is helpful to Miracast porting.

    <!-- Whether WiFi display is supported by this device.
         There are many prerequisites for this feature to work correctly.
         Here are a few of them:
         * The WiFi radio must support WiFi P2P.
         * The WiFi radio must support concurrent connections to the WiFi display and
           to an access point.
         * The Audio Flinger audio_policy.conf file must specify a rule for the "r_submix"
           remote submix module.  This module is used to record and stream system
           audio output to the WiFi display encoder in the media server.
         * The remote submix module "audio.r_submix.default" must be installed on the device.
         * The device must be provisioned with HDCP keys (for protected content).
    -->

audio.r_submix.default - need two patches

"audio.r_submix.default" - 1/2 - audio_policy.conf

+  r_submix {
+    outputs {
+      submix {
+        sampling_rates 44100|48000
+        channel_masks AUDIO_CHANNEL_OUT_STEREO
+        formats AUDIO_FORMAT_PCM_16_BIT
+        devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
+      }
+    }
+    inputs {
+      submix {
+        sampling_rates 44100|48000
+        channel_masks AUDIO_CHANNEL_IN_STEREO
+        formats AUDIO_FORMAT_PCM_16_BIT
+        devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
+      }
+    }
+  }

"audio.r_submix.default" - 2/2 - device.mk

 PRODUCT_PACKAGES += \
         alsa.msm8960 \
         audio_policy.msm8960 \
         audio.primary.msm8960 \
         audio.a2dp.default \
         audio.usb.default \
+        audio.r_submix.default \
         libaudio-resampler

no "audio.r_submix.default" patch, error occurred in connect to a sink.

I/WifiDisplayController(  398): Initiated connection to Wifi display: Wifi display00:90:00:00:43:18

// ...

I/WifiDisplayController(  398): Connected to Wifi display: Wifi display00:90:00:00:43:18
E/AudioPolicyManagerBase(  131): setDeviceConnectionState() invalid remote submix audio device: 8000

after applied patch, succeed r_submix standby.

E/MonoPipe(  131): Failed to fetch local time frequency when constructing a MonoPipe (res = -32).  getNextWriteTimestamp calls will be non-functional
I/AudioFlinger(  131): HAL output buffer size 1024 frames, normal mix buffer size 1024 frames
I/AudioMixer(  131): found effect "Multichannel Downmix To Stereo" from The Android Open Source Project
I/AudioFlinger(  131): HAL output buffer size 1024 frames, normal mix buffer size 1024 frames
I/AudioFlinger(  131): AudioFlinger-s thread 0x41012008 ready to run
I/AudioMixer(  131): found effect "Multichannel Downmix To Stereo" from The Android Open Source Project
I/AudioFlinger(  131): AudioFlinger-s thread 0x40015008 ready to run
I/r_submix(  131): out_standby()

Wireless Display On/Off Switch

  • View AOSP patch
  • /packages/apps/Settings/src/com/android/settings/wfd/WifiDisplaySettings.java