Jump to content

Recommended Posts

Posted

Hello,

I am trying to compile some firmware to recognize a DVB-T USB device.

The compilation process raises an error as following:

 

  Quote
/home/idan/media_build/v4l/sunxi-cir.c:26:25: fatal error: linux/reset.h: No such file or directory #include <linux/reset.h>                     ^compilation terminated.

 

 

I was trying to to build kernel headers again:

$ cd /usr/src/linux-headers-3.4.112-sun8i
$ make headers_check
$ make headers_install
$ make scripts

And then I run this command in the source directory:

$  make ARCH=arm KSRC=/usr/src/linux-headers-3.4.112-sun8i

this is the output:

  Quote

 

make -C /home/idan/media_build/v4l
make[1]: Entering directory '/home/idan/media_build/v4l'
creating symbolic links...
make -C firmware prep
make[2]: Entering directory '/home/idan/media_build/v4l/firmware'
make[2]: Leaving directory '/home/idan/media_build/v4l/firmware'
make -C firmware
make[2]: Entering directory '/home/idan/media_build/v4l/firmware'
make[2]: Nothing to be done for 'default'.
make[2]: Leaving directory '/home/idan/media_build/v4l/firmware'
Kernel build directory is /lib/modules/3.4.112-sun8i/build
make -C ../linux apply_patches
make[2]: Entering directory '/home/idan/media_build/linux'
Syncing with dir ../media/
Patches for 3.4.112-sun8i already applied.
make[2]: Leaving directory '/home/idan/media_build/linux'
make -C /lib/modules/3.4.112-sun8i/build SUBDIRS=/home/idan/media_build/v4l  modules
make[2]: Entering directory '/usr/src/linux-headers-3.4.112-sun8i'
 make ARCH=arm KSRC=   CC [M]  /home/idan/media_build/v4l/sunxi-cir.o
In file included from <command-line>:0:0:
/home/idan/media_build/v4l/compat.h:1573:0: warning: "writel_relaxed" redefined
 #define writel_relaxed writel
 ^
In file included from include/linux/scatterlist.h:10:0,
                 from /home/idan/media_build/v4l/compat.h:1260,
                 from <command-line>:0:
/usr/src/linux-headers-3.4.112-sun8i/arch/arm/include/asm/io.h:235:0: note: this is the location of the previous definition
 #define writel_relaxed(v,c) ((void)__raw_writel((__force u32) \
 ^
/home/idan/media_build/v4l/sunxi-cir.c:26:25: fatal error: linux/reset.h: No such file or directory
 #include <linux/reset.h>
                         ^
compilation terminated.

scripts/Makefile.build:313: recipe for target '/home/idan/media_build/v4l/sunxi-cir.o' failed
make[3]: *** [/home/idan/media_build/v4l/sunxi-cir.o] Error 1
Makefile:1368: recipe for target '_module_/home/idan/media_build/v4l' failed
make[2]: *** [_module_/home/idan/media_build/v4l] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-3.4.112-sun8i'
Makefile:51: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/home/idan/media_build/v4l'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2

 

This is the same error from the compilation process.

How can I solve this problem?

 

Any help will be appreciated.

Posted

You are trying to build backported drivers which warned you in the first place that they might not work properly and IMO this includes compilation. That being said, you can build these drivers by excluding sunxi-cir driver, which is provided by the Armbian anyway.

 

Be very careful when you are mixing old and new drivers/frameworks. Maybe you will have to blacklist or remove some of the old drivers.

Posted
  On 10/23/2016 at 7:08 PM, jernej said:

You are trying to build backported drivers which warned you in the first place that they might not work properly and IMO this includes compilation. That being said, you can build these drivers by excluding sunxi-cir driver, which is provided by the Armbian anyway.

 

Be very careful when you are mixing old and new drivers/frameworks. Maybe you will have to blacklist or remove some of the old drivers.

 

 

How can I exclude sunxi-cir driver?

Posted
  On 10/24/2016 at 7:28 AM, idandavidi said:

How can I exclude sunxi-cir driver?

 

With the following command:

sed -i '3i IR_SUNXI' v4l/versions.txt

Of course, it has to be executed inside media_build folder.

 

You may or may not bump into the issue with "NEED_WRITEL_RELAXED". If you do, you have to apply this patch:

https://github.com/jernejsk/OpenELEC-OPi2/blob/f83e46cf65c71c2a4c9b5f1394d27474000f6abf/projects/H3/patches/media_build/media_build-00-build-fix.patch

 

And rebuild again.

Posted (edited)
  On 10/24/2016 at 3:47 PM, jernej said:

With the following command:

sed -i '3i IR_SUNXI' v4l/versions.txt
Of course, it has to be executed inside media_build folder.

 

You may or may not bump into the issue with "NEED_WRITEL_RELAXED". If you do, you have to apply this patch:

https://github.com/jernejsk/OpenELEC-OPi2/blob/f83e46cf65c71c2a4c9b5f1394d27474000f6abf/projects/H3/patches/media_build/media_build-00-build-fix.patch

 

And rebuild again.

 

 

Hello,

After running the command, it finally built!!!! You don't know how happy I was!! I am trying to get to this point for a week now.

Then I did

sudo make install

and everything looks good.

 

Unfortunately, the OS still does not recognize the tuner (w_scan gives FATAL: ***** NO USEABLE TERRESTRIAL CARD FOUND. *****)

It seems the there is a problem while connecting the tuner to the board, please check out this mseg log:

 

(I have marked in red the lines that the log marked in red as well)

 

 

  Reveal hidden contents

@qualcomm.com>

you can see full log include the build and install process here: https://filetea.me/default/#t1sNqyhWJFyRDeRM3eVICM5Lw

Does it have something to do with the patch you mentioned? Should I try to apply it?

 

Thank you very much, I really appreciate your help.

Edited by idandavidi
Added spoiler tags
Posted

Please add spoiler tag to your log, as mentioned in forum rules for long logs.

 

It was long ago when I compiled media_build package, so I don't remember exactly when patch is needed and it may be that they already fixed the issue. You can certainly try to apply it. If it won't apply, they probably most likely fixed this already.

 

About your issue: I already warned you that you must be careful when mixing old and new drivers. Usually, this can give you headaches. I really don't now how good is installation script here. I guess you already tried just to restart the board? Secondly, run "sudo depmod" and reboot again. Third, search through /lib/modules for *.ko files with the same name (ones build with media_build), no matter in which folder they are and remove the old ones. Then you have to run "sudo depmod" and reboot.

 

I hope this will help. Otherwise, we can take a look specifically to your case and leave other drivers alone.

Posted
  On 10/25/2016 at 4:26 PM, jernej said:

Please add spoiler tag to your log, as mentioned in forum rules for long logs.

 

It was long ago when I compiled media_build package, so I don't remember exactly when patch is needed and it may be that they already fixed the issue. You can certainly try to apply it. If it won't apply, they probably most likely fixed this already.

 

About your issue: I already warned you that you must be careful when mixing old and new drivers. Usually, this can give you headaches. I really don't now how good is installation script here. I guess you already tried just to restart the board? Secondly, run "sudo depmod" and reboot again. Third, search through /lib/modules for *.ko files with the same name (ones build with media_build), no matter in which folder they are and remove the old ones. Then you have to run "sudo depmod" and reboot.

 

I hope this will help. Otherwise, we can take a look specifically to your case and leave other drivers alone.

 

Hello,

I did what you had suggested:

1. I have restarted the device. dmesg still the same

2. Tried "sudo depmod" ant reboot - still the same

3. There are a lot of *.ko files in /lib/modules. I have ran a script that search for duplicate file names recursively and found 0 results (the script was tested and works)

 

I even tried to delete the whole content of /lib/modules/3.4.112-sun8i/kernel/drivers/media/ and installed media_build again. Then tried the suggestions above and the result is the same.

 

I must say: this orangepi pc board purpose is to serve as a local tvheadend server, and that is all it's purpose, so I have no problem to try fresh installation of the OS and rebuild media_build if that might help.

 

 

Do you have any other suggestions for me?

Thank you again.

Posted

Ok, so installation scripts done it's job properly. Unfortunatelly that means that probably some built in driver causes issues. From what I see you have to rebuild the kernel, with one important change - set https://github.com/igorpecovnik/lib/blob/master/config/kernel/linux-sun8i-default.config#L2272to "m" instead of "y". This also means that you will lose support for onboard IR, but you will have support for IR on your dongle. After you rebuilt and installed new kernel, reinstall media_build again.

Posted (edited)
  On 10/25/2016 at 8:35 PM, jernej said:

Ok, so installation scripts done it's job properly. Unfortunatelly that means that probably some built in driver causes issues. From what I see you have to rebuild the kernel, with one important change - set https://github.com/igorpecovnik/lib/blob/master/config/kernel/linux-sun8i-default.config#L2272to "m" instead of "y". This also means that you will lose support for onboard IR, but you will have support for IR on your dongle. After you rebuilt and installed new kernel, reinstall media_build again.

 

Hello,

I am pretty new to Linux and knows nothing about building kernels.

 

I am following the instruction in gibhub documentation. The required Ubuntu was installed, and I cloned the repository:

apt-get -y install git
git clone https://github.com/igorpecovnik/lib --depth 1
cp lib/compile.sh .

I changed line value of ./lib/config/kernel/linux-sun8i-default.config #2272 from "y" to "m"

Then changed the compole.sh:

  Quote
KERNEL_CONFIGURE="yes"

 

And then ran:

./compile.sh

This warning was showed:

2jb4m8g.jpg

 

I pressed enter to continue, and now it runs.

Is that all good?

 

 

Edit:

Ok, the building of the kernel was done:

snhphi.jpg

 

I burnt the img to the SD card and Armbian was loaded.

Cloned media_build, did sed -i '3i IR_SUNXI' v4l/versions.txt and ./build --main-git

The build was succeeded and then I did make install, succeeded as well

 

Unfortunately dmesg and w_scan present the same result:

  Quote

 

root@orangepipc:/home/idan/media_build# dmesg -c

[ 3075.199643] ehci_irq: highspeed device disconnect

[ 3075.199869] usb 3-1: USB disconnect, device number 4

[ 3077.688858] ehci_irq: highspeed device connect

[ 3077.694833] ehci_irq: highspeed device disconnect

[ 3077.931359] ehci_irq: highspeed device connect

[ 3078.210108] usb 3-1: new high-speed USB device number 5 using sunxi-ehci

root@orangepipc:/home/idan/media_build# w_scan

w_scan version 20130331 (compiled for DVB API 5.4)

WARNING: could not guess your country. Falling back to 'DE'

guessing country 'DE', use -c <country> to override

using settings for GERMANY

DVB aerial

DVB-T Europe

scan type TERRESTRIAL, channellist 4

output format vdr-2.0

WARNING: could not guess your codepage. Falling back to 'UTF-8'

output charset 'UTF-8', use -C <charset> to override

Info: using DVB adapter auto detection.

main:3228: FATAL: ***** NO USEABLE TERRESTRIAL CARD FOUND. *****

Please check wether dvb driver is loaded and

verify that no dvb application (i.e. vdr) is running.

 

:(

Maybe I did something wrong?

Edited by idandavidi
Posted
  On 10/26/2016 at 3:48 PM, jernej said:

Please do not shorten dmesg output. Some interested bits might be in there.

 

Sorry for that,

The terminal is still open, this is the end of the installation + lsusb + dmesg

 

 

  Reveal hidden contents

 

Posted

I have posted it in the spoiler tag. here it is again:

 

 

  Reveal hidden contents

@qualcomm.com>

Posted

This doesn't appear to be whole dmesg. Anyway, one issue seems to be apparent. I forget to tell you to set those https://github.com/igorpecovnik/lib/blob/master/config/kernel/linux-sun8i-default.config#L2273-L2283also to "m". Other, more straight forward approach would be to set https://github.com/igorpecovnik/lib/blob/master/config/kernel/linux-sun8i-default.config#L2272 to "# CONFIG_RC_CORE is not set" without quotes. Maybe you should try this second approach first. You will probably get systemd complaints that it can't load sunxi-cir module during boot, but that can be fixed later.

Posted
  On 10/26/2016 at 5:20 PM, jernej said:

This doesn't appear to be whole dmesg. Anyway, one issue seems to be apparent. I forget to tell you to set those https://github.com/igorpecovnik/lib/blob/master/config/kernel/linux-sun8i-default.config#L2273-L2283also to "m". Other, more straight forward approach would be to set https://github.com/igorpecovnik/lib/blob/master/config/kernel/linux-sun8i-default.config#L2272 to "# CONFIG_RC_CORE is not set" without quotes. Maybe you should try this second approach first. You will probably get systemd complaints that it can't load sunxi-cir module during boot, but that can be fixed later.

 

ok, so I will build the kernel again

Just let me make sure I understand:

replace line 2272:

CONFIG_RC_CORE=y

with this line :

# CONFIG_RC_CORE is not set

And one more question - during build process I saw that I can choose Ubuntu Xenial 16.04.1 and a newer kernel (dev)

The tuner worked good for me in VMWare Ubuntu 16.04.1 (media_build just ran smooth), it may not be relevant, but perhaps I should compile Armbian as Ubuntu Xenial 16.04.1 with the latest dev kernel?

Posted

Yes, that should do it.

 

You can use newer kernel, which should have all these drivers included, but AFAIK you will not have any video output. If you need this only to stream to other devices, this solution might work even better.

Posted

Ok,

I am compiling the kernel right now

In the meantime I used another img the I built (with "m" option on #l2272): Armbian_5.23_Orangepipc_Ubuntu_xenial_3.4.112.img

media_build was installed as we discussed - first ran "sed -i '3i IR_SUNXI' v4l/versions.txt"

now dmesg has some intersting output:

 

 

  Reveal hidden contents

 

 

but still w_scan seems to not recognize the device:

 

  Reveal hidden contents

 

btw, this is dmesg after reboot, hope this is a full one:

 

  Reveal hidden contents

@qualcomm.com>

 

 

What should I do now?

Posted

I am compiling the new kernel right now with:

 

#2272:

# CONFIG_RC_CORE is not set

(although the dmesg log above is with img that was built while this line was equal to "m")

 

 

#1871:

CONFIG_I2C_MUX=y

I ask again, is it ok that this warning shows? I pressed enter for this one:

epmbrp.jpg

 

 

And this was showed up (new - because #1871?), is that ok to mark all "y"?

15h1y4j.jpg

Posted
  Quote

I ask again, is it ok that this warning shows? I pressed enter for this one:

 

Warnings are usually safe to ignore. In this case it warns you, that you have made changes to the tools. This means that the changed files won't be updating.

You should make use of directory userpatches. If you will just compile kernel, just proceed since even if we will change config upstream, this won't break you anything.

 

Proper way is to copy kernel config there and edit. I think we wrote all this in manual.

Posted

I am so excited right now. It looks like that i2c mux is recognized!

 

dmesg -c after reconnecting:


[ 3046.784801] ehci_irq: highspeed device disconnect
[ 3046.785030] usb 3-1: USB disconnect, device number 3
[ 3048.578703] ehci_irq: highspeed device connect
[ 3048.584684] ehci_irq: highspeed device disconnect
[ 3048.821209] ehci_irq: highspeed device connect
[ 3049.100118] usb 3-1: new high-speed USB device number 4 using sunxi-ehci
[ 3049.316935] media: Linux media interface: v0.10
[ 3049.322228] WARNING: You are using an experimental version of the media stack.
[ 3049.322249]  As the driver is backported to an older kernel, it doesn't offer
[ 3049.322265]  enough quality for its usage in production.
[ 3049.322279]  Use it with care.
[ 3049.322288] Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
[ 3049.322305]  d52879196556001ca7e8d05811d18c93e3c30576 si2183: Minor fix.
[ 3049.322317]  9842fabcbf29234949fb4ffe18bcc71019810c2c cx231xx: Minor fix.
[ 3049.322330]  59e3a304e12a1ba6d78458455f5de373edb5aef8 cxusb: Fixed RC map table for T230/T230C.
[ 3049.474617] WARNING: You are using an experimental version of the media stack.
[ 3049.474635]  As the driver is backported to an older kernel, it doesn't offer
[ 3049.474648]  enough quality for its usage in production.
[ 3049.474659]  Use it with care.
[ 3049.474667] Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
[ 3049.474681]  d52879196556001ca7e8d05811d18c93e3c30576 si2183: Minor fix.
[ 3049.474694]  9842fabcbf29234949fb4ffe18bcc71019810c2c cx231xx: Minor fix.
[ 3049.474706]  59e3a304e12a1ba6d78458455f5de373edb5aef8 cxusb: Fixed RC map table for T230/T230C.
[ 3049.584596] dvb-usb: found a 'Mygica T230C DVB-T/T2/C' in warm state.
[ 3049.830525] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 3049.830793] DVB: registering new adapter (Mygica T230C DVB-T/T2/C)
[ 3049.830835] usb 3-1: media controller created
[ 3049.833664] dvb_create_media_entity: media entity 'dvb-demux' registered.
[ 3049.860651] i2c i2c-2: Added multiplexed i2c bus 3
[ 3049.860686] si2168 2-0064: Silicon Labs Si2168-D60 successfully identified
[ 3049.860713] si2168 2-0064: firmware version: D 6.0.1
[ 3049.875243] si2157 3-0060: Silicon Labs Si2141/2151 successfully attached
[ 3049.875345] usb 3-1: DVB: registering adapter 0 frontend 0 (Silicon Labs Si2168)...
[ 3049.875415] dvb_create_media_entity: media entity 'Silicon Labs Si2168' registered.
[ 3049.879621] dvb-usb: schedule remote query interval to 100 msecs.
[ 3049.879864] dvb-usb: Mygica T230C DVB-T/T2/C successfully initialized and connected.
[ 3049.880292] usbcore: registered new interface driver dvb_usb_cxusb

 

 

dmesg seems to recognize the right firmware files:

root@orangepipc:/home/idan/media_build# dmesg
[ 3063.584047] si2168 2-0064: downloading firmware from file 'dvb-demod-si2168-d60-01.fw'
[ 3064.014651] si2168 2-0064: firmware version: D 6.0.2
[ 3064.033639] si2157 3-0060: Si2141/2151 reset attempts 1
[ 3064.042403] si2157 3-0060: found a 'Silicon Labs Si2141-A10'
[ 3064.042649] si2157 3-0060: downloading firmware from file 'dvb-tuner-si2141-a10-01.fw'
[ 3064.538375] si2157 3-0060: firmware version: 1.1.10

 

and w_scan works!

root@orangepipc:/home/idan/media_build# w_scan
w_scan
w_scan version 20141122 (compiled for DVB API 5.10)
WARNING: could not guess your country. Falling back to 'DE'
guessing country 'DE', use -c <country> to override
using settings for GERMANY
DVB aerial
DVB-T Europe
scan type TERRESTRIAL, channellist 4
output format vdr-2.0
WARNING: could not guess your codepage. Falling back to 'UTF-8'
output charset 'UTF-8', use -C <charset> to override
Info: using DVB adapter auto detection.
        /dev/dvb/adapter0/frontend0 -> TERRESTRIAL "Silicon Labs Si2168": very good :-))

Using TERRESTRIAL frontend (adapter /dev/dvb/adapter0/frontend0)
-_-_ -_-_ Getting frontend capabilities-_ -_-_-_
Using DVB API 5.10
frontend 'Silicon Labs Si2168' supports
DVB-T2
INVERSION_AUTO
QAM_AUTO
TRANSMISSION_MODE_AUTO
GUARD_INTERVAL_AUTO
HIERARCHY_AUTO
FEC_AUTO
FREQ (42.00MHz ... 870.00MHz)
Scanning DVB-T...
Scanning 7MHz frequencies...
177500: (time: 00:00.009)
184500: (time: 00:02.049)
191500: (time: 00:04.079)
198500: (time: 00:06.119) ^C
ERROR: interrupted by SIGINT, dumping partial result...
(time: 00:06.459) dumping lists (0 services)
..
Done, scan time: 00:06.459

 

Now all is left is to test it in tvheadend to see if the device is really recognized by the system and I can catch some broadcasts.

I will try that later and keep you updated!

 

Thank you so much for that help! I really appreciate it!

Posted

So maybe you could make a pull request to change kernel settings, so others can do this more easily? Just don't disable anything. Mark as "m".

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines