Plan 9: Share Media Content with TV via UPnP
Share media content with UPnP / DLNA capable players.
This is a proof-of-concept of network programming (TCP and UDP) in Plan 9. For information, man udp is a useful place to get started.
# Server - shares /mnt/media
upnp/server 10.0.2.15
# Client
upnp/fs 10.0.2.15
ls /n/upnp
echo refresh > /n/upnp/ctl
Device Quirks
VLC
VLC looks for "urn:schemas-upnp-org:service:ContentDirectory:1" instead of "urn:schemas-upnp-org:device:MediaServer:1" during M-SEARCH.
LG WebOS TV
LG WebOS TV needs the services "urn:schemas-upnp-org:service:ConnectionManager:1" and "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1" in addition to "urn:schemas-upnp-org:service:ContentDirectory:1" in device.xml.
It also seems to remember the UUIDs for a particular IP address. If you change the UUID of our application and it doesn't appear in the TV, restarting the TV might help.
Lessons Learnt
- Put program assets like XML files in /sys/lib/<app> directory.
Code
- https://gitlab.com/atamariya/plan9front/-/blob/dev/sys/src/cmd/upnp/server.c
- https://gitlab.com/atamariya/plan9front/-/blob/dev/sys/src/cmd/upnp/fs.c
Comments
Post a Comment