Integrate with DLNA

Last Updated on : 2024-06-25 03:43:28download

This topic describes the applicability of the Digital Living Network Alliance (DLNA) protocol. The latest TuyaOS IPC SDK has integrated with this protocol and allows users to stream media from IPCs to DLNA-compliant screens over Real Time Streaming Protocol (RTSP) or HTTP.

Overview of DLNA

Integrate with DLNA

DLNA is the protocol established by Intel along with Microsoft and Sony in 2003, in an aim to promote interoperability for digital media. Images, audio, audio-visual (AV), and other types of multimedia files are supported.

Integration method

You can submit a ticket to request support for integration with DLNA.

Architecture

The following figure shows the architecture of DLNA.

Integrate with DLNA

Networking and connectivity

For digital homes, the internet protocol family, including IPv4 and IPv6, provides the backbone for networking and connectivity. DLNA supports both IPv4 and IPv6 to ensure forward and backward device compatibility. IP serves as the cornerstone for communication among network devices. The IP functionality has been implemented on a large number of devices. DLNA-based IP supports the following advantages:

  • Applications can transparently run on the IP network topology and easily discover devices.
  • All devices in a home connect to the internet over IP.
  • Well-proven IP protocols are widely used and cost-effective.

Devices in a home network environment typically support Ethernet (IEEE 802.3i and IEEE 802.3u) and wireless technologies (IEEE 802.11a, IEEE 802.11b, IEEE 802.11g, and IEEE 802.11n). Both technologies enable devices to connect to the internet with little effort.

Device discovery and control

This feature allows compatible devices in a home to discover and communicate with each other to collaboratively accomplish tasks. Universal Plug and Play (UPnP) Device Architecture (UDA) 1.0 (ISO/IEC 29341-1) addresses all these requirements and simplifies the interconnection of devices in a home. As a result, the UDA is the answer to device discovery and control for DLNA-certified devices.

Media management

This feature allows devices networked in a home to support the management and distribution of media data. The UPnP AV architecture meets all possible requirements for a home network. Thus, UPnP is supplied as the media management solution in DLNA.

The UPnP AV protocol defines the interaction model between applications and UPnP AV devices. UPnP AV devices can be defined as (but not limited to) televisions, VCRs, DVD players, set-top boxes, stereo systems, still video cameras, portable media players, mobile phones, and PCs. UPnP AV allows the transmission of content using any media protocol in any format. In UPnP AV, devices on a home network are classified into UPnP AV servers and UPnP AV renderers. In addition, the following four services are defined:

  • Content Directory Service (CDS): makes content available and accessible to other devices on the network.
  • Connection Manager Service (CMS): determines how UPnP AV servers transfer data to UPnP AV renderers.
  • AV Transport Service (ATS): controls data streams.
  • Rendering Control Service (RCS): controls how data streams are played.

Media formats

Media formats describe how data to be transmitted over the home network is encoded, formatted, and displayed. DLNA media formats are categorized into three types of media, including images, audio, and AV. DLNA also defines a group of mandatory and optional media format profiles. Media format profiles include properties, parameters, systems, and compression level details that adequately describe the media format of binary files. This achieves interoperability between DLNA-certified devices of each specific category.

Media transmission

Media transmission defines how data is transmitted over a home network. For DLNA-compatible source devices and receiving devices, HTTP is required for data transmission and RTP serves as an optional transmission protocol.

Device roles

The following table describes four types of DLNA-certified devices.

Abbreviation Full name Description
DMC Digital media controller Establish a connection between a DMS and a DMR to discover the content provided by the DMS and deliver it to the DMR.
DMP Digital media player Search for the content provided by the DMS and play it locally.
DMR Digital media renderer Display the content provided by the DMS under the control of the DMC.
DMS Digital media server Publicize and distribute content that can be used by the DMC, DMP, and DMR.

List of protocols

Discover device

DLNA utilizes the UPnP protocol for device discovery and control. A DLNA-certified device regularly sends NOTIFY multicast messages to the fixed address and port 239.255.255.250:1900. These NOTIFY messages inform other devices on the network about the services offered by this device. This DLNA-certified device can also send M-SEARCH multicast messages to this address to search for other devices on the network.

Get description of device details

After a device is discovered, a control point still has limited information about the discovered device. It can only get the information mentioned in the discovery message, including the UPnP type of the device or service, universally unique identifier (UUID) of the device, and the URL to access the UPnP description of the device. To acquire more details of the device and its functionalities, as well as interaction with the device, the control point must retrieve the comprehensive description of the device and its capabilities from the URL provided in the discovery message.

The UPnP description contains vendor-specific details, definitions for all embedded devices, a URL for device display, a list of all services, and URLs for control and event handling.

Get service information

Each service might have zero or multiple actions. Each action can have zero or multiple parameters. These parameters can be request parameters or response parameters. If an action has one or more output response arguments, one of these arguments can be marked as a return value. Each parameter corresponds to a state variable.

Device control

Given information about a device and its services, a control point can initiate a request to call an action of that service and receive a response that the service returns to indicate the action result. This communication is achieved through Remote Procedure Call (RPC). The control point sends a control request to the service point. Then, when receiving the control command, the service point returns a successful or failed result to the control point.

How to control device

The controlURL element in the description of the device contains the server address. The control point can send appropriate requests to this address to control the device. The control requests are made over Simple Object Access Protocol (SOAP).

Media transmission

The DMR streams media over HTTP or RTSP based on the media URL provided in the SetAVTransportURI command. In this process, HTTP is a mandatory protocol that must be implemented and RTSP is optional.