diff --git a/README.md b/README.md index b100f41..64e3624 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,16 @@ The Display-Source side allows you to connect external displays to your system a On the other hand, the Display-Sink side allows you to create wifi-capable external displays yourself. You can use it on your embedded devices or even on full desktops to allow other systems to use your device as external display. +## Steps to Setup MiracleCast on Ving NUC + +In the root of the project directory, run `sudo ./install.sh` + +Steps to run: +1. Run `sudo miracle-wifid --log-level trace --log-date-time` in a terminal. +2. Run `sudo miracle-sinkctl -e run-vlc.sh --log-level trace --log-journal-level trace --log-date-time -- set-friendly-name VingMiracle` in a separate terminal. + +Now you should be able to cast your Windows 10/11 devices on Ving NUC. + ## Requirements The MiracleCast projects requires the following software to be installed: diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..26881e6 --- /dev/null +++ b/install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +apt install cmake libglib2.0-dev libudev-dev libsystemd-dev libreadline-dev check libtool -y + +apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-tools -y + +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=/usr .. +make +make install + +cd .. + +echo "-- Installing: /root/.miraclecast" +cp res/.miraclecast /root/ + +echo "-- Installing: /usr/bin/run-vlc.sh" +cp res/run-vlc.sh /usr/bin/ + +echo "-- Installing: /etc/systemd/system/miracle-wifid.service" +cp systemd/system/miracle-wifid.service /etc/systemd/system/ + +echo "-- Installing: /etc/systemd/system/miracle-sink.service" +cp systemd/system/miracle-sink.service /etc/systemd/system/ \ No newline at end of file diff --git a/res/.miraclecast b/res/.miraclecast new file mode 100644 index 0000000..1469c1e --- /dev/null +++ b/res/.miraclecast @@ -0,0 +1,17 @@ +[sinkctl] +external-player=1 +#extends.wfd_video_formats=40 00 01 10 0001bdeb 051557ff 00000fff 10 0000 001f 11 0780 0438, 02 10 0001bdeb 155557ff 00000fff 10 0000 001f 11 0780 0438 +extends.wfd_audio_codecs=AAC 0000000f 00, AC3 00000007 00 +#extends.wfd_display_edid=0001 00ffffffffffff0051f38f50010000000e100104a51d10ff2f0000a057499b2610484f000000010101010101010101010101010101011a36809c70381f403020350025a510000018000000fc00496e7465726e616c204c43440a000000fd003c3c9a9a0e00000000000000000000000000000000000000000000000000000030 +extends.wfd_connector_type=05 +extends.microsoft_cursor=none +extends.microsoft_rtcp_capability=none +extends.wfd_idr_request_capability=0 +extends.microsoft_latency_management_capability=none +extends.microsoft_format_change_capability=none +extends.microsoft_diagnostics_capability=none +extends.intel_friendly_name=miraclecast +extends.intel_sink_manufacturer_name=GNU Linux +extends.intel_sink_model_name=Arch linux +extends.intel_sink_device_URL=http://github.com/albfan/miraclecast +extends.wfd_uibc_capability=none \ No newline at end of file diff --git a/res/run-vlc.sh b/res/run-vlc.sh index b43ed46..c762b54 100755 --- a/res/run-vlc.sh +++ b/res/run-vlc.sh @@ -1,2 +1,4 @@ -export DISPLAY=:0 && su -c "cvlc --no-osd --no-video-title-show --network-caching=200 rtp://@:7236" letsving +#!/bin/bash + +export DISPLAY=:0 && su -c "cvlc --no-osd --no-video-title-show --network-caching=300 rtp://@:7236" letsving #export DISPLAY=:0 && su -c "cvlc --no-osd --no-video-title-show --network-caching=200 --no-ts-trust-pcr --h264-fps=23 rtp://@:7236" letsving diff --git a/systemd/system/miracle-sink.service b/systemd/system/miracle-sink.service index 5075600..691323c 100644 --- a/systemd/system/miracle-sink.service +++ b/systemd/system/miracle-sink.service @@ -1,12 +1,12 @@ [Unit] Description=Miraclecast sink on default link Before=network.target -After=miracle-wifid.service +Requires=miracle-wifid.service [Service] Type=simple -ExecStart=/usr/bin/miracle-sinkctl -Restart=always +ExecStart=/usr/bin/miracle-sinkctl --log-level debug --log-journal-level debug -- set-friendly-name VingMiracle +ExecStopPost=-/usr/bin/systemctl stop miracle-wifid.service User=root [Install] diff --git a/systemd/system/miracle-wifid.service b/systemd/system/miracle-wifid.service index f47819d..93d9de3 100644 --- a/systemd/system/miracle-wifid.service +++ b/systemd/system/miracle-wifid.service @@ -1,12 +1,21 @@ [Unit] Description=wpa_supplicant with Miracast support Before=network.target -After=dbus.service +After=dbus.socket [Service] Type=simple -ExecStart=/usr/bin/miracle-wifid -Restart=always + +ExecStartPre=-/usr/bin/systemctl stop ap.service +ExecStartPre=-/usr/bin/systemctl stop NetworkManager.service +ExecStartPre=-/usr/bin/systemctl stop wpa_supplicant.service + +ExecStart=/usr/bin/miracle-wifid --log-level debug + +ExecStopPost=-/usr/bin/systemctl start wpa_supplicant.service +ExecStopPost=-/usr/bin/systemctl start NetworkManager.service +ExecStopPost=-/usr/bin/systemctl start ap.service + User=root [Install]