rimago / rpi-kodi

Dockerized Kodi with audio and video
https://hub.docker.com/r/rimago/rpi-kodi
GNU General Public License v3.0
15 stars 6 forks source link

audio not working #12

Open matt2005 opened 1 year ago

matt2005 commented 1 year ago

hi,

i updated from buster to bullseye and pulled the latest container image. the audio devices don't show and the config page takes +10secs to open.

below is docker compose extract

  rpi-kodi:
    platform: linux/armhf
    profiles: ["mediacentre"]
    image: rimago/rpi-kodi:latest
    container_name: "kodi"
    user: kodi
    network_mode: host
    restart: unless-stopped
    privileged: true
    devices:
      - /dev/fb0:/dev/fb0 # HDMI
      - /dev/vchiq:/dev/vchiq #HDMI CEC
      - /dev/snd:/dev/snd # Sound over HDMI
      - /dev/vcio:/dev/vcio
      - /dev/vcsm-cma:/dev/vcsm-cma
      - /dev/dma_heap:/dev/dma_heap
      - /dev/dri:/dev/dri
    volumes:
      - /home/pi/mount/kodi/home:/home/kodi
      - '/etc/timezone:/etc/timezone:ro'
      - '/etc/localtime:/etc/localtime:ro'
      - '/var/run/dbus:/var/run/dbus'
      - "/opt/vc:/opt/vc"
    tmpfs:
      - /tmp
    environment:
      - PULSE_SERVER=127.0.0.1
      - LD_LIBRARY_PATH=/opt/vc/lib

/boot/config.txt

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
hdmi_force_hotplug=1:0
hdmi_group=1
hdmi_mode=4
hdmi_drive=2
config_hdmi_boost=4
hdmi_force_edid_audio=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Enable DRM VC4 V3D drive
#dtoverlay=vc4-kms-v3d
max_framebuffers=2
arm_64bit=1
gpu_mem=256
[all]
dtoverlay=vc4-fkms-v3d,cma-512
dtoverlay=rpivid-v4l2

/boot/cmdline.txt

console=serial0,115200 console=tty1 root=PARTUUID=07311cfe-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles snd-bcm2835.enable_compat_alsa=1

kodi.log

2023-03-31 00:28:04.214 T:27       INFO <general>: CAESinkALSA - Unable to open device "default" for playback
2023-03-31 00:28:04.241 T:27       INFO <general>: CAESinkALSA - Unable to open device "lavrate" for playback
2023-03-31 00:28:04.241 T:27       INFO <general>: CAESinkALSA - Unable to open device "samplerate" for playback
2023-03-31 00:28:04.242 T:27       INFO <general>: CAESinkALSA - Unable to open device "speexrate" for playback
2023-03-31 00:28:04.253 T:27       INFO <general>: CAESinkALSA - Unable to open device "jack" for playback
2023-03-31 00:28:04.255 T:27       INFO <general>: CAESinkALSA - Unable to open device "oss" for playback
2023-03-31 00:28:04.258 T:27       INFO <general>: CAESinkALSA - Unable to open device "pulse" for playback
2023-03-31 00:28:04.260 T:27       INFO <general>: CAESinkALSA - Unable to open device "upmix" for playback
2023-03-31 00:28:04.262 T:27       INFO <general>: CAESinkALSA - Unable to open device "vdownmix" for playback
2023-03-31 00:28:04.262 T:27       INFO <general>: No Devices found - retry: 3
matt2005 commented 1 year ago

I got the sound working in the end. I had to add the following to the docker compose

      - '/dev/null:/etc/asound.conf:ro'

So the file extract now looks like this

  rpi-kodi:
    #platform: linux/armhf
    profiles: ["mediacentre"]
    image: rimago/rpi-kodi:latest
    container_name: "kodi"
    user: kodi
    network_mode: host
    restart: unless-stopped
    privileged: true
    devices:
      - /dev/fb0:/dev/fb0 # HDMI
      - /dev/vchiq:/dev/vchiq #HDMI CEC
      - /dev/snd:/dev/snd # Sound over HDMI
      - /dev/vcio:/dev/vcio
      - /dev/vcsm-cma:/dev/vcsm-cma
      - /dev/dma_heap:/dev/dma_heap
      - /dev/dri:/dev/dri
    volumes:
      - /home/pi/mount/kodi/home:/home/kodi
      - '/etc/timezone:/etc/timezone:ro'
      - '/etc/localtime:/etc/localtime:ro'
      - '/var/run/dbus:/var/run/dbus'
#      - "/opt/vc:/opt/vc"
      - '/dev/null:/etc/asound.conf:ro'
    tmpfs:
      - /tmp
    environment:
      - PULSE_SERVER=192.168.1.113
      - LD_LIBRARY_PATH=/opt/vc/lib
     # - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket