home-assistant / plugin-audio

Pulseaudio implementation for Home Assistant
Apache License 2.0
24 stars 13 forks source link

no sound with hass #129

Closed zhuayi closed 1 year ago

zhuayi commented 1 year ago
[16:59:00] INFO: Service restart after closing
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/alsa-mixer.sh
[00:59:06] INFO: Adjust ALSA mixer settings for /dev/snd/controlC0
cont-init: info: /etc/cont-init.d/alsa-mixer.sh exited 0
cont-init: info: running /etc/cont-init.d/filesystem.sh
cont-init: info: /etc/cont-init.d/filesystem.sh exited 0
cont-init: info: running /etc/cont-init.d/pulse-config.sh
cont-init: info: /etc/cont-init.d/pulse-config.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun alsa (no readiness notification)
services-up: info: copying legacy longrun pulseaudio (no readiness notification)
s6-rc: info: service legacy-services successfully started
W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
W: [pulseaudio] main.c: Home directory of user 'root' is not '/var/run/pulse', ignoring.
W: [pulseaudio] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
W: [pulseaudio] main.c: OK, so you are running PA in system mode. Please make sure that you actually do want to do that.
W: [pulseaudio] main.c: Please read http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ for an explanation why system mode is usually a bad idea.
W: [pulseaudio] module-udev-detect.c: Failed to open /proc/asound/card0: No such file or directory
E: [pulseaudio] module-rescue-streams.c: module-rescue-stream is obsolete and should no longer be loaded. Please remove it from your configuration.
E: [pulseaudio] main.c: Failed to acquire org.pulseaudio.Server: org.freedesktop.DBus.Error.AccessDenied: Connection ":1.35" is not allowed to own the service "org.pulseaudio.Server" due to security policies in the configuration file
E: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files
agners commented 1 year ago

Can you describe your environment? What Home Assistant OS version are you using? Which board are you using? How do you have audio connected (HDMI/digital otherwise or analog)?

BebeMischa commented 1 year ago

looks similar to this: https://github.com/home-assistant/plugin-audio/issues/139 and this: https://github.com/home-assistant/addons/issues/2990

mib1185 commented 1 year ago

i'm using HAOS as VM in an proxmox environment

ha info

arch: amd64
channel: stable
docker: 23.0.6
features:
- reboot
- shutdown
- services
- network
- hostname
- timedate
- os_agent
- haos
- resolved
- journal
- disk
- mount
hassos: "10.2"
homeassistant: 2023.6.1
hostname: homeassistant
logging: info
machine: qemux86-64
operating_system: Home Assistant OS 10.2
state: running
supervisor: 2023.06.1
supported: true
supported_arch:
- amd64
- i386
timezone: Europe/Berlin

ha audio info

audio:
  application: []
  card:
  - driver: module-alsa-card.c
    index: 0
    name: alsa_card.usb-ACTIONS_Pebble_V3-00
    profiles:
    - active: true
      description: Analog Stereo Output
      name: output:analog-stereo
    - active: false
      description: Digital Stereo (IEC958) Output
      name: output:iec958-stereo
    - active: false
      description: "Off"
      name: "off"
  input: []
  output:
  - applications: []
    card: 0
    default: true
    description: Pebble V3 Analog Stereo
    index: 0
    mute: false
    name: alsa_output.usb-ACTIONS_Pebble_V3-00.analog-stereo
    volume: 0.368621826171875
host: 172.30.32.4
update_available: false
version: 2023.04.1
version_latest: 2023.04.1

the USB speaker is detected properly

# docker exec -ti hassio_audio /bin/bash
bash-5.1# pactl list short
0       module-device-restore
1       module-stream-restore
2       module-card-restore
3       module-switch-on-port-available
4       module-switch-on-connect
5       module-udev-detect
6       module-alsa-card        device_id="1" name="usb-ACTIONS_Pebble_V3-00" card_name="alsa_card.usb-ACTIONS_Pebble_V3-00" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
7       module-bluetooth-discover
8       module-bluez5-discover
9       module-native-protocol-unix     auth-anonymous=1 auth-cookie-enabled=0 socket=/data/external/pulse.sock
10      module-default-device-restore
12      module-always-sink
13      module-position-event-sounds
0       alsa_output.usb-ACTIONS_Pebble_V3-00.analog-stereo      module-alsa-card.c      s16le 2ch 48000Hz       IDLE
0       alsa_output.usb-ACTIONS_Pebble_V3-00.analog-stereo.monitor      module-alsa-card.c      s16le 2ch 48000Hz       IDLE
0       protocol-native.c       vlc
2       protocol-native.c       pactl
0       alsa_card.usb-ACTIONS_Pebble_V3-00      module-alsa-card.c
bash-5.1# aplay -lL
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=V3
    Pebble V3, USB Audio
    Default Audio Device
sysdefault:CARD=V3
    Pebble V3, USB Audio
    Default Audio Device
front:CARD=V3,DEV=0
    Pebble V3, USB Audio
    Front output / input
surround21:CARD=V3,DEV=0
    Pebble V3, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=V3,DEV=0
    Pebble V3, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=V3,DEV=0
    Pebble V3, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=V3,DEV=0
    Pebble V3, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=V3,DEV=0
    Pebble V3, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=V3,DEV=0
    Pebble V3, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=V3,DEV=0
    Pebble V3, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
**** List of PLAYBACK Hardware Devices ****
card 1: V3 [Pebble V3], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

enabled debug log in /etc/pulse/daemon.con and restarted hassio_audio by docker restart hassio_audio further also enabled verbose logging of vlc

unfortunately nothing happens the debug log of pules audio when starting vlc media playback

pulse_debug_after_start.txt vlc_debug.txt

mib1185 commented 1 year ago

i seems the issue lies in alsa, because it is not able to connect to the device

bash-5.1# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=V3
    Pebble V3, USB Audio
    Default Audio Device
sysdefault:CARD=V3
    Pebble V3, USB Audio
    Default Audio Device
front:CARD=V3,DEV=0
    Pebble V3, USB Audio
    Front output / input
surround21:CARD=V3,DEV=0
    Pebble V3, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=V3,DEV=0
    Pebble V3, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=V3,DEV=0
    Pebble V3, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=V3,DEV=0
    Pebble V3, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=V3,DEV=0
    Pebble V3, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=V3,DEV=0
    Pebble V3, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=V3,DEV=0
    Pebble V3, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

bash-5.1# amixer
amixer: Mixer attach default error: No such file or directory

bash-5.1# amixer -D default
amixer: Mixer attach default error: No such file or directory
mib1185 commented 1 year ago

with 2023.04.2 (only available when beta channel has been joined 🤔 )

hassio-audio:/# aplay -lL
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=V3
    Pebble V3, USB Audio
    Default Audio Device
front:CARD=V3,DEV=0
    Pebble V3, USB Audio
    Front output / input
surround21:CARD=V3,DEV=0
    Pebble V3, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=V3,DEV=0
    Pebble V3, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=V3,DEV=0
    Pebble V3, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=V3,DEV=0
    Pebble V3, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=V3,DEV=0
    Pebble V3, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=V3,DEV=0
    Pebble V3, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=V3,DEV=0
    Pebble V3, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
**** List of PLAYBACK Hardware Devices ****
card 1: V3 [Pebble V3], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
hassio-audio:/# amixer -D default
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 49345 [75%] [on]
  Front Right: Playback 49345 [75%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65536 [100%] [on]
  Front Right: Capture 65536 [100%] [on]

hassio-audio:/# amixer -D sysdefault
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib control.c:1528:(snd_ctl_open_noupdate) Invalid CTL sysdefault
amixer: Mixer attach sysdefault error: No such file or directory
mib1185 commented 1 year ago

maybe this could be useful? (_generated by script /usr/sbin/alsa-info.sh from hassioaudio container)

alsa-info.txt

agners commented 1 year ago

Thanks for all the logs and help to get the bottom of this! This is proven to be a Supervisor issue and handled in https://github.com/home-assistant/supervisor/issues/4355.