Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dvb driver addons #2270

Merged
merged 11 commits into from
Dec 14, 2017
Merged

dvb driver addons #2270

merged 11 commits into from
Dec 14, 2017

Conversation

CvH
Copy link
Member

@CvH CvH commented Nov 27, 2017

This implements dvb drivers as add-ons. It is possible to use them at the repo or directly at the image.
Current PR adds them only direct at the image (like we done it at LE8.x).

  • the script (made by @b-jesch aka BJ1 tx !) to choose the add-ons is compatible with driver.dvb, driver.video and driver.net, just add them and the add-on made them available regardless if at image or installed manually ( @escalade ideas for more subsystems to support?) - it is possible to create an add-on to support an older/newer gpu driver or add just another realtek fork etc for community builders without changing the base image

- config/functions: add function install_driver_add-on_files_old adds support to do it via repositories too (RFC if we want to support it at the build system - regardless if we use it or not)

  • "default" (if all add-ons are disabled) are the normal kernel drivers that are build along the linux kernel

WIP things to know:

  • icons + naming + descriptions (native GB speakers welcome) are WIP (ideas welcome)
  • I added all add-ons that are currently possible - it makes no sense to include them all, but I can't really tell at the moment which one are useful or not at LE9.0 release (heavily depends at upstream)

currently I tend to:
generic: crazycat + digital_devices (as it is tiny) + hauppauge
everything else: crazycat + hauppauge

  • no downsizing of the build drivers via config files yet (besides crazycat) - currently its make all
  • only activated for Generic and RPi, they behave like the "old" media_build so building at AML should be no problems but I have no experience at this ( @Raybuntu @kszaq should know if there is something additional needed)

testimage:
LE-Generic-9.0-27.11.2017-devel.tar (works at VM too)

how it works at LE:
demo video how it works

sidenote:
If "we" redo the LE-settings add-on some day, the driver choose script function could be included there, currently nobody likes to touch the LE settings add-on code at all and I really dislike to increase the mess at the current settings add-on even more.

@HiassofT
Copy link
Member

I did a quick build test of master+this PR and one thing I noticed is that the 4 driver addon packages for RPi2 added quite a lot of buildtime - especially when they were rebuilt.

I took some measurements on my laptop (i5-3320M, SSD, 16GB RAM) and timed driver.dvb.crazycat build and as a comparison linux kernel build. Before each test I cleaned the package (scripts/clean ...) and dropped caches (echo 3 > /proc/sys/vm/drop_caches)

driver.dvb.crazycat build with .ccache removed took about 7 minutes, about half the time of a kernel build

time PROJECT=RPi DEVICE=RPi2 ARCH=arm scripts/build linux
real    13m54.482s
user    49m49.688s
sys     2m46.716s

time PROJECT=RPi DEVICE=RPi2 ARCH=arm scripts/build driver.dvb.crazycat
real    6m48.326s
user    12m10.972s
sys     1m0.732s

Then, with ccache intact Ichecked the rebuild time - the crazycat driver rebuild took about 7 times (!) as long as the kernel rebuild:

time PROJECT=RPi DEVICE=RPi2 ARCH=arm scripts/build linux
real    0m47.640s
user    0m53.236s
sys     0m15.160s

time PROJECT=RPi DEVICE=RPi2 ARCH=arm scripts/build driver.dvb.crazycat
real    5m34.088s
user    4m19.508s
sys     0m48.924s

Quite a lot of time in the crazycat build seems to be spent in the modpost stage - when make -f scripts/Makefile.modpost from the kernel tree is run, building the .mod.o files. This build also seems to run non-parallel (CPU was about 60-70% idle during this stage).

@CvH could you check what's causing this?

@HiassofT
Copy link
Member

some more info, as discussed on slack -adding it here so it doesn't get lost:

driver.dvb.hauppauge and driver.dvb.media_build download code from linuxtv.org during make_install - this should be changed to run through scripts/get.

(re-)building media_build on master (i.e. without this PR) is also rather slow:

initial build:
time PROJECT=RPi DEVICE=RPi2 ARCH=arm scripts/build media_build
real    6m5.001s
user    12m1.016s
sys     0m56.360s

rebuild:
time PROJECT=RPi DEVICE=RPi2 ARCH=arm scripts/build media_build
real    4m46.816s
user    4m6.776s
sys     0m44.144s

media_build on 8.2 doesn't seem to have this problem. A rebuild of media_build on another (rather slowish, ancient X3220 Xeon with spinning platter HDDs) buildbox only took about 1 minute:

time PROJECT=RPi2 ARCH=arm scripts/build media_build
real    1m17.449s
user    3m20.408s
sys     0m30.916s

@CvH
Copy link
Member Author

CvH commented Nov 29, 2017

@HiassofT added media_tree package, that package holds the media_tree that was downloaded before with that build in script at media_build, changed driver.dvb.media_build/hauppauge accordingly (idk why I didn't had this idea before as it is pretty simple solution 👍 )

@CvH CvH force-pushed the 9.0-dvb-addons branch 3 times, most recently from 26020cd to fdde57b Compare December 3, 2017 23:36
@CvH
Copy link
Member Author

CvH commented Dec 3, 2017

pushed changes:

  • fixed the long build time problem and added hack to workaround (media_tree + cc) tx @HiassofT
  • added new version of script chooser
  • build in addons are now hidden at addon list tx @b-jesch (added xbmc.python.module.drivers.xml)
  • removed not really needed addons
  • updated hauppauge addon to latest

currently nothing else planed if nobody has any objections

@afl1
Copy link
Contributor

afl1 commented Dec 9, 2017

I rebased your PR to my Amlogic S905/S912 builds for testing. It works, but I have a issue with internal dvb driver buit in crazycat package. I need it start after addon startup. In media_build version I use for starting internal driver following script system.d/amlogic-dvb.service:

[Unit]
Description=Amlogic DVB module loader
ConditionPathExists=/proc/device-tree/dvbfe/dtv_demod0

[Service]
Type=simple
ExecStart=/bin/sh -c '[ `cat /proc/device-tree/dvbfe/dtv_demod0` = "Avl6211" ] && /sbin/modprobe aml_fe'

[Install]
WantedBy=basic.target

Do you have any idea how to fix it?

@HiassofT
Copy link
Member

HiassofT commented Dec 9, 2017

@afl1 try to add a dependency on the kernel overlay service - there are no kernel modules available before it's run

[Unit]
...
After=kernel-overlays.service
...

@afl1
Copy link
Contributor

afl1 commented Dec 9, 2017

@HiassofT thanks, but I had bug in installing amlogic-dvb.service. Now it starts.

@spycat88
Copy link
Contributor

spycat88 commented Dec 9, 2017

@afl1 you can place the service in the project filesystem and it will be automatically enabled by the buildsystem

@MilhouseVH MilhouseVH merged commit 5a14ccb into LibreELEC:master Dec 14, 2017
@CvH CvH deleted the 9.0-dvb-addons branch December 14, 2017 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants