miracle dispctl - AtesComp/miraclecast GitHub Wiki

Miracle Display Controller

A front-end to control the miracle-wifid and miracle-dispd daemons used to project screen and audio to WiFi-Display sink, eg. TV, Miracast dongle, or to miracle-sinkctl.

Here is a example how you project your screen

$ miracle-dispctl -h
Usage:
  miracle-dispctl [OPTION...]

Help Options:
  -h, --help                                  Show help options
  --help-all                                  Show all help options
  --help-gapplication                         Show GApplication options

Application Options:
  -i, --interface=WNIC name                   name of wireless network interface
  -w, --wfd-subelems=device info subelems     device infomation.  default: 000600001c4400c8
  -p, --peer-mac=peer MAC                     MAC address of target peer
  -x, --authority=display authority           authority to capture from display. default: XAUTHORITY environment variable
  -d, --display=display name                  display name.	default: DISPLAY environment variable
  -m, --monitor-num=monitor number            monitor number.  default: -1, primary monitor
  -a, --audio-device=audio device name        pulseaudio device name
  -b, --dont-borrow=don't borrow WNIC         do not acquire the ownership of WNIC before using it
  -r, --dont-return=don't release WNIC        do not release the ownership of WNIC after using it

$ G_MESSAGES_DEBUG=all miracle-dispctl -p 00:50:56:c0:00:08 -i wlx18a6f71ec0b4

The miracle-dispctl process will:

  1. Acquire the ownership of a virtual NIC on the wlx18a6f71ec0b4 device using Network Manager
  2. Assign it to miracle-wifid
    1. Then it ask miracle-wifid to start P2P scanning
    2. Wait for the peer 00:50:56:c0:00:08 appearing
  3. Check with miracle-dispd to see if 00:50:56:c0:00:08 is a sink, if so
    1. Ask miracle-wifid to form P2P group with the sink
  4. Ask miracle-dispd wait for WiFi-Display session request from the sink and start streaming
  5. Wait for session ending
    1. Unassign virtual NIC on wlx18a6f71ec0b4 from miracle-wifid
    2. Release the ownership of the virtual NIC on wlx18a6f71ec0b4