Bug Kodi 19.1 loses audio device after playback
#1
Hello,

I have following setup:
HTPC with Ubuntu 20.04.2 LTS, kernel: Linux x86 64-bit version 5.4.0-77-generic
Kodi (19.1 (19.1.0) Git:20210509-85e05228b4). Platform: Linux x86 64-bit
Host CPU: Intel® Core™ i3-4130 CPU @ 3.40GHz, 4 cores available
Onboard HDMI plugged into ONKYO RT990 Receiver.

Pulseaudio is disabled when starting kodi with startscript:
pasuspender -- env KODI_AE_SINK=ALSA kodi

When I startup KODI everything runs fine. I can play videos with audio via passtrough. After some (random number) videos played the audio stops working. Event GUI sounds are not played any more.
In the logfile I just find following:

suletemibu.kodi (paste)

2021-07-07 21:49:33.360 T:1209     INFO <general>: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=HDMI,DEV=2"
2021-07-07 21:49:33.365 T:1209     INFO <general>: CAESinkALSA - ALSA: pcm_hw.c:1715Sadsnd_pcm_hw_open) open '/dev/snd/pcmC0D8p' failed (-16): Device or resource busy
2021-07-07 21:49:33.365 T:1209     INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=HDMI,DEV=2,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x00" for playback
2021-07-07 21:49:33.365 T:1209     INFO <general>: CAESinkALSA - ALSA: pcm_hw.c:1715Sadsnd_pcm_hw_open) open '/dev/snd/pcmC0D8p' failed (-16): Device or resource busy
2021-07-07 21:49:33.365 T:1209     INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=HDMI,DEV=2" for playback
2021-07-07 21:49:33.365 T:1209    ERROR <general>: CAESinkALSA::Initialize - failed to initialize device "hdmi:CARD=HDMI,DEV=2"

In addition to that if that happens, I am not able to shutdown KODI at all. It freezes after initiating the shutdown command.
In the logfile I found:
2021-07-07 21:50:40.605 T:2463    ERROR <general>: DoWork - Direct texture file loading failed for resource://resource.images.studios.white/Sat 1.png
2021-07-07 21:50:40.605 T:2463    ERROR <general>: DoWork - Direct texture file loading failed for resource://resource.images.studios.white/ORF 1.png
2021-07-07 21:50:41.920 T:1205     INFO <general>: Loading skin file: DialogButtonMenu.xml, load type: KEEP_IN_MEMORY
2021-07-07 21:50:45.155 T:1205     INFO <general>: Stopping player
2021-07-07 21:50:45.155 T:1205     INFO <general>: Storing total System Uptime
2021-07-07 21:50:45.155 T:1205     INFO <general>: Saving settings
2021-07-07 21:50:45.161 T:1205     INFO <general>: Saving skin settings
2021-07-07 21:50:45.162 T:1205     INFO <general>: Stopping all
2021-07-07 21:50:45.162 T:1205     INFO <general>: ES: Stopping event server
2021-07-07 21:50:45.934 T:1205     INFO <general>: stopping upnp
2021-07-07 21:50:46.019 T:1250     INFO <general>: ES: UDP Event server stopped
2021-07-07 21:50:46.338 T:1205     INFO <general>: stopping zeroconf publishing
2021-07-07 21:50:46.344 T:1205     INFO <CWebserver[8080]>: Stopped
2021-07-07 21:50:46.344 T:1205     INFO <general>: stop dvd detect media
2021-07-07 21:50:46.665 T:1234     INFO <general>: CPythonInvoker(0, /home/mediacenter/.kodi/addons/plugin.video.youtube/resources/lib/startup.py): script successfully run
2021-07-07 21:50:46.725 T:1234     INFO <general>: Python interpreter interrupted by user
2021-07-07 21:50:47.070 T:1235     INFO <general>: CPythonInvoker(1, /home/mediacenter/.kodi/addons/script.common.plugin.cache/resources/lib/entry_point.py): script successfully run
2021-07-07 21:50:47.105 T:1235     INFO <general>: Python interpreter interrupted by user
2021-07-07 21:50:47.118 T:1236     INFO <general>: CPythonInvoker(2, /home/mediacenter/.kodi/addons/script.cu.lrclyrics/default.py): script successfully run
2021-07-07 21:50:47.152 T:1236  WARNING <general>: CPythonInvoker(2, /home/mediacenter/.kodi/addons/script.cu.lrclyrics/default.py): the python script "/home/mediacenter/.kodi/addons/script.cu.lrclyrics/default.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE,N9XBMCAddon7xbmcgui6WindowE
2021-07-07 21:50:47.152 T:1236     INFO <general>: Python interpreter interrupted by user
2021-07-07 21:50:47.152 T:1237     INFO <general>: CPythonInvoker(3, /home/mediacenter/.kodi/addons/script.grab.fanart/launcher.py): script successfully run
2021-07-07 21:50:47.167 T:1237     INFO <general>: Python interpreter interrupted by user
2021-07-07 21:50:47.168 T:1238     INFO <general>: CPythonInvoker(4, /home/mediacenter/.kodi/addons/script.service.checkpreviousepisode/default.py): script successfully run
2021-07-07 21:50:47.177 T:1238     INFO <general>: Python interpreter interrupted by user
2021-07-07 21:50:47.177 T:1239     INFO <general>: CPythonInvoker(5, /home/mediacenter/.kodi/addons/service.library.data.provider/service.py): script successfully run
2021-07-07 21:50:47.182 T:1239     INFO <general>: Python interpreter interrupted by user



This whole thing did not happen with KODI 18.X
Reply
#2
Additional Information:

If Kodi freezes on shutdown, I have to kill it (with killall kodi) After then I can restart it and Audio starts to work again.
Reply
#3
The forum moderators have determined that banned addons (wiki) are present on your system. To receive assistance here, these banned items must be removed. If a clean log is not submitted within 3 days, then the relevant post(s) will be removed after this time.
Reply
#4
(2021-07-08, 12:12)asavah Wrote: The forum moderators have determined that banned addons (wiki) are present on your system. To receive assistance here, these banned items must be removed. If a clean log is not submitted within 3 days, then the relevant post(s) will be removed after this time.

OK. I'll remove the addons and provide log again when it happens.

Thank you.
Reply
#5
(2021-07-08, 13:56)6i6i_ Wrote: OK. I'll remove the addons and provide log again when it happens.

Next time, just provide the link to the log file. Pasting parts of that same log into the forum is kinda senseless.
We try to keep the forum server as clean as possible, meaning large log/text blobs which are stored infinitely are just not very useful.
Got a Kodi problem? Provide a full Debug log (wiki) | Usefull pages: First time user (wiki) | Troubleshooting (wiki) | Free content (wiki) | Forum rules (wiki) | VPN policy (wiki)
Reply
#6
Helllo,

So the problem happened again.
Here is the log before the shutdown command was initiated:
https://paste.kodi.tv/adonejoduk.kodi

Here is the log after the shutdown command:
https://paste.kodi.tv/dehaxapojo.kodi

I can unterstand but I just wanted do show the relevant parts of the logfile.
Reply
#7
So I am still having this problem. I already replaced the ONKYO receiver as it was broken (with the same model) but I have still the same problem.
Sometimes I can watch 5-7 videos. Sometimes just one video and the audio is broken afterwards.
Reply
#8
For some strange reasons I'm not able to open the links you provided. So I can't see the logs. Maybe someone else is able to. 

But I have to admit that I'm seeing similar problems using LibreELEC on my AVR. Can you please confirm that after the video stops, the AVR still shows the same as if the video would be playing (in meaning showing the audio codec the movie had...DolbyDigital, DTS, DTS-HDMA or whatever)? Or does the AVR show "DolbyProLogic" instead?

My solution, as LibreELEC is running Kodi as a systemd service, to create a shortcut to the shutdown menu which simply restarts the Kodi service. As you are on Linux, you could do something similar: 

https://kodi.wiki/view/List_of_built-in_...ilt-in.27s

RestartApp

Just use that: https://termbin.com/1k48
and replace it with the content of DialogButtonMenu.xml

Image

Works like a charm. It will restart Kodi within a few seconds. 

That just to mention if your problem won't be solved.
Reply
#9
(2022-01-13, 22:04)DaVu Wrote: For some strange reasons I'm not able to open the links you provided. So I can't see the logs. Maybe someone else is able to. 

Pastes on Kodi.tv are removed after 60 days.
If you want something permanent, use pastebin.com .
Got a Kodi problem? Provide a full Debug log (wiki) | Usefull pages: First time user (wiki) | Troubleshooting (wiki) | Free content (wiki) | Forum rules (wiki) | VPN policy (wiki)
Reply
#10
Ha....haven't looked at the date Big Grin 

Thought this was recently created. Wink
Reply
#11
When the video, that played fine with sound, ends (or is stopped manually) the AV Receiver Display will clear and switch to "Stereo" (but it does the same way if the problem does not occur).
After that the sound does not work anymore.
Even the GUI sounds do not work.

I'll activate debug logging again and provide a new log if it happens.

What I recognized, is that when a video stops and the problem does not occur, the switching to "Stereo" in the Display of the AV Receiver is done quite fast (1 second).
If the problem occur the switching to "Stereo" in the Display takes about 3-4 seconds.

I do something similar regarding restarting.
I wrote a "restart script" that is executed when pressing a button on the remote. This will kill kodi and start it up again.
Restarting Kodi like your script wouldn't be possible, because as mentioned above KODI will freeze when a normal Exit is triggered.
Only force killing KODI and restarting fixes the issue.

I already tried to update to the latest version of Ubuntu but nothing helped yet.

I didn't have this problem at all with Kodi 18.x so after upgrading to Kodi 19.x it happened the first time.
Reply



Logout Mark Read Team Forum Stats Members Help
Kodi 19.1 loses audio device after playback0
This forum uses Lukasz Tkacz MyBB addons.