home-assistant / plugin-audio

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

No more sound output on Odroid N2+ after updating to Supervisor 2023.11.0 #157

Closed GoSpursGoNL closed 11 months ago

GoSpursGoNL commented 1 year ago

Describe the issue you are experiencing

Earlier this week my system updated to HA Supervisor 2023.11.0 Immediate the sound output of the board's 3.5mm output (via VLC addon as always) stopped working.

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Steps to reproduce the issue

  1. Update to Supervisor 2023.11.0
  2. Play some sound on local audio output via VLC addon

Anything in the Supervisor logs that might be useful for us?

Logger: homeassistant.components.vlc_telnet
Source: components/vlc_telnet/media_player.py:62
Integration: VLC media player via Telnet (documentation, issues)
First occurred: 8 november 2023 om 20:31:21 (2 occurrences)
Last logged: 10:15:38
Connection error: Failed to read: 0 bytes read on a total of undefined expected bytes. Partial bytes read: b''

System Health information

System Information

version core-2023.11.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 5.15.90
arch aarch64
timezone Europe/Amsterdam
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.33.0 Stage | running Available Repositories | 1328 Downloaded Repositories | 7
AccuWeather can_reach_server | ok -- | -- remaining_requests | 19
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 9.5 -- | -- update_channel | stable supervisor_version | supervisor-2023.11.0 agent_version | 1.4.1 docker_version | 20.10.22 disk_total | 113.9 GB disk_used | 91.6 GB healthy | true supported | true board | odroid-n2 supervisor_api | ok version_api | ok installed_addons | Samba share (10.0.2), Duck DNS (1.15.0), Home Assistant Google Drive Backup (0.111.1), NGINX Home Assistant SSL proxy (3.5.0), Node-RED (15.1.0), Plex Media Server (3.3.2), Advanced SSH & Web Terminal (15.1.0), WireGuard (0.9.0), AdGuard Home (4.8.17), VLC (0.2.0), Zigbee2MQTT (1.33.2-1), Mosquitto broker (6.3.1), chrony (2.6.2), ESPHome (2023.10.6), File editor (5.6.0), HomePod Connect (28.8-ls118), Whisper (1.0.0), Piper (1.4.0), Music Assistant BETA (2.0.0b74), openWakeWord (1.8.2)
Dashboards dashboards | 1 -- | -- resources | 2 views | 10 mode | storage
Recorder oldest_recorder_run | 8 november 2023 om 18:04 -- | -- current_recorder_run | 8 november 2023 om 19:05 estimated_db_size | 104.43 MiB database_engine | sqlite database_version | 3.41.2

Supervisor diagnostics

config_entry-hassio-f9c2513652a4f6291037d6fa4f7c58d8.json.txt

Additional information

No response

GoSpursGoNL commented 1 year ago

I updated the HA OS from 9.5 to 11.1 but it doesn't make any difference (I was still on 9.5 due to this bug)

thesaofficer commented 1 year ago

I've lost sound on the audio jack too on Odroid N2+ via SqueezeLite. I'm not entirely sure which update broke it. Currently up-to-date with:

Core 2023.11.2 Supervisor 2023.11.0 Operating System 11.1

I notice the following in the audio log:

W: [pulseaudio] module-udev-detect.c: Failed to open /proc/asound/card0: No such file or directory

GoSpursGoNL commented 1 year ago

For me for sure it was the supervisor upgrade.

gxc7719 commented 1 year ago

I am also seeing this. Audio was working fine then suddenly it wasn't. I've been trying to figure it out for a while now and just found this. At least I know what it is now.

GoSpursGoNL commented 1 year ago

On my todo list for some time already was to migrate to an Odroid M1 (because of the NVME storage), so I did that today. Unfortunately for the 3.5mm sounds output it doesn't make any difference, also on the M1 there is no sound.

thesaofficer commented 1 year ago

Still not working with Supervisor 2023.11.3.

GoSpursGoNL commented 1 year ago

The fact that a Supervisor update broke my sound output now for the 3rd time already is starting to frustrate me. Especially since it is the only component of the HA ecosystem which you can't roll back and can't prevent from updating automatically.

gxc7719 commented 1 year ago

I found this info about stopping supervisor from auto updating. I DID NOT TRY IT! After they fix this issue I may turn it off. I also noticed that a supervisor update has broken sound before.

https://community.home-assistant.io/t/how-to-stop-supervisor-auto-update/132271/28

GoSpursGoNL commented 1 year ago

@pvizeli would you be able to have a look at this issue? Last time this happened, you fixed it via https://github.com/home-assistant/supervisor/issues/3620 and https://github.com/home-assistant/plugin-audio/pull/107

Not sure if it helps, but I see the audio logs flouded with: W: [alsa-sink-fe410000.i2s-rk817-hifi rk817-hifi-0] alsa-sink.c: Resume failed, couldn't restore original sample settings.

GoSpursGoNL commented 1 year ago

Hmm, weird, in the meantime some sounds I try to play started working again, some others still haven't. Not sure how I can troubleshoot further. I see Supervisor is on v2023.11.3 now. All my sounds are in essence short .wav files located in the same directory in /media Also Google TTS to the speaker still doesn't work.

amarofarinha commented 12 months ago

Hi. same problem here.

Hardkernel ODROID-N2/N2+ Core: 2023.11.2 Supervisor: 2023.11.3 Operating System: 11.1 Frontend: 20231030.2

I'm not sure which update broke the functionality

Audio Log: 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 s6-rc: info: service pulseaudio successfully started 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 s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started

VLC Log: [0000ffff86147d50] vlcpulse audio output error: stream connection failure: Bad state [0000ffff86147d50] main audio output error: module not functional [0000ffff79ef0090] main decoder error: failed to create audio output

amarofarinha commented 12 months ago

hi. i just made a reestart of the VLC Add-on and its working again. Logs: s6-rc: info: service vlc: starting s6-rc: info: service nginx: starting s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service vlc successfully started s6-rc: info: service nginx successfully started 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/ingress.sh [07:20:12] INFO: Service restart after closing [0000ffff982ab040] main interface error: no suitable interface module [0000ffff983e2b30] main libvlc error: interface "globalhotkeys,none" initialization failed [0000ffff982b99d0] main playlist: playlist is empty [0000ffff982ab830] [http] lua interface: Lua HTTP interface [0000ffff9828f140] [telnet] lua interface: Listening on host "telnet://:4212". cont-init: info: /etc/cont-init.d/ingress.sh exited 0 cont-init: info: running /etc/cont-init.d/secret.sh cont-init: info: /etc/cont-init.d/secret.sh exited 0 s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [07:20:12] INFO: Successfully send discovery information to Home Assistant. 2023/11/21 07:20:13 [notice] 150#150: using the "epoll" event method 2023/11/21 07:20:13 [notice] 150#150: nginx/1.22.1 2023/11/21 07:20:13 [notice] 150#150: OS: Linux 6.1.59 2023/11/21 07:20:13 [notice] 150#150: getrlimit(RLIMIT_NOFILE): 1073741816:1073741816 2023/11/21 07:20:13 [notice] 150#150: start worker processes 2023/11/21 07:20:13 [notice] 150#150: start worker process 155

GoSpursGoNL commented 12 months ago

For me still the same as in last message. Some sounds work, some not. TTS also not.

GoSpursGoNL commented 11 months ago

I have learned that sound files with a sampling rate of 48khz don't work. If I convert them to 44100 hz, they play just fine. I went to check this since some of my files started working again whilst other didn't, as mentioned before. TTS still doesn't work so that probably generates files of 48khz. @pvizeli I hope this helps

amarofarinha commented 11 months ago

its broken again after 2023.12 update.

agners commented 11 months ago

its broken again after 2023.12 update.

So seems a Core/Add-on restart order issue then maybe? Or totally random?

As in, does a VLC restart helps in your situation now?

amarofarinha commented 11 months ago

Reestart did not help this time

A segunda, 11/12/2023, 13:16, Stefan Agner @.***> escreveu:

its broken again after 2023.12 update.

So seems a Core/Add-on restart order issue then maybe? Or totally random?

As in, does a VLC restart helps in your situation now?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/plugin-audio/issues/157, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEEKZZLIV2DTLIZOUHSXXGDYI4BRXAVCNFSM6AAAAAA7F36WR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGA3DAMZVG4 . You are receiving this because you commented.Message ID: @.***>

therealhammer commented 11 months ago

Having the same problem here. Weirdly enough pulse is trying to recognize two audio devices that are both not found.

Audio log: [...] W: [pulseaudio] module-udev-detect.c: Failed to open /proc/asound/card1: No such file or directory W: [pulseaudio] module-udev-detect.c: Failed to open /proc/asound/card0: No such file or directory E: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer: unit failed.

agners commented 11 months ago

The fixed version is currently on the beta channel. You can update the Audio plug-in specifically using:

ha audio update --version 2023.12.0

You might need to restart the VLC add-on after that.

amarofarinha commented 11 months ago

The fixed version is currently on the beta channel. You can update the Audio plug-in specifically using:

ha audio update --version 2023.12.0

You might need to restart the VLC add-on after that.

it worked! there is sound again! thank you!!!

spudje commented 10 months ago

Cool it's fixed. Is this part of 2023.12.1 version of supervisor?

agners commented 10 months ago

The audio plug-in is updated separately. The 2023.12.0 version of the audio plug-in is on the stable channel since a couple of days.

spudje commented 10 months ago

It's not fixed for me. I'm on 2023.12.0. Haven't rebooted the Odroid yet though and my OS is also still on 11.2, so maybe those are reasons.

agners commented 10 months ago

OS 11.2 should not matter, but reboot might be the problem. If the problem still persists after reboot, double check the audio plug-in version (using ha audio info from the terminal).

GoSpursGoNL commented 10 months ago

For me the situation is the same as my last message in: https://github.com/home-assistant/plugin-audio/issues/157#issuecomment-1850170144 So some sounds work, but f.i. TTS (tts.google_translate_say) towards the speaker generates no sound. I suspect it has to do with the nr of hz of the audio source file.

agners commented 10 months ago

@GoSpursGoNL what HAOS version are you on? You are using the N2+ as well correct?

I've just double checked on my end using my ODROID-N2+, running the following service call plays audio just fine on HAOS 11.4 + Supervisor 2023.12.0 + Core 2024.1.2

service: tts.google_translate_say
data:
  cache: false
  entity_id: media_player.vlc_telnet
  message: This is a hello world

I am not aware in any changes in HAOS 11.4 which should affect audio. Out of curiosity I've also downgraded to 11.2, and the same service call seems to work fine here.

My ha audio info output:

# ha audio info
audio:
  application: []
  card:
  - driver: module-alsa-card.c
    index: 0
    name: alsa_card.platform-sound
    profiles:
    - active: true
      description: Analog Stereo Output
      name: output:analog-stereo
    - active: false
      description: Digital Stereo (HDMI) Output
      name: output:hdmi-stereo
    - active: false
      description: Digital Surround 5.1 (HDMI) Output
      name: output:hdmi-surround
    - active: false
      description: Digital Surround 7.1 (HDMI) Output
      name: output:hdmi-surround71
    - active: false
      description: "Off"
      name: "off"
  input: []
  output:
  - applications: []
    card: 0
    default: true
    description: Built-in Audio Analog Stereo
    index: 0
    mute: false
    name: alsa_output.platform-sound.analog-stereo
    volume: 1
host: 172.30.32.4
update_available: false
version: 2023.12.0
version_latest: 2023.12.0

Can you test this again and check/upload the following logs:

ha core logs
ha audio logs
ha supervisor logs
ha host logs --identifier kernel
GoSpursGoNL commented 10 months ago

I switched to the Odroid M1 in the meantime: https://github.com/home-assistant/plugin-audio/issues/157#issuecomment-1850170109 That service call you proposed (adjusted to use my entity id for the speaker media player) produces no sound.

If I let it get cached to a local audio file, where will it be put on my disk? I like to check if I play that file to the speaker if it produces sound, check the hz, adjust and try again. I think this is the problem for me: https://github.com/home-assistant/plugin-audio/issues/157#issuecomment-1850170172

ha audio info:

audio:
  application: []
  card:
  - driver: module-alsa-card.c
    index: 0
    name: alsa_card.platform-hdmi-sound
    profiles:
    - active: true
      description: Stereo Output
      name: output:stereo-fallback
    - active: false
      description: "Off"
      name: "off"
  - driver: module-alsa-card.c
    index: 1
    name: alsa_card.platform-rk809-sound
    profiles:
    - active: false
      description: Stereo Input
      name: input:stereo-fallback
    - active: false
      description: Stereo Output
      name: output:stereo-fallback
    - active: true
      description: Stereo Output + Stereo Input
      name: output:stereo-fallback+input:stereo-fallback
    - active: false
      description: "Off"
      name: "off"
  input:
  - applications: []
    card: 1
    default: true
    description: Built-in Audio Stereo
    index: 2
    mute: false
    name: alsa_input.platform-rk809-sound.stereo-fallback
    volume: 1
  output:
  - applications: []
    card: 0
    default: false
    description: Built-in Audio Stereo
    index: 0
    mute: false
    name: alsa_output.platform-hdmi-sound.stereo-fallback
    volume: 1
  - applications: []
    card: 1
    default: true
    description: Built-in Audio Stereo
    index: 1
    mute: false
    name: alsa_output.platform-rk809-sound.stereo-fallback
    volume: 1
host: 172.30.32.4
update_available: false
version: 2023.12.0
version_latest: 2023.12.0

Attached the other files. Thanks for assisting!

ha audio logs.txt ha core logs.txt ha host logs identifier kernel.txt ha supervisor logs.txt

agners commented 10 months ago

I switched to the Odroid M1 in the meantime: #157 (comment)

Whoops, sorry, I've missed that. I'll have to test on my end.

I've created a new issue from your comment to track the M1 issue (#162).