You are not logged in.

#1 2020-02-07 11:05:09

k395
Member
Registered: 2020-01-29
Posts: 37

Is there a simpler way to mirror computer screen to TV (Miracast)?

Currently I've doing it like this:

1. Install `miraclecast-git` from the AUR. (connman would also work. For some reason, wpa_kli doesn't work for me)
2. Get the source code of https://github.com/intel/wds , then run `cmake .; make desktop-source-test`
3. Install `gst-plugins-bad` and `gst-plugins-ugly`. (I think wds requires those, otherwise `desktop-source-test` will error on connect)
3. Run `desktop_source/desktop-source-test`
4. Start miraclecast. (instruction is at https://github.com/albfan/miraclecast and https://github.com/albfan/miraclecast/issues/4)

systemctl stop NetworkManager.service
systemctl stop wpa_supplicant.service 
sudo miracle-wifid &
select 3
sudo miracle-wifictl
p2p-scan

5. Connect to the device. `connect ff:ff:ff:ff:ff:ff@3`

I don't understand why I should install `desktop-source-test`. It's not linked anywhere in the instruction on how to use miraclecast.
(the linked issue suggests using VLC to play a video, but I don't want to play a video, just mirror the screen)

Another questions: can I mirror the screen/play a video with miraclecast only (or ffmpeg)?

Last edited by k395 (2020-02-08 00:38:11)

Offline

#2 2020-02-07 13:15:12

Wild Penguin
Member
Registered: 2015-03-19
Posts: 320

Re: Is there a simpler way to mirror computer screen to TV (Miracast)?

I've used a SteamLink (with steam client running on the desktop I want to mirror) to achieve this. Also, another laptop running another Steam instance can connect to another computer - I've used this few times, too. Bonus: input is also used on the client, so it is effectively a remote desktop. There were a few quirks if an application outside Steam changed resolution, or if the aspect ratios (of source -> client) didn't match, but those were something I was able to work around (choose an aspect ratio and preferentially resolution on the source computer to match the client aspect ratio and native resolution).

I know it is a bit of a cludge, however, last time I checked, all FOSS solutions I could find were not very convenient or user friendly.

I'm not sure which part you are referring to when they suggest using VLC to play a video. If I understand it correctly, they use Miraclecast to cast (whatever they want to cast) and then VLC  as the client. However I didn't read that issue thoroughly (it gets a bit too technical compared to how much time and interest I've got my hands currently).

EDIT: The instructions how to use Miraclecast are there in the github main page. I've never used it, however it doesn't look too complicated. If it seems too complicated, look for another solution; for example two steam clients. Miraclecast seems to be an implementation for a protocol called Miracast, which is meant for casting over Wifi, and IMHO makes sense only if you already got devices which can cast. If you want to use it as you intend, it is a WIP (as said in the front page and in the issue you've linked - your link has an extra ) at the end, btw.)

Last edited by Wild Penguin (2020-02-07 13:24:17)

Offline

#3 2020-02-12 01:24:08

yochananmarqos
Member
Registered: 2020-02-05
Posts: 197

Re: Is there a simpler way to mirror computer screen to TV (Miracast)?

I would say gnome-network-displays in the AUR is easier if you want to use a GUI.

Offline

#4 2020-02-12 04:07:10

k395
Member
Registered: 2020-01-29
Posts: 37

Re: Is there a simpler way to mirror computer screen to TV (Miracast)?

yochananmarqos wrote:

I would say gnome-network-displays in the AUR is easier if you want to use a GUI.


I came across it before, but I thought it would not work because I don't use a GNOME windows manager.

I've just install and test it. It can list the device name, but it cannot connect.

[]$ sudo G_MESSAGES_DEBUG=all gnome-network-displays 
(gnome-network-displays:20211): GLib-DEBUG: 00:00:24.252: posix_spawn avoided (fd close requested) 
(gnome-network-displays:20211): GLib-GIO-DEBUG: 00:00:24.263: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ‘gio-vfs’
(gnome-network-displays:20211): GLib-DEBUG: 00:00:24.318: posix_spawn avoided (fd close requested) 
** (gnome-network-displays:20211): DEBUG: 00:00:24.321: NdPulseaudio: PA context went into failed state during init
** (gnome-network-displays:20211): DEBUG: 00:00:24.321: NdPulseaudio: Error querying sink info
** (gnome-network-displays:20211): DEBUG: 00:00:24.361: NdScreencastPortal: Aquired Portal proxy

** (gnome-network-displays:20211): WARNING **: 00:00:24.361: Could not create screencast portal proxy: Error spawning command line “dbus-launch --autolaunch=0f33b15dc4fc4e69a57081bdc5188e70 --binary-syntax --close-stderr”: Child process exited with code 1

** (gnome-network-displays:20211): WARNING **: 00:00:24.361: Error initing screencast portal: Error spawning command line “dbus-launch --autolaunch=0f33b15dc4fc4e69a57081bdc5188e70 --binary-syntax --close-stderr”: Child process exited with code 1

** (gnome-network-displays:20211): WARNING **: 00:00:24.361: Falling back to X11! You need to fix your setup to avoid issues (XDG Portals and/or mutter screencasting support)!

** (gnome-network-displays:20211): WARNING **: 00:00:24.362: Error initializing pulse audio sink: PA failed
** (gnome-network-displays:20211): DEBUG: 00:00:24.386: WFDP2PRegistry: Found a new device, creating provider
** (gnome-network-displays:20211): DEBUG: 00:00:24.386: WFDP2PProvider: Found a new sink with peer 0x55e6859accc0 on device 0x55e6859e42b0
** (gnome-network-displays:20211): DEBUG: 00:00:24.386: WfdP2PProvider: Discover is now set to 1
** (gnome-network-displays:20211): DEBUG: 00:00:24.387: SinkList: Adding a sink
** (gnome-network-displays:20211): DEBUG: 00:00:24.387: WFDP2PProvider: Found a new sink with peer 0x55e6859accc0 on device 0x55e6859e42b0
** (gnome-network-displays:20211): DEBUG: 00:00:24.394: WFDP2PRegistry: Got NMClient
** (gnome-network-displays:20211): DEBUG: 00:00:26.802: Found x264enc for video encoding.
** (gnome-network-displays:20211): DEBUG: 00:00:26.802: Found fdkaacenc for audio encoding.
** (gnome-network-displays:20211): DEBUG: 00:00:26.802: Found avenc_aac for audio encoding.
** (gnome-network-displays:20211): DEBUG: 00:00:26.802: Found faac for audio encoding.
** (gnome-network-displays:20211): DEBUG: 00:00:26.803: Got state change notification from streaming sink to state ND_SINK_STATE_WAIT_P2P
** (gnome-network-displays:20211): DEBUG: 00:00:26.804: WfdP2PProvider: Discover is now set to 0
** (gnome-network-displays:20211): DEBUG: 00:00:26.819: NdWfdP2PSink: Got P2P connection
** (gnome-network-displays:20211): DEBUG: 00:00:26.819: Found x264enc for video encoding.
** (gnome-network-displays:20211): DEBUG: 00:00:26.819: Found fdkaacenc for audio encoding.
** (gnome-network-displays:20211): DEBUG: 00:00:26.819: Found avenc_aac for audio encoding.
** (gnome-network-displays:20211): DEBUG: 00:00:26.819: Found faac for audio encoding.
** (gnome-network-displays:20211): DEBUG: 00:00:26.820: Got state change notification from streaming sink to state ND_SINK_STATE_WAIT_SOCKET
** (gnome-network-displays:20211): DEBUG: 00:00:54.823: WfdServer: Finalize
** (gnome-network-displays:20211): DEBUG: 00:00:54.823: WfdMediaFactory: Finalize
** (gnome-network-displays:20211): DEBUG: 00:00:54.823: Got state change notification from streaming sink to state ND_SINK_STATE_ERROR

Offline

#5 2020-02-12 15:37:11

yochananmarqos
Member
Registered: 2020-02-05
Posts: 197

Re: Is there a simpler way to mirror computer screen to TV (Miracast)?

Does the same thing happen if you test with a dummy display? See the Testing section on GitHub.

Offline

#6 2020-02-13 04:03:49

freebird54
Member
Registered: 2019-08-29
Posts: 12

Re: Is there a simpler way to mirror computer screen to TV (Miracast)?

Not sure if this comment contributes to the discussion, but the title does ask for simple...
I haven't looked into mirrorcast or anything else yet, because it appears that Chromium-based browsers have an extension that handles everything I need in casting. I use Brave, and it gives the choice of casting a (t)ab, a (f)ile or the (s)creen - which has covered everything so far. well - simple was requested!

Freebird54

Offline

#7 2020-02-15 08:24:08

k395
Member
Registered: 2020-01-29
Posts: 37

Re: Is there a simpler way to mirror computer screen to TV (Miracast)?

freebird54 wrote:

Not sure if this comment contributes to the discussion, but the title does ask for simple...
I haven't looked into mirrorcast or anything else yet, because it appears that Chromium-based browsers have an extension that handles everything I need in casting. I use Brave, and it gives the choice of casting a (t)ab, a (f)ile or the (s)creen - which has covered everything so far. well - simple was requested!

I think that it's Chromecast, not Miracast.

Offline

#8 2020-02-15 08:31:57

k395
Member
Registered: 2020-01-29
Posts: 37

Re: Is there a simpler way to mirror computer screen to TV (Miracast)?

yochananmarqos wrote:

Does the same thing happen if you test with a dummy display? See the Testing section on GitHub.

It does work as expected. If I run `sudo NETWORK_DISPLAYS_DUMMY=1 gnome-network-displays `, then choose "Dummy WFD Sink", then run `mplayer rtsp://localhost:7236/wfd1.0 `, the video can be played.

Offline

#9 2020-08-28 11:52:59

zebulon
Member
Registered: 2008-10-20
Posts: 358

Re: Is there a simpler way to mirror computer screen to TV (Miracast)?

Having searched a way to do this, I can also report my experience. Computer runs Arch (obviously...) and TV is a Q7FN 2018 from Samsung.

I was able to do a Miraclecast connection to the TV using instructions given at https://github.com/albfan/miraclecast/issues/47. However, that is just that, a connection (the TV acknowledges the connection) and as explained on the same link, you need to stream a flux to get an image to your TV. The thread suggests cvlc, which used, but I did not find which app to use on the TV to read that stream. Using a Samsung phone, this works automatically, I am wondering which mechanism is behind this (maybe a specific port)? Anyway, miracast has a big disadvantage: you need to use a Wifi adapter dedicated for this, meaning you lose Internet connection on the PC.

Then I tried Steam. Steam Link app is available for Samsung smart TV. And this works great. I was able to command using a Steam Controler (in Blutooth mode) from the TV. I was able also to exit big picture, leading to being able to see and use the Linux desktop. Unfortunately, I had to use a virtual keyboard, but this is a good enough solution for me. Maybe a blutooth keyboard would be useable as well?

Last edited by zebulon (2020-08-28 11:53:55)

Offline

Board footer

Powered by FluxBB