Alignment fault with CA entry

I have a Vero4K with the newest updates installed (August 2017) and a working DVB-S2 usb adapter (Sundtek, see logs). As backend I am using TVHeadend (supplied by OSMC) with the KODI client plugin, which works as expected when watching FTA channels. As soon as I switch to a scrambled channel, TVHeadend crashes with a kernel alignment fault. If I try to watch a scrambled channel and the card has no keys for it, TVHeadend does not crash.
I’ve been using TVHeadend in the past successfully on other platforms, but not this version (4.2.2).


The logs don’t seem to be very useful, but it shows at least what I mean. The error can be reproduced at any time and with any (scrambled) channel the card can decode.

Does anyone run TVHeadend 4.2.2 with a CA entry on the Vero4K and it works? I’ll try another kodi client to see if it’s a client (kodi) or server (TVHeadend) problem.

Don’t know enough about Sundtek + CA to weigh in a lot on this.

I just tried with Kodi 17.4 on my laptop, same error. So the problem is TVHeadend. Would be interesting if the error persists on another platform with TVHeadend 4.2.2. I saw there’s a newer version on github (4.2.3 or even 4.3). Are those stable and if yes, when do you plan to update @sam_nazarko?

I try to reproduce the error in a docker container (x86_64) with version 4.2.2.

I don’t think 4.3 is stable – I was originally planning to release this version but the community told me not to.

I’ll bump the version to 4.2.3 if you can confirm if it’s fixed with that version.

I could not reproduce the problem on x86_64. What I did:

  • Minimal Debian 9.1 install (+ ssh server)
  • Installed driver for the sundtek usb stick (wget and reboot
  • Installed some needed packages
  • pulled tvheadend from github (tag: v4.2.2)
  • configure with parameters: --enable-bundle
  • make
  • run tvheadend with parameters : -C

and everything worked (including descrambling). Probably the configure script configures the build based on the packages installed. So here’s a list of all additional packages:

I also tried a network tuner on the Vero4K, this time the TVHeadend server did not crash, but I never got to watch a scrambled channel. It always showed:

descrambler: cannot decode packets for service “”

So the problem must be somewhere in your build. Which configuration parameters did you use?

See osmc/ at master · osmc/osmc · GitHub
We cannot enable bundle because of a problem with dvb-apps; too bloaty; and for ARM64, the headers are wrong.

Mmh, especially this package (dvb-apps) seems to be important for the CA function to work properly (according to some forum entries).
I tried your parameters, except:

  • I changed ‘enable-libsystemd_daemon’ to ‘disable-libsystemd_daemon’ (installing libsystemd-dev did not work)
  • Disabled hdhomerun_client (don’t know what it is and complained during make)
    When I run this build, I get

2017-09-01 19:06:39.778 [ ERROR] http: HTTP/1.1 GET /redir/theme.css – 400
2017-09-01 19:06:39.778 [ ERROR] webui: failed to open src/webui/static/tvh.js.gz
2017-09-01 19:06:39.778 [ ERROR] http: HTTP/1.1 GET /static/tvh.js.gz – 500

Seems tvheadend doesn’t find the right web directory.

It’s not clear how you built it. The correct way:

git clone
cd osmc/package/tvheadend-app-osmc
make armv7

If that’s a requirement then it won’t work as expected at this time unfortunately. This is why we have some issues with CI support on RBP as well.

I was building on x86_64… Ok, looks like it doesn’t work, but hopefully will in the future! :slight_smile:

Sorry – Vero 4K is an ARM target and I thought you built it on the device directly.


I got it to work. I added the package ‘libdvbcsa-dev’ as dependency in your build script and changed two configure options:

  • –enable-dvbcsa
  • –enable-tvhcsa

Both were disabled before. Is there any reason for disabling those? Another thing i noticed:
Even though the option ‘–enable-dvben50221’ is set, the tvheadend configure script says:

checking for cc libdvben50221 … fail

With the ‘new’ options it says ‘ok’. I tested it for about an hour, no more alignment faults, everything works flawlessly so far.

Good stuff. To be completely honest, my knowledge of TVHeadend is a little limited; so I simply built it with the options that the community generally recommended.

@grahamh wanted to enable CI support and added --enable-libdvben50221. However this didn’t work because such an option depends on libraries. It seemed that dvb-apps was necessary to bring this library in (although that seemed strange as Debian usually won’t mix libs and binaries in this manner).

I assume we also want the built package to depend on libdvbcsa1.

If all we need to do is change those configure options and add those two libraries; then I’m happy with that and can get it included in the next update.


Thanks for your patch, it seems to work that way. I just tried to compile it with ‘libdvbcsa1’ instead of ‘libdvbcsa-dev’ and it worked, too. So you don’t need the development headers to build. I assume the dependencies in your ‘’ script are both, run- and buildtime dependencies :slight_smile:
And you could edit the options instead of just appending new to the command line, it’s more readable.

I committed this a few days ago and got it built in the staging repo. Thanks for the suggestions.