Jump to content


Photo

[etxx00] patch to support Abilis as102 devices on kernel 3.0.3


  • Please log in to reply
31 replies to this topic

#1 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 22 October 2011 - 15:31

I ported the old patch for as102 USB sticks from kernel 2.6.31 to the new kernel 3.0.3.

In attachment you can find the new patch and the relevant OpenEmbedded files (the kernel recipe, config etc..).

Basically, I applied the old patch to the new kernel and then I followed the instructions in this post:

http://www.kernellab...78#comment-2317

So I changed change usb_buffer_alloc() to usb_alloc_coherent() and usb_buffer_free to usb_free_coherent() to support the new kernel API names.

Moreover, I added the USB VID/PID to support the as102 device from nBox (as explained in the forum post).

The driver compiles fine, but unfortunately it crashes the kernel when the as102 is connected to the USB port:

dmesg
DVB: registering new adapter (dvb0)
DVB: registering adapter 0 frontend 0 (DVB-S2)...
DVB: registering adapter 0 frontend 1 (DVB-S2)...
input: front panel as /devices/virtual/input/input1
as10x_usb: device has been detected
DVB: registering new adapter (Super Digi KEY)
DVB: registering adapter 1 frontend 0 (Super Digi KEY)...
as10x_usb: fimrware: as102_data1_st.hex loaded with success
as10x_usb: fimrware: as102_data2_st.hex loaded with success
usbcore: registered new interface driver Abilis Systems as10x usb driver
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
ftdi_sio 3-1:1.0: FTDI USB Serial Device converter detected
usb 3-1: Detected FT232BM
usb 3-1: Number of endpoints 2
usb 3-1: Endpoint 1 MaxPacketSize 64
usb 3-1: Endpoint 2 MaxPacketSize 64
usb 3-1: Setting MaxPacketSize 64
ftdi_sio ttyUSB0: Unable to read latency timer: -32
usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB0
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
NET: Registered protocol family 10
svc: failed to register lockdv1 RPC service (errno 124).
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
DVB: registering adapter 0 frontend 2 (vtuner)...
CPU 0 Unable to handle kernel paging request at virtual address 007b9900, epc == 80010cc4, ra == 8039d108
Oops[#1]:
Cpu 0
$ 0   : 00000000 10008701 00000200 80010cb0
$ 4   : cfc7de88 007b9900 00000000 00000200
$ 8   : 00000000 00000005 800d58a4 fffffff8
$12   : cd44c01c cd44c100 00000080 00410000
$16   : ce7ced00 cfeb0c00 00000002 00000000
$20   : e148f000 8064aa60 ce7ced08 00000189
$24   : 0041240c 2b6866bc				 
$28   : cdcc2000 cdcc3bc0 7faec910 8039d108
Hi    : 00000000
Lo    : 00000000
epc   : 80010cc4 mips_dma_map_page+0x14/0x108
    Tainted: PF		 
ra    : 8039d108 usb_hcd_map_urb_for_dma+0x338/0x4a8
Status: 10008703    KERNEL EXL IE
Cause : 00800008
BadVA : 007b9900
PrId  : 0002a044 (Brcm4380)
Modules linked in: nfsd ipv6 ftdi_sio usbserial exportfs dvb_as102 dvb(F) modloader2(P) modloader(P) tpm
Process usbtunerhelper (pid: 395, threadinfo=cdcc2000, task=cf111b48, tls=2b569820)
Stack : 00000041 00010a78 00000009 8008a0a8 ce7ced00 cfeb0c00 00000002 8039d108
	    00000041 fffffbff 80679980 10008700 00000002 00000000 8140a30c 8064ad48
	    ce7ced00 ce7ced00 cfe8b800 cfeb0c00 00000020 e148f000 8064aa60 ce7ced08
	    00000189 8039d540 00000178 cde8f100 80679f80 00000000 00000000 80679f84
	    00000000 00000000 000000d0 000200d0 cfc03aa4 8008a2a0 000200d0 cfe8b800
	    ...
Call Trace:
[<80010cc4>] mips_dma_map_page+0x14/0x108
[<8039d108>] usb_hcd_map_urb_for_dma+0x338/0x4a8
[<8039d540>] usb_hcd_submit_urb+0x2c8/0x8cc
[<e13655d8>] as102_submit_urb_stream+0x64/0xc8 [dvb_as102]
[<e1365680>] as102_usb_start_stream+0x44/0x80 [dvb_as102]
[<e1363628>] as102_dvb_dmx_start_feed+0xb4/0x17c [dvb_as102]
[<803e20f4>] dmx_ts_feed_start_filtering+0x5c/0x134
[<803de454>] dvb_dmxdev_start_feed+0xd4/0x158
[<803dff28>] dvb_dmxdev_filter_start+0x2b8/0x448
[<803e07ac>] dvb_demux_do_ioctl+0x2a0/0x654
[<803ddc8c>] dvb_usercopy+0x124/0x204
[<800d5284>] do_vfs_ioctl+0xa0/0x6c0
[<800d58e8>] sys_ioctl+0x44/0xa8
[<8000ecfc>] stack_done+0x20/0x40

Code: afb00010  afbf001c  afb20018 <8ca30000> 3c02806d  00031e42  000318c0  244280c0  00431021

I observed similar crashes with the old driver in kernel 2.6.18, but for some reason with kernel 2.6.31 the driver was at least loading properly (not all the times). Anyway, even with 2.6.31, the as102 stick could not find any channel with both manual and automatic scan.

That's strange, since this driver is reported to work on kernel 3 (in the above post) and I also installed it with success in my Ubuntu 10.04 PC (with kernel 2.6.32).

I looked for more updated versions but the original author is not maintaining it any more. The only alternative version is this one:

http://www.kernellab...78#comment-1588

but the changes are only relevant to old kernels (<= 2.6.19).

Attached Files



Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #2 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 22 October 2011 - 16:13

More info about the kernel crashes:

a while ago I discussed this issue on the SifTeam forum (in italian):

http://forum.sifteam...y-problemi.html

A member (DS-1) reported the kernel crashes with the as102 stick and an ET5000 decoder. The same user tested the same stick on a VU+ DUO decoder (with a different image) with success.
Since I think all images are using the same drivers (from OpenEmbedded 1.6), I think the driver is perfectly fine, and the problem is probably related to the ETxx00 DVB drivers.

Any idea?

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #3 Carl

  • Senior Member
  • 367 posts

+8
Neutral

Posted 22 October 2011 - 16:41

Probably not all modules are installed.
on http://www.kernellab...78#comment-1711 they have over the follow modules

kernel-module-tuner-xc2028
kernel-module-mt20xx
kernel-module-tuner-simple
XP1000, Clarketech CT9000 and a VU+ duo

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #4 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 22 October 2011 - 17:06

That forum post talks about some compilation errors related to the entire v4l-dvb tree on a non compatible kernel, so the errors are not strictly related to the as102 driver.

Moreover, I think there is no dependency in the driver, as the as102 is an all-in-one chip.

Anyway, I tried to install also those modules and to modprobe them, but I still get a kernel crash as soon as I insert the stick in the USB port.

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #5 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 12 November 2011 - 16:02

I've updated the previous driver to support the latest 3.1.0 kernel.
This new version is based on the reworked driver that is currently on the "staging" phase to be included in one of the next Linux kernel releases. More info here:

http://lwn.net/Articles/465050/

I've just added support for the USB VID/PID of my as102 device (Super Digital Key from Sky Italia).
Unfortunately, the driver is still crashing the kernel as in the previous version.
The same problem is reported on Vu+ Uno decoders:

http://www.vuplus-co...ner-as102.3850/
http://forum.sifteam...-dtt-as102.html

In case someone wants to test the driver, I'm including a pre-compiled ipk file for ET9x00 and kernel 3.1.0, as well as the patch and other relevant files.

Attached Files


Edited by Gennar1, 12 November 2011 - 16:03.


Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #6 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 12 November 2011 - 16:20

ok, so for now it does not make sense to add it to the kernel?
We should probably wait till it made it to staging, and hope it has gotten more testing + fixes by then.

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #7 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 12 November 2011 - 17:30

I agree, it doesn't make much sense to add it as it is.
We will see if the driver will be fixed before going upstream. I don't expect much, since this problem is only seen with some decoders featuring the Broadcom 7405 CPU, while the driver works fine on x86 hardware. The weird thing is that not all 7405 based decoders are affected. Maybe it depends on some kernel configuration parameter?

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #8 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 8 February 2012 - 11:34

From today, Abilis as102 devices are supported on the ETxx00 kernels.

I managed to fix the kernel crashes and now the stick runs perfectly fine.

I also adapted the SNR output to the format required by Enigma2.
So in the end everything works well: reliable frequency scanning (VHF and UHF), fast zapping, proper SNR/signal strength reports.

To install the driver by telnet:

opkg install kernel-module-dvb-as102

The working driver patch is available here:

http://openpli.git.s...ace3a36c72ecb31

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #9 lionheart

  • Member
  • 35 posts

0
Neutral

Posted 8 February 2012 - 16:13

I've installed the new module, rebooted the box, rebooted enigma after plugging the DVB-T stick, yet the tuner does not appear on the tuners list. Is there anything else to be done?

Just FYI.. these are the kernel messages:

usb 1-1: new high-speed USB device number 3 using ehci-brcm
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.4: new high-speed USB device number 4 using ehci-brcm
as10x_usb: device has been detected
DVB: registering new adapter (Sky IT Digital Key (green led))
DVB: registering adapter 1 frontend 0 (Sky IT Digital Key (green led))...
as10x_usb: unable to locate firmware file: as102_data1_st.hex
Registered device Sky IT Digital Key (green led)

I've highlighted in red the firmware error which looks suspicious to me (I've read the shortlog and ran the box upgrade after the latest commit changes).


Thanks,
LH

Edited by lionheart, 8 February 2012 - 16:14.


Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #10 lionheart

  • Member
  • 35 posts

0
Neutral

Posted 8 February 2012 - 16:25

Ok, apparently the firmware package is not in the repository and the kernel module is not tied by dependencies. Can the PLI team please fix that? Thanks!

Edited by lionheart, 8 February 2012 - 16:28.


Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #11 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 8 February 2012 - 17:41

The firmware package should be fixed soon.

In the meantime, you can get the firmwares in this way:

cd /lib/firmware
wget http://kernellabs.com/firmware/as102/as102_data1_st.hex
wget http://kernellabs.com/firmware/as102/as102_data2_st.hex

Edited by Gennar1, 8 February 2012 - 17:42.


Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #12 lionheart

  • Member
  • 35 posts

0
Neutral

Posted 9 February 2012 - 18:24

Thanks Gennar1. Now the device loads correctly, but the tuner does not show up yet under Enigma2 :(

These are the kernel messages, I do not see any tuner/vtuner being created. I believe we now have the kernel driver, but miss the tuner interface to Enigma2:

as10x_usb: device has been detected
DVB: registering new adapter (Sky IT Digital Key (green led))
DVB: registering adapter 1 frontend 0 (Sky IT Digital Key (green led))...
as10x_usb: firmware: as102_data1_st.hex loaded with success
as10x_usb: firmware: as102_data2_st.hex loaded with success
Registered device Sky IT Digital Key (green led)
usbcore: registered new interface driver Abilis Systems as10x usb driver

Edited by lionheart, 9 February 2012 - 18:25.


Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #13 lionheart

  • Member
  • 35 posts

0
Neutral

Posted 9 February 2012 - 18:41

Ok, a few things I noticed:

Package name for kernel-module-dvb-as102 is not consistent with the naming convention of OpenPLI, it should be named kernel-module-dvb-usb-as102 instead. Then, I believe we are still missing dependencies because the tuner is not detected at all (e.g. we are missing a frontend driver):

root@et9x00:~# cat /proc/bus/nim_sockets
NIM Socket 0:
Type: DVB-S2
Name: AVL2108
Has_Outputs: yes
Frontend_Device: 0
I2C_Device: 2
NIM Socket 1:
Type: DVB-S2
Name: AVL2108
Has_Outputs: yes
Frontend_Device: 1
I2C_Device: 3

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #14 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 9 February 2012 - 20:55

Package name for kernel-module-dvb-as102 is not consistent with the naming convention of OpenPLI, it should be named kernel-module-dvb-usb-as102 instead.


not true, package names are automatically generated based on their path in the kernel tree. So the name is correct.

Then, I believe we are still missing dependencies because the tuner is not detected at all (e.g. we are missing a frontend driver):


no, this is a combined dvb+frontend driver, it does not use external dvb frontend drivers.

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #15 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 10 February 2012 - 04:16

The name is correct, as this driver is not using the dvb-usb framework, but instead it is using its own independent driver structure. As pieterg already explained, this device is an all-in-one chip so it's a bit different from the usual USB sticks.

The issue you are reporting is known: the device is not always discovered at boot.
To solve the problem, you just have to unplug/replug the device from the USB port and restart Enigma2, then the new tuner will appear in the list.
It happens also on my PC running Ubuntu, so it's another small issue of the driver.

Please remember that this driver is still in the staging phase in the 3.2/3.3 kernels, so it is not perfect yet.
Anyway, once you get it loaded it works perfectly fine.

Edited by Gennar1, 10 February 2012 - 04:19.


Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #16 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 10 February 2012 - 11:27

A little update on the mis-detection issue:
- if you do an hard reboot (with the power switch on the back) or if you put the decoder in deep stand-by, the as102 is always detected and properly initialized at boot;
- if you do a soft reboot (without a power cycle) with the device connected, it will not be detected again;

It seems the device is not properly closed when the system shuts down, so it remains in an undetermined state and needs a power cycle to be usable again.

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #17 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 10 February 2012 - 21:38

btw, now with 3.2.2, which has the as102 driver in staging, perhaps it would be better to create a smaller diff, just with your fixes, against the in-tree driver?
(though I expect the current driver to keep working, because you patched it into drivers/media/dvb, rather than drivers/staging/media, so the two should not conflict)

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #18 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 11 February 2012 - 03:30

Yes, I'll do it tomorrow.

Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #19 lionheart

  • Member
  • 35 posts

0
Neutral

Posted 11 February 2012 - 12:14

I'm afraid to say that even doing the hard reboot (pressing the power switch on the back) the tuners do not show up under /proc/bus/nim_sockets . Just a question... was this ever tested on an ET-9000? Because I see references to Ubuntu only in this post and I really can't find a way to make it work.

EDIT: just read the above, will test it again once Gennar1 commits his changes against the 3.2.2 tree, as it doesn't make much sense now to keep testing on 3.1.0.


Thanks

Edited by lionheart, 11 February 2012 - 12:17.


Re: [etxx00] patch to support Abilis as102 devices on kernel 3.0.3 #20 Gennar1

  • Senior Member
  • 296 posts

+31
Good

Posted 11 February 2012 - 17:58

Well, I have an ET9000 and a Sky Digital Key and it works as described with both 3.1.0 and 3.2.2.
Are you sure you have the new firmware files installed?
There was a problem with one of the firmwares on the openembedded repo, and pieterg fixed it yesterday.
Please check that you got this result running "md5sum /lib/firmware/as102_data*":

root@et9x00:~# md5sum /lib/firmware/as102_data*
9ecb71defadf8f63e414fa217afc49ce  /lib/firmware/as102_data1_st.hex
6f8f845fd4d84aeba684678adb7f0189  /lib/firmware/as102_data2_st.hex

In case this is the problem just run:

opkg install --force-reinstall firmware-as102-data1-st firmware-as102-data2-st

to reinstall the firmware files.

Edited by Gennar1, 11 February 2012 - 18:03.



11 user(s) are reading this topic

0 members, 11 guests, 0 anonymous users