addons: vlc-core on Home Assistant Operating System no longer playing audio and path seems invalid
Describe the issue you are experiencing
Back in December, I was using vlc-core with the vlc-telnet successfully. I am currently trying to use vlc 0.1.3 on core 2022.2.5. I have uninstalled and reinstalled vlc and the telnet integration multiple times lately trying to fix the issue.
What happens? No audio come out. More importantly, it appears that vlc is looking in the wrong path.
Notice in the logs:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] ingress.sh: executing...
[cont-init.d] ingress.sh: exited 0.
[cont-init.d] secret.sh: executing...
[cont-init.d] secret.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022/02/17 03:45:37 [notice] 249#249: using the "epoll" event method
2022/02/17 03:45:37 [notice] 249#249: nginx/1.18.0
2022/02/17 03:45:37 [notice] 249#249: OS: Linux 5.10.92-v8
2022/02/17 03:45:37 [notice] 249#249: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2022/02/17 03:45:37 [notice] 249#249: start worker processes
2022/02/17 03:45:37 [notice] 249#249: start worker process 279
[0000007f9e01e570] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0000007f9e01e570] main interface error: no suitable interface module
[0000007f9e162b50] main libvlc error: interface "dbus,none" initialization failed
[0000007f99bdf850] main interface error: no suitable interface module
[0000007f9e162b50] main libvlc error: interface "globalhotkeys,none" initialization failed
[0000007f9e0459d0] main playlist: playlist is empty
[0000007f9e01e6a0] [telnet] lua interface: Listening on host "telnet://:4212".
[0000007f99bdfcd0] [http] lua interface: Lua HTTP interface
[22:45:38] INFO: Successfully send discovery information to Home Assistant.
[snip http info]
[0000007f9903de60] filesystem stream error: cannot open file **/run/s6/services/vlc/**doorbell-128mp3.mp3 (No such file or directory)
[0000007f99338680] main input error: Your input can't be opened
[0000007f99338680] main input error: VLC is unable to open the MRL 'file:///run/s6/services/vlc/doorbell-128mp3.mp3'. Check the log for details.
NOTE: When I go in through the terminal, the path /run/s6/services/vlc does not exist on the device!!
my configuration.yaml contains the following that might be relevant:
homeassistant:
allowlist_external_dirs:
- "/config/tmp"
media_dirs:
media: /media
What type of installation are you running?
Home Assistant OS
Which operating system are you running on?
Other (e.g., Raspbian/Raspberry Pi OS/Fedora)
Which add-on are you reporting an issue with?
VLC
What is the version of the add-on?
0.1.3
Steps to reproduce the issue
- install vlc-core
- restart
- add vlc-telnet integration
- attempt to play audio
service: media_player.play_media
data:
media_content_type: music
media_content_id: doorbell.wav
target:
entity_id: media_player.vlc_telnet
Anything in the Supervisor logs that might be useful for us?
Nothing
Anything in the add-on logs that might be useful for us?
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] ingress.sh: executing...
[cont-init.d] ingress.sh: exited 0.
[cont-init.d] secret.sh: executing...
[cont-init.d] secret.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022/02/17 03:45:37 [notice] 249#249: using the "epoll" event method
2022/02/17 03:45:37 [notice] 249#249: nginx/1.18.0
2022/02/17 03:45:37 [notice] 249#249: OS: Linux 5.10.92-v8
2022/02/17 03:45:37 [notice] 249#249: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2022/02/17 03:45:37 [notice] 249#249: start worker processes
2022/02/17 03:45:37 [notice] 249#249: start worker process 279
[0000007f9e01e570] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0000007f9e01e570] main interface error: no suitable interface module
[0000007f9e162b50] main libvlc error: interface "dbus,none" initialization failed
[0000007f99bdf850] main interface error: no suitable interface module
[0000007f9e162b50] main libvlc error: interface "globalhotkeys,none" initialization failed
[0000007f9e0459d0] main playlist: playlist is empty
[0000007f9e01e6a0] [telnet] lua interface: Listening on host "telnet://:4212".
[0000007f99bdfcd0] [http] lua interface: Lua HTTP interface
[22:45:38] INFO: Successfully send discovery information to Home Assistant.
[snip http info]
[0000007f9903de60] filesystem stream error: cannot open file **/run/s6/services/vlc/**doorbell-128mp3.mp3 (No such file or directory)
[0000007f99338680] main input error: Your input can't be opened
[0000007f99338680] main input error: VLC is unable to open the MRL 'file:///run/s6/services/vlc/doorbell-128mp3.mp3'. Check the log for details.
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (9 by maintainers)
@Maco65 My understanding is that it should be
media_content_id: media-source://media_source/local/ringbell.mp3. That’s what the play media action in the UI gives me when I pick a file from/media.The instructions for making that uri are here, the catch is I believe you say
localinstead ofmediaformedia_dirwhen youre referencing a file in/mediasince that’s the default.But like I said above, when in doubt just pop into the UI and use the play media action and it’s picker. Then you can flip to see the yaml and copy and paste the
media_content_id. That should always work, if not it’s a bug with core.@Maco65 so you are right that this broke because of
2022.2. In2022.2a number of media integrations (includingvlc_telnet) we’re updated to support playing media from any media source. Prior to this releasevlc_telnetwas one of several media integrations that could only play local media in your/mediafolder or if you gave them a full URL directly to a file. Now it can play any audio file you can find in media browser.More specifically, it now supports any of the following for
media_content_id:https://example.com/audio/ringbell.mp3)/local/ringbell.mp3)media-source://media_source/local/ringbell.mp3). Note that if you use the play media action in the script editor UI you always get this one now since it leaves no ambiguity for HA.The problem though in your case is 2 above. A relative URL is indistinguishable from file path and so it is treated like a relative URL. This is a problem because its an incorrect relative URL. If you used
media-source://media_source/local/ringbell.mp3then the URL that HA would hand to the VLC addon is{HA host}/media/local/ringbell.mp3?authSig={token}. But your config causes it to hand it{HA host}/media/ringbell.mp3?authSig={token}which is invalid and thus breaks.What I would suggest is use the play media action in the UI to configure this action. And then you can show the YAML and copy and paste it anywhere else you need it. Or create the
media-sourceURIs by hand if you want, they aren’t particularly complicated for local media (media-source://media_source/local/{path within /media}).As for the
authSig, that part is fine. Anything you see in the media browser in HA is protected by authentication. So when you pick a media file to play from there HA generates a token which grants access to that file and puts it on the URL so that the external player can get to it without needing to know authentication was required.If it still doesn’t work I’d recommend opening an issue in core. There’s not really anything the addon can do about this, it just gets handed a URL and told to play it.