Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#2470 closed enhancement (wontfix)

Argolis TripleReader Smargo not working

Reported by: bagaceroso Owned by:
Priority: minor Component: Reader
Severity: low Keywords: smargo triplereader
Cc: Sensitive: no

Description

Revision

6574

Issue Description

When using the new Argolis TripleReader Smargo, the list_smargo utility don't detect any smargo, on oscam the only way to get it working is using mouse protocol.

When the issue occurs

Always

How the issue is reproducable

Always.

Attachments (9)

oscam.patch.gz (1.9 KB ) - added by Schasanify 10 years ago.
Patch to support Argolis Triple using smartreader protocol
ifd_smartreader.c.diff (5.8 KB ) - added by Nimloth 9 years ago.
Patch ported to latest rev
tripplereader_http.diff (3.7 KB ) - added by Nimloth 9 years ago.
Http part changed according to patch posted here: http://www.streamboard.tv/wbb2/thread.php?postid=442434
oscam_p1.log (27.6 KB ) - added by Nimloth 9 years ago.
oscam_p3.log (28.9 KB ) - added by Nimloth 9 years ago.
oscam_http_ok.diff (16.1 KB ) - added by Nimloth 9 years ago.
patch_http.jpg (57.2 KB ) - added by Nimloth 9 years ago.
oscam_http_ok_v2.diff (16.5 KB ) - added by Nimloth 9 years ago.
This one is full and should be ok for all parts - devs pls verify
triplepatch.diff (14.6 KB ) - added by Admin 9 years ago.
I've got a better one (hope so, I can't test because I don't have such a device). It removes the device-endpoint config param. Instead you use "device" for it. Just use like before to get the normal Smartreader. Otherwise add either "Infinity;", "TripleP1;", "TripleP2;" or "TripleP3;" in front of your device config to get the params for those devices.

Download all attachments as: .zip

Change History (63)

comment:1 by Deas, 10 years ago

Priority: criticalminor
Severity: highlow
Type: defectenhancement

comment:2 by Bit, 10 years ago

Which hardware do you use?
If it's a Dreambox, you need a kernel patch. The latest version of newnigma2.to 3.3.2 includes this: (Info: ftdi patch for kernel 2.6.18 added. that patch enables triple/quad reader support.)

comment:3 by bagaceroso, 10 years ago

I'm using it on my computer with ubuntu 11.10 64 bits to test.

The smargo is detected, but oscam can't find it.

Looking at list_smargo source i've found that it looks for a deviceID 0x6001, the Triple Reader has 0x6011. Looking at the lsusb log the serial number apears to be the same to all 3 readers. I tried with on Windows, and looks that each reader get a serial, following this rule.

Reader1: SerialNumberA
Reader2: SerialNumberB
Reader3: SerialNumberC

Here are the log of lsusb.

Bus 001 Device 016: ID 0403:6011 Future Technology Devices International, Ltd FT4232H
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0403 Future Technology Devices International, Ltd
  idProduct          0x6011 FT4232H
  bcdDevice            5.00
  iManufacturer           1 Argolis
  iProduct                2 Triple Reader+
  iSerial                 3 00000226
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           78
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              150mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              2 Triple Reader+
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              2 Triple Reader+
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              2 Triple Reader+
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0003
  Self Powered
  Remote Wakeup Enabled

comment:4 by spock, 10 years ago

I got one of these new readers too, and it works more or less fine as mouse. Also selecting smargo protocol works on the first (A) reader, I think it was the card slot on the side of the unit. Not working on other slots though, and it was a bit unstable with smargo as protocol (couldn't reset card, eject, reinsert, etc failed).. Haven't had much time to play with it though.

I did write a mail to the manufacturer and they said they're going to release software (I guess they meant firmware and settings tool) to make it more compatible (smartreader+ mode) in the near future.. I wonder if there really is much that oscam devs can do about it?

comment:5 by Admin, 10 years ago

"smargo" mode is undocumented and has bugs. You should not use it.
"smartreader" mode checks the device id. Does it work with this mode if you change the line

if (desc.idVendor==0x0403 && desc.idProduct==0x6001) {

to

if (desc.idVendor==0x0403 && (desc.idProduct==0x6001 || desc.idProduct==0x6011)) {

in ifd_smartreader.c?

in reply to:  5 comment:6 by bagaceroso, 10 years ago

Replying to Admin:

"smargo" mode is undocumented and has bugs. You should not use it.
"smartreader" mode checks the device id. Does it work with this mode if you change the line

if (desc.idVendor==0x0403 && desc.idProduct==0x6001) {

to

if (desc.idVendor==0x0403 && (desc.idProduct==0x6001 || desc.idProduct==0x6011)) {

in ifd_smartreader.c?

I already tried it, but no sucess, the smargo still not detected.

Last edited 10 years ago by bagaceroso (previous) (diff)

comment:7 by spock, 10 years ago

I've now tried most things to get this reader working in "smartreader" mode, but it seems my somewhat mediocre programming skills just don't get me all the way there. In Linux I can only get one serial out of if to use for setting up oscam (this is when using the triple reader on a usb-modded dm500hd and a vuultimo), anyway it still doesn't work. No chance yet to try it on a real linux PC. Plugging the reader into a Windows PC shows all the three readers and serials for some reason.

Can't really put my finger on if this is a problem with Linux (or libusb), oscam or the triple reader itself..

Manufacturer still hasn't released any updates for using the reader in "smartreader" mode. As mouse it's all fine though, just wish it could be identified and used as if it were just three standard smargo smartreaders, but in one little device.

Last edited 10 years ago by spock (previous) (diff)

comment:8 by Schasanify, 10 years ago

Looking at the code:

Prerequisite is the given "desc.idProduct==0x6011"

With that your device_out_endpoint defaults to 0x82, which is not true for the triple reader.
Have you also tried to set set that to the real thing, which would be 0x81 for the first reader?

If that works you could be getting to add two more [reader] sections using endpoint ids of 0x83 and 0x85 respectively.

comment:9 by Schasanify, 10 years ago

And it still cant work, because there is no such thing as the device_in_endpoint to configure, this is hardcoded to 0x1, whereas it should be 0x2, 0x4 and 0x6.
So I guess one could get it to work for a checkout by replacing 0x1 hard codes to 0x2 hard codes.
This only as a proof of concept, in the long run this has to become a configurable parameter.
I shall perform a POC whether this device can get to work with this quick hack to decide about a new parameter.

Last edited 10 years ago by Schasanify (previous) (diff)

comment:10 by Schasanify, 10 years ago

I have patched it to do something, BUT: It is not yet working. There seems to be some more to be done in the smartreader protocol.
Also other slots apart from 0 seem to be unavailable, to be looked at.

If you try it, dont forget to put your reader serial AND the endpoint into oscam.server

Device = Serial:00000123
device_out_endpoint = 0x81

2012/06/21 18:06:44 DA0688 r Using 0x81/0x02 as endpoint for smartreader hardware detection
2012/06/21 18:06:44 DA0688 r Found reader with serial 00000123 at 001:015
2012/06/21 18:06:44 DA0688 r Found smartreader device Serial:00000123
2012/06/21 18:06:44 DA0688 r reader mtv initialized (device=Serial:00000123, detect=cd, mhz=600, cardmhz=600)
2012/06/21 18:06:45 DA0688 r mtv card detected
2012/06/21 18:06:47 DA0688 r ATR: 3B 24 00 30 42 30 30
2012/06/21 18:06:47 DA0688 r Reader mtv: Maximum frequency for this card is formally 5 Mhz, clocking it to 6.00 Mhz
2012/06/21 18:06:48 DA0688 r card system not supported
2012/06/21 18:06:48 DA0688 r Normal mode failed, reverting to Deprecated Mode
2012/06/21 18:06:50 DA0688 r ATR: 3B 24 00 30 42 30 30
2012/06/21 18:06:50 DA0688 r Reader mtv: Maximum frequency for this card is formally 5 Mhz, clocking it to 6.00 Mhz
2012/06/21 18:06:51 DA0688 r type: Conax, caid: 0B00, serial: xxxxxxxx, hex serial: xxxxxxxx, card: v64
2012/06/21 18:06:51 DA0688 r Providers: 1
2012/06/21 18:06:51 DA0688 r Provider: 1 Provider-Id: 000000
2012/06/21 18:06:51 DA0688 r Provider: 1 SharedAddress: 0
2012/06/21 18:06:51 DA0688 r found cardsystem conax
2012/06/21 18:06:51 DA0688 r Package: 1, id: 1010, classes: 01FFFFFF, date: 1990/01/01 - 1990/01/01, name: Technisat
2012/06/21 18:06:51 DA0688 r Package: 2, id: 1010, classes: 01FFFFFF, date: 1990/01/01 - 1990/01/01, name: Technisat
2012/06/21 18:06:51 DA0688 r Package: 3, id: 2010, classes: 0100FFFF, date: 1990/01/01 - 1990/01/01, name: Preview 1
2012/06/21 18:06:51 DA0688 r Package: 4, id: 2010, classes: 0100FFFF, date: 1990/01/01 - 1990/01/01, name: Preview 1
2012/06/21 18:06:51 DA0688 r Package: 5, id: 2011, classes: 0100FFFF, date: 1990/01/01 - 1990/01/01, name: Preview 2
2012/06/21 18:06:51 DA0688 r Package: 6, id: 2011, classes: 0100FFFF, date: 1990/01/01 - 1990/01/01, name: Preview 2
2012/06/21 18:06:52 DA0688 r [conax-reader] ready for requests
2012/06/21 18:06:52 0 s init for all local cards done
2012/06/21 18:06:52 DA0688 r card ejected

by Schasanify, 10 years ago

Attachment: oscam.patch.gz added

Patch to support Argolis Triple using smartreader protocol

comment:11 by aikonautik, 10 years ago

thanks for patch, port0 works for me

[reader]
label = smartreader-00
protocol = smartreader
device = Serial:000000XX
device_out_endpoint = 0x81
caid = 0D0F
detect = none
mhz = 600
cardmhz = 600
group = 1
deprecated = 1

2012/06/29 11:16:53 A0F1278 h restarting reader smartreader-00
2012/06/29 11:16:53 A0F1278 h creating thread for device Serial:000000XX
2012/06/29 11:16:53 A10A988 r Using 0x81/0x02 as endpoint for smartreader hardware detection
2012/06/29 11:16:53 A10A988 r Found reader with serial 000000XX at 001:002
2012/06/29 11:16:53 A10A988 r Found smartreader device Serial:000000XX
2012/06/29 11:16:53 A10A988 r reader smartreader-00 initialized (device=Serial:000000XX, detect=none, mhz=600, cardmhz=600)
2012/06/29 11:16:54 A10A988 r smartreader-00 [smartreader] smartreader-00 card detected
2012/06/29 11:16:55 A10A988 r smartreader-00 [smartreader] ATR: 3B 78 12 00 00 A0 C4 06 07 XX XX XX XX
2012/06/29 11:16:56 A10A988 r Reader smartreader-00: Maximum frequency for this card is formally 5 Mhz, clocking it to 6.00 Mhz
2012/06/29 11:16:57 A10A988 r smartreader-00 [smartreader] card detected
2012/06/29 11:16:57 A10A988 r smartreader-00 [smartreader] type: CryptoWorks
2012/06/29 11:16:57 A10A988 r smartreader-00 [smartreader] type: CryptoWorks, caid: 0D0F, ascii serial: XXXXXXXXXXXX, hex serial: XXXXXXXXXX
2012/06/29 11:16:58 A10A988 r smartreader-00 [smartreader] issuer: GITAL, id: 04, bios: v6, pin: unknown, mfid: 3F64
2012/06/29 11:16:58 A10A988 r smartreader-00 [smartreader] providers: 4 (04,08,0C,10)
2012/06/29 11:16:58 A10A988 r smartreader-00 [smartreader] found cardsystem cryptoworks
2012/06/29 11:16:58 A10A988 r smartreader-00 [cryptoworks] provider: 1, id: 04, name: Public TV
2012/06/29 11:16:58 A10A988 r smartreader-00 [cryptoworks] chid: 0009, date: 2010/03/23 - 2010/04/22, name: Ceska televize
2012/06/29 11:16:58 A10A988 r smartreader-00 [cryptoworks] chid: 0011, date: 2010/03/23 - 2010/04/22, name: Prima
2012/06/29 11:16:58 A10A988 r smartreader-00 [cryptoworks] chid: 0015, date: 2010/03/23 - 2010/04/22, name: Nova
2012/06/29 11:16:58 A10A988 r smartreader-00 [cryptoworks] chid: 0022, date: 2010/03/23 - 2010/04/22, name: STV1
2012/06/29 11:16:58 A10A988 r smartreader-00 [cryptoworks] chid: 0023, date: 2010/03/23 - 2010/04/22, name: STV2
2012/06/29 11:16:58 A10A988 r smartreader-00 [cryptoworks] chid: 0035, date: 2010/03/23 - 2010/04/22, name: STV3
2012/06/29 11:16:58 A10A988 r smartreader-00 [cryptoworks] chid: 0026, date: 2010/03/23 - 2010/04/22, name: Nova Cinema
2012/06/29 11:16:58 A10A988 r smartreader-00 [cryptoworks] chid: 0036, date: 2010/03/23 - 2010/04/22, name: Markiza
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0040, date: 2010/03/23 - 2010/04/22, name: Barrandov
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0041, date: 2010/03/23 - 2010/04/22, name: Nova HD
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0040, date: 2012/01/07 - 2012/08/06, name: Barrandov
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0036, date: 2012/02/01 - 2012/08/31, name: Markiza
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0022, date: 2012/05/01 - 2012/12/01, name: STV1
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0015, date: 2012/02/01 - 2012/08/31, name: Nova
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0026, date: 2012/06/01 - 2012/12/31, name: Nova Cinema
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0011, date: 2012/01/01 - 2012/07/31, name: Prima
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0023, date: 2012/05/01 - 2012/12/01, name: STV2
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0035, date: 2012/02/01 - 2012/08/31, name: STV3
2012/06/29 11:16:59 A10A988 r smartreader-00 [cryptoworks] chid: 0041, date: 2012/06/15 - 2013/01/14, name: Nova HD
2012/06/29 11:17:00 A10A988 r smartreader-00 [cryptoworks] chid: 0009, date: 2012/05/01 - 2012/12/01, name: Ceska televize
2012/06/29 11:17:00 A10A988 r smartreader-00 [cryptoworks] chid: 0067, date: 2011/03/01 - 2011/03/31, name: Prima HD
2012/06/29 11:17:00 A10A988 r smartreader-00 [cryptoworks] chid: 0067, date: 2012/03/01 - 2012/10/01, name: Prima HD
2012/06/29 11:17:00 A10A988 r smartreader-00 [cryptoworks] provider: 2, id: 08, name: Pay TV
2012/06/29 11:17:00 A10A988 r smartreader-00 [cryptoworks] chid: 0032, date: 2010/03/23 - 2010/04/05, name: DoQ
2012/06/29 11:17:00 A10A988 r smartreader-00 [cryptoworks] chid: 0034, date: 2010/03/23 - 2010/04/05, name: Eurosport
2012/06/29 11:17:00 A10A988 r smartreader-00 [cryptoworks] chid: 0038, date: 2010/03/23 - 2010/04/05, name: Sport 1
2012/06/29 11:17:00 A10A988 r smartreader-00 [cryptoworks] chid: 0033, date: 2010/03/23 - 2010/04/05, name: Film+
2012/06/29 11:17:00 A10A988 r smartreader-00 [cryptoworks] chid: 0039, date: 2010/03/23 - 2010/04/05, name: F&H
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0045, date: 2010/03/23 - 2010/04/05, name: Minimax
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0044, date: 2010/03/23 - 2010/04/05, name: Disney Channel
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0046, date: 2010/03/23 - 2010/04/05, name: AXN
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0047, date: 2010/03/23 - 2010/04/05, name: AXN Sci-Fi
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0048, date: 2010/03/23 - 2010/04/05, name: AXN Crime
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0049, date: 2010/03/23 - 2010/04/05, name: Sport 2
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0051, date: 2010/03/23 - 2010/04/05, name: Nat Geo Wild
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0050, date: 2010/03/23 - 2010/04/05, name: Nat Geo
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0052, date: 2010/03/23 - 2010/04/05, name: HBO 2
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0053, date: 2010/03/23 - 2010/04/05, name: Cinemax
2012/06/29 11:17:01 A10A988 r smartreader-00 [cryptoworks] chid: 0054, date: 2010/03/23 - 2010/04/05, name: MTV
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0010, date: 2010/03/23 - 2010/04/05, name: CS Film
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0012, date: 2010/03/23 - 2010/04/05, name: Galaxie sport
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0013, date: 2010/03/23 - 2010/04/05, name: HBO
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0016, date: 2010/03/23 - 2010/04/05, name: XXX Xtreme
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0018, date: 2010/03/23 - 2010/04/05, name: FILMBOX
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0019, date: 2010/03/23 - 2010/04/05, name: NONSTOPKINO
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0025, date: 2010/03/23 - 2010/04/05, name: Spektrum
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0027, date: 2010/03/23 - 2010/04/05, name: CS Film detem
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0031, date: 2010/03/23 - 2010/04/05, name: Sport 5
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0030, date: 2010/03/23 - 2010/04/05, name: LEO TV
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0010, date: 2012/06/01 - 2012/07/07, name: CS Film
2012/06/29 11:17:02 A10A988 r smartreader-00 [cryptoworks] chid: 0025, date: 2012/06/01 - 2012/07/07, name: Spektrum
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0033, date: 2012/06/01 - 2012/07/07, name: Film+
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0049, date: 2012/06/01 - 2012/07/07, name: Sport 2
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0045, date: 2012/06/01 - 2012/07/07, name: Minimax
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0053, date: 2012/06/01 - 2012/07/07, name: Cinemax
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0013, date: 2012/06/01 - 2012/07/07, name: HBO
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0044, date: 2012/06/01 - 2012/07/07, name: Disney Channel
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0052, date: 2012/06/01 - 2012/07/07, name: HBO 2
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0032, date: 2012/06/01 - 2012/07/07, name: DoQ
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0048, date: 2012/06/01 - 2012/07/07, name: AXN Crime
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0056, date: 2010/06/18 - 2010/07/01, name: Retro Music
2012/06/29 11:17:03 A10A988 r smartreader-00 [cryptoworks] chid: 0034, date: 2012/06/01 - 2012/07/07, name: Eurosport
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0050, date: 2012/06/01 - 2012/07/07, name: Nat Geo
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0030, date: 2012/06/01 - 2012/07/07, name: LEO TV
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0046, date: 2012/06/01 - 2012/07/07, name: AXN
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0038, date: 2012/06/01 - 2012/07/07, name: Sport 1
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0054, date: 2012/06/01 - 2012/07/07, name: MTV
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0057, date: 2010/06/18 - 2010/07/01, name: Hallmark
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0047, date: 2012/06/01 - 2012/07/07, name: AXN Sci-Fi
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0012, date: 2012/06/01 - 2012/07/07, name: Galaxie sport
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0027, date: 2012/06/01 - 2012/07/07, name: CS Film detem
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0051, date: 2012/06/01 - 2012/07/07, name: Nat Geo Wild
2012/06/29 11:17:04 A10A988 r smartreader-00 [cryptoworks] chid: 0031, date: 2012/06/01 - 2012/07/07, name: Sport 5
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] chid: 0039, date: 2012/06/09 - 2012/07/15, name: F&H
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] chid: 0016, date: 2012/06/09 - 2012/07/15, name: XXX Xtreme
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] chid: 0056, date: 2012/06/01 - 2012/07/07, name: Retro Music
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] chid: 0057, date: 2012/06/01 - 2012/07/07, name: Hallmark
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] chid: 0058, date: 2010/11/04 - 2010/11/17, name: Eurosport 2
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] chid: 0058, date: 2012/06/01 - 2012/07/07, name: Eurosport 2
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] chid: 0062, date: 2012/06/01 - 2012/07/05, name: promo payTV
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] chid: 0059, date: 2011/06/25 - 2011/07/08, name: Brava HD
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] chid: 0069, date: 2011/06/25 - 2011/07/08, name: Hustler Night
2012/06/29 11:17:05 A10A988 r smartreader-00 [cryptoworks] provider: 3, id: 0C, name: Keyset 3
2012/06/29 11:17:06 A10A988 r smartreader-00 [cryptoworks] provider: 4, id: 10, name: Keyset 4
2012/06/29 11:17:06 A10A988 r smartreader-00 [cryptoworks] ready for requests
2012/06/29 11:24:01 B7202AE8 c xxxxxxx (0D0F&000004/0000/13EF/7C:5745): found (219 ms) by smartreader-00
2012/06/29 11:24:03 B7202AE8 c xxxxxxx (0D0F&000004/0000/13EF/7C:DCC8): found (219 ms) by smartreader-00
2012/06/29 11:24:13 B7202AE8 c xxxxxxx (0D0F&000004/0000/13EF/7C:0D73): found (219 ms) by smartreader-00

comment:12 by rwxr, 9 years ago

Can anyone tell how to install the patch? thank you

comment:14 by rwxr, 9 years ago

root@mega:~/oscam-svn# patch -p1 < oscam.patch
patching file csctapi/ifd_smartreader.c
Reversed (or previously applied) patch detected! Assume -R? [n] y
Hunk #1 succeeded at 66 (offset 4 lines).
Hunk #2 succeeded at 95 with fuzz 1 (offset 4 lines).
Hunk #3 FAILED at 128.
Hunk #4 FAILED at 164.
Hunk #5 succeeded at 606 (offset -19 lines).
Hunk #6 succeeded at 633 (offset -19 lines).
Hunk #7 FAILED at 662.
Hunk #8 succeeded at 666 with fuzz 1 (offset -19 lines).
Hunk #9 FAILED at 712.
Hunk #10 FAILED at 720.
Hunk #11 succeeded at 721 (offset -19 lines).
Hunk #12 succeeded at 737 (offset -19 lines).
5 out of 12 hunks FAILED -- saving rejects to file csctapi/ifd_smartreader.c.rej

comment:15 by gf, 9 years ago

The patch is against r6574 (probably), we we more than 1200 revisions later it is normal that the patch doesn't apply.

comment:16 by rwxr, 9 years ago

ok, with rev 6574..

root@mega:~/oscam-svn# patch -p1 < oscam.patch
patching file csctapi/ifd_smartreader.c
Hunk #1 succeeded at 61 (offset -1 lines).
Hunk #2 succeeded at 90 (offset -1 lines).
Hunk #3 succeeded at 127 (offset -1 lines).
Hunk #4 succeeded at 163 (offset -1 lines).
Hunk #5 succeeded at 626 with fuzz 2 (offset 1 line).
Hunk #6 succeeded at 653 (offset 1 line).
Hunk #7 succeeded at 663 (offset 1 line).
Hunk #8 FAILED at 685.
Hunk #9 succeeded at 713 with fuzz 1 (offset 1 line).
Hunk #10 succeeded at 721 (offset 1 line).
Hunk #11 succeeded at 741 (offset 1 line).
Hunk #12 succeeded at 757 (offset 1 line).
1 out of 12 hunks FAILED -- saving rejects to file csctapi/ifd_smartreader.c.rej
root@mega:~/oscam-svn# patch -p0 < oscam.patch

oscam log:

2012/10/16 17:54:08 B73117D0 r Using 0x81/0x02 as endpoint for smartreader hardware detection
2012/10/16 17:54:08 B73117D0 r Smartreader device Serial:00000410 not found
2012/10/16 17:54:08 B73117D0 r Cannot open device: Serial:00000410

root@mega:/usr/local/bin# lsusb -d 403:6011 -v | grep iSerial

iSerial 3 00000410

root@mega:/usr/local/bin#

Last edited 9 years ago by rwxr (previous) (diff)

comment:17 by gf, 9 years ago

So this means that the patch does not work?

comment:18 by rwxr, 9 years ago

Does not work for me.

Just get something with:

protocol = mouse
device = /dev/ttyUSB0

But there is this problem I can not solve.

2012/10/16 16:31:08 B700DBA0 r card [mouse] Reader initialized (device=/dev/ttyUSB0, detect=cd, mhz=600, cardmhz=600)
2012/10/16 16:31:08 B700DBA0 r card [mouse] card detected
2012/10/16 16:31:16 B700DBA0 r card [mouse] ATR: 3F FF 95 00 FF 91 81 71 FE 47 00 44 4E 41 53 50 31 34 32 20 52 65 76 47 30 34 10
2012/10/16 16:31:17 B700DBA0 r card [mouse] Maximum frequency for this card is formally 5 Mhz, clocking it to 6.00 Mhz
2012/10/16 16:31:18 B700DBA0 r card [mouse] Warning: Card returned error on setting ifsd value to 251
2012/10/16 16:31:19 B700DBA0 r card [mouse] detect native nagra card
2012/10/16 16:31:21 B700DBA0 r card [mouse] T1 Resync command error, trying to reactivate!

Last edited 9 years ago by rwxr (previous) (diff)

comment:19 by zywo, 9 years ago

Looking at the date inside the patch, I applied the patch to r7067 (21/06/2012) without errors:

xxxxx@xxxxxx:~/Bureau/7067$ patch -p0 < oscam.patch
patching file csctapi/ifd_smartreader.c
xxxxx@xxxxxx:~/Bureau/7067$

comment:20 by rwxr, 9 years ago

Thanks zywo..

but I have another problem...

2012/10/17 11:20:32 90D6378 r Found reader with serial 00000410 at 001:002
2012/10/17 11:20:32 90D6378 r Found smartreader device Serial:00000410
2012/10/17 11:20:32 90D6378 r reader card initialized (device=Serial:00000410, detect=cd, mhz=368, cardmhz=357)
2012/10/17 11:20:33 90D6378 r card card detected
2012/10/17 11:20:36 90D6378 r ATR: 3F FF 95 00 FF 91 81 71 FE 47 00 44 4E 41 53 50 31 34 32 20 52 65 76 47 30 34 10
2012/10/17 11:20:36 90D6378 r Reader card: Maximum frequency for this card is formally 5 Mhz, clocking it to 3.69 Mhz
2012/10/17 11:20:38 90D6378 r detect native nagra card
2012/10/17 11:20:46 90D6378 r card system not supported
2012/10/17 11:20:46 90D6378 r card initializing error

I've tried with other values ​​in mhz and cardmhz but it's the same

Last edited 9 years ago by rwxr (previous) (diff)

comment:21 by rwxr, 9 years ago

someone help me?

comment:22 by aztek, 9 years ago

Why the patch isn't merged on the trunk? There is development for this patch?
I have tried the reader with videoguard2 card and ecm are very delayed with smargo protocol and mouse protocol can't read the atr correctly.

comment:23 by Nimloth, 9 years ago

Can devs apply this patch to latest trunk (after modyfying it to latest rev)?
It won't break old smargo ... and enable further changes for tripplereader

by Nimloth, 9 years ago

Attachment: ifd_smartreader.c.diff added

Patch ported to latest rev

comment:24 by Admin, 9 years ago

Committed that in r8007.

by Nimloth, 9 years ago

Attachment: tripplereader_http.diff added

Http part changed according to patch posted here: http://www.streamboard.tv/wbb2/thread.php?postid=442434

comment:26 by Nimloth, 9 years ago

What kind of logs devs needs to try to solve issue with tripple reader?
As it was said in smartreader mode only 1st reader works and like after 10% of restarts.

When we try to start with other reader (P2 or P3) it fails because /dev/ttyUSB1 or /dev/ttyUSB2 is not disconnected (here we try to start using P3)
[ 3784.616656] usb 2-1: usbfs: process 13789 (oscam-1.20-unst) did not claim interface 2 before use

What is also wrong that when we try to start P3 in smartreader mode (/dev/ttyUSB2) /dev/ttyUSB0 is disconnected:
root@ubuntu:/media/oscam-svn/Distribution# ls -la /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 1 Jan 1 16:08 /dev/ttyUSB1
crw-rw---- 1 root dialout 188, 2 Jan 1 16:08 /dev/ttyUSB2

Just to summarize:
1) When we start P1 /dev/ttyUSB0 should be removed (and it works currently correct)
2) When we start P2 /dev/ttyUSB1 should be removed (don't work as /dev/ttyUSB0 is removed)
1) When we start P3 /dev/ttyUSB2 should be removed (don't work as /dev/ttyUSB0 is removed)

I'm ready to make some more tests if needed.

Cheers

Last edited 9 years ago by Nimloth (previous) (diff)

comment:27 by Admin, 9 years ago

Please try to change the following line in ifd_smartreader.c:

reader->sr_config->interface = INTERFACE_ANY;

to

reader->sr_config->interface = 1;

or

reader->sr_config->interface = 2;

I think that this could lead to port 2 or 3 working (but port 1 will have the same issue; it's just for testing so far)...if it works we should probably think again about config for this. Perhaps it's really better to set the supported few devices (Infinity USB, Argolis Smartreader and Triplereader) in the config instead of all those parameters that are necessary to get it running...

comment:28 by Nimloth, 9 years ago

Changed to 1 and now it disconnects ttyUSB1 when I try 2nd reader:
[ 454.031608] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[ 454.035851] ftdi_sio 2-1:1.1: device disconnected

root@ubuntu:/media/oscam-svn/Distribution# ls -la /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Jan 1 18:27 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 2 Jan 1 18:27 /dev/ttyUSB2

It's more missing as oscam don't even read ATR ... but we are on good track:
2013/01/01 18:35:45 8FB22E0 r mysmartreader [smartreader] Using 0x83/0x04 as endpoint for smartreader hardware detection
2013/01/01 18:35:45 8FB22E0 r Found reader with serial 000003b8 at 002:002
2013/01/01 18:35:45 8FB22E0 r Found smartreader device Serial:000003b8
2013/01/01 18:35:45 8FB22E0 r mysmartreader [smartreader] Reader initialized (device=Serial:000003b8, detect=cd, mhz=369, cardmhz=368)
2013/01/01 18:35:46 8FB22E0 r mysmartreader [smartreader] card detected
2013/01/01 18:35:51 8FB22E0 r mysmartreader [smartreader] Error activating card.
2013/01/01 18:36:04 0 --- Skipped 2 duplicated log lines ---
2013/01/01 18:36:04 8FB22E0 r mysmartreader [smartreader] card initializing error
2013/01/01 18:36:04 0 s init for all local cards done
2013/01/01 18:36:04 0 s anti cascading log initialized

What else in ifd_smartreader.c U think should be changed to force 2nd or 3rd reader except:

reader->sr_config->interface = x

which is correct change

?

comment:29 by Admin, 9 years ago

Is this already a debug log? Slot1 works (without the change of the interface) and initializes the ATR?

comment:30 by Nimloth, 9 years ago

Debug logs will be attached below - from P1 (/dev/ttyUSB0) where ATR read works and from P3 (/dev/ttyUSB2) where there is no ATR read

by Nimloth, 9 years ago

Attachment: oscam_p1.log added

by Nimloth, 9 years ago

Attachment: oscam_p3.log added

comment:31 by theparasol, 9 years ago

Are you using the readerslots at the same time?
Can you test if readerslot 3 works if its the only one in use on the triplereader?
Thinking: there is only 1 interface to oscam, if slot 1 is running and slot 3 is firing up it tries to set baudrate and all other interface things. I can imagine thats going wrong since the individual readers dont know something else is already communicating

comment:32 by Nimloth, 9 years ago

No only one reader was used during tests with same card (old Seca).
Also it's not possible to use few slots at same time ... due to bug in oscam ... Admin already found where was the problem.

Last edited 9 years ago by Nimloth (previous) (diff)

comment:33 by Admin, 9 years ago

Maybe you could also change

reader->sr_config->index = INTERFACE_A;

to something of the value INTERFACE_B, INTERFACE_C or INTERFACE_D to get these other ports working. That's all what could be specific here as far as I can see...

comment:34 by Nimloth, 9 years ago

I'll check it later ... but in ifd_smartreader_types.h we have:

enum smartreader_interface
{
    INTERFACE_ANY = 0,
    INTERFACE_A   = 1,
    INTERFACE_B   = 2,
    INTERFACE_C   = 3,
    INTERFACE_D   = 4
};

so it can be solution ...

comment:35 by Nimloth, 9 years ago

Admin still at work and will test in few hours ... but there is mismatch (or I think it is) in code regarding entries.

Current:
OUT - Endpoint:
0x82 - Smargo Smartreader Plus
0x81 - Smargo Triple Port 1/Infinity USB Smart
0x83 - Smargo Triple Port 2
0x85 - Smargo Triple Port 3

Should be:
IN - Endpoint:
0x82 - Smargo Smartreader Plus
0x81 - Smargo Triple Port 1/Infinity USB Smart
0x83 - Smargo Triple Port 2
0x85 - Smargo Triple Port 3

Example:
1) From Tripple reader:

      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0

2) From Infinity:

          ===>Endpoint Descriptor<===
bLength:                           0x07
bDescriptorType:                   0x05
bEndpointAddress:                  0x81  -> Direction: IN - EndpointID: 1
bmAttributes:                      0x02  -> Bulk Transfer Type
wMaxPacketSize:                  0x0040 = 0x40 bytes
bInterval:                         0x00

          ===>Endpoint Descriptor<===
bLength:                           0x07
bDescriptorType:                   0x05
bEndpointAddress:                  0x01  -> Direction: OUT - EndpointID: 1
bmAttributes:                      0x02  -> Bulk Transfer Type
wMaxPacketSize:                  0x0040 = 0x40 bytes
bInterval:                         0x00

Maybe this should be changes also to correct (replace in <-> out in code) ?

Cheers

comment:36 by Nimloth, 9 years ago

Good news - ATR is read on every reader when we do changes bellow

Reader P1:

    reader->sr_config->interface = INTERFACE_ANY;
    reader->sr_config->index = INTERFACE_A;

        case TYPE_4232H:
            if (!reader->sr_config->index)
                reader->sr_config->index = INTERFACE_A;
            break;

Reader P2:

    reader->sr_config->interface = INTERFACE_ANY + 1;
    reader->sr_config->index = INTERFACE_A + 1;

        case TYPE_4232H:
            if (!reader->sr_config->index)
                reader->sr_config->index = INTERFACE_A + 1;
            break;

Reader P3:

    reader->sr_config->interface = INTERFACE_ANY + 2;
    reader->sr_config->index = INTERFACE_A + 2;

        case TYPE_4232H:
            if (!reader->sr_config->index)
                reader->sr_config->index = INTERFACE_A + 2;
            break;

I'm not dev but I tried to make patch that will do this automatically ... I'll attach it ... web interface is ok and good settings are written to oscam.server ... but endpoints are not taken from config ... :/ maybe you want to use it and fix

by Nimloth, 9 years ago

Attachment: oscam_http_ok.diff added

by Nimloth, 9 years ago

Attachment: patch_http.jpg added

by Nimloth, 9 years ago

Attachment: oscam_http_ok_v2.diff added

This one is full and should be ok for all parts - devs pls verify

by Admin, 9 years ago

Attachment: triplepatch.diff added

I've got a better one (hope so, I can't test because I don't have such a device). It removes the device-endpoint config param. Instead you use "device" for it. Just use like before to get the normal Smartreader. Otherwise add either "Infinity;", "TripleP1;", "TripleP2;" or "TripleP3;" in front of your device config to get the params for those devices.

comment:37 by Nimloth, 9 years ago

How can I use 'device' for it as device config is already used for choosing correct smartreader:
device = Serial:000003b8
or I don't get what you mean :)

comment:38 by Deas, 9 years ago

device = TripleP1;Serial:000003b8

comment:39 by Nimloth, 9 years ago

Something is missing - correct endpoing is set and correct ttyUSB is disconnected.

2013/01/02 19:36:15 907B418 r mysmartreader [smartreader] Using 0x06/0x85 as endpoint for smartreader hardware detection
2013/01/02 19:36:15 907CCE8 h HTTP Server listening on port 80
2013/01/02 19:36:15 907B418 r Found reader with serial 000003b8 at 002:002
2013/01/02 19:36:15 907B418 r Found smartreader device Serial:000003b8
2013/01/02 19:36:15 907B418 r mysmartreader [smartreader] Reader initialized (device=TripleP3;Serial:000003b8, detect=cd, mhz=369, cardmhz=369)
2013/01/02 19:36:16 907B418 r mysmartreader [smartreader] card detected
2013/01/02 19:36:26 907B418 r mysmartreader [smartreader] usb bulk write failed : ret = -7

With my patch:

2013/01/02 19:40:18 B7200468 h mysmartreader [smartreader] creating thread for device Serial:000003b8
2013/01/02 19:40:18 B7401900 r mysmartreader [smartreader] Using 0x85/0x06 as endpoint for smartreader hardware detection
2013/01/02 19:40:18 B7401900 r Found reader with serial 000003b8 at 002:002
2013/01/02 19:40:18 B7401900 r Found smartreader device Serial:000003b8
2013/01/02 19:40:18 B7401900 r mysmartreader [smartreader] Reader initialized (device=Serial:000003b8, detect=cd, mhz=369, cardmhz=369)
2013/01/02 19:40:18 B7401900 r mysmartreader [smartreader] card detected
2013/01/02 19:40:19 B7401900 r mysmartreader [smartreader] ATR: 3B F7 11 00 01 40 96 70 70 07 0E 6C B6 D6
2013/01/02 19:40:19 B7401900 r mysmartreader [smartreader] Init card protocol T0, FI=1, F=372, D=1, N=1
2013/01/02 19:40:19 B7401900 r mysmartreader [smartreader] Setting baudrate to 9919 bps
2013/01/02 19:40:19 B7401900 r mysmartreader [smartreader] Calculated work ETU is 100.81 us
2013/01/02 19:40:20 B7401900 r mysmartreader [smartreader] ATR Fsmax is: 5 Mhz, clocking card to wanted user cardspeed of 3.69 Mhz (specified in reader->mhz)
2013/01/02 19:40:21 B7401900 r mysmartreader [smartreader] card system not supported
2013/01/02 19:40:21 B7401900 r mysmartreader [smartreader] Normal mode failed, reverting to Deprecated Mode
2013/01/02 19:40:22 B7401900 r mysmartreader [smartreader] ATR: 3B F7 11 00 01 40 96 70 70 07 0E 6C B6 D6
2013/01/02 19:40:22 B7401900 r mysmartreader [smartreader] Init card protocol T0, FI=1, F=372, D=1, N=1
2013/01/02 19:40:22 B7401900 r mysmartreader [smartreader] Calculated work ETU is 100.81 us
2013/01/02 19:40:23 B7401900 r mysmartreader [smartreader] ATR Fsmax is: 5 Mhz, clocking card to wanted user cardspeed of 3.69 Mhz (specified in reader->mhz)
2013/01/02 19:40:26 B7401900 r mysmartreader [smartreader] card system not supported
2013/01/02 19:40:26 B7401900 r mysmartreader [smartreader] card initializing error


Last edited 9 years ago by Nimloth (previous) (diff)

comment:40 by Admin, 9 years ago

Probably i mixed up in_ep and out_ep in smart_write function in line 152?

comment:41 by Nimloth, 9 years ago

Yep that was the case - you can put it in trunk for further testing.
Of course we don't have yet 100% working readers ... but at least 3 of them are initialized using smartreader mode.

Another issue is segfault - when you stop reader and start it again ... already posted log at forum:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d7db40 (LWP 13241)]
0xb7fa7cb7 in pthread_mutex_lock () from /lib/i386-linux-gnu/libpthread.so.0
(gdb) bt
#0 0xb7fa7cb7 in pthread_mutex_lock () from /lib/i386-linux-gnu/libpthread.so.0
#1 0xb7fbc205 in libusb_release_interface () from /lib/i386-linux-gnu/libusb-1.0.so.0
#2 0x080657aa in SR_Close (reader=0x81d5dd0) at csctapi/ifd_smartreader.c:1381
#3 0x0805b9c1 in ICC_Async_Close (reader=0x81d5dd0) at csctapi/icc_async.c:264
#4 0x080e4f62 in cleanup_thread (var=0x81da2e0) at oscam.c:645
#5 0x080ebadf in work_thread (ptr=0xb7a02a60) at oscam.c:3156
#6 0xb7fa5d4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#7 0xb7ee2d3e in clone () from /lib/i386-linux-gnu/libc.so.6

When you start reader in smartreader mode it disconnects /dev/ttyUSB*.
When we stop reader shouldn't oscam release it (reatach /dev/ttyUSB*) ?

Last edited 9 years ago by Nimloth (previous) (diff)

comment:42 by Admin, 9 years ago

Well it seems to segfault at exactly the point where it tries to release it (libusb_release_interface). However, it segfaults in libusb library which is quite weird. Does this happen on all ports?

comment:43 by Nimloth, 9 years ago

This segfault is before patch ... let me generate new one ... sec will edit in min

EDIT:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d7db40 (LWP 6767)]
0xb7fa7cb7 in pthread_mutex_lock () from /lib/i386-linux-gnu/libpthread.so.0
(gdb) bt
#0  0xb7fa7cb7 in pthread_mutex_lock () from /lib/i386-linux-gnu/libpthread.so.0
#1  0xb7fbc205 in libusb_release_interface () from /lib/i386-linux-gnu/libusb-1.0.so.0
#2  0x0806576a in SR_Close (reader=0x81d6de8) at csctapi/ifd_smartreader.c:1372
#3  0x0805ba01 in ICC_Async_Close (reader=0x81d6de8) at csctapi/icc_async.c:264
#4  0x080e6402 in cleanup_thread (var=0xb7c015d8) at oscam.c:645
#5  0x080ecfff in work_thread (ptr=0xb7a022d8) at oscam.c:3156
#6  0xb7fa5d4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#7  0xb7ee2d3e in clone () from /lib/i386-linux-gnu/libc.so.6

Also there is other problem ... when we start reader for 1st time (P1, P2 or P3) it doesn't init ... it works (ATR read) after restart (oscam as restart reader gives segfault)

And another one:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d36b40 (LWP 6908)]
0x080654c9 in smartreader_set_baudrate (reader=0x81d6fb8, baudrate=9600) at csctapi/ifd_smartreader.c:604
604	    reader->sr_config->baudrate = baudrate;
(gdb) bt
#0  0x080654c9 in smartreader_set_baudrate (reader=0x81d6fb8, baudrate=9600) at csctapi/ifd_smartreader.c:604
#1  0x0806715e in smartreader_usb_open_dev (reader=0x81d6fb8) at csctapi/ifd_smartreader.c:933
#2  SR_Init (reader=0x81d6fb8) at csctapi/ifd_smartreader.c:1132
#3  0x0805a44f in ICC_Async_Device_Init (reader=0x81d6fb8) at csctapi/icc_async.c:73
#4  0x080acb0b in cardreader_device_init (reader=0x81d6fb8) at reader-common.c:243
#5  cardreader_init (reader=0x81d6fb8) at reader-common.c:297
#6  0x080e2402 in reader_init (reader=0x81d6fb8) at oscam-reader.c:616
#7  0x080ec936 in work_thread (ptr=0xb7c007c0) at oscam.c:3294
#8  0xb7fa5d4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#9  0xb7ee2d3e in clone () from /lib/i386-linux-gnu/libc.so.6
Last edited 9 years ago by Nimloth (previous) (diff)

comment:44 by Admin, 9 years ago

I think there may be problems if you have a reader which is still attached to libusb (before OSCam starts) and try to attach it again. Please create a valgrind log (see memleaks thread) and post that in the forum. We're getting away from the real topic on getting the reader itself working.

comment:45 by Nimloth, 9 years ago

Yes you are right ... segfaults happen when you try to start reader immediatelly after you stopped it. If you wait some time (so it finish attaching reader to /dev/ttyUSB*) and then try to start reader there is no segfault (webif shouldn't allow to enable reader before it stop fully it's job)

Not sure what we can test now ...

comment:46 by Admin, 9 years ago

How long do you have to wait to let it restart without crashing?
There is normally a lock in the closing and the init function so what you describe seems to mean that the close function says "device is closed" where indeed the kernel has not completely deattached it yet. Then we would need some sleeping in the close function before we release the lock.
Edit: I just changed those locks a bit...maybe that helps.

Regarding the triple reader: So we can now at least read the atr on all ports. Does it show the same behaviour of not reading the card on all three slots? Because above someone wrote that port0 worked...

Last edited 9 years ago by Admin (previous) (diff)

comment:47 by Nimloth, 9 years ago

list-smargo don't detect tripple

root@ubuntu:/media/oscam-svn# lsusb
...
Bus 005 Device 002: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor
Bus 002 Device 002: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC
root@ubuntu:/media/oscam-svn# Distribution/list_smargo-1.20-unstable_svn8040-i686-linux-gnu-libusb 
Looking for smartreader compatible devices...
root@ubuntu:/media/oscam-svn#

I have to wait till it will be reattached to /dev/ttyUSB* ... and then I'm sure that it won't crash (it's like max 1 min for my system) ... but if you enable reader and disable it within seconds reattaching /dev/ttyUSB* is instant.

There is same behaviour for all ports. Each port work (init) but after like 30 resets.
Maybe for Smargo+ single there is same behaviour (we don't know which mode tripple uses) ... and additional config tool from Argolis was setting correct parameters ?

comment:48 by mariovandijck@…, 9 years ago

Oscam Revision #8079

scanusb.html

Bus 002 Device 003: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC
      iProduct 2 Triple Reader+
      iSerial 3 000009b4

Log file:

2013/01/09 12:19:03 B6F00468 h triple_01 [smargo] creating thread for device TripleP1;Serial:000009b4
2013/01/09 12:19:03 B6B03910 r triple_01 [smargo] smargo init 
2013/01/09 12:19:03 B6B03910 r triple_01 [smargo] ERROR: Opening device TripleP1;Serial:000009b4 (errno=2 No such file or directory)
2013/01/09 12:19:03 B6B03910 r triple_01 [smargo] Cannot open device: TripleP1;Serial:000009b4

What do I wrong?


Last edited 9 years ago by mariovandijck@… (previous) (diff)

comment:49 by oliv3r, 9 years ago

Hi, I wrote (converted previous patch and expanded) the patch at the start of this thread and posted it on the forums (http://www.streamboard.tv/wbb2/addreply.php?action=quote&postid=443492).

Nimloth, you say list_smargo doesn't work for you, but are you trying the patched/rewritten version I posted on the forum? I didn't read in this thread about it being patched in upstream.

comment:50 by Nimloth, 9 years ago

list_smargo was already fixed by admin in:
http://www.streamboard.tv/oscam/changeset/8064/trunk

comment:51 by oliv3r, 9 years ago

I stand corrected. Does look like the patch. It worked for me, but did not do extensive testing though.

comment:52 by oliv3r, 9 years ago

r8115 does work with smartreader mode, but all 3 modes (mouse, smargo and smartreader) still Very Often fail to initialize the card.

Ironically, when I only have 2 cards inserted, port3 even says there is a card inserted. SmartReader mode currently appear a little broken, but it is hard to say when timing issues causing horrible pain.

So, liberating smargo, shouldn't be horribly hard :) Anybody got any idea's how to implement a single port reader passed through USB? :)

comment:53 by Deas, 9 years ago

Resolution: wontfix
Status: newclosed

comment:54 by mariovandijck@…, 8 years ago

I tried it again but unfortunately get the following @ r8844

2013/08/18 13:33:48 95118A8 r Found reader with serial 00000b9c at 001:002 
2013/08/18 13:33:48 95118A8 r Found smartreader device Serial:00000b9c 
2013/08/18 13:33:48 95118A8 r Reader-1_00000b9c [smartreader] Reader initialized (device=TripleP1;Serial:00000b9c, detect=cd, mhz=343, cardmhz=357) 
2013/08/18 13:33:49 95118A8 r Reader-1_00000b9c [smartreader] card detected 
2013/08/18 13:33:50 95118A8 r Reader-1_00000b9c [smartreader] ATR: 3B F7 11 00 01 40 96 70 70 0A 0E 6C B7 D7 
2013/08/18 13:33:50 95118A8 r Reader-1_00000b9c [smartreader] Init card protocol T0, FI=1, F=372, D=1, N=1 
2013/08/18 13:33:50 95118A8 r Reader-1_00000b9c [smartreader] Calculated work ETU is 108.45 us 
2013/08/18 13:33:50 95118A8 r Reader-1_00000b9c [smartreader] ATR Fsmax is: 5 MHz, clocking card to wanted user cardspeed of 3.43 MHz (specified in reader->mhz) 
2013/08/18 13:33:53 95118A8 r Reader-1_00000b9c [smartreader] card system not supported 
2013/08/18 13:33:53 95118A8 r Reader-1_00000b9c [smartreader] Normal mode failed, reverting to Deprecated Mode 
2013/08/18 13:33:55 95118A8 r Reader-1_00000b9c [smartreader] ATR: 3B F7 11 00 01 40 96 70 70 0A 0E 6C B7 D7 
2013/08/18 13:33:55 95118A8 r Reader-1_00000b9c [smartreader] Init card protocol T0, FI=1, F=372, D=1, N=1 
2013/08/18 13:33:55 95118A8 r Reader-1_00000b9c [smartreader] Calculated work ETU is 108.45 us 
2013/08/18 13:33:55 95118A8 r Reader-1_00000b9c [smartreader] ATR Fsmax is: 5 MHz, clocking card to wanted user cardspeed of 3.43 MHz (specified in reader->mhz) 
2013/08/18 13:33:56 95118A8 r Reader-1_00000b9c [smartreader] type: SECA, caid: 0100, serial: #########, card: Mediaguard v10.0 
2013/08/18 13:33:56 95118A8 r Reader-1_00000b9c [smartreader] provider 1: 0000, valid: 1, name: MANAGMENT, expiry date: 2013/10/14 
2013/08/18 13:33:56 95118A8 r Reader-1_00000b9c [smartreader] SA: ######## 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [smartreader] no PBM for provider 1 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [smartreader] provider 2: 006A, valid: 1, name: CANALDIGITAAL, expiry date: 2013/10/18 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [smartreader] SA: ######## 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [smartreader] PBM for provider 2: e200000000000000 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [smartreader] providers: 2 (0000,006A) 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [smartreader] parental locked 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [smartreader] ready for requests 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [smartreader] found card system seca 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [seca] provider 1: 0000, valid: 1, name: MANAGMENT, expiry date: 2013/10/14 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [seca] SA: ######## 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [seca] no PBM for provider 1 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [seca] provider 2: 006A, valid: 1, name: CANALDIGITAAL, expiry date: 2013/10/18 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [seca] SA: ######## 
2013/08/18 13:33:57 95118A8 r Reader-1_00000b9c [seca] PBM for provider 2: e200000000000000 
2013/08/18 13:33:58 95118A8 r Reader-1_00000b9c [seca] card ejected 

[reader]
label                         = Reader-1_00000b9c
description                   = Triple Reader
protocol                      = smartreader
device                        = TripleP1;Serial:00000b9c
caid                          = 0100
ecmwhitelist                  = 0100@00006A:64
ecmheaderwhitelist            = 0100@00006A:813061006A00075C00,803061006A00075C00
detect                        = cd
mhz                           = 343
ident                         = 0100:00006A,000000
group                         = 1,26
emmcache                      = 1,3,0
dropbadcws                    = 1
ratelimitecm                  = 4
ratelimitseconds              = 10
ecmunique                     = 1
Last edited 8 years ago by mariovandijck@… (previous) (diff)
Note: See TracTickets for help on using tickets.