Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
MiracleCast – Wifi-Display/Miracast Implementation (github.com/albfan)
151 points by tosh on Dec 10, 2022 | hide | past | favorite | 39 comments


Kick ass to see progress continuing on this great Miracast implementation (Miraclecast). It seems to have been one of the ongoing sticking points that Linux just never quite got going, in spite of a couple tries.

It's unfortunate the industry as a whole never really got their stuff together on this- while I like the thicker client model that, say, a Chromecast has for many reasons (not trying to stream media live is a win), having streaming media as a baseline tech seems straightforwardly sensible & universal, and we probably would have advanced wifi & streaming considerably if this had started seeing wider adoption. It was a reasonable enough wireless-cable-substitute.

There's a PR for getting Miraclecast working as a source for external displays, which would be a great addition. https://github.com/albfan/miraclecast/pull/455


Gnome Network Displays seems to be working fine here. Including virtual monitors. I use it regularly to cast to my TV including videos with sound. The latency could be better though.


Is there a way to enable compression on it? That may help with latency depending on the root cause.


afaik it's almost always h.264. but it's just rtp/rtsp...

> Miracast is based on the peer-to-peer Wi-Fi Direct standard. It allows sending up to 1080p HD video (H.264 codec) and 5.1 surround sound (AAC and AC3 are optional codecs, mandated codec is pcm)


No idea. It's kind of plug and play, without any settings involved.


Miracast was cool... while it lasted. It had some issues as a standard though (one of the biggest being no maximum latency). Apple never supported it (AirPlay), and Android only supported it from 4.2-5.0, since being replaced with Google Cast (and as ComputerWorld sarcastically put it, this was "to the immense disappointment of approximately seven people"). Miracast is still functional on Windows and Linux... but how many people use it?

The best effort, though little known, was Microsoft selling a wireless stick for $49 that would connect to your TV and only supported Miracast. However, the latency was never near as good as Microsoft portrayed (watching a movie over Miracast generally isn't fun). They still sell it apparently, but now only for business uses: https://www.microsoft.com/en-us/d/microsoft-wireless-display...


The MS Wireless Display Adapter is amazing for business use (PowerPoint, etc.). Mostly static content. They also even more silently released a 4K one recently, which may have resolved the latency.


Why would latency be a problem with video? Or is the audio separate and not latency compensated?


If you have video-only content like a presentation you're fine. The moment you've got content with audio, like a movie, the AV sync issues are intolerable. I had one of the Microsoft adapters and I'd also see dropped frames and stuttering video. That was when I could even get the thing to connect. Apple's AirPlay isn't perfect by any means but it's a far better experience than I've ever had with Miracast.


> The moment you've got content with audio, like a movie, the AV sync issues are intolerable.

VLC media player allows you to adjust audio delay. Doing so can help combat the issue.

https://wiki.videolan.org/VLC_HowTo/Adjust_audio_delay/


I used that adapter to watch a bunch of Game of Thrones episodes with no noticeable lag issues. But the device casting was Surface, so maybe it's just a case of vendor optimizing for its own products.


> and Android only supported it from 4.2-5.0

I can cast my android 12 tablet (samsung) to my tv (panasonic, running firefox-os). The tablet calls it smart-view, the TV vierra-link. At least vierra-link is just a different name for miracast.


Google dropped it from Android, but several phone manufacturers are putting it back in ever since.


I used Miracast with the Microsoft stick to watched movies and it was way better than competitors IMO.


It would be neat if there were userspace Miracast framebuffers. Could have a larger number of information displays around and just send images to them occasionally without having to have run X for each, or whatever.


If I understand your goal correctly, would EVDI (Extensible Virtual Display Interface) not be a possibility for you? EVDI allows to create "virtual heads", that you could then conceivably cast to external displays via `miraclecast`, VNC, etc.

It was originally created to support some ancient USB graphics card, but can be used independently off any specific hardware.

https://github.com/DisplayLink/evdi


That's a kernel module. Why should I need that? I just want to tell some network device to display a PNG or whatever.


To simulate a graphics_card/virtual_head?

That gives you the full possibilities of your desktop environment to arrange surfaces in relation to each-other, and place content.

Now, true, if you only need to "beam" static images somewhere, there are other options.

On any recent distribution, `evdi` should be available through the package manager, even Debian has `evdi-dkms`. And your distribution takes care of signing the module, so that you don't have to disable SecureBoot. (Just need to uncomment the line to enable the module-signing helper.)


No, that is not what I am saying.


Especially with the flood of mediocre but very cheap and thin "portable" displays that can be powered over USB.


Yes, that would be lovely.


Interested to know if anyone can share what sink devices they use to drive the external display? My intention was to achieve something similar via VNC/nx and use a RaspberryPI ZeroW driving a TV via HDMI input.


Microsoft's 4k wireless display adapter works great with reasonably low latency.

Chromecast has so much latency on my tv, that its impossible to use mouse and UI while looking at the tv.

And miracast just works with windows 10, its built in. Plus you don't need to be on the same network, good for guests.


Miracast also seems to work with most Android phones, with the notable exception of Google (who used to have it in Nexus and then killed it off to promote Chromecast).


> Plus you don't need to be on the same network, good for guests

That means that the traffic goes through Microsoft's servers? Might be a privacy issue ?


> Plus you don't need to be on the same network

You mean in case of the Wireless Display Adapter? For Miracast you do need to be on the same LAN, right?


No, it makes a WifiDirect connection to the tv concurrent to your normal wifi.


Can you use a different Wi-Fi network at the same time for internet access or does Wi-Fi Direct block any other Wi-Fi access?


Yes, it works simultaneously, that's what I meant with concurrent.


Could this be used to allow a bigger and faster embedded system share its big screen with smaller boards with no video output through WiFi, or Ethernet where available, so that each one of them receives a portion of the screen, sorta like a quad multiplexer used in CCTV?


In short, yes, but the exact (very long) answer depends on whether you have a gfx-card in the (beefy) 'compute-machine', whether you use X11, or Wayland, Gnome or not, HW-encoding available etc. And that is on the server side. Clientside this also depends on whether you can install arbitrary software, or are limited to e.g. the DLNA-Implementation of e.g. a TV, when it comes to launching/pushing the streams of each quarter.

You should be able to use `ffmpeg` or `gstreamer` to construct pipeline(s) to screenrecord, pump out 4 TransportStreams in as-lossless-as-possible-bitrate over UDP, and use DLNA/whatEv to instruct the client devices to display the appropriate stream.

If the GFX-Card(s) in the "BeefyPC" can render 4 heads. then this will nearly work ootb with miraclecast.


This has been around for a while: https://taoofmac.com/space/apps/screencasting

Good thing to see it’s pretty much full featured now.


How much does casting video over Wi-Fi (especially 4k) affect the performance of the other Wi-Fi traffic in a house? I moved everything to ethernet cables recently, except phones and tablets and I have no more stuttering when watching videos. But that's only me. I wonder, what if there were other people around doing their own Wi-Fi traffic and watching their own videos?


It will depend on the number of antennas in your client and AP and the wifi tech. MIMO and beamforming make interference less impactful, but that's offset by the increasing number of devices.


A different altern@tive gor media streaming, dimilar to chromecast, is Nymphcast: https://github.com/MayaPosch/NymphCast

Both clients and servers are available, it also works at a higher level.


Why not use VNC's protocol, and e.g. allow your screen to be displayed in a web-browser too?


Microsoft and other vendors have built-in support for Miracast; I think a small number of TVs might too. VNC is a remote desktop protocol; Miracast is more of a networked display cable.


Also, VNC is hugely inefficient in comparison with more modern protocols.


This would be handy as an OBS output. I wonder how well it builds and runs on macOS?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: