GMediaRender Deployment Runbook

Last updated: May 2024 | Version: 1.0

Table of Contents

1. Prerequisites

Note: This guide assumes Proxmox VE as the host system. Adjustments may be needed for other platforms.

Required Packages

sudo apt update
sudo apt install -y alsa-utils gstreamer1.0-tools

Hardware Requirements

2. Host Audio Setup

Verify Audio Device

# List all audio devices
aplay -l

# Expected output:
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CX20632 Analog [CX20632 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Test Audio Output

speaker-test -D hw:CARD=PCH,DEV=0 -c 2 -twav

# Expected output:
speaker-test 1.2.4
Playback device is hw:CARD=PCH,DEV=0
Stream parameters are 48000Hz, S16_LE, 2 channels
0 - Front Left
1 - Front Right
Warning: If no sound is heard, check volume levels with alsamixer -c 0 and unmute channels.

3. LXC Container Setup

Create Container

# On Proxmox host
pct create 100 local:vztmpl/debian-11-standard_11.3-1_amd64.tar.gz \
    --hostname audio-renderer \
    --memory 512 \
    --cores 1 \
    --net0 name=eth0,bridge=vmbr0,ip=dhcp

Configure Audio Passthrough

# Edit container config
nano /etc/pve/lxc/100.conf

# Add these lines:
lxc.cgroup2.devices.allow: c 116:* rwm
lxc.mount.entry: /dev/snd dev/snd none bind,optional,create=dir
Note: Container ID (100) and network settings should be adjusted for your environment.

4. GMediaRender Installation

Install Dependencies

# Inside LXC container
apt update
apt install -y gmediarender gstreamer1.0-alsa gstreamer1.0-plugins-good

Quick Test

gmediarender --friendly-name="Test Renderer" \
    --gstout-audiosink="alsasink device=hw:CARD=PCH,DEV=0" \
    --port=49494

# Expected output:
Ready for rendering.

5. Service Configuration

Create Systemd Service

nano /etc/systemd/system/gmediarender.service

# Add this configuration:
[Unit]
Description=DLNA Audio Renderer
After=network.target

[Service]
ExecStart=/usr/bin/gmediarender \
    --friendly-name="LXC Audio Renderer" \
    --gstout-audiosink="alsasink device=hw:CARD=PCH,DEV=0" \
    --port=49494 \
    --uuid=$(uuidgen) \
    --logfile=/var/log/gmediarender.log
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

Enable and Start Service

systemctl daemon-reload
systemctl enable --now gmediarender
systemctl status gmediarender

# Expected status:
● gmediarender.service - DLNA Audio Renderer
     Loaded: loaded (/etc/systemd/system/gmediarender.service; enabled; vendor preset: enabled)
     Active: active (running) since ...

6. Verification & Testing

Check Logs

tail -f /var/log/gmediarender.log

# Expected:
Ready for rendering.

Test with GStreamer

gst-launch-1.0 audiotestsrc ! audio/x-raw,rate=44100,channels=2 ! alsasink device=hw:CARD=PCH,DEV=0
Success: At this point, your DLNA renderer should appear in network clients (e.g., VLC, BubbleUPnP).

7. Troubleshooting

Common Issues

No sound in container:
# On host:
ls -l /dev/snd/
# Ensure container has access to controlC0 and pcmC0D0p devices
Service crashes:
journalctl -u gmediarender -f
# Check for ALSA or GStreamer errors

Network Debugging

# Check if port is open
ss -tulnp | grep 49494

# Test discovery protocol
avahi-browse -r _renderer._tcp
Pro Tip: For persistent issues, run gmediarender manually without --daemon to see real-time output.