Moderator Control Panel ]

Linux driver issue

Linux driver issue

Postby lwis » Fri Aug 03, 2018 2:58 pm

Hi,

I hope you can help. I'm running Raspbian stretch on a Raspberry Pi 3, here is the script I wrote to install the driver tree for my 5520SE;

Code: Select all
#!/bin/sh
    cd

    sudo apt install patchutils libproc-processtable-perl build-essential git raspberrypi-kernel-headers

    #sudo rpi-update 5315c7a2f806c123e9e4ee26980f0019c43b9f69

    sudo rm -rf /lib/modules/$(uname -r)/kernel/drivers/media
    sudo rm -rf /lib/modules/$(uname -r)/kernel/drivers/staging/media
    sudo rm -rf /lib/modules/$(uname -r)/extra

    wget http://www.tbsdtv.com/download/document/linux/tbs-tuner-firmwares_v1.0.tar.bz2
    sudo tar jxvf tbs-tuner-firmwares_v1.0.tar.bz2 -C /lib/firmware/
    rm tbs-tuner-firmwares_v1.0.tar.bz2

    #git clone https://github.com/tbsdtv/media_build.git
    #git clone --depth=1 https://github.com/tbsdtv/linux_media.git -b latest ./media

    cd ~/media
    git clean -fdx
    git pull

    cd ~/media_build
    git clean -fdx
    git pull

    make dir DIR=../media
    make allyesconfig
    make -j4

    sudo make install

    sudo modprobe dvb-usb-tbs5520se


modprobe results in;

Code: Select all
modprobe: ERROR: could not insert 'dvb_usb_tbs5520se': Invalid argument


With the following in dmesg;

Code: Select all
    [   30.980251] dvb_usb: disagrees about version of symbol rc_register_device
    [   30.980270] dvb_usb: Unknown symbol rc_register_device (err -22)
    [   30.980363] dvb_usb: disagrees about version of symbol rc_free_device
    [   30.980370] dvb_usb: Unknown symbol rc_free_device (err -22)
    [   30.980448] dvb_usb: disagrees about version of symbol rc_allocate_device
    [   30.980454] dvb_usb: Unknown symbol rc_allocate_device (err -22)
    [   30.980592] dvb_usb: disagrees about version of symbol rc_unregister_device
    [   30.980599] dvb_usb: Unknown symbol rc_unregister_device (err -22)



My kernel is;

Code: Select all
    Linux raspberrypi 4.14.52-v7+ #1123 SMP Wed Jun 27 17:35:49 BST 2018 armv7l GNU/Linux


Thanks!
lwis
 
Posts: 3
Joined: Thu Aug 02, 2018 10:01 pm

Re: Linux driver issue

Postby smile » Fri Aug 03, 2018 5:56 pm

HI
You can not using this way install the drivers into a Raspberry Pi 3 system. you need using the cross-compiled. compile the drivers into the image of the Raspberry Pi 3.

Thanks
Best Regards
smile
 
Posts: 97
Joined: Sun Oct 09, 2011 9:51 am

Re: Linux driver issue

Postby lwis » Fri Aug 03, 2018 6:02 pm

smile wrote:HI
You can not using this way install the drivers into a Raspberry Pi 3 system. you need using the cross-compiled. compile the drivers into the image of the Raspberry Pi 3.

Thanks
Best Regards


Hi, thanks - how do I do that? Or is a pre-built image available?
lwis
 
Posts: 3
Joined: Thu Aug 02, 2018 10:01 pm

Re: Linux driver issue

Postby 4l3x2k » Sat Aug 04, 2018 12:04 am

Hello,

I had the same problem.

The key point is that you should try to alter as less as possible to the (kernel) configuration! The command "make allyesconfig" is such a command that does not respect this. Even if it only rely on media sub tree, which contain dvb_usb etc.

I think (and hope :)) that I overcome this by placing a copy of kernel configuration - namely .config - from /lib/modules/$(uname -r)/build into media_build/v4l. Then I ran "make menuconfig" (which requires libncurses5-dev) and I enabled only the tbs5520se, tuner and demod drivers as modules and saving that config. After make and make install that message disappeared and the module loads without errors.
Maybe the better way would be storing the .config as .config.old to media_build/v4l as make menuconfig would yield new entries.

The problem in this case seem to be a mismatch between the module that contains rc_* functions and is provided by a default raspbian image and the media_build / linux_media module. A configuration change making the driver built-in or a module is sufficient for a mismatch.

The described approach lets you build only the drivers you need and does not require the whole kernel to be rebuild. You could also follow smile's approach. Look for building a raspberrypi kernel. There is an article with a link to a cross compiler on the raspberrypi's foundation website.


Heads up ;)
4l3x2k
 
Posts: 5
Joined: Thu Jul 05, 2018 1:06 am

Re: Linux driver issue

Postby lwis » Sat Aug 04, 2018 4:53 am

4l3x2k wrote:Hello,

I had the same problem.

The key point is that you should try to alter as less as possible to the (kernel) configuration! The command "make allyesconfig" is such a command that does not respect this. Even if it only rely on media sub tree, which contain dvb_usb etc.

I think (and hope :)) that I overcome this by placing a copy of kernel configuration - namely .config - from /lib/modules/$(uname -r)/build into media_build/v4l. Then I ran "make menuconfig" (which requires libncurses5-dev) and I enabled only the tbs5520se, tuner and demod drivers as modules and saving that config. After make and make install that message disappeared and the module loads without errors.
Maybe the better way would be storing the .config as .config.old to media_build/v4l as make menuconfig would yield new entries.

The problem in this case seem to be a mismatch between the module that contains rc_* functions and is provided by a default raspbian image and the media_build / linux_media module. A configuration change making the driver built-in or a module is sufficient for a mismatch.

The described approach lets you build only the drivers you need and does not require the whole kernel to be rebuild. You could also follow smile's approach. Look for building a raspberrypi kernel. There is an article with a link to a cross compiler on the raspberrypi's foundation website.


Heads up ;)


Woo! Getting there, thanks for the tip. I only selected tbs5520se under USB - what did you mean by tuner and demod drivers?

Although it's picked up as a frontend, when tvheadend tries to access it I'm getting a stacetrace in dmesg :(

Code: Select all
[   13.703145] Unable to handle kernel NULL pointer dereference at virtual address 00000020
[   13.705128] pgd = 80004000
[   13.707046] [00000020] *pgd=00000000
[   13.708970] Internal error: Oops: 5 [#1] SMP ARM
[   13.710857] Modules linked in: cmac bnep hci_uart btbcm serdev bluetooth ecdh_generic av201x(O) si2157(O) media si2183(O) i2c_mux dvb_usb_tbs5520se(O) dvb_usb(O) dvb_core brcmfmac brcmutil cfg80211 rfkill snd_bcm2835(C) snd_pcm snd_timer snd uio_pdrv_genirq uio fixed ip_tables x_tables ipv6
[   13.715189] CPU: 1 PID: 568 Comm: kdvb-ad-0-fe-0 Tainted: G         C O    4.14.52-v7+ #1123
[   13.717356] Hardware name: BCM2835
[   13.719441] task: bc02e900 task.stack: b9712000
[   13.721533] PC is at dvb_usb_fe_wakeup+0x20/0x60 [dvb_usb]
[   13.723656] LR is at dvb_frontend_init+0x28/0x74 [dvb_core]
[   13.725717] pc : [<7f40a328>]    lr : [<7f3ea3f0>]    psr: 20000013
[   13.727775] sp : b9713ef8  ip : b9713f10  fp : b9713f0c
[   13.729857] r10: b9453cd8  r9 : 80cbdbd4  r8 : 7f3eb894
[   13.731928] r7 : ba007400  r6 : ba3d1b00  r5 : 00000000  r4 : bc2a1000
[   13.734005] r3 : 00000000  r2 : 0000012c  r1 : 00000001  r0 : bc2a1000
[   13.736091] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   13.738189] Control: 10c5383d  Table: 3961406a  DAC: 00000055
[   13.740298] Process kdvb-ad-0-fe-0 (pid: 568, stack limit = 0xb9712210)
[   13.742413] Stack: (0xb9713ef8 to 0xb9714000)
[   13.744526] 3ee0:                                                       bc2a1000 00000000
[   13.746691] 3f00: b9713f24 b9713f10 7f3ea3f0 7f40a314 00000000 bc2a1000 b9713f7c b9713f28
[   13.748869] 3f20: 7f3eb8f4 7f3ea3d4 8079c508 be5b8d40 bc2a1244 ba007594 00000000 b9712000
[   13.751064] 3f40: 00000000 ba3d1b00 bc2a1000 7f3eb894 b946981c b9469800 00000000 ba3d1b00
[   13.753287] 3f60: bc2a1000 7f3eb894 b946981c b9453cd8 b9713fac b9713f80 8013d97c 7f3eb8a0
[   13.755517] 3f80: 80102d94 ba3d1b00 8013d840 00000000 00000000 00000000 00000000 00000000
[   13.757766] 3fa0: 00000000 b9713fb0 8010810c 8013d84c 00000000 00000000 00000000 00000000
[   13.760006] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   13.762255] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[   13.764560] [<7f40a328>] (dvb_usb_fe_wakeup [dvb_usb]) from [<7f3ea3f0>] (dvb_frontend_init+0x28/0x74 [dvb_core])
[   13.766919] [<7f3ea3f0>] (dvb_frontend_init [dvb_core]) from [<7f3eb8f4>] (dvb_frontend_thread+0x60/0x4c4 [dvb_core])
[   13.769299] [<7f3eb8f4>] (dvb_frontend_thread [dvb_core]) from [<8013d97c>] (kthread+0x13c/0x16c)
[   13.771659] [<8013d97c>] (kthread) from [<8010810c>] (ret_from_fork+0x14/0x28)
[   13.773999] Code: e8bd4000 e5903240 e1a04000 e3a01001 (e5935020)
[   13.776364] ---[ end trace c162546cbdc363a5 ]---


I feel like I'm so close!

UPDATE: Did;

Code: Select all
sudo rm -rf /lib/modules/$(uname -r)/kernel/drivers/media
sudo rm -rf /lib/modules/$(uname -r)/kernel/drivers/staging/media
sudo rm -rf /lib/modules/$(uname -r)/extra


then rebuilt, and all is working now!
lwis
 
Posts: 3
Joined: Thu Aug 02, 2018 10:01 pm

Re: Linux driver issue

Postby 4l3x2k » Sat Aug 04, 2018 10:55 pm

Hi lwis,

great to hear that drivers and tvheadend are working now.

Well, you already found the tbs5520se usb driver in menuconfig. This driver depends on further drivers for frontend (si2183, demod) and tuners (av201x for dvbs, si2157 for dvbc/t). You can see that in your trace (modules linked in) or by issuing lsmod. These dependent drivers are selected automatically for you, but you can disable it and select the driver manually (Multimedia Support -> Autoselect ancillary drivers (...) -> Customize TV tuners || Customise DVB Frontends).

If you encounter something like read_status failed=-11 or set_params failed=-11 in kernel log, stop tvheadend for about 10 minutes. This error is - in my opinion and up to now - tvheadend related and occurs if you enable more than one dvb sub-system (for example dvbc and dvbt) and switch between them. The 10 minutes arise from default timeout for epg grabbers in tvheadend configuration.

TBS5520SE support one mux at a time. That means you can watch or record only one channel. The exception is, that if the mux contains more than one "program" you can watch and record these simultaneously. You can find that channels by tvheadend -> configuration -> dvb inputs -> services and filter for desired mux.

Crazycat explained it in more detail in this forum or elsewhere. I cannot remember exactly where.


Cheers
4l3x2k
 
Posts: 5
Joined: Thu Jul 05, 2018 1:06 am

Re: Linux driver issue

Postby al777ex » Tue Dec 04, 2018 3:14 pm

lwis wrote:
4l3x2k wrote:Hello,

I had the same problem.

The key point is that you should try to alter as less as possible to the (kernel) configuration! The command "make allyesconfig" is such a command that does not respect this. Even if it only rely on media sub tree, which contain dvb_usb etc.

I think (and hope :)) that I overcome this by placing a copy of kernel configuration - namely .config - from /lib/modules/$(uname -r)/build into media_build/v4l. Then I ran "make menuconfig" (which requires libncurses5-dev) and I enabled only the tbs5520se, tuner and demod drivers as modules and saving that config. After make and make install that message disappeared and the module loads without errors.
Maybe the better way would be storing the .config as .config.old to media_build/v4l as make menuconfig would yield new entries.

The problem in this case seem to be a mismatch between the module that contains rc_* functions and is provided by a default raspbian image and the media_build / linux_media module. A configuration change making the driver built-in or a module is sufficient for a mismatch.

The described approach lets you build only the drivers you need and does not require the whole kernel to be rebuild. You could also follow smile's approach. Look for building a raspberrypi kernel. There is an article with a link to a cross compiler on the raspberrypi's foundation website.


Heads up ;)


Woo! Getting there, thanks for the tip. I only selected tbs5520se under USB - what did you mean by tuner and demod drivers?

Although it's picked up as a frontend, when tvheadend tries to access it I'm getting a stacetrace in dmesg :(

Code: Select all
[   13.703145] Unable to handle kernel NULL pointer dereference at virtual address 00000020
[   13.705128] pgd = 80004000
[   13.707046] [00000020] *pgd=00000000
[   13.708970] Internal error: Oops: 5 [#1] SMP ARM
[   13.710857] Modules linked in: cmac bnep hci_uart btbcm serdev bluetooth ecdh_generic av201x(O) si2157(O) media si2183(O) i2c_mux dvb_usb_tbs5520se(O) dvb_usb(O) dvb_core brcmfmac brcmutil cfg80211 rfkill snd_bcm2835(C) snd_pcm snd_timer snd uio_pdrv_genirq uio fixed ip_tables x_tables ipv6
[   13.715189] CPU: 1 PID: 568 Comm: kdvb-ad-0-fe-0 Tainted: G         C O    4.14.52-v7+ #1123
[   13.717356] Hardware name: BCM2835
[   13.719441] task: bc02e900 task.stack: b9712000
[   13.721533] PC is at dvb_usb_fe_wakeup+0x20/0x60 [dvb_usb]
[   13.723656] LR is at dvb_frontend_init+0x28/0x74 [dvb_core]
[   13.725717] pc : [<7f40a328>]    lr : [<7f3ea3f0>]    psr: 20000013
[   13.727775] sp : b9713ef8  ip : b9713f10  fp : b9713f0c
[   13.729857] r10: b9453cd8  r9 : 80cbdbd4  r8 : 7f3eb894
[   13.731928] r7 : ba007400  r6 : ba3d1b00  r5 : 00000000  r4 : bc2a1000
[   13.734005] r3 : 00000000  r2 : 0000012c  r1 : 00000001  r0 : bc2a1000
[   13.736091] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   13.738189] Control: 10c5383d  Table: 3961406a  DAC: 00000055
[   13.740298] Process kdvb-ad-0-fe-0 (pid: 568, stack limit = 0xb9712210)
[   13.742413] Stack: (0xb9713ef8 to 0xb9714000)
[   13.744526] 3ee0:                                                       bc2a1000 00000000
[   13.746691] 3f00: b9713f24 b9713f10 7f3ea3f0 7f40a314 00000000 bc2a1000 b9713f7c b9713f28
[   13.748869] 3f20: 7f3eb8f4 7f3ea3d4 8079c508 be5b8d40 bc2a1244 ba007594 00000000 b9712000
[   13.751064] 3f40: 00000000 ba3d1b00 bc2a1000 7f3eb894 b946981c b9469800 00000000 ba3d1b00
[   13.753287] 3f60: bc2a1000 7f3eb894 b946981c b9453cd8 b9713fac b9713f80 8013d97c 7f3eb8a0
[   13.755517] 3f80: 80102d94 ba3d1b00 8013d840 00000000 00000000 00000000 00000000 00000000
[   13.757766] 3fa0: 00000000 b9713fb0 8010810c 8013d84c 00000000 00000000 00000000 00000000
[   13.760006] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   13.762255] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[   13.764560] [<7f40a328>] (dvb_usb_fe_wakeup [dvb_usb]) from [<7f3ea3f0>] (dvb_frontend_init+0x28/0x74 [dvb_core])
[   13.766919] [<7f3ea3f0>] (dvb_frontend_init [dvb_core]) from [<7f3eb8f4>] (dvb_frontend_thread+0x60/0x4c4 [dvb_core])
[   13.769299] [<7f3eb8f4>] (dvb_frontend_thread [dvb_core]) from [<8013d97c>] (kthread+0x13c/0x16c)
[   13.771659] [<8013d97c>] (kthread) from [<8010810c>] (ret_from_fork+0x14/0x28)
[   13.773999] Code: e8bd4000 e5903240 e1a04000 e3a01001 (e5935020)
[   13.776364] ---[ end trace c162546cbdc363a5 ]---


I feel like I'm so close!

UPDATE: Did;

Code: Select all
sudo rm -rf /lib/modules/$(uname -r)/kernel/drivers/media
sudo rm -rf /lib/modules/$(uname -r)/kernel/drivers/staging/media
sudo rm -rf /lib/modules/$(uname -r)/extra


then rebuilt, and all is working now!



can you explain step by step how to install drivers on raspberry, please :oops: :oops: :oops:
al777ex
 
Posts: 1
Joined: Mon Dec 03, 2018 10:15 pm


Return to TBS5520 Multi-standard TV Tuner USB Box

Who is online

Users browsing this forum: No registered users and 1 guest