Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

[PROBLEM] Kodi randomly hangs while playing audio
Thank you for your donation

Pages (2): 1 2 Next »
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Problem: Kodi randomly hangs while playing audio
16th Feb, 2020, 09:38 PM
Post: #1
jakenl Offline
Registered
Posts: 97
Joined: Jun 2015
Reputation: 6
Kodi randomly hangs while playing audio
As of a couple weeks ago Kodi starts to randomly hang while playing audio. Afterwards Kodi (GUI) is completely unresponsive. Even a restart of the service by 'sudo service xbmc restart' takes an awful long time and doesn't result in a working Kodi afterwards. My only solution is a reboot.

I checked out the running mp3 file, but nex time Kodi doesn't have issues playing it. Therefore I enabled debug logging to see if I can catch any additional information, leading to the error. I have added the log from the line where the last just started playing correctly. In the middle of that file Kodi quit on me.
last bit of log file (Click to View)
2020-02-16 12:17:06.308 T:2955410800 DEBUG: unrecognized ID3 frame detected: MCDI
2020-02-16 12:17:06.308 T:2955410800 DEBUG: unrecognized ID3 frame detected: PRIV
2020-02-16 12:17:06.308 T:2955410800 DEBUG: unrecognized ID3 frame detected: TLEN
2020-02-16 12:17:06.309 T:2955410800 DEBUG: CPlayerGUIInfo::InitCurrentItem(musicdb://songs/2793.mp3)
2020-02-16 12:17:06.324 T:2741100768 DEBUG: XBian XBMC-Upstart bridge: got notification for event Player.OnPlay. player.isPlayingLiveTV() = False
2020-02-16 12:17:06.325 T:2741100768 DEBUG: XBian XBMC-Upstart bridge: emitting Upstart event: sudo initctl emit -n -q player ACTION=PLAY TYPE=SONG
2020-02-16 12:17:06.372 T:2924474592 DEBUG: CActiveAE::DiscardStream - audio stream deleted
2020-02-16 12:17:06.373 T:2565837024 DEBUG: DoWork - Saving file state for audio item musicdb://songs/2792.mp3
2020-02-16 12:17:06.373 T:2924474592 DEBUG: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
2020-02-16 12:17:06.374 T:2515529952 DEBUG: Previous line repeats 1 times.
2020-02-16 12:17:06.374 T:2515529952 DEBUG: PAPlayer::ProcessStreams - Stream Freed
2020-02-16 12:17:06.404 T:2565837024 DEBUG: DoWork - Marking audio item musicdb://songs/2792.mp3 as listened
2020-02-16 12:17:06.410 T:2955410800 DEBUG: ------ Window Init (DialogBusy.xml) ------
2020-02-16 12:17:06.411 T:2955410800 DEBUG: Window DialogBusy.xml was already loaded
2020-02-16 12:17:06.411 T:2955410800 DEBUG: Alloc resources: 0.12ms
2020-02-16 12:17:06.509 T:2741100768 DEBUG: XBian XBMC-Upstart bridge: calculated priority: 2, based on monitor.screensaver=True, monitor.library_statuses={'scanning_video': False, 'cleaning_video': False, 'scanning_music': False, 'cleaning_music': False}, player.isPlaying()=1, player.isPlayingLiveTV()=False
2020-02-16 12:17:06.528 T:2955410800 DEBUG: ------ Window Deinit (DialogBusy.xml) ------
2020-02-16 12:17:06.528 T:2955410800 WARNING: OnMessage: Suspiciously long time to handle GUI_MSG_PLAYBACK_STARTED (0.27s)
2020-02-16 12:17:06.571 T:2924474592 DEBUG: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
2020-02-16 12:17:36.429 T:2565837024 DEBUG: Thread JobWorker 2565837024 terminating (autodelete)
2020-02-16 12:18:55.680 T:2678046944 DEBUG: JSONRPC Server: New connection detected
2020-02-16 12:18:55.680 T:2678046944 INFO: JSONRPC Server: New connection added
2020-02-16 12:18:55.683 T:2565837024 DEBUG: CWebServer[8080]: request received for /jsonrpc
2020-02-16 12:19:02.917 T:2686439648 DEBUG: Previous line repeats 24 times.
2020-02-16 12:19:02.917 T:2686439648 DEBUG: EventClient: button code 0 pressed
2020-02-16 12:19:02.922 T:2955410800 DEBUG: HandleKey: sleep (0xdf) pressed, screen saver/dpms woken up
2020-02-16 12:19:02.959 T:2749493472 DEBUG: XBian-config : on saver deactivated
2020-02-16 12:19:03.258 T:2741100768 DEBUG: XBian XBMC-Upstart bridge: got notification for event onScreensaverDeactivated
2020-02-16 12:19:03.259 T:2741100768 DEBUG: XBian XBMC-Upstart bridge: emitting Upstart event: sudo initctl emit -n -q screensaver ACTION=STOP
2020-02-16 12:19:03.482 T:2741100768 DEBUG: XBian XBMC-Upstart bridge: calculated priority: 4, based on monitor.screensaver=False, monitor.library_statuses={'scanning_video': False, 'cleaning_video': False, 'scanning_music': False, 'cleaning_music': False}, player.isPlaying()=1, player.isPlayingLiveTV()=False
2020-02-16 12:19:03.482 T:2741100768 DEBUG: XBian XBMC-Upstart bridge: emitting Upstart event: sudo initctl emit -n -q xbmcplevel PREVLEVEL=2 LEVEL=4
2020-02-16 12:19:03.937 T:2565837024 DEBUG: CWebServer[8080]: request received for /jsonrpc
2020-02-16 12:19:03.943 T:2955410800 DEBUG: ------ Window Deinit () ------
2020-02-16 12:19:03.948 T:2565837024 DEBUG: CWebServer[8080]: request received for /jsonrpc
2020-02-16 12:19:06.071 T:2686439648 DEBUG: Previous line repeats 8 times.
2020-02-16 12:19:06.071 T:2686439648 DEBUG: EventClient: button code 0 pressed
2020-02-16 12:19:06.075 T:2955410800 DEBUG: HandleKey: sleep (0xdf) pressed, action is SkipNext
2020-02-16 12:19:06.075 T:2955410800 DEBUG: CPlayerCoreFactory::GetPlayers(musicdb://songs/2794.mp3)
2020-02-16 12:19:06.075 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: mms/udp
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: radio
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerCoreFactory::GetPlayers: adding audiodefaultplayer (PAPlayer)
2020-02-16 12:19:06.076 T:2955410800 DEBUG: CPlayerCoreFactory::GetPlayers: for video=0, audio=1
2020-02-16 12:19:06.077 T:2955410800 DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
2020-02-16 12:19:06.077 T:2955410800 DEBUG: CPlayerCoreFactory::GetPlayers: adding player: VideoPlayer
2020-02-16 12:19:06.077 T:2955410800 DEBUG: CPlayerCoreFactory::GetPlayers: added 2 players
2020-02-16 12:19:07.179 T:2565837024 DEBUG: CWebServer[8080]: request received for /jsonrpc
2020-02-16 12:19:07.278 T:2686439648 DEBUG: Previous line repeats 4 times.
2020-02-16 12:19:07.278 T:2686439648 DEBUG: EventClient: button code 0 pressed
2020-02-16 12:19:08.255 T:2582622432 DEBUG: CWebServer[8080]: request received for /jsonrpc
2020-02-16 12:19:16.639 T:2678046944 DEBUG: Previous line repeats 2 times.
2020-02-16 12:19:16.639 T:2678046944 INFO: JSONRPC Server: Disconnection detected
2020-02-16 12:20:08.338 T:2686439648 NOTICE: ES: Client from 192.168.1.4 timed out
After such a crash the SSH connection is still responsive, but as soon as I force a 'sudo reboot' the RPI disappears from the network and doesn't come alive anymore, unless I physically pull the plug.
Find all posts by this user
Quote this message in a reply
17th Feb, 2020, 02:36 AM
Post: #2
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Kodi randomly hangs while playing audio
Nothing suspicious to see ...
Please look into /var/log/upstart/xbmc.log, maybe there are some useful informations
Find all posts by this user
Quote this message in a reply
17th Feb, 2020, 06:00 AM
Post: #3
jakenl Offline
Registered
Posts: 97
Joined: Jun 2015
Reputation: 6
RE: Kodi randomly hangs while playing audio
(17th Feb, 2020 02:36 AM)Nachteule Wrote:  Nothing suspicious to see ...
Please look into /var/log/upstart/xbmc.log, maybe there are some useful informations
too bad, well I checked the content of xbmc.log, but that doesn't tell me much more:
Sending action: XBMC.Reboot
Feb 16 12:39:06: kodi.bin still alive after 30s, killing it now

I check the previous log file (the 'logrotated' one) and it gives the same 2 lines last week.
Find all posts by this user
Quote this message in a reply
17th Feb, 2020, 07:19 AM
Post: #4
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Kodi randomly hangs while playing audio
Hmmm, filesystem already checked?
Find all posts by this user
Quote this message in a reply
19th Feb, 2020, 03:46 AM
Post: #5
jakenl Offline
Registered
Posts: 97
Joined: Jun 2015
Reputation: 6
RE: Kodi randomly hangs while playing audio
(17th Feb, 2020 07:19 AM)Nachteule Wrote:  Hmmm, filesystem already checked?
No, i haven't. I guess I should stop Kodi first and do a manual unmount of the usb device with the data?

Shouldn't a corrupt file not always be corrupt? In my case I have no problem to play the same song after I reboot the rpi
Find all posts by this user
Quote this message in a reply
19th Feb, 2020, 04:03 AM
Post: #6
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Kodi randomly hangs while playing audio
(19th Feb, 2020 03:46 AM)jakenl Wrote:  
(17th Feb, 2020 07:19 AM)Nachteule Wrote:  Hmmm, filesystem already checked?
No, i haven't. I guess I should stop Kodi first and do a manual unmount of the usb device with the data?

Shouldn't a corrupt file not always be corrupt? In my case I have no problem to play the same song after I reboot the rpi

I meant the root fs
Find all posts by this user
Quote this message in a reply
20th Feb, 2020, 06:53 AM
Post: #7
jakenl Offline
Registered
Posts: 97
Joined: Jun 2015
Reputation: 6
RE: Kodi randomly hangs while playing audio
(19th Feb, 2020 04:03 AM)Nachteule Wrote:  
(19th Feb, 2020 03:46 AM)jakenl Wrote:  
(17th Feb, 2020 07:19 AM)Nachteule Wrote:  Hmmm, filesystem already checked?
No, i haven't. I guess I should stop Kodi first and do a manual unmount of the usb device with the data?

Shouldn't a corrupt file not always be corrupt? In my case I have no problem to play the same song after I reboot the rpi

I meant the root fs
No I haven't done that either. Can you please give a tip how to do that? (I have no SD-card anymore, running from an USB stick instead.
Find all posts by this user
Quote this message in a reply
20th Feb, 2020, 06:58 AM
Post: #8
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Kodi randomly hangs while playing audio
(20th Feb, 2020 06:53 AM)jakenl Wrote:  
(19th Feb, 2020 04:03 AM)Nachteule Wrote:  
(19th Feb, 2020 03:46 AM)jakenl Wrote:  
(17th Feb, 2020 07:19 AM)Nachteule Wrote:  Hmmm, filesystem already checked?
No, i haven't. I guess I should stop Kodi first and do a manual unmount of the usb device with the data?

Shouldn't a corrupt file not always be corrupt? In my case I have no problem to play the same song after I reboot the rpi

I meant the root fs
No I haven't done that either. Can you please give a tip how to do that? (I have no SD-card anymore, running from an USB stick instead.

1st) you have to enable initramfs (can be done in Kodi XBian-Config GUI)
2nd) you have to add rescue parameter in /boot/cmdline.txt
3rd) reboot Pi and after entering in rescue mode run btrfs check /dev/sda2
Find all posts by this user
Quote this message in a reply
21st Feb, 2020, 06:51 AM
Post: #9
jakenl Offline
Registered
Posts: 97
Joined: Jun 2015
Reputation: 6
RE: Kodi randomly hangs while playing audio
(20th Feb, 2020 06:58 AM)Nachteule Wrote:  
(20th Feb, 2020 06:53 AM)jakenl Wrote:  
(19th Feb, 2020 04:03 AM)Nachteule Wrote:  
(19th Feb, 2020 03:46 AM)jakenl Wrote:  
(17th Feb, 2020 07:19 AM)Nachteule Wrote:  Hmmm, filesystem already checked?
No, i haven't. I guess I should stop Kodi first and do a manual unmount of the usb device with the data?

Shouldn't a corrupt file not always be corrupt? In my case I have no problem to play the same song after I reboot the rpi

I meant the root fs
No I haven't done that either. Can you please give a tip how to do that? (I have no SD-card anymore, running from an USB stick instead.


1st) you have to enable initramfs (can be done in Kodi XBian-Config GUI)
2nd) you have to add rescue parameter in /boot/cmdline.txt
3rd) reboot Pi and after entering in rescue mode run btrfs check /dev/sda2
I executed your given commands. After reboot I indeed ended up in the recovery environment. In order to do the fschk, I had to run the command 'rom' to unmount the rootfs before doing the file check.

Luckily / unfortunately I didn't find any errors. I made a picture of the screen:
checking root items
checking extents
checking free space cache
checking fs roots
checking only items (without verifying data)
checking root refs
checking quota groups skipped (not enabled on this FS)
found xxx bytes used, no error found

Afterward, I think I had to enter 'exit' in order to continue boot to Kodi. So far so good, not good since I didnt' find a root cause yet.
Find all posts by this user
Quote this message in a reply
21st Feb, 2020, 06:58 AM
Post: #10
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Kodi randomly hangs while playing audio
Hmmm, so very difficult to say what the problem is

Kodi has not been updateted for a long time, so must be other reason Confused
Find all posts by this user
Quote this message in a reply
8th Mar, 2020, 10:37 PM
Post: #11
jakenl Offline
Registered
Posts: 97
Joined: Jun 2015
Reputation: 6
Kodi randomly hangs while playing audio
My problem is still there. The weird thing is that playing audio fails all the time, but video's play fine. They are both located on different USB-sticks.

Also, I did 2 things in between multiple 'pull plugs' because xbian hangs/can't be accessed anymore:

Did from SSH a 'sudo reboot'. On the screen I see Kodi closing down and it is showing the Xbian log while saying 'unmounting fs'. However, it stays on that screen forever
After another hang up with Kodi, I checked 'df -h' through SSH, but that command makes Raspbian to fail completely, I can't use the cmdline anymore at all.

So, could be this one USB-stick the culprit? What would be the best method to check?
- Put the stick in a Windows PC and do file check?
- Copy the data-backup on pc to my 2nd stick with the video files and check if it still has issues playing form there?
Find all posts by this user
Quote this message in a reply
9th Mar, 2020, 12:06 AM
Post: #12
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Kodi randomly hangs while playing audio
(8th Mar, 2020 10:37 PM)jakenl Wrote:  My problem is still there. The weird thing is that playing audio fails all the time, but video's play fine. They are both located on different USB-sticks.
Ah, ok!

Quote:Also, I did 2 things in between multiple 'pull plugs' because xbian hangs/can't be accessed anymore:

Did from SSH a 'sudo reboot'. On the screen I see Kodi closing down and it is showing the Xbian log while saying 'unmounting fs'. However, it stays on that screen forever

If a process still holds a file open, umount will how work. So, please check which process keeps file open after you have stopped Kodi by running command sudo lsof /mountpoint/of/your/usbstick

Quote:After another hang up with Kodi, I checked 'df -h' through SSH, but that command makes Raspbian to fail completely, I can't use the cmdline anymore at all.

So, could be this one USB-stick the culprit? What would be the best method to check?
- Put the stick in a Windows PC and do file check?
- Copy the data-backup on pc to my 2nd stick with the video files and check if it still has issues playing form there?

Yes, copy files to the 'good' stick would be good idea

Or read all files from that 'bad' stick from the Pi with command

for f in $(find /mountpoint/of/your/usbstick -type f); do echo reading $f; cp -v $f /dev/null; done

plz note that this command can not deal with spaces in filename/dirs
Find all posts by this user
Quote this message in a reply
9th Mar, 2020, 08:16 AM
Post: #13
jakenl Offline
Registered
Posts: 97
Joined: Jun 2015
Reputation: 6
RE: Kodi randomly hangs while playing audio
(9th Mar, 2020 12:06 AM)Nachteule Wrote:  If a process still holds a file open, umount will how work. So, please check which process keeps file open after you have stopped Kodi by running command sudo lsof /mountpoint/of/your/usbstick
Ah, I wasn't aware of this utility. However, stopping Kodi in these circumstances usually doesn't work. Whether I use 'kodi stop' or 'sudo service xbmc stop' the command won't finish. In normal circumstances these commands work as expected. Good chance that lsof will show a file lock by Kodi on the mp3 file that was playing during the crash, but still interesting to find out.
Quote:Yes, copy files to the 'good' stick would be good idea
I used the 'copy -R method to copy a certain segment of albums to that 2nd stick. I didn't add them to the library yet, to not confuse matters, and now play them by selecting them as files. It is playing as I type and I am now a few tracks further than this morning. Only in the 3rd track I heart a 'scratch' sound. I'll have to see afterwards if I can replicate this when I play the same file from another device on the network, like my laptop.
Quote:Or read all files from that 'bad' stick from the Pi with command

for f in $(find /mountpoint/of/your/usbstick -type f); do echo reading $f; cp -v $f /dev/null; done

plz note that this command can not deal with spaces in filename/dirs
Most albums have plenty spaces in them, but no problem. I have all albums stored on the PC as well and keep it there as a main source of data (with previous crashed USB-sticks in mind).
Find all posts by this user
Quote this message in a reply
10th Mar, 2020, 04:13 PM
Post: #14
jakenl Offline
Registered
Posts: 97
Joined: Jun 2015
Reputation: 6
Kodi randomly hangs while playing audio
It must have been the usb stick. Some music tracks didn't even wanted to start when i put the stick in my PC. After a full format I put all the files back on it and now xbian runs fine while playing audio, without crashes.
Find all posts by this user
Quote this message in a reply
10th Mar, 2020, 09:04 PM
Post: #15
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Kodi randomly hangs while playing audio
Yes, everything pointed to it.
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »
Post Reply 


Possibly Related Threads...
Thread: Author Replies Views: Last Post
  [PROBLEM] Kodi hangs randomly while on playback guillaumesoucy 6 12,091 11th Jan, 2023 02:32 PM
Last Post: celinedion
  Kodi 17.4 is not playing video smoothly. GastonBA 24 54,496 13th Oct, 2017 04:43 AM
Last Post: cairnarvon

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 18th May, 2025, 03:33 AM Powered By MyBB, © 2002-2025 MyBB Group.