hdmi cec compile

Discussion in 'UDOO X86' started by drc85, Jan 11, 2018.

  1. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    hi im trying to get cec to work...https://www.udoo.org/docs-x86/Hardware_&_Accessories/CEC-HDMI.html

    im on kernel 4.14.13
    do i need to be on 4.14.0 to compile?
    when installing i get this

    rc ~ $ sudo apt install git build-essential linux-headers-`uname -r`
    [sudo] Passwort für drc:
    Paketlisten werden gelesen... Fertig
    Abhängigkeitsbaum wird aufgebaut.
    Statusinformationen werden eingelesen.... Fertig
    »build-essential« ist bereits die neuste Version (12.1ubuntu2).
    »git« ist bereits die neuste Version (1:2.7.4-0ubuntu1.3).
    »linux-headers-4.14.13-041413-generic« ist bereits die neuste Version (4.14.13-041413.201801101001).
    0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

    geting the files from the git and copying them to linux worked but,

    when trying to make it i get this
    rc ~/secocec $ make
    make -C /lib/modules/4.14.13-041413-generic/build M=/home/drc/secocec modules
    make[1]: Verzeichnis „/usr/src/linux-headers-4.14.13-041413-generic“ wird betreten
    Makefile:948: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". Schluss.
    make[1]: Verzeichnis „/usr/src/linux-headers-4.14.13-041413-generic“ wird verlassen
    Makefile:15: die Regel für Ziel „modules“ scheiterte
    make: *** [modules] Fehler 2

    what does "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"mean? i cant find them online??
     
  2. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    ok update!
    i switched to the 4.14.0 kernel and it workd i now have the seco-cec.ko file!!!

    next problem is

    modprobe cec
    modprobe: ERROR: could not insert 'cec': Operation not permitted

    when trying to
    blacklist the smsbs driver i2c-i801 it gives me also a error

    echo "blacklist i2c-i801" > /etc/modprobe.d/i2c-i801.conf
    ash: /etc/modprobe.d/i2c-i801.conf: no permission

    any solution?
     
  3. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    91
    I don't have any experience on getting CEC to work, but generally when asked to install something, try to run command:
    sudo apt install PACKAGE

    For example to try to install package libelf-dev mentioned above, use command:
    sudo apt install libelf-dev

    If that fails then such a package doesn't exist and you can try installing other packages mentioned (libelf-devel or elfutils-libelf-devel). That notice mentions several names as different Linuxes might use different name for the needed package.
     
  4. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    91
    Those instructions seem to assume that you are running commands as root user. To do that you can first run command su to switch to root user. After su, all following commands in that terminal will be done as root user, so be careful to not make any typos.

    So try this sequence of commands, all in same terminal:
    su
    modprobe cec
    echo "blacklist i2c-i801" > /etc/modprobe.d/i2c-i801.conf


    Then you can either close the terminal or give command exit to get out of root mode.
     
    Last edited: Jan 12, 2018
    drc85 likes this.
  5. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    hi thanks.. it is already blacklisted... on my filesystem.... i just found out...

    only problem is how i can get the module to run... i tried
    su but it gave me legitimation error
     
  6. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    i also tried sudo -s and gksudo

    didnt worded either...
     
  7. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    i just tied
    sudo modprobe cec
    i had to enter my password but also nothing happend
     
  8. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    91
    That should work.

    You can try sudo modprobe -v cec which should show a bit more of what modprobe is doing. (Manual for modprobe says that "Usually modprobe only prints messages if something goes wrong".)

    As for su, that error probably just means that it's not installed in Mint by default. I mentioned it because sudo doesn't work with all commands, for example with that echo ..., but with modprobe it does work.
     
    drc85 likes this.
  9. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    ok thanks i will try it tonight, hopefully i can get it running, good to know modprobe only prints messages if something goes wrong...
    probably almost had it (im hoping :D)...
    HDMI CEC is the only thing left on my todo list :D

    when the modul is loaded i think the next steps are easier they look kind of familiar :D
     
  10. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    i just tried
    sudo modprobe -v cec

    this is what it said:
    insmod /lib/modules/4.14.13-041413-generic/kernel/drivers/media/rc/rc-core.ko
    insmod /lib/modules/4.14.13-041413-generic/kernel/drivers/media/cec/cec.ko
    whats next?

    cd secocec
    sudo insmod seco-cec.ko
    insmod: ERROR: could not insert module seco-cec.ko: Invalid module format :(

    without cd secocec
    sudo insmod seco-cec.ko
    insmod: ERROR: could not load module seco-cec.ko: No such file or directory
     
  11. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    ok i tried using sudo -s

    when using
    sudo -s
    cd secocec
    insmod seco-cec.ko

    ---->insmod: ERROR: could not insert module seco-cec.ko: Invalid module format


    could it be i need to run at the same kernel the modul is compiled for? it is compiled in 4.14 but after rebooting my system always uses the newest kernel... wich is 4.14.14... i think i will deinstall the 4.14.14 kernel so it auto starts inside the 4.14 kernel .. maybe thats why its invalid?
     
  12. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    ok i think i got it ...
    went back to kernel 4.14

    i used
    cd secocec
    and then
    sudo insmod seco-cec.ko
    after this nothing happens does this means it loaded? where can i check if it is loaded?
     
  13. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    91
    Yes, if you use modules you have compiled yourself, you need to recompile them every time kernel changes.


    After insmod you can try lsmod which should list all installed modules.
     
    drc85 likes this.
  14. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    YEAH thanks alot with your help i got :D the module is running.

    is the module started automatically with each boot?
    or do i need to do this everytime i start linux?
    if its not autostarting how can i make autostart skript for this? sorry for the stupid question :D
     
  15. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    lol ok module is running but the next step dont work at all... i installed v4l-utils but i cant start nothing...

    cec-ctl
    --- command not found
     
  16. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    91
    It's not loaded automatically. To do that I think you need to edit file /etc/modules and add module name there:
    gksudo gedit /etc/modules

    I'm not certain if that is enough or if you need to do something else also.
     
    drc85 likes this.
  17. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    ok i can take care about autostart later :D i will find a way.

    also do i need to create the file in userspace dev/cec0 myself?
     
  18. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    91
    Try installing cec-utils, after some Googling it seems that Linux Mint has cec-ctl in that package and not v4l-utils:
    sudo apt install cec-utils

    As for /dev/cec0, I think installing correct package should create it automatically.
     
    drc85 likes this.
  19. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2
    ok i installed cec-utils ...
    still get the message command not found
     
  20. drc85

    drc85 Member

    Joined:
    Dec 30, 2017
    Messages:
    45
    Likes Received:
    2

Share This Page