Public bug reported:

# Miracast/Wi-Fi Display fails with MediaTek MT7612U USB adapter despite
working P2P discovery

## Summary

I am trying to use Ubuntu 26.04's GNOME Network Displays to mirror the
laptop display to a Roku Express 3900 using Wi-Fi Direct/Miracast.

The laptop has an internal Realtek Wi-Fi adapter and a USB MediaTek
MT7612U adapter. The USB adapter is being used specifically for Wi-Fi
Display/P2P.

The MT7612U is correctly detected by Ubuntu, the `mt76x2u` driver loads,
and the adapter advertises P2P-client and P2P-GO capabilities. I was
also able to discover the Roku directly using a standalone
`wpa_supplicant` instance.

However, GNOME Network Displays does not discover the Roku reliably, and
the normal NetworkManager/system `wpa_supplicant` path initially failed
to acquire the MT7612U interface.

## System information

* Ubuntu: 26.04
* Kernel: 7.0.0-31-generic
* GNOME Network Displays: 0.99.0-1
* NetworkManager: 1.54.3
* wpa_supplicant: 2.11
* USB Wi-Fi chipset: MediaTek MT7612U
* USB ID: `0e8d:7612`
* Driver: `mt76x2u`
* Target device: Roku Express 3900

USB identification:

```text
0e8d:7612 MediaTek Inc. MT7612U 802.11a/b/g/n/ac Wireless Adapter
```

Driver information:

```text
driver: mt76x2u
version: 7.0.0-31-generic
firmware-version: 0.0.00-b1
bus-info: 3-1:1.0
```

The adapter appears as:

```text
wlx808c97be890a
```

## P2P capabilities

`iw phy phy1 info` reports support for:

```text
P2P-client
P2P-GO
```

and also reports:

```text
start_p2p_device
```

The reported interface combination includes:

```text
#{ managed, AP, mesh point, P2P-client, P2P-GO } <= 2
total <= 2
#channels <= 1
```

Therefore the hardware/driver does expose Wi-Fi Direct/P2P
functionality.

## Successful direct P2P discovery of the Roku

Using a standalone `wpa_supplicant` instance dedicated to the MT7612U, I
ran:

```text
sudo wpa_cli -i wlx808c97be890a p2p_find 30
```

followed by:

```text
sudo wpa_cli -i wlx808c97be890a p2p_peers
```

The Roku was discovered:

```text
da:31:34:2d:6e:82
```

Querying the peer produced:

```text
device_name=Express
level=-56
listen_freq=2437
oper_freq=0
status=0
```

This demonstrates that the MT7612U/`mt76x2u` path is capable of
detecting the Roku's P2P device.

## GNOME Network Displays behavior

GNOME Network Displays starts normally but does not discover the Roku
through the expected NetworkManager-managed P2P path.

The application reports that the P2P device associated with the MT7612U
is not yet available and waits for it.

The internal Wi-Fi adapter creates a usable P2P device and GNOME Network
Displays can see other P2P devices such as HP/Brother printers, but the
Roku is not discovered through this path.

## NetworkManager / wpa_supplicant problem

Initially NetworkManager reported the MT7612U as:

```text
wlx808c97be890a  wifi  unavailable
p2p-dev-wlx808c97be890a  wifi-p2p  unavailable
```

NetworkManager repeatedly reported:

```text
Couldn't initialize supplicant interface:
GDBus.Error:fi.w1.wpa_supplicant1.UnknownError:
wpa_supplicant couldn't grab this interface.
```

At the same time, the system `wpa_supplicant` reported that the control
socket for the MT7612U already existed and appeared to be in use.

This was ultimately traced to a manually launched standalone
`wpa_supplicant` instance that had previously been used for the P2P
test. After terminating that process and removing the stale state, the
normal NetworkManager path was able to acquire the interface.

## Current/clean NetworkManager result

After toggling the device from unmanaged to managed:

```text
sudo nmcli device set wlx808c97be890a managed no
sudo nmcli device set wlx808c97be890a managed yes
```

NetworkManager successfully changed the MT7612U to:

```text
wlx808c97be890a  wifi  disconnected
```

and created:

```text
p2p-dev-wlx808c97be890a  wifi-p2p  disconnected
```

The NetworkManager journal contained:

```text
supplicant interface state: internal-starting -> disconnected
```

then:

```text
Wi-Fi P2P device controlled by interface wlx808c97be890a created
```

and:

```text
device (wlx808c97be890a):
state change: unavailable -> disconnected
(reason 'supplicant-available')
```

A corresponding wpa_supplicant control socket was created:

```text
/run/wpa_supplicant/wlx808c97be890a
```

Therefore the normal system `wpa_supplicant` can successfully acquire
and manage the MT7612U after the stale/competing supplicant state is
cleared.

## Why I am reporting this

The important observation is that the problem does not appear to be
simple hardware detection or lack of P2P support.

The following layers have been demonstrated to work:

```text
MT7612U hardware
        ↓
mt76x2u kernel driver
        ↓
P2P capability
        ↓
standalone wpa_supplicant
        ↓
Roku P2P discovery
```

NetworkManager can also eventually create and manage the corresponding
P2P device.

The unresolved failure is the complete integrated Miracast path:

```text
GNOME Network Displays
        ↓
NetworkManager
        ↓
system wpa_supplicant
        ↓
MT7612U / mt76x2u
        ↓
Wi-Fi Direct / P2P
        ↓
Roku Express 3900
```

GNOME Network Displays still fails to discover/connect to the Roku
through the normal desktop networking stack.

I would appreciate guidance on whether this is a known limitation or bug
involving:

* GNOME Network Displays
* NetworkManager's P2P handling
* wpa_supplicant P2P integration
* `mt76x2u` P2P operation
* or the interaction between multiple Wi-Fi PHYs/interfaces when one is used 
for normal Wi-Fi and another for Miracast.

The system has two independent Wi-Fi PHYs:

```text
phy0: wlp1s0
phy1: wlx808c97be890a
```

The internal adapter remains connected to the normal Wi-Fi network while
the MT7612U is intended for Miracast/P2P.

## Additional observation

The kernel/wpa_supplicant logs also contained repeated:

```text
nl80211: kernel reports: Match already configured
```

during the period when the MT7612U could not be acquired by the system
`wpa_supplicant`.

It is unclear whether this is merely residual state from the earlier
standalone `wpa_supplicant` process or indicates a deeper P2P/nl80211
state-management problem.

## Expected behavior

GNOME Network Displays should be able to discover the Roku Express 3900
through the MT7612U USB adapter and establish a Wi-Fi Display/Miracast
session while the internal Wi-Fi adapter remains connected to the normal
network.

## Actual behavior

The MT7612U is detected and supports P2P, and direct P2P discovery using
standalone `wpa_supplicant` can find the Roku, but GNOME Network
Displays does not discover/connect to the Roku through the normal
integrated Ubuntu networking stack.

## Reproduction hardware

USB adapter:

```text
MediaTek MT7612U
USB ID: 0e8d:7612
Driver: mt76x2u
```

Target:

```text
Roku Express 3900
```

Software:

```text
Ubuntu 26.04
Linux 7.0.0-31-generic
GNOME Network Displays 0.99.0-1
NetworkManager 1.54.3
wpa_supplicant 2.11
```

** Affects: gnome-network-displays (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169479

Title:
  Miracast/Wi-Fi Display fails with MediaTek MT7612U USB adapter despite
  working P2P discovery

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-network-displays/+bug/2169479/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to