TonyTromp / tidal-connect-docker

This is the dockerized version of Tidal Connect Raspberry binairies. Can be seemlessly used in HifiberryOS or any other RPi based operating system running Docker.
162 stars 28 forks source link

Enable app volume control with ALSA softvol on USB audio interface #45

Open ulexxander opened 6 months ago

ulexxander commented 6 months ago

Sharing my solution, did not find anything appropriate for me in issues here.

I am using tidal-connect-docker image on plain Raspberry Pi OS without any desktop environment, on Pi 4B model with MOTU M2 USB audio interface that outputs to speakers.

As playback device I was setting M2: USB Audio (hw:2,0). Because of that volume control didn't work as that device did not had any controls in ALSA.

To make volume control in Tidal app work I configured ALSA to enable softvol - software volume control and set that as a playback device in tidal-connect-docker.

Instead of M2 below put your card name, find it with aplay -L

File asound.conf

pcm.softvol {
    type            softvol
    slave {
        pcm         "hw:CARD=M2,DEV=0"
    }
    control {
        name        "SoftMaster"
        card        "M2" 
    }
}

pcm.!default {
    type             plug
    slave {
        pcm         "softvol"
    }
}

ctl.!default {
    type hw
    card "M2" 
}

File docker-compose.yml

version: "3.8"

services:
  tidal-connect:
    image: edgecrush3r/tidal-connect:latest
    tty: true
    network_mode: host
    devices:
      - /dev/snd
    volumes:
      - /var/run/dbus:/var/run/dbus
      - ./asound.conf:/etc/asound.conf
    environment:
      - FRIENDLY_NAME=malinka
      - MODEL_NAME=malinka
      - PLAYBACK_DEVICE=default
      - MQA_CODEC=false
      - MQA_PASSTHROUGH=false
    restart: always
    stop_grace_period: 1s

Further reading: