# Miracast

## Overview

Miracast is a wireless display technology that works in two different modes. Mago supports both modes automatically. The mode used depends entirely on how the network is configured and how the user device is connected.

### Miracast over WiFi Direct

This is the original Miracast technology. The connection forms a direct peer to peer link between the user device and Mago. It does not use the corporate WiFi network, does not rely on access points and does not require any VLAN or firewall configuration. Miracast over WiFi Direct is especially useful when the user device is connected on a different network or not connected to any WiFi network at all.

### Miracast over Infrastructure

This mode is designed for enterprise environments. Discovery still uses WiFi, but the actual media traffic flows over the existing network infrastructure (WiFi or Ethernet) instead of a direct peer connection. This mode uses the corporate network, DNS resolution, VLAN routing and specific ports that must be opened on the firewall. Miracast over infrastructure is also known as MS MICE.

### How Windows chooses the Miracast mode

Windows prefers Miracast over infrastructure when the sending device and the Mago Room device are on the same enterprise network and the required ports and multicast traffic are allowed.\
If these conditions are not met, **Windows automatically falls back to Miracast over WiFi Direct**.\
If both modes fail, Miracast will not connect.

In summary:

* When the network supports MS MICE, Miracast over infrastructure will be used.
* If the corporate network blocks the requirements for MS MICE, Miracast over WiFi Direct will be used automatically.
* If WiFi Direct is disabled by policies or drivers, Miracast may not work in any mode.

## Common requirements for all Miracast modes

{% stepper %}
{% step %}

### Hardware and driver support

Miracast requires compatible hardware on both the sending device and the Mago device.\
This includes the following.

**Graphics adapter**

* Windows Display Driver Model WDDM 1.3 or newer

To check WDDM:

1. Press Windows key and R, type `dxdiag` and press Enter.
2. Let the DirectX Diagnostic Tool finish.
3. Select Save All Information.
4. Open the saved text file and search for "WDDM".

**WiFi adapter**

* Supports Miracast
* Supports WiFi Direct
* Uses a driver with NDIS 6.3 or newer

To check Miracast support:

1. Open a Command Prompt window.
2. Type `netsh wlan show driver` and press Enter.
3. Check the Miracast line in the output.
   {% endstep %}

{% step %}

### WLAN AutoConfig service is running

Miracast requires the WLAN AutoConfig service (wlansvc) to be operating.\
If this service is disabled, WiFi Direct and MS MICE cannot start.

To enable the service:

1. Press Windows key and R, type `services.msc` and press Enter.
2. Find WLAN AutoConfig in the list.
3. Right click, select Properties.
4. Select Start and set the startup type to Automatic.
5. Restart the computer.
   {% endstep %}

{% step %}

### Windows Firewall configuration

Windows Firewall must allow the Windows User Mode Driver Framework Host Process, which handles Miracast communication.

Allow the following:

`C:\Windows\System32\WUDFHost.exe`

Inbound and outbound traffic, TCP and UDP on all ports. If this process is blocked by a local or third party firewall, Miracast pairing or streaming may fail.
{% endstep %}

{% step %}

### Group Policy permissions

Local or domain security policies must allow the creation and use of WiFi Direct. If blocked, Miracast will not work in either mode.

Check the following policy:

Computer Configuration > Windows Settings > Security Settings > Wireless Network (IEEE 802.11) Policies

Within Network Permissions:

1. Allow everyone to create all user profiles
2. Uncheck any setting that disables WiFi Direct groups

{% hint style="info" %}
These policies must allow Windows to create a Microsoft WiFi Direct Virtual Adapter and a DIRECT-XXXXXX temporary network.
{% endhint %}
{% endstep %}

{% step %}

### Drivers are up to date

Miracast is sensitive to driver compatibility. Keep the following updated:

* Chipset drivers
* Graphics adapter drivers
* WiFi adapter drivers

Outdated drivers are one of the most common causes of unstable or failing Miracast sessions.
{% endstep %}
{% endstepper %}

## Miracast over Infrastructure (MS MICE) mode specific requirements

Miracast over infrastructure transports the media stream over the existing network, usually enterprise WiFi or Ethernet. Discovery still uses WiFi but the session is routed through the network.

{% stepper %}
{% step %}

### Network reachability and VLAN routing

The user device and Mago Room must be reachable across the network.

Requirements:

* Devices in the same enterprise network or routed VLAN
* DNS records for Mago Room resolvable by the client
* Firewall rules allowing bidirectional traffic
  {% endstep %}

{% step %}

### Required firewall and network ports

The following ports must be allowed in both directions between the client device and Mago:

* UDP 5353 for mDNS discovery
* TCP / UDP 7236 for RTSP Control Port
* TCP 7250 for Miracast Sink
* UDP 32768-65536 for Ephemeral ports for Return traffic

These ports enable session negotiation, discovery and continuous streaming.

| Port          | Type      | Direction | Service                            |
| ------------- | --------- | --------- | ---------------------------------- |
| 5353          | UDP       | Both      | mDNS Discovery                     |
| 7236          | TCP / UDP | Both      | RTSP Control Port                  |
| 7250          | TCP       | Both      | Miracast Sink                      |
| 32768-65536   | UDP       | Both      | Ephemeral ports for Return traffic |
| {% endstep %} |           |           |                                    |

{% step %}

### AP isolation disabled

Since Miracast over infrastructure uses the access point and VLANs, the AP must allow client to client communication. AP isolation or client isolation must be disabled on the SSID used by the sender. If enabled, Miracast over the network cannot function.
{% endstep %}

{% step %}

### Multicast and broadcast traffic allowed

Miracast over infrastructure relies on mDNS discovery. Ensure that the network does not block the following:

* UDP 5353
* Multicast forwarding between VLANs if required
* IGMP snooping causing excessive filtering

If multicast discovery is blocked, MS MICE cannot initialize.
{% endstep %}
{% endstepper %}

## Miracast over WiFi Direct mode specific requirements

Miracast over WiFi Direct creates a dedicated peer to peer wireless link between the user device and Mago. It is not routed through the corporate network.

{% stepper %}
{% step %}

### 2.4 GHz wireless availability

Discovery and pairing always use the 2.4 GHz band on channels 1, 6 or 11. Even if the sending device is connected to 5 GHz or not connected to any WiFi network, pairing begins on 2.4 GHz. Ensure that the 2.4 GHz radio is enabled in the environment. If 2.4 GHz is disabled, Miracast over WiFi Direct cannot initialize.
{% endstep %}

{% step %}

### WiFi Direct Virtual Adapter must be created

During pairing, Windows must create the following:

* Microsoft WiFi Direct Virtual Adapter
* A temporary wireless network named DIRECT-XXXXXX

If these do not appear in Network Connections during an attempted Miracast session, Group Policies or drivers are blocking WiFi Direct.
{% endstep %}
{% endstepper %}

## Quick summary

1. **Confirm Miracast support**\
   • Windows 10 or later\
   • Graphics adapter with WDDM 1.3 or newer\
   • WiFi adapter supporting Miracast, WiFi Direct and NDIS 6.3 or newer\
   Check using `netsh wlan show driver`.
2. **Enable required Windows services**\
   • WLAN AutoConfig service must be running\
   • Group Policies must allow WiFi Direct and creation of DIRECT-XXXXXX networks
3. **Allow Miracast through Windows Firewall**\
   • Allow C:\Windows\System32\WUDFHost.exe for inbound and outbound TCP and UDP
4. **Update drivers**\
   • Update chipset, graphics and WiFi drivers to the latest versions
5. **If using Miracast over Infrastructure (MS MICE)**\
   • User device and Mago Room must be reachable across VLANs\
   • Required ports open\
   • AP isolation must be disabled\
   • Multicast discovery (mDNS) must be allowed
6. **If using Miracast over WiFi Direct**\
   • 2.4 GHz WiFi must be enabled\
   • AP isolation does not affect this mode\
   • WiFi Direct Virtual Adapter and DIRECT-XXXXXX network must appear during pairing

## Troubleshooting flowchart

{% stepper %}
{% step %}

### Check Miracast hardware support

1. Run `netsh wlan show driver`
2. Check WDDM version with dxdiag

{% hint style="danger" %}
If Miracast not supported → **Stop**. **Update drivers or hardware required.**
{% endhint %}

{% hint style="success" %}
If supported → **Continue**
{% endhint %}
{% endstep %}

{% step %}

### Check WLAN AutoConfig service

1. Ensure **wlansvc** is running

{% hint style="warning" %}
If stopped → **Enable and restart PC**
{% endhint %}

{% hint style="success" %}
If running → **Continue**
{% endhint %}
{% endstep %}

{% step %}

### Attempt Miracast connection

Do DIRECT-XXXXXX network and WiFi Direct Virtual Adapter appear?

{% hint style="warning" %}
No → Group Policy or drivers are blocking WiFi Direct. **Fix GPO and update drivers**.
{% endhint %}

{% hint style="success" %}
Yes → WiFi Direct is functioning → **Continue**
{% endhint %}

If DIRECT network appears, but connection fails.

* Check Windows Firewall for WUDFHost.exe
* Update graphics and WiFi drivers
  {% endstep %}

{% step %}

### Determine connection mode

Is the device on same VLAN and required ports open?

**Yes** → Windows will use Miracast over Infrastructure

**No** → Windows will fall back to WiFi Direct
{% endstep %}

{% step %}

### If using Miracast over Infrastructure

1. Check firewall ports (TCP 7236, 7250, UDP 7236, 5353)
2. Check that AP isolation is disabled
3. Confirm mDNS multicast works across VLAN

{% hint style="warning" %}
If blocked → **Fix network settings**
{% endhint %}

{% hint style="success" %}
If working → **Great! Miracast will work in over Infrastructure mode**
{% endhint %}
{% endstep %}

{% step %}

### If using WiFi Direct

1. Ensure 2.4 GHz radio is enabled
2. Check for RF congestion
3. Test connection again

{% hint style="warning" %}
If issues persist → **Update all chipset, WiFi and graphics drivers**
{% endhint %}

{% hint style="success" %}
If working → **Great! Miracast will work in WiFi Direct mode**
{% endhint %}
{% endstep %}
{% endstepper %}

## Miracast over WiFi Direct vs Miracast over Infrastructure

<table><thead><tr><th width="230.1640625">Aspect</th><th>Miracast over Infrastructure (MS MICE)</th><th>Miracast over WiFi Direct</th></tr></thead><tbody><tr><td><strong>Connection type</strong></td><td>Routed through enterprise network</td><td>Peer to peer WiFi Direct link</td></tr><tr><td><strong>Uses access point</strong></td><td>Yes</td><td>No</td></tr><tr><td><strong>VLANs required</strong></td><td>Yes, if endpoints are on different subnets</td><td>No</td></tr><tr><td><strong>DNS required</strong></td><td>Yes</td><td>No</td></tr><tr><td><strong>Firewall rules required</strong></td><td>Yes, ports 7236, 7250, 5353</td><td>No</td></tr><tr><td><strong>AP isolation impact</strong></td><td>Must be disabled</td><td>No impact</td></tr><tr><td><strong>2.4 GHz requirement</strong></td><td>Not required once infrastructure mode is active</td><td>Required for negotiation (channels 1, 6, 11)</td></tr><tr><td><strong>WiFi Direct Virtual Adapter creation</strong></td><td>Still required for negotiation</td><td>Required</td></tr><tr><td><strong>Discovery mechanism</strong></td><td>mDNS (UDP 5353)</td><td>WiFi Direct beaconing</td></tr><tr><td><strong>Stability in enterprise WiFi</strong></td><td>Better for managed enterprise deployments</td><td>Good for isolated or guest scenarios</td></tr><tr><td><strong>Best use cases</strong></td><td>Corporate networks with proper routing and firewall setup</td><td>Guest devices, unmanaged networks, fallback mode</td></tr><tr><td><strong>Mode priority</strong></td><td>Preferred if infrastructure is correctly configured</td><td>Used when MS MICE is not possible</td></tr></tbody></table>
