SkillAgentSearch skills...

DirettaRendererUPnP

The world's first native UPnP/DLNA renderer with Diretta protocol support

Install / Use

/learn @cometdom/DirettaRendererUPnP
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Diretta UPnP Renderer v2.1.4

The world's first native UPnP/DLNA renderer with Diretta protocol support - Low-Latency Edition

License: MIT Platform C++17


Version Low Latency SDK Audirvana


What's New in v2.1.4

Fix Audirvana local stream detection.

  • Link-local address detection — Audirvana streams via link-local addresses (169.254.x.x) were incorrectly detected as remote streams, enabling HTTP reconnection options that Audirvana's local HTTP server doesn't support. This caused playback interruptions, white noise, and track advancement issues with Audirvana Studio.
  • Resilient UPnP startup — On systems where the network isn't ready at boot (e.g., GentooPlayer with OpenRC), UPnP initialization now retries automatically instead of failing immediately.

See CHANGELOG.md for details.

Previous Versions

| Version | Highlights | |---------|-----------| | v2.1.3 | Fix target retry pre-check bypass | | v2.1.2 | Resilient target discovery (retry at startup instead of immediate exit) | | v2.1.1 | UAPP compatibility, format transition stability, high sample rate buffers, build capabilities logging | | v2.1.0 | Web Configuration UI, Advanced SDK settings, stop fix (herisson-88), libupnp auto-detect | | v2.0.6 | Advanced SDK settings, config migration, stop fix (herisson-88), libupnp auto-detect | | v2.0.5 | Stop fix for Holo Red (herisson-88), libupnp auto-detection, privilege drop removed | | v2.0.4 | Centralized logging, rebuffering on underrun, ARM NEON SIMD, systemd hardening, unit tests | | v2.0.3 | Audirvana compatibility (UPnP event deduplication), adaptive buffer for remote streaming | | v2.0.2 | Native DSD from Audirvana (DSDIFF parser), UPnP event notifications, gapless preload | | v2.0.1 | 24-bit white noise fix for DACs without 32-bit support | | v2.0.0 | Complete rewrite — low-latency architecture, lock-free ring buffer, AVX2 SIMD |

See CHANGELOG.md for full version history.


Support This Project

If you find this renderer valuable, you can support development:

ko-fi

Important notes:

  • Donations are optional and appreciated
  • Help cover test equipment and coffee
  • No guarantees for features, support, or timelines
  • The project remains free and open source for everyone

IMPORTANT - PERSONAL USE ONLY

This renderer uses the Diretta Host SDK, which is proprietary software by Yu Harada available for personal use only. Commercial use is strictly prohibited. See LICENSE for details.


Table of Contents


Overview

This is a native UPnP/DLNA renderer that streams high-resolution audio using the Diretta protocol for bit-perfect playback. Unlike software-based solutions that go through the OS audio stack, this renderer sends audio directly to a Diretta Target endpoint (such as Memory Play, GentooPlayer, or hardware with Diretta support), which then connects to your DAC.

What is Diretta?

Diretta is a proprietary audio streaming protocol developed by Yu Harada that enables ultra-low latency, bit-perfect audio transmission over Ethernet. The protocol uses two components:

  • Diretta Host: Sends audio data (this renderer uses the Diretta Host SDK)
  • Diretta Target: Receives audio data and outputs to DAC (e.g., Memory Play, GentooPlayer, or DACs with native Diretta support)

Key Benefits

  • Bit-perfect streaming - Bypasses OS audio stack entirely
  • Ultra-low latency - ~300ms PCM buffer (vs ~1s in v1.x)
  • High-resolution support - Up to DSD1024 and PCM 1536kHz
  • Gapless playback - Seamless track transitions
  • UPnP/DLNA compatible - Works with any UPnP control point
  • Network optimization - Adaptive packet sizing with jumbo frame support

Architecture

Version 2.x uses a simplified, performance-focused architecture:

┌─────────────────────────────┐
│  UPnP Control Point         │  (JPlay, BubbleUPnP, mConnect, etc.)
└─────────────┬───────────────┘
              │ UPnP/DLNA Protocol (HTTP/SOAP/SSDP)
              ▼
┌───────────────────────────────────────────────────────────────┐
│  DirettaRendererUPnP v2.x                                     │
│  ┌─────────────────┐  ┌─────────────────┐  ┌───────────────┐  │
│  │   UPnPDevice    │─▶│ DirettaRenderer │─▶│  AudioEngine  │  │
│  │ (discovery,     │  │ (orchestrator,  │  │ (FFmpeg       │  │
│  │  transport)     │  │  threading)     │  │  decode)      │  │
│  └─────────────────┘  └────────┬────────┘  └───────┬───────┘  │
│                                │                   │          │
│                                ▼                   ▼          │
│                  ┌─────────────────────────────────────────┐  │
│                  │           DirettaSync                   │  │
│                  │  ┌───────────────────────────────────┐  │  │
│                  │  │       DirettaRingBuffer           │  │  │
│                  │  │  (lock-free SPSC, AVX2 convert)   │  │  │
│                  │  └───────────────────────────────────┘  │  │
│                  │              │                          │  │
│                  │              ▼ getNewStream() callback  │  │
│                  │  ┌───────────────────────────────────┐  │  │
│                  │  │      DIRETTA::Sync (SDK)          │  │  │
│                  │  └───────────────────────────────────┘  │  │
│                  └─────────────────────────────────────────┘  │
└───────────────────────────────────────────────────────────────┘
              │ Diretta Protocol (UDP/Ethernet)
              ▼
┌─────────────────────────────┐
│      Diretta TARGET         │  (Memory Play, GentooPlayer, etc.)
└─────────────┬───────────────┘
              ▼
┌─────────────────────────────┐
│            DAC              │
└─────────────────────────────┘

v2.0 vs v1.x Architecture

| Component | v1.x | v2.0 | |-----------|------|------| | SDK Base Class | DIRETTA::SyncBuffer | DIRETTA::Sync | | Data Model | Push (SDK manages timing) | Pull (getNewStream() callback) | | Ring Buffer | Standard | Lock-free SPSC with AVX2 | | Format Conversion | Per-sample | SIMD batch (8-32 samples) | | Thread Safety | Mutex-based | Lock-free atomics |


Features

Audio Quality

  • Bit-perfect streaming: No resampling or processing (when formats match)
  • PCM Bypass mode: Direct path for bit-perfect playback when no conversion needed
  • High-resolution support:
    • PCM: Up to 32-bit/1536kHz
    • DSD: DSD64, DSD128, DSD256, DSD512, DSD1024
  • Format support: FLAC, ALAC, WAV, AIFF, DSF, DFF, MP3, AAC, OGG
  • Gapless playback: Seamless album listening experience

Low-Latency Optimizations

  • Reduced buffers: 300ms PCM (was 1s), 800ms DSD
  • Micro-sleeps: 500µs flow control (was 10ms)
  • Lock-free path: Zero mutex in audio hot path
  • SIMD conversions: AVX2 for 8-32x throughput
  • Zero allocations: Pre-allocated buffers in steady state

UPnP/DLNA Features

  • Full transport control: Play, Stop, Pause, Resume, Seek
  • Device discovery: SSDP advertisement for automatic detection
  • Dynamic protocol info: Exposes all supported formats to control points
  • Position tracking: Real-time playback position updates

Network Optimization

  • Adaptive packet sizing: Synchronized with SDK cycle time
  • Jumbo frame support: Up to 16KB MTU for maximum performance
  • Automatic MTU detection: Configures optimal packet size

Robustness

  • Resilient startup: Retries target discovery indefinitely if target is not yet available, with periodic status logging
  • Auto-release: Diretta target released after idle timeout for coexistence with other Diretta hosts

Requirements

Supported Architectures

The renderer automatically detects and optimizes for your CPU:

| Architecture | Variants | Notes | |--------------|----------|-------| | x64 (Intel/AMD) | v2 (baseline), v3 (AVX2), v4 (AVX-512), zen4 | AVX2 recommended but not required | | ARM64 | Standard (4KB pages), k16 (16KB pages) | Pi 4/5 supported | | RISC-V | Experimental | riscv64 |

Note on older x64 CPUs: CPUs without AVX2 (Sandy Bridge, Ivy Bridge - 2011-2012) are fully supported. The build system automatically detects CPU capabilities and uses optimized scalar implementations when AVX2 is not available. Use the x64-linux-15v2 SDK variant for these systems.

Platform Support

| Platform | Status | |----------|--------| | Linux x64 | Supported (Fedora, Ubuntu, Arch, AudioLinux) | | Linux ARM64 | Supported (Raspberry Pi 4/5) | | Windows | Not supported | | macOS | Not supported |

Hardware

  • Minimum: Dual-core CPU, 1GB RAM, Gigabit Ethernet
  • Recommended: Quad-core CPU, 2GB RAM, 2.5/10G Et

Related Skills

View on GitHub
GitHub Stars20
CategoryCustomer
Updated7d ago
Forks10

Languages

C++

Security Score

75/100

Audited on Mar 16, 2026

No findings