Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vlc addon audio not working #2

Open
sanilkuma opened this issue Mar 11, 2020 · 41 comments
Open

vlc addon audio not working #2

sanilkuma opened this issue Mar 11, 2020 · 41 comments
Assignees

Comments

@sanilkuma
Copy link

now vlc telnet addon before audio output alsa0,alsa1,alsa2 now only default and
Built-in Audio Digital Stereo (IEC958) i am trying both not working
[01758f40] main decoder error: failed to create audio output
ALSA lib dlmisc.c:283:(snd_dlobj_cache_get0) Cannot open shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so ((null): Error loading shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so: No such file or directory)
[016c29f0] alsa audio output error: cannot open ALSA device "default": No such device or address
[016c29f0] main audio output error: Audio output failed
[016c29f0] main audio output error: The audio device "default" could not be used:
No such device or address.

@rodripf
Copy link
Owner

rodripf commented Mar 11, 2020

Hi there! Sorry to hear about your error, what model of the raspberry pi are you using?

@sanilkuma
Copy link
Author

Raspberrypi3b+

@sanilkuma
Copy link
Author

sanilkuma commented Mar 11, 2020

Two week before working Update after not working

@netmms
Copy link

netmms commented Mar 11, 2020

I now have the exact same error! It used to work like a dream, but an update or such broke it. I am now at the latest HassOS 3.12 and Home Assistant 106.6.

I get the errors above. The old device “bcm...” is no longer listed, and instead I have “default” or “Built in IEC958”. In both cases I get the errors above.

@netmms
Copy link

netmms commented Mar 11, 2020

...Also PI 3B+

@rodripf rodripf self-assigned this Mar 11, 2020
@rodripf
Copy link
Owner

rodripf commented Mar 11, 2020

Everything points to the HA update, which I haven't downloaded yet. I'll be analyzing what in this update broke the add-on.
In the meantime, if you can, I suggest rolling back the update.
I'll be in touch. Thank you for the report!

@netmms
Copy link

netmms commented Mar 11, 2020

The strange thing is that the problem started before I did the manual update, about two days ago. I was still at OS 2.something and Home Assistant 103 and have not updated for two months. My philosophy is once something is working well, I don’t touch it.

Something updated — I do not know what. I thought you updated VLC and did the manual update of the OS and Home Assistant in order to solve the problem.

At any rate, let us know what you come up with. I know you will get it sorted.

@rodripf
Copy link
Owner

rodripf commented Mar 11, 2020

A quick chat with the Great Frenck pointed out to a change in the way the audio sources are managed and a new requirement on the docker image of the add-ons. I'll try to add and test the new requirement ASAP.

https://twitter.com/pvizeli/status/1233336433487773698
https://twitter.com/pvizeli/status/1231641608887521281

@netmms
Copy link

netmms commented Mar 16, 2020

Rodrigo, any idea when this is going to be fixed?

@rodripf
Copy link
Owner

rodripf commented Mar 20, 2020

I followed @pvizeli instructions, but another error came up:

Now the plugin plays music at the second or third time you press play and the log is a hell of
alsa audio output error: cannot estimate delay: I/O error

I'll have to fix this new one before making a new release. I'm investigating on this.

@netmms
Copy link

netmms commented Mar 27, 2020

Any good news on this front, dear Rodrigo?

@Bratan9600
Copy link

May be this would be helpfull
https://community.home-assistant.io/t/rhasspy-offline-voice-assistant-toolkit/60862/1150

Hope u fix it soon.

@rodripf
Copy link
Owner

rodripf commented Mar 30, 2020

Sadly after hours trying to figure out what's going on, I can't fix it yet.
Thank you for the link, I'll take a look! Thank you for your support!

@pvizeli
Copy link

pvizeli commented Mar 30, 2020

I've a timeslot tomorrow and look into the issue of the software

@rodripf
Copy link
Owner

rodripf commented Apr 4, 2020

Hi @pvizeli ! Did you have any chance to check this out? Would you like to arrange a call?
Cheers

@netmms
Copy link

netmms commented Apr 10, 2020

Is there a way to somehow go to older versions of Hassio? I was perfectly happy with how things were.

@pvizeli
Copy link

pvizeli commented Apr 10, 2020

It is pretty simple, just use vlc with PulseAudio directly or with also PulseAudio plugin like I've written in the dev documentation.

@netmms
Copy link

netmms commented Apr 10, 2020

So its it working now? Would you kindly point me to the dev documentation? I could not find it.

@rodripf
Copy link
Owner

rodripf commented Apr 10, 2020

Hi! I've found the magic parameter!
--aout=pulse
In the vlc execution command line, to force vlc to use pulse audio as you suggested @pvizeli
Now it works and the popping errors are removed.

Please update the add-on!
Thank you all for the support!

@netmms
Copy link

netmms commented Apr 10, 2020

Would someone please help us to figure out how to install PulseAudio? I did Local-VLC rebuild and also uninstall/install, but I get these errors:

ALSA lib dlmisc.c:283:(snd_dlobj_cache_get0) Cannot open shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so ((null): Error loading shared library /usr/lib/alsa-lib/libasound_module_pcm_pulse.so: No such file or directory)
[00c7cad0] alsa audio output error: cannot open ALSA device "default": No such device or address
[00c7cad0] main audio output error: Audio output failed
[00c7cad0] main audio output error: The audio device "default" could not be used:
No such device or address.
[00c7cad0] main audio output error: module not functional
[00d11450] main decoder error: failed to create audio output

I'm using a Pi 3B+.

@rodripf
Copy link
Owner

rodripf commented Apr 10, 2020

On your side you should do nothing, but only update the add-on. Do you have the last plugin version installed, 18?

@netmms
Copy link

netmms commented Apr 10, 2020

No matter what I do, I only get v. 17. I uninstalled and installed. Still v. 17. I did a rebuild. Still 17.

@rodripf
Copy link
Owner

rodripf commented Apr 10, 2020

That's the problem, but weird. Did you tried with the white refresh arrow on the top-right of the add-on store to force check for updates?

@netmms
Copy link

netmms commented Apr 11, 2020

Thank you very much. you are great. After some fiddling, I got it to update (I had to update HA first).

However, notice two things:

  1. It does not work as well as before. For some reason, there a small "hesitance" at the beginning of plying an audio clip. This was not the case before. This could be coming from the new pulseaudio driver or somewhere else. Not a big deal, but it was perfection before.

  2. I am getting this error in the log:

Log Details (ERROR)
Logger: homeassistant.helpers.entity
Source: components/vlc_telnet/media_player.py:133
First occurred: 3:59:02 AM (18 occurrences)
Last logged: 4:02:08 AM

Update for media_player.vlc fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/vlc_telnet/media_player.py", line 133, in update
    info = self._vlc.info()
  File "/usr/local/lib/python3.7/site-packages/python_telnet_vlc/vlctelnet.py", line 247, in info
    unparsed = [x for x in self.run_command('info') if x != '|']
  File "/usr/local/lib/python3.7/site-packages/python_telnet_vlc/vlctelnet.py", line 59, in run_command
    command_output = self.tn.read_until(b'> ').decode('ascii').split('\r\n')[:-1]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in position 62: ordinal not in range(128)
Connection lost. Reconnecting…

@netmms
Copy link

netmms commented Apr 11, 2020

I'm also getting this from VLC-Local:

[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error
[024bfbe0] alsa audio output error: cannot estimate delay: I/O error

@Bratan9600
Copy link

Same errors. Full log below

[00a4c780] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[00a4c780] main interface error: no suitable interface module
[b6e97f80] main libvlc error: interface "dbus,none" initialization failed
[00a4c8b0] [telnet] lua interface: Listening on host "telnet://:4212".
[00a562d0] main interface error: no suitable interface module
[b6e97f80] main libvlc error: interface "globalhotkeys,none" initialization failed
[00a30080] main playlist: playlist is empty
[00a562d0] [http] lua interface: Lua HTTP interface
[00a31c40] alsa audio output error: cannot estimate delay: I/O error
[00a31c40] alsa audio output error: cannot estimate delay: I/O error
[00a31c40] alsa audio output error: cannot estimate delay: I/O error

@rodripf rodripf reopened this Apr 11, 2020
@rodripf
Copy link
Owner

rodripf commented Apr 11, 2020

Let me check on those errors....

@Bratan9600
Copy link

Any good news?

@Bratan9600
Copy link

Bratan9600 commented Apr 19, 2020

I found kind of solution. May be this wil be helpfull.
I have RPi4B, Rasbian Buster OS, Hass installed in Docker and my RPi4 dont play any sound via 3.5jack (not from OS, not from Hass).
In OS i uninstall pulseaudio software
sudo apt-get remove pulseaudio
and after that i can play any sound in OS and Hass with this addon.

EDITED:
Error '[00a31c40] alsa audio output error: cannot estimate delay: I/O error' dont go away

@netmms
Copy link

netmms commented May 1, 2020

Any resolution on the horizon or work-around? Also, does the message below have any bearing on this issue?. Do others see it in the Developer Tools Logs?

Logger: homeassistant.helpers.entity
Source: components/vlc_telnet/media_player.py:133
First occurred: April 13, 2020, 3:10:49 PM (1538 occurrences)
Last logged: 3:09:57 PM

Update for media_player.vlc fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/vlc_telnet/media_player.py", line 133, in update
    info = self._vlc.info()
  File "/usr/local/lib/python3.7/site-packages/python_telnet_vlc/vlctelnet.py", line 247, in info
    unparsed = [x for x in self.run_command('info') if x != '|']
  File "/usr/local/lib/python3.7/site-packages/python_telnet_vlc/vlctelnet.py", line 59, in run_command
    command_output = self.tn.read_until(b'> ').decode('ascii').split('\r\n')[:-1]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 38: ordinal not in range(128)

Repository owner deleted a comment from terslowe May 6, 2020
@rodripf
Copy link
Owner

rodripf commented May 6, 2020

Hi mates,

I think there is a problem between VLC and the alsa-pulse-plugin that I am sadly unable to solve.
I tested different configurations, but almost blindly since the linux sound pipeline is not my specialty.

The most stable configuration I got was:

The cannot estimate delay: I/O error continues appearing, but less frequently, and the initials delays and noises when playing a song are gone.

I can't explain why or if it is a valid and permanent fix for everyone. Please, tell me if it works for you.

Thanks for your support

@rodripf
Copy link
Owner

rodripf commented May 6, 2020

On the other hand, I'm thinking on move away completely from vlc to another player that has better compatibility with the new pulseaudio plattform on HA, but it has to have at least the same capabilities of VLC.
I'll be investigating in the subject and luckily come up with a new add-on for our embedded player needs.

The rapsberry pi native omxplayer perhaps? The simple aplay? IDK I'll be investigating.
I'll keep you informed!

If you want to get in touch with me, contact me via discord at rodripf#2573

@netmms
Copy link

netmms commented May 6, 2020

I will test it and report.

When VLC did not work, I switched to Mopidy. It works but is not as good. It has two issues: 1) volume control is mostly ignored, and 2) Quality of play is not as good.

In the past, I tested omxplayer on the Pi. It mysteriously cut off the last portion of MP3 files for some reason. That was some time ago, though.

aplay, I think, cannot play MP3 files, only WAV files.

@netmms
Copy link

netmms commented May 6, 2020

I just tested it. Latest everything. Installed the add-on. Rebooted the entire server.

Unfortunately, at least for me, it is still not working :(

@rodripf
Copy link
Owner

rodripf commented May 6, 2020

Sorry to hear that :(

I discovered cmus, and there already is an integration
https://www.home-assistant.io/integrations/cmus/

It would be a good target to make an add-on. Did you already tried it?

@netmms
Copy link

netmms commented May 7, 2020

If you package it for Hassio I will test it.

I have also in the past used mpg321 with good results.

And maybe omxplayer was fixed in recent versions.

@netmms
Copy link

netmms commented Jul 10, 2020

No new update on this topic? Any fixes or new packages?

@netmms
Copy link

netmms commented Aug 14, 2020

I have created a simple local audio add-on that is working 100% for me.

Pros:
Uses the robust Sox library
Very simple and light weight
Excellent control of sound volume

Cons:
Doesn't work as a service because it is a local addon
No web client

If your need is to play local files on the Hassio server, this is perfect for you. If there is interest, I could post it here or somewhere. Perhaps then someone can turn it into an official addon on GitHub.

@lightzhuk
Copy link

lightzhuk commented Jan 11, 2021

Hello. I ran into a problem while installing

[000000558e380ea0] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[000000558e380ea0] main interface error: no suitable interface module
[0000007fa9055780] main libvlc error: interface "dbus,none" initialization failed
[000000558e391200] main interface error: no suitable interface module
[0000007fa9055780] main libvlc error: interface "globalhotkeys,none" initialization failed
[000000558e354160] main playlist: playlist is empty
[000000558e381060] [telnet] lua interface: Listening on host "telnet://:4212".
[000000558e393780] [http] lua interface: Lua HTTP interface

There is no sound from the speakers. Only occasionally slight interference.

@lightzhuk
Copy link

In general, it seems strange to me that Hassio comes without the ability to use the audio output out of the box.

@Electronlibre2012
Copy link

Hello @lightzhuk ,

do you found a solution please?

i am in the same boat, same errors like you.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants