benzea / gnome-network-displays

Miracast implementation for GNOME
GNU General Public License v3.0
367 stars 39 forks source link

WARNING

This project has been moved to https://gitlab.gnome.org/GNOME/gnome-network-displays

All issues have also been moved there.


This is an experimental implementation of Wi-Fi Display (aka Miracast).

The application will stream the selected monitor if the mutter screencast portal is available. If it is unavailable, a fallback to X11 based frame grabbing will happen. As such, it should work fine in almost all setups.

To get audio streaming, you need to change the audio output in pulseaudio to use the created "Network-Displays" sink.

To use it, you will need:

Build

To build it locally:

Devices

The following devices have been tested:

Testing

For testing purposes you can run with NETWORK_DISPLAYS_DUMMY=1 set. In that case, a dummy sink will be provided that allows connecting on localhost using any RTSP capable client to test WFD streaming.

You can connect to rtsp://localhost:7236/wfd1.0 then.

Debugging

Codecs

Appropriate video/audio encoders will be selected automatically. You should also get a notification if codecs are missing and an offer to automatically install these. To debug the codecs themselves, you can modify the default choice by setting the NETWORK_DISPLAYS_H264_ENC and NETWORK_DISPLAYS_AAC_ENC environment variables and specifying the gstreamer element to use (if supported and detected). Run with G_MESSAGES_DEBUG=all to see the selection at work during connection establishment.

Connection issues

P2P WiFi/WiFi Direct and the mechanism to establish a connection is a relatively complicated process that can fail in a number of different ways and stages.

As a first step, you should run with G_MESSAGES_DEBUG=all to get a better idea when the failure happens. Your TV/Display may also give an indication about the progress. Much of the information is also displayed in the UI, but might only be visible for a very short period of time.

Discovery

The first required step is successful discovery of the remote device. This step can already be problematic sometimes. Confirm the following, each ensuring that support exists:

If everything looks good, but you still can't find the TV, then please try the following:

Establishing a P2P Group

When you click on the TV, the first step is to establish a WiFi P2P connection. Check whether you see the message:

Got state change notification from streaming sink to state ND_SINK_STATE_WAIT_P2P
[...]
Got state change notification from streaming sink to state ND_SINK_STATE_WAIT_SOCKET

If you see both of these messages, then we have successfully created a P2P Group.

Network configuration and socket connection

What happens next is that both side will configure their network. Then the TV will establish a connection to gnome-network-displays.

Things could go wrong here:

At this point the IP link is there. You can do the following:

RTSP stream issues

Not all devices are compliant, and the standard is a bit odd. If you have problems where the stream seems to start, but then does not work or stop after a while.

Try the following: