This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[HOWTO] Recompiling the kernel for DVB-T support in Tinkerboard.
#1
Recompiling the kernel for DVB-T support on Tinkerboard.
Tested in clean installation of Tinker-OS 2.0.5.

UPDATED: 2018-April-09

****

In this old line in the howto...

sudo mv /lib/modules/4.4.71+ /lib/modules/old-modules must be...
sudo cp -r /lib/modules/4.4.71+ /lib/modules/old-modules

It is already corrected in the howto.

***

You don't need repeat all the job if you have done this howto before this was corrected.

If it is your first try start on HOWTO corrected.

But If you have done before corrected, then rename folder /lib/modules/4.4.71+ to not-ok-modules-dep-4.4.71+ and copy the /lib/modules/old-modules/4.4.71+ to /lib/modules/ you can use sudo pcmanfm to rename the folders and then...

cd debian_kernel

sudo make ARCH=arm modules_install

And reboot and test.

Now you can delete /lib/modules/not-ok-modules-dep-4.4.71+

***

HOWTO corrected.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove

sudo apt-get install -y ncurses-dev
sudo apt-get install -y git-core
sudo apt-get install -y gitk
sudo apt-get install -y git-gui
sudo apt-get install -y device-tree-compiler 
sudo apt-get install -y mtools 
sudo apt-get install -y parted
sudo apt-get install -y libssl-dev

sudo apt-get install -y build-essential

git clone https://github.com/TinkerBoard/debian_kernel.git -b release

cd debian_kernel

make ARCH=arm miniarm-rk3288_defconfig -j16
make ARCH=arm oldconfig -j16
make ARCH=arm scripts -j16
make ARCH=arm menuconfig

***

Add drivers for example to Afatech AF9035 DVB-T USB2.0 support:

Device Drivers  --->  
 <*> Multimedia support  --->  
[*]   Digital TV support  
[*]   Media USB Adapters  ---> 
 <M>   Support for various USB DVB devices 
<M>   Support for various USB DVB devices v2 
<M>     Afatech AF9035 DVB-T USB2.0 support 

Save and exit.

***

Optional:

If you do some error you can do:

make ARCH=arm clean -j16

and start again.

make ARCH=arm miniarm-rk3288_defconfig -j16
make ARCH=arm oldconfig -j16
make ARCH=arm scripts -j16
make ARCH=arm menuconfig

***

make zImage ARCH=arm -j16

About 30 minutes with SD card Sandisk Ultra A1 16Gb.

***

Note: As of 2018-01-05, if may be necessary to edit the Makefile
to add
-Wno-misleading-indentation
to the CFLAGS_MODULE if you are using GCC 6 and up.

gcc -v

Output in terminal on Tinker Os 2.0.5 is...gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)

leafpad /home/linaro/debian_kernel/Makefile

Search CFLAGS_MODULE that is about line 383... must see:

CFLAGS_MODULE   = -Wno-misleading-indentation

Save and exit.

***

make modules ARCH=arm -j16

About 5 minutes with SD card Sandisk Ultra A1 16Gb.

***

make ARCH=arm rk3288-miniarm.dtb -j16
Ignore warnings.

make dtbs ARCH=arm -j16
Ignore warnings.

***

sudo mkdir /lib/modules/old-modules
sudo cp -r /lib/modules/4.4.71+ /lib/modules/old-modules

sudo mkdir /boot/old-boot
sudo mv /boot/zImage /boot/old-boot/zImage
sudo mv /boot/rk3288-miniarm.dtb /boot/old-boot/rk3288-miniarm.dtb

***

sudo make ARCH=arm modules_install

***

sudo cp arch/arm/boot/zImage /boot
sudo cp arch/arm/boot/dts/rk3288-miniarm.dtb /boot

***

https://tinkerboarding.co.uk/wiki/index....are#Kernel

***

TV support on tinker OS:

DVB-T programs...

sudo apt-get install -y dvb-apps

You need dvb-usb-af9035-02.fw or dvb-usb-it9135-02.fw firmware in /lib/firmware

AVerMedia AVerTV Volar Green HD (A835)...

/lib/firmware/dvb-usb-it9135-02.fw
/lib/firmware/dvb-usb-it9135-01.fw

https://github.com/OpenELEC/dvb-firmware...9135-02.fw

https://github.com/OpenELEC/dvb-firmware...9135-01.fw

AVerMedia AVerTV Volar HD PRO (A835)...

/lib/firmware/dvb-usb-af9035-02.fw

https://github.com/OpenELEC/dvb-firmware...9035-02.fw

***

Reboot to activate new kernel and firmware and enjoy.

https://linuxtv.org/wiki/index.php/TV_Related_Software
Reply
#2
(04-07-2018, 11:53 AM)FightingForFun Wrote: Hi Tinkerboy.

I have usb adapter Geniatech Mygica T230, after i compile and install new kernel with DVB support as in your instruction, kernel work, firmware put into lib/firmware but adapter is still not working.

I thought that need install Media_Build (Form LinuxTV - https://www.linuxtv.org/wiki/index.php/Geniatech_T230), but still have errors with build and compile.

The post is nothing more than an example of kernel recompilation with a specific example for TV usb adapters such as the Aver TV HD PRO using the afatech 9035 chip.
The firmware is for these adapters with afatech 9035 chip.Do nothing with others.
You need to know what chip your adapter uses and if you need a specific firmware.
I recommend you read the last link to learn more.

It would be nice if someone recompiled vlc with full support for the tinkerboard and HD channels would be without pixilation.
Right now in Tinker-OS 2.0.5 the non-HD channels look good but HD TV need a push with the software.

Driver support

Drivers are included in kernel 3.19 and up. But not activated on tinkerboard kernel default.

Firmware

Firmware for both the demodulator and tuner are necessary. OpenELEC dvb-firmware collection includes firmwares for this device too.
[*]dvb-demod-si2168-b40-01.fw
[*]dvb-tuner-si2158-a20-01.fw

Place the 2 firmware files in /lib/firmware.

https://github.com/OpenELEC/dvb-firmware...r/firmware

[*]Reboot and test again.

You need kernel recompilation and add support for the driver.
NOTE: This device needs I2C-Mux support in kernel or as kernel module (CONFIG_I2C_MUX).

https://www.linuxtv.org/wiki/index.php/S...abs_Si2157
Reply
#3
Recompiling the kernel for DVB-T support on Tinkerboard.

UPDATED: 2018-April-09

See first post.
Reply
#4
Many thanks. everything is working!
Media_build is not needed. all and so it works.
Reply
#5
HOWTO HD-DVB-T 1080p on tinkerboard 100% quality sound and video.

***

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove

***

sudo apt-get install -y smplayer
mkdir /home/linaro/.mplayer

Put your channels.conf in /home/linaro/.mplayer/channels.conf

***

Open smplayer...

In options--> preferences--> performance... test using 2 or 4 threads to decode h264.
Advanced---> mplayer/mpv you can uncheck report mpv crashes.
UPDATED...
General---> Video ---> Enable postprocessing by default on [this seems to be the key to good quality image]
Smplayer must use mpv like multimedia engine.
Restart smplayer.

Open smplayer Open--> TV ---> test HD channels...

Now you have DVB-T channels in 1080p with 100% quality image and no visible dropped frames or audio loss.

Note:

CPU usage is about 50% with very good quality sound and video.
Smplayer tuning is slow about 10 seconds.
With all these settings HD TV looks nice.I do not know why it works but it works.

Example quality channel output smplayer...

Demuxer: lavf
Clip info
Name: Cuatro HD(MEDIASET)
Video
Resolution: 1920 x 1080
Aspect ratio: 1.77778
Format: h264
Bitrate: 5503 kbps
Frames per second: 25.000000
Selected codec: 
Initial Audio Stream
Format: mp2
Bitrate: 192 kbps
Rate: 48000 Hz
Channels: 2

Enjoy.

***

Optional...

git clone https://github.com/rockchip-linux/mpp.git
cd mpp
cmake -DRKPLATFORM=ON -DHAVE_DRM=ON -DCMAKE_BUILD_TYPE=Release .
make -j16
sudo make install

This will install /usr/local/lib/pkgconfig/rockchip_mpp.pc

https://forum.odroid.com/viewtopic.php?f=150&t=30182

Reboot.

***

Updated added ffmpeg compilation...

git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg

./configure --enable-gpl --disable-vaapi --enable-pthreads --enable-neon --enable-vfp --enable-rkmpp --enable-version3 --enable-libdrm --enable-shared --enable-static

make -j16
[about 15 minutes]

sudo make install
sudo ldconfig
ffmpeg

***

UPDATED 11-April-2018:

mpp or ffmpeg on tinker-os 2.0.5 is not mandatory to good quality image DVB-T HD channels.
The key seems to be adjust smplayer properly.

General---> Video ---> Enable postprocessing by default on

This seems to be the key to good quality image on HD channels.

Here are some keys...

https://www.pclinuxos.com/forum/index.ph...c=139236.0
Reply
#6
Hey,

thank you so very much for these instructions. Building AND using my very own kernel is a dream for me since years. But as of today, I have no Idea  what is happening here.

But I do get the following error messages from the "make zimage" command.

Quote:  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CC      scripts/mod/empty.o
  CC      scripts/mod/devicetable-offsets.s
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mapcs’; did you mean ‘-maes’?
gcc: error: unrecognized command line option ‘-mno-sched-prolog’; did you mean ‘-Wno-sign-promo’?
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’; did you mean ‘-fno-sched-interblock’?
gcc: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mapcs’; did you mean ‘-maes’?
gcc: error: unrecognized command line option ‘-mno-sched-prolog’; did you mean ‘-Wno-sign-promo’?
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’; did you mean ‘-fno-sched-interblock’?
gcc: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?
scripts/Makefile.build:258: die Regel für Ziel „scripts/mod/empty.o“ scheiterte
scripts/Makefile.build:153: die Regel für Ziel „scripts/mod/devicetable-offsets.s“ scheiterte
scripts/Makefile.build:403: die Regel für Ziel „scripts/mod“ scheiterte
Makefile:573: die Regel für Ziel „scripts“ scheiterte

Do you have any clue? Running the command "make ARCH=arm scripts -j16" also uttered a lot of complaints and asks if those errors are typos.
Reply
#7
(04-12-2018, 02:35 PM)Leviathan Wrote: Hey,

thank you so very much for these instructions. Building AND using my very own kernel is a dream for me since years. But as of today, I have no Idea  what is happening here.

But I do get the following error messages from the "make zimage" command.

[See post above]

Do you have any clue? Running the command "make ARCH=arm scripts -j16" also uttered a lot of complaints and asks if those errors are typos.

In the official guide make ARCH = arm scripts -j16 is not used https://tinkerboarding.co.uk/wiki/index....are#Kernel however in the few times that I have needed to recompile the kernel I remember having used make scripts but this was about x86 not ARM.
The official guide is for cross-compilation in other PC and is not for compilation on the tinkerboard.
I am not an expert in kernel recompilation.
I will try to do make clean don't do make scripts and see what happens.

This guide is an adaptation of the official to recompile on the same tinkerboard that is more than capable of doing it in less than an hour.

It would be appreciated a simple official guide for novices by the team of ASUS tinker-os.
In my opinion most users what they will demand the most is to open the kernel and recompile to give support not activated by default in the official rockchip kernel.

Keep in mind that if you are trying to support some features in the kernel that are not tested for rockchip team you will run into a lot of problems.

What are you doing to add to your new kernel?
Are you sure that is supported?
Do you have all patches and dependencies?

Try what has been said and see what happens.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)