GioF71 / mpd-alsa-docker

Easily run mpd with Alsa or PulseAudio output with Docker. Upsampling 2x 4x 8x with "Goldilocks" settings by Archimago. Scrobbling support.
Apache License 2.0
18 stars 5 forks source link

HTTPD stream #403

Open bonelifer opened 2 months ago

bonelifer commented 2 months ago

Now that I changed the httpd to lame, 320, I can't get MPDroid or any other mpd client which supports the httpd stream. When my set up was wrong with wave and HTTPD_OUTPUT_ENCODER_BITRATE and HTTPD_OUTPUT_ENCODER_QUALITY set, at least MPDroid would grab the stream and play it. Not sure what to do. Everything seems right. mpd is running as I an able to listen on the desktop via pulseaudio.

.env

HTTPD_OUTPUT_CREATE=yes
HTTPD_OUTPUT_ENABLED=yes
HTTPD_OUTPUT_NAME="HTTP Stream"
HTTPD_OUTPUT_PORT=8000
HTTPD_OUTPUT_BIND_TO_ADDRESS=192.168.1.80
HTTPD_OUTPUT_ENCODER=lame
HTTPD_OUTPUT_ENCODER_BITRATE=320
HTTPD_OUTPUT_MAX_CLIENTS=0
HTTPD_OUTPUT_ALWAYS_ON=yes
HTTPD_OUTPUT_TAGS=yes
HTTPD_OUTPUT_FORMAT=44100:16:2
HTTPD_OUTPUT_MIXER_TYPE=software
PULSE_AUDIO_OUTPUT_CREATE=yes
ENFORCE_PLAYER_STATE=no
AUTO_UPDATE=yes
PUID=1000
GUID=1000

docker-compose.yml

---
services:
  mpd-alsa:
    container_name: mpd-alsa
    devices:
      - /dev/snd
    ports:
      - 6600:6600
    environment:
      - PULSE_AUDIO_OUTPUT_CREATE=${PULSE_AUDIO_OUTPUT_CREATE:-yes}
#      - MPD_BIND_ADDRESS=${MPD_BIND_ADDRESS:-192.168.1.80}
      - MPD_PORT=${MPD_PORT:-6600}
      - PUID=${PUID:-1000}
      - GUID=${GUID:-1000}
      - HTTPD_OUTPUT_CREATE=${HTTPD_OUTPUT_CREATE:-yes}
      - HTTPD_OUTPUT_ENABLED=${HTTPD_OUTPUT_ENABLED:-yes}
      - HTTPD_OUTPUT_NAME=${HTTPD_OUTPUT_NAME:-HTTP Stream}
      - HTTPD_OUTPUT_PORT=${HTTPD_OUTPUT_PORT:-8000}
      - HTTPD_OUTPUT_BIND_TO_ADDRESS=${HTTPD_OUTPUT_BIND_TO_ADDRESS}
      - HTTPD_OUTPUT_ENCODER=${HTTPD_OUTPUT_ENCODER:-lame}
      - HTTPD_OUTPUT_ENCODER_BITRATE=${HTTPD_OUTPUT_ENCODER_BITRATE}
      - HTTPD_OUTPUT_MAX_CLIENTS=${HTTPD_OUTPUT_MAX_CLIENTS:-0}
      - HTTPD_OUTPUT_ALWAYS_ON=${HTTPD_OUTPUT_ALWAYS_ON:-yes}
      - HTTPD_OUTPUT_TAGS=${HTTPD_OUTPUT_TAGS:-yes}
      - HTTPD_OUTPUT_FORMAT=${HTTPD_OUTPUT_FORMAT:-44100:16:2}
      - HTTPD_OUTPUT_MIXER_TYPE=${HTTPD_OUTPUT_MIXER_TYPE:-software}
      - AUTO_UPDATE=${AUTO_UPDATE:-yes}
      - ENFORCE_PLAYER_STATE=${ENFORCE_PLAYER_STATE:-no}

    volumes:
      - /media/william/OracleHarbor/LidarMusic/CLEAN/:/music:ro
      - ./data/.mpd/playlists:/playlists
      - ./data/.mpd/log:/log
      - ./data/.mpd/config:/user/config
      - ./data/.mpd/db:/db
      - /run/user/${PUID}/pulse:/run/user/${PUID}/pulse
    network_mode: "host"  # Add host mode networking
    restart: unless-stopped
    image: giof71/mpd-alsa
GioF71 commented 2 months ago

Looks ok... can you post the logs of mpd so I can check the generated file?

docker-compose logs mpd-alsa

Let's also see if mpd cannot open the specified port. The logs should provide the information hopefully

GioF71 commented 2 months ago

One thing, if you use host networking, port mapping has no effect. You are probably getting the warning from docker-compose I believe

GioF71 commented 2 months ago

Also check in mympd that the output if effectively enabled

GioF71 commented 1 month ago

Hello @bonelifer, did you solve the issue?

bonelifer commented 1 month ago

Sorry haven't had a chance, have been working on revising a website. I'll close this for now and reopen it when I have time. Thanks for getting back to me.

GioF71 commented 1 month ago

You can leave it open, no worries. I was just asking for an update!