TV tuner driver tips for advanced users

Moderators: mdrjr, odroid

TV tuner driver tips for advanced users

Unread postby crashoverride » Fri Apr 01, 2016 9:53 pm

I have a USB ATSC TV tuner that is not supported by the current kernel. The solution to this is to use the linuxtv.org media_build tree that 'automagically' backports drivers. Unfortunately, its not a trivial process. The purpose of this post is to document some information for others wishing to try it.

1) The key to making it work is to compile a kernel without any V4L dependencies.
I first did a 'grep -r "select VIDEO_V4L2"' over the drivers/amlogic folder. This revealed the kernel modules that will force V4L to be build into the kernel, and therefore, non-modifiable.
Code: Select all
drivers/amlogic/camera/Kconfig: select VIDEO_V4L2
drivers/amlogic/video_dev/Kconfig:      select VIDEO_V4L2
drivers/amlogic/video_dev/Kconfig:      select VIDEO_V4L2_COMMON
drivers/amlogic/ionvideo/Kconfig:       select VIDEO_V4L2

The Amlogic camera driver, video capture driver, and ION video driver need to be disabled. This will allow you to set the V4L module to 'm' to make it a module.

2) You need the media_build tree from linuxtv.org
Install dependencies:
Code: Select all
sudo apt-get install libproc-processtable-perl

Then clone the repository:
Code: Select all
git clone git://linuxtv.org/media_build.git
cd media_build
./build

At the time of this writing, the build will fail. [Edit: The revert is no longer needed as a recent commit corrects it]I had to revert the commit '58fe88e69ff83f37c089565ab4e4d37cc5f829f4' and modify v4l/compat.h:
Code: Select all
#ifdef NEED_WRITEL_RELAXED
//#define writel_relaxed writel
#endif

After these corrections you can run make. Its very important to not run ./build again. This will reset all changes.
Code: Select all
make -j4

After make completes successfully, you can install the modules.
Code: Select all
sudo make install

At this point, you should reboot and if everything went well, your driver will be loaded and show up in dmesg.

3) Compile and run tvheaded
Install dependencies
Code: Select all
sudo apt-get install python gettext pkg-config libssl-dev bzip2 wget libavahi-client-dev

Compile tvheaded
Code: Select all
git clone https://github.com/tvheadend/tvheadend.git
cd tvheadend
./configure --disable-libav --disable-libffmpeg_static --disable-libx264_static --disable-libx265_static
make -j4


At this point i was able to run tvheadend and setup my tuner.
Code: Select all
sudo ./build.linux/tvheadend --noacl


I accessed it from a PC using a web browser at:
http://odroid64:9981

I hope this information is helpful to others. Its not intended to be a tutorial or step-by-step. Its my hope that forum members will help fill in the details.
Last edited by crashoverride on Wed Apr 06, 2016 5:54 pm, edited 1 time in total.
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby mad_ady » Sun Apr 03, 2016 3:11 am

Would this guide influence the video4linux subsystem - e.g. uvc cameras as well? I'm having stability problems when grabbing frames from my UVC camera with the stock C2 kernel. I might give this a go.

I look forward to your article describing how to run KVM and using newer drivers for specific tasks :) Great job!
User avatar
mad_ady
 
Posts: 2379
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Sun Apr 03, 2016 11:19 am

It updates V4L and all the driver in the "media" tree:
http://git.linuxtv.org/media_tree.git/tree/drivers/media

UVC is part of that tree:
http://git.linuxtv.org/media_tree.git/tree/drivers/media/usb/uvc

Long term, I expect media based distros like OpenELEC will integrate this to better support their user's TV tuners. Note that this should also work for C1, but I have not tested that. I have tested C2 with my USB TV tuner and its been working perfectly.
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby mad_ady » Sun Apr 03, 2016 1:16 pm

Sweet! Thanks! I will probably roll my own kernel to fix my webcam issues then
User avatar
mad_ady
 
Posts: 2379
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Wed Apr 06, 2016 5:48 pm

I documented the kernel options to change on C2:
Code: Select all
$make menuconfig
Device Drivers
   Amlogic Device Drivers
      ION Support
         ION memory management support = no
      Amlogic ion video support
         videobuf2-ion video device support = no
         Amlogic ion video devic support = no
      V4L2 Video Support
         Amlogic v4l video device support = no
         Amlogic v4l video2 device support = no
      Amlogic Camera Support
         Amlogic Platform Capture Driver = no
   Multimedia support = m

You can verify its correct by looking for "CONFIG_VIDEO_V4L2=m"
Code: Select all
$ grep "V4L" .config
# V4L2 Video Support
# CONFIG_V4L_AMLOGIC_VIDEO is not set
# CONFIG_V4L_AMLOGIC_VIDEO2 is not set
CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_VIDEO_V4L2=m
CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_EM28XX_V4L2=m
# CONFIG_V4L_PLATFORM_DRIVERS is not set
# CONFIG_V4L_MEM2MEM_DRIVERS is not set
# CONFIG_V4L_TEST_DRIVERS is not set
CONFIG_DVB_AU8522_V4L=m
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby mad_ady » Wed Apr 06, 2016 9:15 pm

You read my mind. I was just about to post a question - I couldn't find VIDEO_V4L2 in the menu... I'm about to apply the patches and will report back.

Edit: Ok, I hit an error. Before that some suggestions:
1. Please add the package patchutils which is a dependency of media_build
2. The build program looks for the kernel sources under /lib/modules/`uname -r`/build, so if you don't have them there you need to run something like
Code: Select all
sudo ln -s ~adrianp/development/linux/ /lib/modules/`uname -r`/build


3. You may need to compile the kernel before applying the patch - because at first it complained:
Code: Select all
make -C /lib/modules/3.14.29-18-odrobian+/build SUBDIRS=/home/adrianp/development/media_build/v4l  modules
make[2]: Entering directory '/home/adrianp/development/linux'

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.


  WARNING: Symbol version dump /home/adrianp/development/linux/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /home/adrianp/development/media_build/v4l/altera-lpt.o
In file included from <command-line>:0:0:
/home/adrianp/development/linux/include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory
 #include <generated/autoconf.h>
                                ^
compilation terminated.



So I ran a "make prepare" (I had run make odroidc2_defconfig and make menuconfig previously) and it finished (correctly I guess?):
Code: Select all
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/arm64/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
<stdin>:1232:2: warning: #warning syscall renameat2 not implemented [-Wcpp]


However, make clean && ./build still failed:
Code: Select all
Generating vicam/firmware.fw
Generating ttusb-budget/dspbootcode.bin
Generating cpia2/stv0672_vp4.bin
Generating av7110/bootcode.bin
make[2]: Leaving directory '/home/adrianp/development/media_build/v4l/firmware'
Kernel build directory is /lib/modules/3.14.29-18-odrobian+/build
make -C ../linux apply_patches
make[2]: Entering directory '/home/adrianp/development/media_build/linux'
Patches for 3.14.29-18-odrobian+ already applied.
make[2]: Leaving directory '/home/adrianp/development/media_build/linux'
make -C /lib/modules/3.14.29-18-odrobian+/build SUBDIRS=/home/adrianp/development/media_build/v4l  modules
make[2]: Entering directory '/home/adrianp/development/linux'

  WARNING: Symbol version dump /home/adrianp/development/linux/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /home/adrianp/development/media_build/v4l/altera-lpt.o
In file included from <command-line>:0:0:
/home/adrianp/development/media_build/v4l/compat.h:1569:0: warning: "writel_relaxed" redefined  HOSTCC  scripts/bin2c
<stdin>:1232:2: warning: #warning syscall renameat2 not implemented [-Wcpp]
  HOSTCC  scripts/recordmcount

 #define writel_relaxed writel
 ^
In file included from include/linux/clocksource.h:19:0,
                 from include/clocksource/arm_arch_timer.h:19,
                 from /home/adrianp/development/linux/arch/arm64/include/asm/arch_timer.h:27,
                 from /home/adrianp/development/linux/arch/arm64/include/asm/timex.h:19,
                 from include/linux/timex.h:65,
                 from include/linux/sched.h:17,
                 from /home/adrianp/development/linux/arch/arm64/include/asm/compat.h:25,
                 from /home/adrianp/development/linux/arch/arm64/include/asm/stat.h:23,
                 from include/linux/stat.h:5,
                 from include/linux/sysfs.h:21,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from include/linux/input.h:22,
                 from /home/adrianp/development/media_build/v4l/compat.h:10,
                 from <command-line>:0:
/home/adrianp/development/linux/arch/arm64/include/asm/io.h:103:0: note: this is the location of the previous definition
 #define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))
 ^
/bin/sh: 1: /home/adrianp/development/linux/scripts/recordmcount: not found
scripts/Makefile.build:308: recipe for target '/home/adrianp/development/media_build/v4l/altera-lpt.o' failed
make[3]: *** [/home/adrianp/development/media_build/v4l/altera-lpt.o] Error 127
Makefile:1276: recipe for target '_module_/home/adrianp/development/media_build/v4l' failed
make[2]: *** [_module_/home/adrianp/development/media_build/v4l] Error 2


I've checked and I don't have /home/adrianp/development/linux/scripts/recordmcount.

I'm guessing I have to build the kernel first and then apply the patches and build just the modules (which is what I think ./build does).
Will report back.

Edit2: It seems recordmcount is generated when running make in the kernel tree:
Code: Select all
  HOSTCC  scripts/bin2c
<stdin>:1232:2: warning: #warning syscall renameat2 not implemented [-Wcpp]
  HOSTCC  scripts/recordmcount

User avatar
mad_ady
 
Posts: 2379
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby mad_ady » Wed Apr 06, 2016 11:11 pm

The results are in:
1. I built the kernel normally. Didn't try to boot it yet.
2. I returned to media_build and ran
Code: Select all
make clean
./build

It started to compile a ton of modules, but always throws this warning:
Code: Select all
  CC [M]  /home/adrianp/development/media_build/v4l/s5k5baf.o
In file included from <command-line>:0:0:
/home/adrianp/development/media_build/v4l/compat.h:1569:0: warning: "writel_relaxed" redefined
 #define writel_relaxed writel
 ^
In file included from include/linux/clocksource.h:19:0,
                 from include/clocksource/arm_arch_timer.h:19,
                 from /home/adrianp/development/linux/arch/arm64/include/asm/arch_timer.h:27,
                 from /home/adrianp/development/linux/arch/arm64/include/asm/timex.h:19,
                 from include/linux/timex.h:65,
                 from include/linux/sched.h:17,
                 from /home/adrianp/development/linux/arch/arm64/include/asm/compat.h:25,
                 from /home/adrianp/development/linux/arch/arm64/include/asm/stat.h:23,
                 from include/linux/stat.h:5,
                 from include/linux/sysfs.h:21,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from include/linux/input.h:22,
                 from /home/adrianp/development/media_build/v4l/compat.h:10,
                 from <command-line>:0:
/home/adrianp/development/linux/arch/arm64/include/asm/io.h:103:0: note: this is the location of the previous definition
 #define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))



Anyway, I left it compiling, but it errored after a while:
Code: Select all
  LD [M]  /home/adrianp/development/media_build/v4l/s5c73m3.o
/home/adrianp/development/media_build/v4l/s5c73m3-spi.o:(.rodata+0x10): multiple definition of `__mod_of_device_table'
/home/adrianp/development/media_build/v4l/s5c73m3-core.o:(.rodata+0x398): first defined here
scripts/Makefile.build:444: recipe for target '/home/adrianp/development/media_build/v4l/s5c73m3.o' failed
make[3]: *** [/home/adrianp/development/media_build/v4l/s5c73m3.o] Error 1
Makefile:1276: recipe for target '_module_/home/adrianp/development/media_build/v4l' failed
make[2]: *** [_module_/home/adrianp/development/media_build/v4l] Error 2
make[2]: Leaving directory '/home/adrianp/development/linux'
Makefile:51: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/home/adrianp/development/media_build/v4l'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2
build failed at ./build line 491.



I'm not interested in building all the video modules, I just want the UVC drivers + V4L2, but the build script doesn't seem to look into the kernel config (or does it? - I'll need to check).

One more thing - let's say that the build script finishes. Do I need to run make on the kernel once more and resume the kernel build from there?

Update: I reran make menuconfig in the kernel directory and unselected most of the TV Tuner modules (left UVC selected). Ran "make", it compiled the kernel successfully. Returned to media_build, ran "make clean && ./build" and it compiled all the modules, exiting with error again at s5c73m3. It looks like it doesn't care about the kernel config, or the kernel config for these modules is somewhere else (under backports?). More reading is necessary (for me)...
User avatar
mad_ady
 
Posts: 2379
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Thu Apr 07, 2016 2:07 am

mad_ady wrote:1. I built the kernel normally. Didn't try to boot it yet.

You need to make and install the kernel first. when you do "sudo make modules_install" the /lib/modules/`uname -r`/build symlink is created. After you have installed the new kernel and its modules, you need to reboot to use it. This makes the 'uname -r' paths point to the correct location.

mad_ady wrote:but always throws this warning:

You need to modify v4l/compat.h as noted in the first post:
crashoverride wrote:At the time of this writing, the build will fail. [...] modify v4l/compat.h:

Code: Select all
#ifdef NEED_WRITEL_RELAXED
//#define writel_relaxed writel
#endif

Note that the #define line is being commented out.

mad_ady wrote:I'm not interested in building all the video modules

I think its an all or nothing situation. You can use 'make -j4' to speed up the compile.

mad_ady wrote:Do I need to run make on the kernel once more and resume the kernel build from there?

As noted in the first post, after the build completes, you then install the modules which overwrites the modules in /lib/modules with the new ones.
crashoverride wrote:After make completes successfully, you can install the modules.

Code: Select all
sudo make install


You should reboot after that final step to ensure no old modules are already in use.
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby mad_ady » Thu Apr 07, 2016 4:05 am

Thank you for the clarifications, i'll give it a try tomorrow.
User avatar
mad_ady
 
Posts: 2379
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby mad_ady » Thu Apr 07, 2016 5:34 pm

Ok, I managed to compile and install the new modules.

I followed your advice and installed the target kernel.
Went back into media_build and had to run "make distclean" to purge all caches. I modified "./build" and commented out lines 490 and 491:
Code: Select all
#system ("make allyesconfig") == 0 or die "can't select all drivers";
#system ("make") == 0 or die "build failed";


Next I ran ./build and afterwards I ran "make menuconfig" and selected just the drivers I needed (otherwise it still failed at s5c73m3). Saved the config and ran "make" and "sudo make install". Next I rebooted to load the updated drivers.

Now, uvc is a bit different (though it's the same version):
Code: Select all
Before:

filename:       /lib/modules/3.14.29-adrianp1+/kernel/drivers/media/usb/uvc/uvcvideo.ko
version:        1.1.1
license:        GPL
description:    USB Video Class driver
author:         Laurent Pinchart <laurent.pinchart@ideasonboard.com>
srcversion:     770BF6494900525EE074509


After:

filename:       /lib/modules/3.14.29-adrianp1+/kernel/drivers/media/usb/uvc/uvcvideo.ko
version:        1.1.1
license:        GPL
description:    USB Video Class driver
author:         Laurent Pinchart <laurent.pinchart@ideasonboard.com>
srcversion:     ABB640B428E9BD08DE882AD

Alas, the Hardkernel 720p webcam still has problems grabbing images. Sometimes it takes 6s to grab an image, other times can take up to 30s (it keeps waiting in a syscall). I'll have to look for other alternatives, but at least I tried with the newest drivers, so thanks for the opportunity/guide...
User avatar
mad_ady
 
Posts: 2379
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Thu Apr 07, 2016 5:41 pm

mad_ady wrote:Next I ran ./build and afterwards I ran "make menuconfig" and selected just the drivers I needed (otherwise it still failed at s5c73m3).

The order is important:
crashoverride wrote:After these corrections you can run make. Its very important to not run ./build again. This will reset all changes.


mad_ady wrote:Alas, the Hardkernel 720p webcam still has problems grabbing images.

Sorry to hear that.
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby Raybuntu » Fri Apr 08, 2016 3:04 pm

Thanks,
I just build the DVBsky drive (unselected others from menuconfig). Works so far. I'm using vdr so I need to build the kodi plugin first to test.

Would be nice if we could also build meson-ir. But I couldn't find it through menuconfig.
BTC: 13M7sUBpS9uVpo4mzukV9CH8HGg7vDUC7Y
Raybuntu
 
Posts: 1161
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby freefall99 » Thu Apr 21, 2016 12:41 pm

Hi all,
I'm trying to get a pair of USB dual tuners up and running but I am having an issue getting both tuners in each card to work. The question I have is:

My cards are listed as "In the kernel" and "supported out of the box". Does this mean that I should need to firmware files for the card or is it possible that the kernel module will just go looking for the firmware files.

I'm trying to use a DigitalNow TinyTwin v1 (af9013 and af9015) and a v3a (IT9135).
freefall99
 
Posts: 46
Joined: Fri May 17, 2013 2:56 pm
Location: Sydney
languages_spoken: english
ODROIDs: odroid-u2, odroid-u3 (x6), odroid-xu4 (x4), odroid-c1+, odroid-c2 (x2)

Re: TV tuner driver tips for advanced users

Unread postby mad_ady » Thu Apr 21, 2016 2:33 pm

If you follow crashoverride's procedure above you will build the necessary drivers and firmware files to get the cards running. You should test the cards first on a linux pc to see which modules/firmware files are loaded to help you troubleshoot problems
User avatar
mad_ady
 
Posts: 2379
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby freefall99 » Wed May 11, 2016 10:42 am

I'm trying this on a XU-4 with Ubuntu 15.10. When I run the configure (I'm disabling x265) with the --disable-libx264_static I get the following error:
Code: Select all
./configure --disable-libav --disable-libffmpeg_static --disable-libx264_static --disable-libx265
Checking support/features
  checking for cc execinfo.h ...                    ok
  checking for cc -mmmx ...                         fail
  checking for cc -msse2 ...                        fail
  checking for cc -Wunused-result ...               ok
  checking for cc getloadavg ...                    ok
  checking for cc atomic64 ...                      ok
  checking for cc atomic_time_t ...                 ok
  checking for cc lockowner ...                     ok
  checking for cc qsort_r ...                       ok
  checking for cc stime ...                         ok
  checking for cc gmtoff ...                        ok
  checking for cc recvmmsg ...                      ok
  checking for cc sendmmsg ...                      ok
  checking for cc libiconv ...                      fail
  checking for cc libdvben50221 ...                 fail
  checking for cc ifnames ...                       ok
  checking for py module gzip ...                   ok
  checking for pkg-config ...                       ok
  checking for xgettext ...                         ok
  checking for msgmerge ...                         ok
  checking for gzip ...                             ok
  checking for bzip2 ...                            ok
  checking for pkg openssl  ...                     ok (detected 1.0.2d)
  checking for cc linux/dvb/version.h ...           ok
  checking for pkg zlib  ...                        ok (detected 1.2.8)
  checking for pkg liburiparser  ...                fail (detected <none>)
  checking for pkg avahi-client  ...                ok (detected 0.6.31)
  checking for pkg x264 >=0.142 ...                 fail (detected <none>)
ERROR: x264 package not found

I have x264 libraries on the system:
Code: Select all
locate x264
/usr/lib/arm-linux-gnueabihf/libx264.so.146
/usr/lib/arm-linux-gnueabihf/x264-10bit
/usr/lib/arm-linux-gnueabihf/x264-10bit/libx264.so.146
/usr/share/doc/libx264-146
/usr/share/doc/libx264-146/changelog.Debian.gz
/usr/share/doc/libx264-146/copyright
/usr/src/tvheadend/build.linux/ffmpeg/x264-snapshot-20160502-2245
/usr/src/tvheadend/build.linux/ffmpeg/x264-snapshot-20160502-2245/.tvh_build
/usr/src/tvheadend/build.linux/ffmpeg/x264-snapshot-20160502-2245/.tvh_download
/usr/src/tvheadend/support/patches/libx264.configure.diff
/var/cache/apt/archives/x264_2%3a0.146.2555+git0c21480-1_armhf.deb
/var/lib/dpkg/info/libx264-146:armhf.list
/var/lib/dpkg/info/libx264-146:armhf.md5sums
/var/lib/dpkg/info/libx264-146:armhf.postinst
/var/lib/dpkg/info/libx264-146:armhf.postrm
/var/lib/dpkg/info/libx264-146:armhf.shlibs

Do I need to worry about x264 (can I just disable it all together)? Is this just if I want to transcode the recordings?
freefall99
 
Posts: 46
Joined: Fri May 17, 2013 2:56 pm
Location: Sydney
languages_spoken: english
ODROIDs: odroid-u2, odroid-u3 (x6), odroid-xu4 (x4), odroid-c1+, odroid-c2 (x2)

Re: TV tuner driver tips for advanced users

Unread postby andy5macht » Fri Jun 03, 2016 3:24 pm

ive followed the your commands carefully. maybe i have to say that i am on clean ubuntu image v2.0
kernel compile worked fine.
after building dvb drivers with ./build i am getting this error:
Code: Select all
  CC [M]  /home/odroid/media_build/v4l/cx231xx-audio.o
In file included from <command-line>:0:0:
/home/odroid/media_build/v4l/compat.h:1569:0: warning: "writel_relaxed" redefined
 #define writel_relaxed writel
 ^
In file included from include/linux/clocksource.h:19:0,
                 from include/clocksource/arm_arch_timer.h:19,
                 from /home/odroid/linux/arch/arm64/include/asm/arch_timer.h:27,
                 from /home/odroid/linux/arch/arm64/include/asm/timex.h:19,
                 from include/linux/timex.h:65,
                 from include/linux/sched.h:17,
                 from /home/odroid/linux/arch/arm64/include/asm/compat.h:25,
                 from /home/odroid/linux/arch/arm64/include/asm/stat.h:23,
                 from include/linux/stat.h:5,
                 from include/linux/sysfs.h:21,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from include/linux/input.h:22,
                 from /home/odroid/media_build/v4l/compat.h:10,
                 from <command-line>:0:
/home/odroid/linux/arch/arm64/include/asm/io.h:103:0: note: this is the location of the previous definition
 #define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)
 ^
  CC [M]  /home/odroid/media_build/v4l/cx231xx-video.o
In file included from <command-line>:0:0:
/home/odroid/media_build/v4l/compat.h:1569:0: warning: "writel_relaxed" redefined
 #define writel_relaxed writel
 ^
In file included from include/linux/clocksource.h:19:0,
                 from include/clocksource/arm_arch_timer.h:19,
                 from /home/odroid/linux/arch/arm64/include/asm/arch_timer.h:27,
                 from /home/odroid/linux/arch/arm64/include/asm/timex.h:19,
                 from include/linux/timex.h:65,
                 from include/linux/sched.h:17,
                 from /home/odroid/linux/arch/arm64/include/asm/compat.h:25,
                 from /home/odroid/linux/arch/arm64/include/asm/stat.h:23,
                 from include/linux/stat.h:5,
                 from include/linux/sysfs.h:21,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from include/linux/input.h:22,
                 from /home/odroid/media_build/v4l/compat.h:10,
                 from <command-line>:0:
/home/odroid/linux/arch/arm64/include/asm/io.h:103:0: note: this is the location of the previous definition
 #define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)
 ^
  CC [M]  /home/odroid/media_build/v4l/cx231xx-i2c.o
In file included from <command-line>:0:0:
/home/odroid/media_build/v4l/compat.h:1569:0: warning: "writel_relaxed" redefined
 #define writel_relaxed writel
 ^
In file included from include/linux/clocksource.h:19:0,
                 from include/clocksource/arm_arch_timer.h:19,
                 from /home/odroid/linux/arch/arm64/include/asm/arch_timer.h:27,
                 from /home/odroid/linux/arch/arm64/include/asm/timex.h:19,
                 from include/linux/timex.h:65,
                 from include/linux/sched.h:17,
                 from /home/odroid/linux/arch/arm64/include/asm/compat.h:25,
                 from /home/odroid/linux/arch/arm64/include/asm/stat.h:23,
                 from include/linux/stat.h:5,
                 from include/linux/sysfs.h:21,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from include/linux/input.h:22,
                 from /home/odroid/media_build/v4l/compat.h:10,
                 from <command-line>:0:
/home/odroid/linux/arch/arm64/include/asm/io.h:103:0: note: this is the location of the previous definition
 #define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)
 ^
/home/odroid/media_build/v4l/cx231xx-i2c.c: In function 'cx231xx_i2c_mux_select':
/home/odroid/media_build/v4l/cx231xx-i2c.c:562:24: error: implicit declaration of function 'i2c_mux_priv' [-Werror=implicit-function-declaration]
  struct cx231xx *dev = i2c_mux_priv(muxc);
                        ^
/home/odroid/media_build/v4l/cx231xx-i2c.c:562:24: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
/home/odroid/media_build/v4l/cx231xx-i2c.c: In function 'cx231xx_i2c_mux_create':
/home/odroid/media_build/v4l/cx231xx-i2c.c:569:14: error: implicit declaration of function 'i2c_mux_alloc' [-Werror=implicit-function-declaration]
  dev->muxc = i2c_mux_alloc(&dev->i2c_bus[1].i2c_adap, dev->dev, 2, 0, 0,
              ^
/home/odroid/media_build/v4l/cx231xx-i2c.c:569:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  dev->muxc = i2c_mux_alloc(&dev->i2c_bus[1].i2c_adap, dev->dev, 2, 0, 0,
            ^
/home/odroid/media_build/v4l/cx231xx-i2c.c:573:11: error: dereferencing pointer to incomplete type 'struct i2c_mux_core'
  dev->muxc->priv = dev;
           ^
/home/odroid/media_build/v4l/cx231xx-i2c.c: In function 'cx231xx_i2c_mux_register':
/home/odroid/media_build/v4l/cx231xx-i2c.c:581:7: error: implicit declaration of function 'i2c_mux_add_adapter' [-Werror=implicit-function-declaration]
  rc = i2c_mux_add_adapter(dev->muxc,
       ^
/home/odroid/media_build/v4l/cx231xx-i2c.c: In function 'cx231xx_i2c_mux_unregister':
/home/odroid/media_build/v4l/cx231xx-i2c.c:594:2: error: implicit declaration of function 'i2c_mux_del_adapters' [-Werror=implicit-function-declaration]
  i2c_mux_del_adapters(dev->muxc);
  ^
cc1: some warnings being treated as errors
scripts/Makefile.build:308: recipe for target '/home/odroid/media_build/v4l/cx231xx-i2c.o' failed
make[3]: *** [/home/odroid/media_build/v4l/cx231xx-i2c.o] Error 1
Makefile:1278: recipe for target '_module_/home/odroid/media_build/v4l' failed
make[2]: *** [_module_/home/odroid/media_build/v4l] Error 2
make[2]: Leaving directory '/home/odroid/linux'
Makefile:51: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/home/odroid/media_build/v4l'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2
build failed at ./build line 491.


maybe anybody can help me? :(

PS: ive tried to disable cx231xx via "make menuconfig" but after ./build they are enabled again :?
andy5macht
 
Posts: 183
Joined: Mon May 16, 2016 5:25 am
languages_spoken: english, german
ODROIDs: U3, C2

Re: TV tuner driver tips for advanced users

Unread postby Raybuntu » Fri Jun 03, 2016 8:43 pm

build script is an automated process and it probably runs "make config_all". Try using make directly and not running "build" again.

Read carefully what @crashoverride wrote in the first post:
crashoverride wrote:After these corrections you can run make. Its very important to not run ./build again. This will reset all changes.
BTC: 13M7sUBpS9uVpo4mzukV9CH8HGg7vDUC7Y
Raybuntu
 
Posts: 1161
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby mad_ady » Fri Jun 03, 2016 9:06 pm

You can run
Code: Select all
make menuconfig


to select only what you need before running make.
User avatar
mad_ady
 
Posts: 2379
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby andy5macht » Sat Jun 04, 2016 1:12 am

i did.
it fails now at si2168 ... the module i need :/

i will report log when i get home again.
andy5macht
 
Posts: 183
Joined: Mon May 16, 2016 5:25 am
languages_spoken: english, german
ODROIDs: U3, C2

Re: TV tuner driver tips for advanced users

Unread postby Raybuntu » Sat Jun 04, 2016 4:19 am

are you using dvbsky? I have a backport that. check my github.
BTC: 13M7sUBpS9uVpo4mzukV9CH8HGg7vDUC7Y
Raybuntu
 
Posts: 1161
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby uross » Sun Aug 14, 2016 4:38 pm

I'm using DietPi and have installed meveric's latest kernel and media-tree (http://forum.odroid.com/viewtopic.php?f=52&t=5908&start=150#p155402), which he built based on this thread's instructions.

I'm using an Elgato (Geniatech) EyeTV Hybrid (the EU 2008 model). Based on error messages from dmesg I also did copy additional firmware (https://github.com/OpenELEC/dvb-firmware/blob/master/firmware/dvb-usb-terratec-htc-stick-drxk.fw) to /lib/firmware

I did update kernel, installed media-tree-odroid and tvheadend (version Build: 4.1-2042~gdfffcb1 (2016-05-16T17:44:56+0200)) through apt-get in DietPi. But when scanning the Muxes, I'm getting the following error message in the Tvheadend log:

Code: Select all
2016-08-14 00:44:20.369 [   INFO] mpegts: 130MHz in KMS - tuning on DRXK DVB-C DVB-T : DVB-C #0
2016-08-14 00:44:20.378 [  ERROR] linuxdvb: DRXK DVB-C DVB-T : DVB-C #0 - DTV_CLEAR failed [e=Inappropriate ioctl for device]
2016-08-14 00:44:20.382 [   INFO] mpegts: 682MHz in KMS - tuning on DRXK DVB-C DVB-T : DVB-C #0
2016-08-14 00:44:20.384 [  ERROR] linuxdvb: DRXK DVB-C DVB-T : DVB-C #0 - DTV_CLEAR failed [e=Inappropriate ioctl for device]
2016-08-14 00:44:20.389 [   INFO] mpegts: 466MHz in KMS - tuning on DRXK DVB-C DVB-T : DVB-C #0
2016-08-14 00:44:20.389 [  ERROR] linuxdvb: DRXK DVB-C DVB-T : DVB-C #0 - DTV_CLEAR failed [e=Inappropriate ioctl for device]

dvbv5-scan does recognise new channels of those muxes:
Code: Select all
dvbv5-scan -F /usr/share/dvb/dvb-c/de-Muenchen-KMS
ERROR    command BANDWIDTH_HZ (5) not found during retrieve
Scanning frequency #1 130000000
Lock   (0x1f) Quality= Poor Signal= 100.00% C/N= 35.70dB UCB= 2096 postBER= 2.37x10^-3 PER= 12.1x10^-3
Service BR Fernsehen Süd HD, provider ARD: reserved
Service BR Fernsehen Nord HD, provider ARD: reserved
Service NDR FS NDS HD, provider ARD: reserved
Service NDR FS MV HD, provider ARD: reserved
Service NDR FS HH HD, provider ARD: reserved
Service NDR FS SH HD, provider ARD: reserved
Service PHOENIX HD, provider ARD: reserved
Scanning frequency #2 682000000
Lock   (0x1f) Quality= Good Signal= 100.00% C/N= 24.20dB UCB= 2319 postBER= 2.37x10^-3 PER= 0
Service ZDF HD, provider ZDFvision: reserved
Service zdf_neo HD, provider ZDFvision: reserved
Service zdf.kultur HD, provider ZDFvision: reserved
Scanning frequency #3 466000000
Lock   (0x1f) Quality= Poor Signal= 100.00% C/N= 35.60dB UCB= 2406 postBER= 3.17x10^-3 PER= 6.86x10^-3
Service tagesschau24, provider ARD: digital television
Service Einsfestival, provider ARD: digital television
Service EinsPlus, provider ARD: digital television
Service arte, provider ARD: digital television
Service PHOENIX, provider ARD: digital television
Service Test-R, provider ARD: digital television


On the tvheadend forum I found the following entry (https://tvheadend.org/boards/5/topics/15005), containing keywords like 64bit and DTV_CLEAR at least. But that problem presumably has been fixed in tvheadend a year ago.

Any idea for the reason of this?
uross
 
Posts: 11
Joined: Sat May 07, 2016 8:40 pm
languages_spoken: english german
ODROIDs: C2

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Mon Aug 15, 2016 2:23 am

uross wrote:Any idea for the reason of this?

The code is pretty much the same for the current release of tvheadend
https://github.com/tvheadend/tvheadend/blob/master/src/input/mpegts/linuxdvb/linuxdvb_frontend.c#L1396-L1425

This means the actual driver itself does not support the IOCTL or it can not understand it. The former is more likely. The latter usually only happens when different GCC versions interpret the "struct"s differently using different alignment rules.
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby Maury Markowitz » Sat Dec 17, 2016 1:17 am

I am trying to build a C1+ version of the OS onto a second SSD card I have, so I can keep the current one as a backup. I started by GITing out the current kernel sources into a directory in my HOME. Then I ran 'make menuconfig' from the 'linux' folder GIT created. And then I started reading the posts above...

> The Amlogic camera driver, video capture driver, and ION video driver need to be disabled

When I did this, every setting was already turned off except for one, 'videobuf2-ion video device support'

Is this what you all saw as well, or is my menuconfig different?

> This will allow you to set the V4L module to 'm' to make it a module.

It took me a while to figure out how to do this! It looks like you should Select that item (or return) and then turn something on, but when you try that you can't do anything. This has to be set at the "root" of the menu, which is entirely non-obvious.

I also noticed that there is an option at the "root" menu of menuconfig to turn on loadable modules. This was turned off on my config. I assume this has to be turned on, so I did. Did I so something wrong?

It is building now, and then I will try to make a boot SSD out of it.
Maury Markowitz
 
Posts: 39
Joined: Tue Nov 24, 2015 8:03 am
languages_spoken: english

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Sat Dec 17, 2016 4:55 am

I will attempt to document this for C0/C1 when time permits.
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby mad_ady » Sat Dec 17, 2016 2:39 pm

@Maury: make sure you run the correct make defconfig for your board before running make menuconfig. Defconfig should set HK's default kernel configuration as a template.
I generally use this guide when compiling kernels:
https://github.com/umiddelb/armhf/wiki/ ... ARM-device
User avatar
mad_ady
 
Posts: 2379
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Sun Dec 18, 2016 4:50 pm

I finally got the drivers to compile on C0/C1. However, I have NOT TESTED it.
The procedure is similar to the C2. With the media_tree at the time of this writing, additional patching is required.

1) Clone the kernel source and do "make odroidc_defconfig"

2a) Disable V4L2 drivers using "make menuconfig". (use spacebar to cycle through options for entries)
Code: Select all
Device Drivers
   Amlogic Device Drivers
      Amlogic ion video support
         videobuf2-ion video device support =
         Amlogic ion video devic support =
      V4L2 Video Support
         Amlogic v4l video device support =
         Amlogic v4l video2 device support =
      Amlogic Camera Support
         Amlogic Platform Capture Driver =
   Multimedia support = m


2b) Build the kernel and copy the uImage file to /media/boot/uImage.
(See http://odroid.com/dokuwiki/doku.php?id= ... ing_kernel for more details)

2c) Reboot after the new kernel is installed.

3) Clone media_build
Code: Select all
git clone git://linuxtv.org/media_build.git
cd media_build
./build

*** THE BUILD WILL FAIL **
You can stop the build after everything has been downloaded and patched by the script.

4) Edit v4l/compat.h
Code: Select all
#ifdef NEED_WRITEL_RELAXED
//#define writel_relaxed writel
#endif


5) Edit linux/drivers/media/v4l2-of.c
Code: Select all
int v4l2_of_parse_endpoint(const struct device_node *node,
            struct v4l2_of_endpoint *endpoint)
{
#if 0
   int rval;

   of_graph_parse_endpoint(node, &endpoint->base);
   /* Zero fields from bus_type to until the end */
   memset(&endpoint->bus_type, 0, sizeof(*endpoint) -
          offsetof(typeof(*endpoint), bus_type));

   rval = v4l2_of_parse_csi_bus(node, endpoint);
   if (rval)
      return rval;
   /*
    * Parse the parallel video bus properties only if none
    * of the MIPI CSI-2 specific properties were found.
    */
   if (endpoint->bus.mipi_csi2.flags == 0)
      v4l2_of_parse_parallel_bus(node, endpoint);
#endif

   return 0;
}
EXPORT_SYMBOL(v4l2_of_parse_endpoint);


6) Fix the .config file
Code: Select all
make menuconfig

Exiting without any changes will prompt for saving. Without saving, the build will not work.

7) Build the code
Code: Select all
make -j4


8) Install the new drivers
Code: Select all
sudo make install


9) reboot
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby Maury Markowitz » Mon Dec 19, 2016 8:25 am

Minor update:

5) Edit linux/drivers/media/v4l2-of.c

that should be:

5) Edit linux/drivers/media/v4l2-core/v4l2-of.c

I needed to apt-get cmake to build tvheadend. Also, in spite of apt-getting x264 and x265, I was unable to compile with these options turned on. Actually I can't get it to compile, period. Still trying...

Ahh, it appears the current version in the repo does not compile property on ARM. Crash, did you use an older version or stable or something? I was able to get it to build by turning off x264, x265, ffmpeg and libav.
Maury Markowitz
 
Posts: 39
Joined: Tue Nov 24, 2015 8:03 am
languages_spoken: english

Re: TV tuner driver tips for advanced users

Unread postby Maury Markowitz » Mon Dec 19, 2016 11:16 am

Oh well, neither stick appears in the adaptor list in TVH.

I see dmesg lines about the kworld, with warnings, but does not appear in TVH. The 955Q does not appear in dmesg anywhere that I can see.

I can no longer find the 8GB ssd with the working 14.x system on it, I think it was vacuumed by my wife. So I no longer have any working system :-(
Maury Markowitz
 
Posts: 39
Joined: Tue Nov 24, 2015 8:03 am
languages_spoken: english

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Mon Dec 19, 2016 11:52 am

Maury Markowitz wrote:did you use an older version or stable or something?

I used the instructions in the first post to build tvheadend. I needed to add additional "disable" flags. I disabled h264, h265 and ffmpeg. "./configure --help" will show the options.

Maury Markowitz wrote:I see dmesg lines about the kworld, with warnings, but does not appear in TVH.

I saw the same thing with my KWorld tuner. Its identified in "dmesg", but it does not show up in tvheadend. This is because media_build is also a "moving target". The current 4.9 code made changes to the tuner chip section. This means the Kworld is identified and loaded, but the ATSC tuner is disabled in code and it provides no TV functionality.

I have posted a question in the linuxtv IRC channel asking how to use a specific kernel's media tree (before the tuner chip was broken). So far I have not received any solution. As time goes on, more and more tuners are simply disabled for older kernels due to breaking changes. We need to build against specific (deterministic) code instead of the "linux-current" strategy that is employed.
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby Maury Markowitz » Mon Dec 19, 2016 12:31 pm

One would expect the 955Q would be supported, as a much newer unit. But no such luck, it's not even recognized. I even tried a second build with the unsupported drivers, no change. Unfortunately while the older 14.x system worked with kWorld, I can no longer get those, so theres basically no tuner that works that I can get.
Maury Markowitz
 
Posts: 39
Joined: Tue Nov 24, 2015 8:03 am
languages_spoken: english

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Mon Dec 19, 2016 12:47 pm

Maury Markowitz wrote:One would expect the 955Q would be supported

According to the product page and linuxtv page, it should be supported. I do not have that device to test with. For diagnostics, you should start the C1 and insert the device after it has started up. This makes all relevant log issues show up at the end of "dmesg" where they can be easily spotted. The output of "lsusb" should also be checked to ensure the VID/PID match:
https://www.linuxtv.org/wiki/index.php/ ... V-HVR-955Q

Maury Markowitz wrote: so theres basically no tuner that works that I can get.

It will probably cause far less headaches down the road if you use a networked tuner such as:
https://www.silicondust.com/product/hdhomerun-connect/

The tuner should not require ANY linux kernel drivers. It is stated to have two tuners and should cost less than two individual 955Q tuners at MSRP. It is also supposed to support tvheadend. I do not have one nor have I used one to say anything for certain.
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Mon Dec 19, 2016 1:44 pm

While I have not received an official answer, I did manage to get my Kworld identified in tvheadend.

The additional steps I took to "rollback" to the time of the first post is:

1) Clone as usual:
Code: Select all
git clone git://linuxtv.org/media_build.git
cd media_build
./build


2) After the build script has finished downloading:
Code: Select all
git checkout a9c762b78433ab5aecb8131b3905d11a906d1ae8
git reset --hard

cd linux
wget https://linuxtv.org/downloads/drivers/linux-media-2016-04-08-e07d46e7e0da.tar.bz2
rm linux-media.tar.bz2
mv linux-media-2016-04-08-e07d46e7e0da.tar.bz2 linux-media.tar.bz2
make untar
cd ..


3) Patch the files as before:
vi v4l/compat.h
vi linux/drivers/media/v4l2-core/v4l2-of.c

4) Clean and build
Code: Select all
make clean
make -j4
sudo make install
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: TV tuner driver tips for advanced users

Unread postby rooted » Mon Dec 19, 2016 3:42 pm

Maury Markowitz wrote:One would expect the 955Q would be supported, as a much newer unit. But no such luck, it's not even recognized. I even tried a second build with the unsupported drivers, no change. Unfortunately while the older 14.x system worked with kWorld, I can no longer get those, so theres basically no tuner that works that I can get.

The 950Q works fine, it has kernel support.

I just went through this struggle, I had a great KWorld UB435-Q that a component burnt out on so my search began.

I first bought an AverMedia H837 because I couldn't find a definitive answer if it was "supported" in Linux...it's not. I went on the search again, I came to the conclusion the Hauppauge 950 or 950Q was the dongle for me. I got on ebay and grabbed one for $22 (actually a HP KS523AA), it's a 950Q with FM tuner...anyway it's supported and works OOB.

It's not as good as the KWorld (dBi wise) but it's okay.

If you have the money just get an HD Homerun.
User avatar
rooted
 
Posts: 3652
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1
C1+
C2
XU3 Lite
XU4
VU7+
HiFi Shield 2
Smart Power (original)

Re: TV tuner driver tips for advanced users

Unread postby Maury Markowitz » Mon Dec 19, 2016 10:14 pm

rooted wrote:The 950Q works fine, it has kernel support.

You're on the C1? If so I will see if I can track these down.

rooted wrote:If you have the money just get an HD Homerun.

So here's the actual problem I am trying to solve: half the stations in my area come from 165 degrees, the other half from 260. A single antenna will not receive enough of a single from both to be useful. I need two antennas, and ideally two separate tuners, or more.

Now you can mix signals from antennas, but it is not a trivial task. Signals in one will phase-cancel signals in the other, and the combiner loses half the signal even in the best conditions. For some of the marginal signals, they'll just disappear.

The older HDHRs used to have two inputs, one for each tuner. This would have been *perfect*, but by the time I moved into this house they were no longer available and I have not seen one come up for sale. Tablo has the same problem, two or four tuners, but a single input.

So with TVH I could put a separate tuner on each antenna, program the channel listings to pick from whichever I knew would be better, and the world would be a place of flowers and singing birds.

I still think that may be true. The fatal flaw in my reasoning was the C1, which, as you can see, has been a continual struggle.
Maury Markowitz
 
Posts: 39
Joined: Tue Nov 24, 2015 8:03 am
languages_spoken: english

Re: TV tuner driver tips for advanced users

Unread postby rooted » Mon Dec 19, 2016 11:24 pm

I'm actually using a XU4 but that shouldn't matter, what I was saying is the 950Q only needs firmware which is already installed and there is a package for it if it isn't (linux-firmware-nonfree).

It works on the C2 and XU4/3 so it should work on the C1/+, it's been in the kernel since 2.6.26.
User avatar
rooted
 
Posts: 3652
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1
C1+
C2
XU3 Lite
XU4
VU7+
HiFi Shield 2
Smart Power (original)

Re: TV tuner driver tips for advanced users

Unread postby crashoverride » Tue Dec 20, 2016 10:07 am

I finally got my C1 hooked up to an antenna and I can confirm that the above "rollback" does work as expected with tvheadend.
C1 with Kworld UB435-Q V3
Code: Select all
[   62.437491] media: Linux media interface: v0.10
[   62.451253] Linux video capture interface: v2.00
[   62.451270] WARNING: You are using an experimental version of the media stack.
                As the driver is backported to an older kernel, it doesn't offer
                enough quality for its usage in production.
                Use it with care.
               Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
                e07d46e7e0da86c146f199dae76f879096bc436a [media] tpg: Export the tpg code from vivid as a module
                d1e5d8bd49d9a830b6b5f4da906f868b2ceb83a4 [media] vivid: use new v4l2-rect.h header
                ac49de8c49d770b5ded5c717c1eaf339d7649da1 [media] v4l2-rect.h: new header with struct v4l2_rect helper functions
[   62.524159] em28xx: New device  USB 2875 Device @ 480 Mbps (1b80:e34c, interface 0, class 0)
[   62.524172] em28xx: DVB interface 0 found: bulk
[   62.524305] em28xx: chip ID is em2874
[   63.039280] em2874 #0: EEPROM ID = 26 00 01 00, EEPROM hash = 0xa597ee54
[   63.039289] em2874 #0: EEPROM info:
[   63.039296] em2874 #0:       microcode start address = 0x0004, boot configuration = 0x01
[   63.062905] em2874 #0:       AC97 audio (5 sample rates)
[   63.062915] em2874 #0:       500mA max power
[   63.062922] em2874 #0:       Table at offset 0x24, strings=0x206a, 0x048a, 0x0000
[   63.063220] em2874 #0: Identified as KWorld USB ATSC TV Stick UB435-Q V3 (card=93)
[   63.063237] em2874 #0: dvb set to bulk mode.
[   63.063490] usbcore: registered new interface driver em28xx
[   63.082203] WARNING: You are using an experimental version of the media stack.
                As the driver is backported to an older kernel, it doesn't offer
                enough quality for its usage in production.
                Use it with care.
               Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
                e07d46e7e0da86c146f199dae76f879096bc436a [media] tpg: Export the tpg code from vivid as a module
                d1e5d8bd49d9a830b6b5f4da906f868b2ceb83a4 [media] vivid: use new v4l2-rect.h header
                ac49de8c49d770b5ded5c717c1eaf339d7649da1 [media] v4l2-rect.h: new header with struct v4l2_rect helper functions
[   63.145155] em2874 #0: Binding DVB extension
[   63.176836] tda18212 1-0060: NXP TDA18212HN/M successfully identified
[   63.176890] DVB: registering new adapter (em2874 #0)
[   63.176911] usb 1-1.2: DVB: registering adapter 0 frontend 0 (LG Electronics LGDT3305 VSB/QAM Frontend)...
[   63.176957] dvb_create_media_entity: media entity 'LG Electronics LGDT3305 VSB/QAM Frontend' registered.
[   63.178741] dvb_create_media_entity: media entity 'dvb-demux' registered.
[   63.182808] em2874 #0: DVB extension successfully initialized
[   63.182827] em28xx: Registered (Em28xx dvb Extension) extension
crashoverride
 
Posts: 3058
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1


Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 5 guests