Jump to content


Photo

Libusb support added to oscam-experimental


  • Please log in to reply
77 replies to this topic

#1 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 12 June 2012 - 23:23

Hallo I just added libusb support to oscam-experimental

Since the new kernel on dm but also other boxes do support it now

I compilied with this patch, and obtained a succesfull binary which works perfect with libusb and smartreader

Included a git patch file for openpli-oe-core (PLI3.0)





forgot to attach file

Attached Files


Edited by christophecvr, 12 June 2012 - 23:23.


Re: Libusb support added to oscam-experimental #2 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 13 June 2012 - 16:55

@pieterg

Hallo I now tested the libusb add to oscam. It does work perfect. On dm8000 . Other persons did report goot working on other boxes ass well.

Smargo now full compatible with protocol = smartreader , dev = bus:id or dev = Serial:Reader 1

Note for oscam the serial number file does need to be 8 long (thats a limit from argolis 1.7 setup software under windows), started by a serie of letters followed by a space then a number.

Reader 1 is ok Reader 23 not ok, Smart 21 is ok. entso on....

For the older V 1.4 argolis they do have a fixed serial number, There it can be Reader 123 entso on ...

I also included the installation of list_smargo utility. User can find info about there smartreader by just typing list_smargo in telnet session on box.

Included with this message the now full reworked patch. Smargo support added on all oscam versions, List smargo utility as well. Revision is set to r1. Then it updates and rebuild with libusb included even if svn revision number did not changed.

It would be nice if You push the patch to openpli-oe-core.

Thanks

Attached Files



Re: Libusb support added to oscam-experimental #3 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 13 June 2012 - 17:20

regarding

-${LIBUSB}


you probably intended

${LIBUSB}


and

LIBUSB = "-DHAVE_LIBUSB=1"

?

(because when LIBUSB is not set, an error would occur because of the stray '-')

Re: Libusb support added to oscam-experimental #4 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 13 June 2012 - 18:02

regarding


-${LIBUSB}


you probably intended

${LIBUSB}


and

LIBUSB = "-DHAVE_LIBUSB=1"

?

(because when LIBUSB is not set, an error would occur because of the stray '-')


Wel it was meant like that.

But If You wish I will change that, If the strat by -${LIBUSB} may cause an error

Ther result oft this now are ok but yes It could cause in case a problem arise cause problem I did not knwo that.

I then also will change all the other -${xxx} to ${xxx} and add the - in LIBUSB="-Dxxx and xxxx=-xxxx

Re: Libusb support added to oscam-experimental #5 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 13 June 2012 - 18:33

Here the corrected patch chanched all the -$

I well set r2 as revision. And it did update on my box for experimental.

And work's :)

Attached Files



Re: Libusb support added to oscam-experimental #6 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 13 June 2012 - 19:02

Just one remark, It's based on the statical installed libusb-1.0.a file. In openpli3 dm8000 it's installed by standard in sysroots/lib dir.
I do not now about the sysroots off other boxes, But I gues its' also standard there in openpli3.0

The libusb-1.0.a file is not installed ont the box self. It's not needed since the lib is incorporated into the oscam binary, no need to install the libusb-1.0 ...so files to the box

Edited by christophecvr, 13 June 2012 - 19:04.


Re: Libusb support added to oscam-experimental #7 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 13 June 2012 - 19:48

Here the corrected patch chanched all the -$


thanks, much better. I had not noticed that there were some -$ instances already.

Regarding static vs dynamic linking of libusb, I'd actually prefer if you could use dynamic linking, as there are other libusb users in the image, so the library can be shared, rather than duplicated in the binary.

Re: Libusb support added to oscam-experimental #8 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 13 June 2012 - 20:41


Here the corrected patch chanched all the -$


thanks, much better. I had not noticed that there were some -$ instances already.

Regarding static vs dynamic linking of libusb, I'd actually prefer if you could use dynamic linking, as there are other libusb users in the image, so the library can be shared, rather than duplicated in the binary.


Thank's

About the static and dynamically linking, I fully agree with You. It comes well from defaullt by oscam just for this specific library. To solve this it will require a couple of patches for the whole smargo integration into the oscam project itself. Now lucky its a very smab lib, its only increaing the binary by +- 150 kb and the resulting memory upon use of oscam is not really affected by this one. Then at default by dm at least the libusb so files are not included in the standard images. We will need to install them extra . Obviousely if other packages are used who needs the lib usb 1.0 they need to be installed and dynamic linking would be the best.

What we well can do now is use the binary in every mipsel box. even if that box has a older kernel like 2.6.18 . As long they also have ssl 0.9.8 and lybcrypto 0.9.8 installed it will work fine. The fact that the smartreader in case of that kernel does not work with smartreader protocol does not affect the overall working off oscam, they just need to use the smartreader trough ftdio drivers with mouse protocol. (speed settings are not avbl in that case the reader needs to be set up with external tool then)

Re: Libusb support added to oscam-experimental #9 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 13 June 2012 - 21:40

I just discovered a small hickup with the installation trough application setup on box.

I added the utility list_smargo which is always compiled at standard on compiling oscam. it's not installed by default.

what I did is is intalling it trough extra install _append in oscam.inc like this :

do_install_append() {
  mv "${D}${bindir}/oscam" "${D}${bindir}/${PN}"
  cp "${OECMAKE_BUILDPATH}/utils/list_smargo" "${D}${bindir}/list_smargo" \  //the added install
}

Now when you have one ocam installed , all ok. If you install an extra oscam. It fails cause list_smargo is already present on box.

I had oscam-experimenal installed. And wanted to install oscam-unstable. That second faild on list_smargo already present. (note if i first deleted the list_smargo manually it did installed the oscam-unstable with again list-smargo utility )

Is there a way to change that extra install add so that it in case the file list_smargo is already present on box it will not fail the installation but just :

1) overwrite the existing one (by preference is better in case its updated)
or
2) just ignore and install the oscam whitout this file ?

Edited by christophecvr, 13 June 2012 - 21:41.


Re: Libusb support added to oscam-experimental #10 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 13 June 2012 - 22:33

don't the oscam binaries themselve conflict?
Perhaps just mark them RREPLACES_${PN} = "..." and RCONFLICTS_${PN} = "..."

Re: Libusb support added to oscam-experimental #11 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 13 June 2012 - 23:05

don't the oscam binaries themselve conflict?
Perhaps just mark them RREPLACES_${PN} = "..." and RCONFLICTS_${PN} = "..."


No the binary do not conflicts as they are different. oscam-experimental has oscam-experimental as binary
oscam-unstable has oscam-unstable as binary
oscam-stable has oscam-stable as binary.
Then for those who want to use the oscam-experimental-cs There is a conflict resolvement. You can not install oscam-experimental_cs togheter with oscam-experimetal as they use same binary.
But You can install oscam-stable-cs and oscam-experimental . different binary's. majorly that's for pesrons who uses two softcams one as cs only and one as softcam.

The problem here is that since I included the list-smargo into the installation of a oscam That does not change from name. It is well an almost unmissable utility on a box to determine Youre smartreader .
The same for each oscam version only the box type can make diff mips or ppc or ....

I now just made I trie and changed the extra install from

cp "${OECMAKE_BUILDPATH}/utils/list_smargo" "${D}${bindir}/list_smargo"

into

install -m 0755 ${OECMAKE_BUILDPATH}/utils/list_smargo ${D}${bindir}/list_smargo

The update seemed to work fine but install of extra oscam, i tried oscam-stable


gives as error

* check_data_file_clashes : Package oscam-stable wants to install file /us/bin/list_smargo But that file is already provided by package * oscam-experimental
* opkg_install_cmd: Cannot install package enigma2-plugin-softcams-oscam-stable
Voortang voltooid !

The question was is there a work arround that I can do in the .bb file to add a force override for this conflict issue later on
that will be in the ipk file

Re: Libusb support added to oscam-experimental #12 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 13 June 2012 - 23:48

The question was is there a work arround that I can do in the .bb file to add a force override for this conflict issue later on
that will be in the ipk file

no, force override is a hack not a solution ;)

Perhaps just split the tool in a different package, and make the various oscam packages RDEPEND_${PN} on it.

Re: Libusb support added to oscam-experimental #13 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 13 June 2012 - 23:59


The question was is there a work arround that I can do in the .bb file to add a force override for this conflict issue later on
that will be in the ipk file

no, force override is a hack not a solution ;)

Perhaps just split the tool in a different package, and make the various oscam packages RDEPEND_${PN} on it.


Yes hack is not a real solution. here its' whel a special case.

Now I will go to look a solution in the direction You mentionned above. Then with RDEPENS indeed it will be there as soon one of the oscam version's is installed.

thanks

Re: Libusb support added to oscam-experimental #14 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 15 June 2012 - 16:20

@pieterg

Hallo. I did changed the oscam again. Now the list_smargo is as a splitted package.

I added it as an extra .bb file named list-smargo.bb . This bb file will be build upon build off oscam-experimental.

It will be installed to the box (RDEPENDS) up on installation of any oscam . stable-unstable or experimental.

I needed to patch the CMakelist.txt file of this specific utils.

To check if it work's all fine, I did a rebuild from scratch. build the feeds.

reflashed the box.

And installed oscam trough application download addons.

It did went perfect, No opkg conflicts anymore. The three versions did installed and do run ok with smargo support.

list_smargo does work perfect as well :)

I'm having dreams about bitbake bb files cmake and .... eighter nightmares now :P

Included the patch file just made. An tested on af fresh pull.

Attached Files



Re: Libusb support added to oscam-experimental #15 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 15 June 2012 - 16:44

a few things:

RDEPENDS should always be for a specific package name (e.g. RDEPENDS_${PN})
You cannot set RDEPENDS for an entire recipe.

LIC_FILES_CHKSUM should point to something in the repository, not to a file provided by the metadata.
The point is to detect license changes.

you seem to have accidentally added CMakeLists.txt

Re: Libusb support added to oscam-experimental #16 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 15 June 2012 - 17:34

a few things:

RDEPENDS should always be for a specific package name (e.g. RDEPENDS_${PN})
You cannot set RDEPENDS for an entire recipe.

LIC_FILES_CHKSUM should point to something in the repository, not to a file provided by the metadata.
The point is to detect license changes.

you seem to have accidentally added CMakeLists.txt

RDEPENDS should always be for a specific package name (e.g. RDEPENDS_${PN})
You cannot set RDEPENDS for an entire recipe.


The RDEPENDS is like that to avoid opkg confilict and stick to the list-smargo as check. The check is on the ipk file if i'm not wrong and will take list-smargo_xxxxxx only list-margo . It's in this case not an entire recipe check.

LIC_FILES_CHKSUM should point to something in the repository, not to a file provided by the metadata.
The point is to detect license changes.


Yes the LIC check ... The only way to obain the module only was with svn://oscam.to/svn/oscam/trunk;module=utils;xxxx

There in are only two files CMakelist.txt and list_smargo.c

There is no COPY license file. To solve that I copied the oscam svn licence file and added it to list-smargo folder. Later on I check on that file . I know it's a bit off a hack, Other wise I do need to download again th whole svn and it will be compiled as well. That's a lot usseless proccesor time and a waist of space.

you seem to have accidentally added CMakeLists.txt

Yes that addition is an error oops .

Re: Libusb support added to oscam-experimental #17 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 15 June 2012 - 18:52

RDEPENDS should always be for a specific package name (e.g. RDEPENDS_${PN})
You cannot set RDEPENDS for an entire recipe.


The RDEPENDS is like that to avoid opkg confilict and stick to the list-smargo as check. The check is on the ipk file if i'm not wrong and will take list-smargo_xxxxxx only list-margo . It's in this case not an entire recipe check.


The check won't make it into the ipk file, because you did not specify a package name for which the RDEPENDS is to be used.
You should never use RDEPENDS (or any other R(untime) variable) without specifying the package name for which it should be used.

Re: Libusb support added to oscam-experimental #18 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 16 June 2012 - 00:49

It did worked , like i did,

Now I changed the RDEPENS tp RDEPENDS_${PN} , Removed the CMakelist .txt , nod needed md5 file.

To be shure it still work's , I'm now first building a fresh PLI and then will apply the patch before building the feeds.

Will take some time . If ok I will set the new patch.

Re: Libusb support added to oscam-experimental #19 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 16 June 2012 - 02:57

All changes are done .

I tested the patch on frech build. Builds' ok.
Reflashed box. Installation oscam all three went fine. No opkg conflicts anymore.
List smargo also installed up unstilation of oscam. :)

Here the git patch.

Attached Files



Re: Libusb support added to oscam-experimental #20 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 16 June 2012 - 14:05

@pieterg

Hello a saw you added to the openpli 3.0.

You did some very good changes

I did not think about the solution for the lic check very nice :) solution.
The way how to inherit the cmake much better .

But :
You changed the name from util smargo . But now there are coming build errors and opkg conflicts again.

With extra patch you removed the depends from individual cam's to the .inc That's a bad move as they may need to be treathed differently. Now it's not possible for user who build themself to add a change concerning those settings
depending on version. This was actually a very important setting. And will makes maintenace later on very easy.

I now for test again removed the full openpli and start a building for scratch to analize the new arized conflict.
Will take some time sorry ..


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users