Crash when using TVheadend

I use OSMC on Raspberry Pi 2 to watch TV from my TVheadend server.

I am often getting OSCM/kodi crashed when trying to start any TV program.
The Kodi log file always says about TV29.db constraint violation - eg. here is recent crash:

18:09:50.505 T:1477878528 ERROR: SQL: [TV29.db] Abort due to constraint violation
Query: INSERT INTO channels (iUniqueId, bIsRadio, bIsHidden, bIsUserSetIcon, bIsUserSetName, bIsLocked, sIconPath, sChannelName, bIsVirtual, bEPGEnabled, sEPGScraper, iLastWatched, iClientId, idEpg) VALUES (1432878457, 1, 0, 0, 0, 0, ‘’, ‘RMF Classic’, 0, 1, ‘client’, 0, 2146250725, -1)
18:09:50.506 T:1477878528 ERROR: CommitInsertQueries - failed to execute queries

Then I have to go to TV configuration, select option to clan all program and EPG data. Afterwards it works, but not for too long - after OSMC staying idle for some time I’m getting the crash again.

Any idea what’s wrong here, please? I’ve been trying to recreate TV29.db file, but that does not help.

Hi, To get a better understanding of the problem you are experiencing we need more information from you. The best way to get this information is for you to upload logs that demonstrate your problem. You can learn more about how to submit a useful support request here.

So, in summary:

  • activate the logging
  • reboot the OSMC device
  • reproduce the issue
  • upload the log set either using the Log Uploader method within the My OSMC menu in the GUI or the ssh method invoking command grab-logs -A
  • publish the provided URL from the log set upload, here

Thanks for your understanding. We hope that we can help you get up and running again shortly.


Here is URL with logs

When doing tail -f kodi.log I have noticed it crashes without providing actual reason in kodi.log file.

So once I select TV channel and press OK to play it, the following appears in kodi.log:

14:47:37.037 T:1926370048 DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPlay
14:47:37.037 T:1926370048 DEBUG: UPnP: Building didl for object ‘pvr://channels/tv/Wszystkie/pvr.hts_1448345253.pvr’
14:47:37.049 T:1685611264 DEBUG: Skin Helper Widgets --> Kodi_Monitor: sender xbmc - method: Player.OnPlay - data: {“item”:{“channeltype”:“tv”,“id”:132,“title”:“TVN 24 HD”,“type”:“channel”},“player”:{“playerid”:1,“speed”:1}}
14:47:37.056 T:1891627776 DEBUG: CAESinkPi:Drain delay:69ms now:0ms
14:47:37.056 T:1891627776 DEBUG: CAESinkPi:Deinitialize
14:47:37.057 T:1891627776 DEBUG: CAESinkPi:SetAudioProps hdmi_stream_channels 0 hdmi_channel_map 00000000
14:47:37.064 T:1891627776 DEBUG: COMXCoreComponent::Deinitialize : OMX.broadcom.audio_render handle 0x702af440
14:47:37.064 T:1891627776 DEBUG: CActiveAESink::OpenSink - trying to open device PI:HDMI
14:47:37.065 T:1891627776 DEBUG: CAESinkPi:Initialize Format:15 Channels:2 Samplerate:44100 framesize:8 bufsize:17640 bytes/s=352800.00 dest=PI:HDMI
14:47:37.065 T:1891627776 DEBUG: CAESinkPi:SetAudioProps hdmi_stream_channels 0 hdmi_channel_map 00000008
14:47:37.067 T:1891627776 DEBUG: COMXCoreComponent::Initialize OMX.broadcom.audio_render input port 100 output port 100 m_handle 0x702cfa08
14:47:37.070 T:1891627776 DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.audio_render) - port(100), nBufferCountMin(1), nBufferCountActual(2), nBufferSize(17648), nBufferAlignmen(16)
14:47:37.071 T:1891627776 DEBUG: CActiveAESink::OpenSink - SinkPi Initialized:
14:47:37.072 T:1891627776 DEBUG: Output Device : HDMI
14:47:37.072 T:1891627776 DEBUG: Sample Rate : 44100
14:47:37.073 T:1891627776 DEBUG: Sample Format : AE_FMT_FLOAT
14:47:37.073 T:1891627776 DEBUG: Channel Count : 2
14:47:37.074 T:1891627776 DEBUG: Channel Layout: FL,FR
14:47:37.074 T:1891627776 DEBUG: Frames : 2205
14:47:37.075 T:1891627776 DEBUG: Frame Size : 8
14:47:37.078 T:1891627776 DEBUG: ffmpeg[70BFF300]: [SWR] Using fltp internally between filters
14:47:37.079 T:1677222656 DEBUG: JSONRPC: Incoming request: {“jsonrpc”: “2.0”, “id”: 1, “method”: “Player.GetActivePlayers”}

… and nothing afterwards, Kodi just crashes.

So probably the previous SQL error was misleading.

are you using the tvheadend server version available in osmc appstore ?
if so, try deleting all epg data (in the server) by running the following commands in a command line:

sudo service tvheadend stop
rm ~/.hts/tvheadend/epgdb.v2
sudo service tvheadend start

you might also have some configuration corruption. in that case I suggest to stop tvheadend service, remove the entire tvheadend configuration and start again (instead of deleting the configuration, I opted for a backup to another directory):

sudo service tvheadend stop
mv ~/.hts/ ~/.hts.bak/
sudo service tvheadend start

I forgot:
You might also try disabling “asyncrhronus EPG transfer” in advanced settings of kodi’s tvheadend client.

Not really, I use external tvheadend 4.2.6 running on my ubuntu box (where I have TBS satellite card installed)… Do you suggest to run another, local copy of tvheadend on RPi? Asynchronous transfer is already disabled on OSMC.

I somehow doubt it is related to tvheadend server itself, because every time I clean all TV program and EPG data in Kodi - it works fine, for some time, then it starts crashing again.


Do any other devices access the TVheadend server?

If so is the issue only occurring with osmc?

I’m just trying to work out if it is indeed a client issue, rather than server. It may be worth checking the logs on the server.

Thanks Tom.

I’ve done limited testing with Movian and LibreElec - they both seem to work fine. I’ll do more testing and let you know if I find any suspects

I have noticed my LibreElec uses Tvheadend client version, while OSMC still uses 3.4.27

Maybe that’s an issue? As mentioned, LibreElec (with Kodi 17.6) seems to work perfectly fine.


In the logs I noticed error messages either related to the skin or an addon. I would try defaults, just to rule out an issue with your setup:

sudo systemctl stop mediacenter
mv ~/.kodi ~/.kodi_back
sudo systemctl start mediacenter

Then just reenable TVHeadend HTSP and setup and try watching a stream.

After testing you can restore your settings:

sudo systemctl stop mediacenter
mv ~/.kodi_back ~/.kodi
sudo systemctl start mediacenter

Thanks Tom.

I think that’s just LE patching the TVH client to suit themselves. All their PVR clients seem to be like that. I have 3.4.27 on Windoze and it works fine with a Vero4k or RPi server.

Thanks for all hep. :heart_eyes:

After your suggestions I realised I probably had started having those issues after trying a couple of other skins (defaule OSMC skin is not really ideal for TV) - and while I had uninstalled them, I still have had a couple of helpers those skins installed. After I removed those helpers - crashes seemed to magically disappear, so it must have been one of those addons for automatic media description retrieval.

Not sure though which was the culprit as I had at least three of them.

Thanks again!

1 Like