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

Feature/CEC detection #877

Merged

Conversation

m-seker
Copy link
Contributor

@m-seker m-seker commented Jul 15, 2020

Summary

Implements #708

Pause V4L2 grabber if "standby" event is observed on HDMI bus. Continue on "on" event.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated (docs/docs/en)
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

Also see this : #878

Also see this : hyperion-project/hyperion.docker-ci#3

Info(LOG, QString("\tPath : %1").arg(descriptor.strComPath).toLocal8Bit());
}

QString CECHandler::scan() const
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scan is currently not used. We may need it in future.

@hyperion-project
Copy link

Here is your new link to your workflow artifacts.

@hyperion-project
Copy link

Here is your new link to your workflow artifacts.

@@ -110,6 +110,7 @@
/// * cropTop : Cropping from the top [default=0]
/// * cropBottom : Cropping from the bottom [default=0]
/// * signalDetection : enable/disable signal detection [default=true]
/// * cecDetection : enable/disable cec detection [default=true]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just copied above line but it doesn't look correct

using CECParameter = CEC::libcec_parameter;
using CECConfig = CEC::libcec_configuration;
using CECAlert = CEC::libcec_alert;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why the whole file looks like I used spaces instead of tabs whereas I triplechecked that I used tabs.

@hyperion-project
Copy link

Here is your new link to your workflow artifacts.

@Paulchen-Panther
Copy link
Member

Is the shared libcec also included in the finished packages or is it not necessary?
https://github.com/hyperion-project/hyperion.ng/blob/master/cmake/Dependencies.cmake

@hyperion-project
Copy link

Here is your new link to your workflow artifacts.

@m-seker
Copy link
Contributor Author

m-seker commented Jul 19, 2020

@Paulchen-Panther I updated it, thanks

@Paulchen-Panther
Copy link
Member

@Paulchen-Panther I updated it, thanks

I didn't mean the system library SKIP list. The library should be found in variable CEC_LIBRARIES.

@hyperion-project
Copy link

Here is your new link to your workflow artifacts.

@hyperion-project
Copy link

Here is your new link to your workflow artifacts.

@hyperion-project
Copy link

Here is your new link to your workflow artifacts.

@Paulchen-Panther Paulchen-Panther merged commit c124e21 into hyperion-project:master Jul 20, 2020
@tihoangyeudau
Copy link

tihoangyeudau commented Jul 20, 2020

When i run this code: wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh

ive got this issue:

CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find CEC (missing: CEC_INCLUDE_DIRS CEC_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindCEC.cmake:16 (find_package_handle_standard_args)
  libsrc/cec/CMakeLists.txt:2 (find_package)

-- Configuring incomplete, errors occurred!
See also "/hyperion/build/CMakeFiles/CMakeOutput.log".
See also "/hyperion/build/CMakeFiles/CMakeError.log".
---> Hyperion compilation failed! Abort

i installed sudo apt install libcec-dev but not solve

@m-seker
Copy link
Contributor Author

m-seker commented Jul 20, 2020

When i run this code: wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh

ive got this issue:

CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find CEC (missing: CEC_INCLUDE_DIRS CEC_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindCEC.cmake:16 (find_package_handle_standard_args)
  libsrc/cec/CMakeLists.txt:2 (find_package)

-- Configuring incomplete, errors occurred!
See also "/hyperion/build/CMakeFiles/CMakeOutput.log".
See also "/hyperion/build/CMakeFiles/CMakeError.log".
---> Hyperion compilation failed! Abort

i installed sudo apt install libcec-dev but not solve

Check this :

murse@murse-mint:~/projects/hyperion.ng/build$ sudo apt-get remove libcec-dev 
[sudo] password for murse:         
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  chromium-codecs-ffmpeg-extra libcec4 libp8-platform2
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libcec-dev
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 143 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 303801 files and directories currently installed.)
Removing libcec-dev (4.0.4+dfsg1-4ubuntu3) ...
murse@murse-mint:~/projects/hyperion.ng/build$ cmake -DCMAKE_PREFIX_PATH=/mnt/software/Qt/5.15.0/gcc_64 -DCMAKE_BUILD_TYPE=Debug  ..
-- CMake Version: 3.16.3
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:18 (CMAKE_POLICY):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Found Python3: /usr/bin/python3.8 (found version "3.8.2") found components: Interpreter Development 
-- PLATFORM is not defined, evaluated platform: x11
-- PLATFORM: x11
-- ENABLE_AMLOGIC = OFF
-- ENABLE_DISPMANX = OFF
-- ENABLE_FB = ON
-- ENABLE_OSX = OFF
-- ENABLE_SPIDEV   = ON
-- ENABLE_TINKERFORGE = ON
-- ENABLE_V4L2 = ON
-- ENABLE_WS281XPWM = OFF
-- ENABLE_AVAHI = ON
-- ENABLE_USB_HID = ON
-- ENABLE_CEC = ON
-- ENABLE_X11 = ON
-- ENABLE_QT = ON
-- ENABLE_TESTS = OFF
-- ENABLE_PROFILER = OFF
-- Current Version: 2.0.0-alpha.6
--  - Build: master (GitHub-f23c4d15/37fbc1a2-1595273613)
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Linker: GNU gold
-- Found Qt Version: 5.15.0
-- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Performing Test TURBOJPEG_WORKS
-- Performing Test TURBOJPEG_WORKS - Success
-- Found TurboJpeg: /usr/lib/x86_64-linux-gnu/libturbojpeg.so  
-- Using Turbo JPEG library: /usr/lib/x86_64-linux-gnu/libturbojpeg.so
-- Looking for strtof_l
-- Looking for strtof_l - found
-- Looking for strtoull_l
-- Looking for strtoull_l - found
fatal: No annotated tags can describe '37fbc1a23e35eae9c531358e3bb439b3a9f67802'.
However, there were unannotated tags: try --tags.
CMake Warning at dependencies/external/flatbuffers/CMake/Version.cmake:22 (message):
  git describe failed with exit code: 128
Call Stack (most recent call first):
  dependencies/external/flatbuffers/CMakeLists.txt:540 (include)


Proceeding with version: 1.12.0.0
-- Using flatbuffers compiler: /home/murse/projects/hyperion.ng/build/bin/flatc
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Protobuf: doing try-compiles for hash map/set headers
-- Protobuf: doing try-compiles for pthread test
-- Looking for stddef.h
-- Looking for stddef.h - found
CMake Deprecation Warning at dependencies/external/protobuf/src/CMakeLists.txt:329 (cmake_policy):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Using protobuf compiler: /home/murse/projects/hyperion.ng/build/bin/protoc
-- Found PythonInterp: /usr/bin/python3.8 (found version "3.8.2") 
-- Found Perl: /usr/bin/perl (found version "5.30.0") 
-- Using static mbedtls libraries (build version "2.16.7")
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find CEC (missing: CEC_INCLUDE_DIRS CEC_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindCEC.cmake:16 (find_package_handle_standard_args)
  libsrc/cec/CMakeLists.txt:2 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/murse/projects/hyperion.ng/build/CMakeFiles/CMakeOutput.log".
See also "/home/murse/projects/hyperion.ng/build/CMakeFiles/CMakeError.log".
murse@murse-mint:~/projects/hyperion.ng/build$ sudo apt-get install libcec-dev 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  chromium-codecs-ffmpeg-extra
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  libcec-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/21,2 kB of archives.
After this operation, 143 kB of additional disk space will be used.
Selecting previously unselected package libcec-dev.
(Reading database ... 303789 files and directories currently installed.)
Preparing to unpack .../libcec-dev_4.0.4+dfsg1-4ubuntu3_amd64.deb ...
Unpacking libcec-dev (4.0.4+dfsg1-4ubuntu3) ...
Setting up libcec-dev (4.0.4+dfsg1-4ubuntu3) ...
murse@murse-mint:~/projects/hyperion.ng/build$ rm -rf *
murse@murse-mint:~/projects/hyperion.ng/build$ cmake -DCMAKE_PREFIX_PATH=/mnt/software/Qt/5.15.0/gcc_64 -DCMAKE_BUILD_TYPE=Debug  ..
-- CMake Version: 3.16.3
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:18 (CMAKE_POLICY):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Found Python3: /usr/bin/python3.8 (found version "3.8.2") found components: Interpreter Development 
-- PLATFORM is not defined, evaluated platform: x11
-- PLATFORM: x11
-- ENABLE_AMLOGIC = OFF
-- ENABLE_DISPMANX = OFF
-- ENABLE_FB = ON
-- ENABLE_OSX = OFF
-- ENABLE_SPIDEV   = ON
-- ENABLE_TINKERFORGE = ON
-- ENABLE_V4L2 = ON
-- ENABLE_WS281XPWM = OFF
-- ENABLE_AVAHI = ON
-- ENABLE_USB_HID = ON
-- ENABLE_CEC = ON
-- ENABLE_X11 = ON
-- ENABLE_QT = ON
-- ENABLE_TESTS = OFF
-- ENABLE_PROFILER = OFF
-- Current Version: 2.0.0-alpha.6
--  - Build: master (GitHub-f23c4d15/37fbc1a2-1595273613)
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Linker: GNU gold
-- Found Qt Version: 5.15.0
-- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Performing Test TURBOJPEG_WORKS
-- Performing Test TURBOJPEG_WORKS - Success
-- Found TurboJpeg: /usr/lib/x86_64-linux-gnu/libturbojpeg.so  
-- Using Turbo JPEG library: /usr/lib/x86_64-linux-gnu/libturbojpeg.so
-- Looking for strtof_l
-- Looking for strtof_l - found
-- Looking for strtoull_l
-- Looking for strtoull_l - found
fatal: No annotated tags can describe '37fbc1a23e35eae9c531358e3bb439b3a9f67802'.
However, there were unannotated tags: try --tags.
CMake Warning at dependencies/external/flatbuffers/CMake/Version.cmake:22 (message):
  git describe failed with exit code: 128
Call Stack (most recent call first):
  dependencies/external/flatbuffers/CMakeLists.txt:540 (include)


Proceeding with version: 1.12.0.0
-- Using flatbuffers compiler: /home/murse/projects/hyperion.ng/build/bin/flatc
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Protobuf: doing try-compiles for hash map/set headers
-- Protobuf: doing try-compiles for pthread test
-- Looking for stddef.h
-- Looking for stddef.h - found
CMake Deprecation Warning at dependencies/external/protobuf/src/CMakeLists.txt:329 (cmake_policy):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Using protobuf compiler: /home/murse/projects/hyperion.ng/build/bin/protoc
-- Found PythonInterp: /usr/bin/python3.8 (found version "3.8.2") 
-- Found Perl: /usr/bin/perl (found version "5.30.0") 
-- Using static mbedtls libraries (build version "2.16.7")
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found CEC: /usr/include  
-- CPACK: Found DEB builder
-- Configuring done
-- Generating done
-- Build files have been written to: /home/murse/projects/hyperion.ng/build
murse@murse-mint:~/projects/hyperion.ng/build$ 

edit it to read it better
@Paulchen-Panther

@tihoangyeudau
Copy link

tihoangyeudau commented Jul 21, 2020

@m-seker Can I use docker to complie it?

Solved it for docker: I deleted docker images then download them again.

@m-seker
Copy link
Contributor Author

m-seker commented Jul 21, 2020

@m-seker Can I use docker to complie it?

Solved it for docker: I deleted docker images then download them again.

Perfect !

@tihoangyeudau
Copy link

tihoangyeudau commented Jul 23, 2020

I tried this function with samsung tv that has anynet+ (HDMI-CEC), i turned on this function in hyperion.ng and in my tv. After that i found a device in my tv but no one had been found. I also turned tv to standby but hyperion still grabbered.

@m-seker
Copy link
Contributor Author

m-seker commented Jul 23, 2020

@tihoangyeudau Can we see logs ? Did you confirm that your TV sends CEC standby event via cec-client ?

@tihoangyeudau
Copy link

Searching tool of anynet+ in samsung tv searched no any device

@m-seker
Copy link
Contributor Author

m-seker commented Jul 23, 2020

I am not sure if we we broadcast Hyperion but that's not relevant anyway. We only listen for Standby events, that's all.

@tihoangyeudau
Copy link

Yes, but i still tested turn tv to standby by remote but it still grabbered. Nothing to goin on

@m-seker
Copy link
Contributor Author

m-seker commented Jul 23, 2020

Did you confirm that your TV sends standby event when it goes to standby ?

You can use cec-client to listen for events from TV. Don forget to stop Hyperion before.

And please share the logs.

@tihoangyeudau
Copy link

Cec hdmi https://imgur.com/gallery/brSQGYJ

Here it is

@tpmodding
Copy link
Collaborator

those are images... logs from hyperion please... webui->system->logs

https://bfy.tw/OaKw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants