Occasional audio interruptions only fixed by rebooting
#1
I'm running Kodi on an older Ubuntu Eoan box with HDMI output into an amp/receiver that forwards the video signal to an HD projector. Quite often, when I play video content (usually MKV/h264/ac3) the audio will drop out every minute or so for a couple of seconds. Video continues uninterrupted. I've tried restarting Kodi and restarting gdm3 but the problem continues. If I reboot the whole box, however, I'm able to play smoothly without any audio interruptions.

I'm not using pulseaudio, alsa, jack -- just pass-through audio output to HDMI device.

Box specs are Quad Core i5-3470 CPU @ 3.20GHz; 8GB RAM; OS running on SSD. HDMI output is through Radeon HD 5000/6000/7350/8350 Series device.

Any suggestions for what might be going on here? The behavior suggests it is probably a problem outside of Kodi, but I'm not running anything else on the box and can't think of any way to troubleshoot.
Reply
#2
Usually dmesg and kernel log are the first ones to examine.
Reply
#3
(2020-05-01, 16:28)Segfault Wrote: Usually dmesg and kernel log are the first ones to examine.
I've tried running tail -f on both dmesg and kern.log while playing and no messages show up when there is an audio interruption. I also scanned through the logs generally and don't see anything that would appear to be related.
Reply
#4
Got a link to a kodi debug log (wiki) ?  Not sure if it'll reveal anything, but it certainly won't without one.
Learning Linux the hard way !!
Reply
#5
(2020-05-01, 20:46)black_eagle Wrote: Got a link to a kodi debug log (wiki) ?  Not sure if it'll reveal anything, but it certainly won't without one.
Debug log posted here

I think I see the problem now -- specifically, this error corresponds with audio skips:
log:
2020-05-02 15:28:31.399 T:140247364699904   ERROR: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover
2020-05-02 15:28:44.717 T:140244900898560   DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-29948.597168, adjusted:-41708.333333
2020-05-02 15:29:07.539 T:140247364699904   ERROR: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover

I see someone else reported what looks like an identical issue . I am experimenting with the solution posted there (enabling buffering and increasing cachemembuffersize in advancesettings.xml) and will report back.
Reply
#6
This won't solve your issue. Sadly you cut the part of kodi's log that shows the kernel version.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#7
(2020-05-02, 21:51)fritsch Wrote: This won't solve your issue. Sadly you cut the part of kodi's log that shows the kernel version.
Here's a full session log from launch.
Reply
#8
(2020-05-02, 22:04)kja7 Wrote:
(2020-05-02, 21:51)fritsch Wrote: This won't solve your issue. Sadly you cut the part of kodi's log that shows the kernel version.
Here's a full session log from launch. 
One more log with more detailed audio component audio logging enabled.

And, yes, I do seem to still have audio interruptions even after enabling buffering in advancedsettings.xml.
Reply
#9
Please upgrade to latest 5.4.x kernel - what I really wonder: the first Debug Log you linked in here showed that you had an ATI Card, now it's intel ... curious.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#10
(2020-05-02, 22:22)fritsch Wrote: Please upgrade to latest 5.4.x kernel - what I really wonder: the first Debug Log you linked in here showed that you had an ATI Card, now it's intel ... curious.
The debug logs were all generated on the same system without any hardware change (or even rebooting) in between. Not sure why they would show different video cards. I've posted full output of lspci here.

I've upgraded to 5.4.28 which appears to be the most recent working build from Ubuntu. Is that sufficiently recent? (The later versions appear to be broken for amd64 in Ubuntu's autobuild). I will experiment and see if audio behavior is any different.
Reply
#11
(2020-05-02, 22:35)kja7 Wrote:
(2020-05-02, 22:22)fritsch Wrote: Please upgrade to latest 5.4.x kernel - what I really wonder: the first Debug Log you linked in here showed that you had an ATI Card, now it's intel ... curious.
The debug logs were all generated on the same system without any hardware change (or even rebooting) in between. Not sure why they would show different video cards. I've posted full output of lspci here.

I've upgraded to 5.4.28 which appears to be the most recent working build from Ubuntu. Is that sufficiently recent? (The later versions appear to be broken for amd64 in Ubuntu's autobuild). I will experiment and see if audio behavior is any different.  

Still getting some audio dropouts on Linux 5.4.28 -- seems to correspond with this in the log file:
log:

2020-05-02 16:37:08.718 T:140405459449600   DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-15012.808550, adjusted:-15012.808550
2020-05-02 16:37:13.714 T:140405459449600   DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-10159.587574, adjusted:-10159.587574
2020-05-02 16:37:26.770 T:140405459449600   DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-10471.289823, adjusted:-10471.289823
2020-05-02 16:37:39.826 T:140405459449600   DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-10470.557585, adjusted:-10470.557585
2020-05-02 16:37:46.047 T:140406842980096   ERROR: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover
2020-05-02 16:37:46.823 T:140407058929408   DEBUG: ActiveAE::SyncStream - average error -110.323028 above threshold of 100.000000
2020-05-02 16:37:46.897 T:140407058929408   DEBUG: ActiveAE::SyncStream - average error -24.989695 below threshold of 30.000000
2020-05-02 16:37:47.901 T:140407058929408   DEBUG: ActiveAE::SyncStream - average error -697.126762 above threshold of 100.000000
2020-05-02 16:37:48.096 T:140407058929408   DEBUG: ActiveAE::SyncStream - average error -25.126762 below threshold of 30.000000
2020-05-02 16:37:49.139 T:140405459449600   DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-16875.670720, adjusted:-16875.670720
Reply
#12
Yes, that's a kernel /driver bug on your system:

2020-05-02 16:37:46.047 T:140406842980096   ERROR: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover

Your sound card driver looses connection to the HW. In order to rule out  / find which component it is, testing with LibreELEC from an usb stick will help to find the issue.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#13
(2020-05-02, 22:41)fritsch Wrote: Yes, that's a kernel /driver bug on your system:

2020-05-02 16:37:46.047 T:140406842980096   ERROR: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover

Your sound card driver looses connection to the HW. In order to rule out  / find which component it is, testing with LibreELEC from an usb stick will help to find the issue.
Anything in particular I should do with LibreELEC? Just launch Kodi, play media, and record log?

Does it make any sense that this problem usually goes away for a while after a reboot?

Worth trying a low latency kernel or is that barking up the wrong tree?
Reply
#14
No, RT kernel is counter productive for kodi. just do you usual use-case and see if you can reproduce on LE.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
Occasional audio interruptions only fixed by rebooting0