Opened 11 years ago

Closed 11 years ago

#3025 closed defect (fixed)

Last version ( STAPI version ) cardreader not work.

Reported by: ngc1927 Owned by: theparasol
Priority: trivial Component: Reader
Severity: low Keywords:
Cc: Sensitive: no

Description

Revision

r8032

Issue Description

Not work card reader ( internal )

When the issue occurs

Always with last commit ( r8025 work ok )

Attachments (5)

8032_error.log (2.1 KB ) - added by ngc1927 11 years ago.
8039_error.log (17.9 KB ) - added by ngc1927 11 years ago.
8043_error.log (18.9 KB ) - added by ngc1927 11 years ago.
sh4chunk.patch (1.8 KB ) - added by Admin 11 years ago.
Thought on something like that.
stapichunk.patch (3.1 KB ) - added by Admin 11 years ago.
So here's the revised patch. The code path is only valid for WITH_STAPI and only for the internal readers => other serial readers on these plattforms should work with the regular code.

Download all attachments as: .zip

Change History (32)

by ngc1927, 11 years ago

Attachment: 8032_error.log added

comment:1 by ni hao, 11 years ago

attach complete (!) d255 log. Here card reader works, so discuss first in forum

comment:2 by ni hao, 11 years ago

Priority: majortrivial
Resolution: invalid
Severity: mediumlow
Status: newclosed

by ngc1927, 11 years ago

Attachment: 8039_error.log added

comment:3 by ngc1927, 11 years ago

Resolution: invalid
Status: closedreopened

Now attached 255 debug

@theparasol
I test last 8039 ..not work.

comment:4 by Admin, 11 years ago

Possibly cause by r8028?

comment:5 by ngc1927, 11 years ago

Now have tested r8027 ( work ok ) and r8029 ( not work ).

P.S.
have jump r8028 why not compile with SH4

comment:6 by theparasol, 11 years ago

Try http://www.streamboard.tv/oscam/changeset/8043

Actually reverted the whole read all chars at once for sh4 only.
If I got it right your box will work again.
Perhaps a more experienced dev can rewrite the code so that it pulls all chars from reader of SH4. But perhaps these kind of boxes only deliver chars one by one?

comment:7 by Admin, 11 years ago

What is somehow strange from the log is that the error exists when he just requests a chunk of size 1?

comment:8 by theparasol, 11 years ago

Yup, saw that too and couldnt find a solution, therefor the revert for SH4/STAPI :(

by ngc1927, 11 years ago

Attachment: 8043_error.log added

comment:9 by ngc1927, 11 years ago

Also r8043 not work, with other error ( see log attached 8043.. )

comment:10 by theparasol, 11 years ago

Double checked it again... only thing I found was a readed = 0
I missed to reimplement. If this not fixes it I'm out of options and somebody else better give a look at it.

http://www.streamboard.tv/oscam/changeset/8049

Last edited 11 years ago by theparasol (previous) (diff)

comment:11 by Admin, 11 years ago

I know the problem in the original commit I think:

while( (((tv_spent.tv_sec-tv.tv_sec)*1000000) + ((tv_spent.tv_usec-tv.tv_usec)/1000000L)) < (time_t)(timeout))

{

readed =read(reader->handle, &data[count], size-count);
gettimeofday(&tv_spent,0);

}

The break condition and the "count +=readed;" is missing here! That's why after the first successful receive, it tries to read further until timeout time is reached and at this point "read" probably returns 0 then resulting in the error!

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

comment:12 by theparasol, 11 years ago

If you can fix it, go ahead. BTW: I like it the way its now: splitted up in section SH4 and other devices. Much better readable code

Last edited 11 years ago by theparasol (previous) (diff)

by Admin, 11 years ago

Attachment: sh4chunk.patch added

Thought on something like that.

comment:13 by kroki, 11 years ago

You will switch the codeblocks on the _sh4_ Pragma, this affects all Sh4-Versions.Not only the Stapi-Readers!
Not all Sh4-Versions are using the Stapi-Interface.

comment:14 by ngc1927, 11 years ago

Resolution: fixed
Status: reopenedclosed

r8052 work ok ..thx

comment:15 by Admin, 11 years ago

Resolution: fixed
Status: closedreopened

Please test the attached patch first. If it works, it will yield better performance.
@kroki: Well, but you can compile without stapi even if you are on such a box...you mean we should check for internal reader additionally?

comment:16 by kroki, 11 years ago

@Admin: That's right. If you use a Enigma2 or Neutrino-Image on these Boxes you don't use the Stapi-Interface. So with your Patch you always mention, that sh4 = stapi.
So the optimisations for the other readers didn't have any effect on sh4, if you use the pragma _sh4_. Better use WITH_STAPI.

Last edited 11 years ago by kroki (previous) (diff)

comment:17 by ngc1927, 11 years ago

@Admin
I applied your patch to r8048 ..and work ok

comment:18 by theparasol, 11 years ago

Great, thats the best solution of all.
Tnx for testing!

comment:19 by Admin, 11 years ago

I'll try to make it more restrictive in the evening...please don't commit yet.

by Admin, 11 years ago

Attachment: stapichunk.patch added

So here's the revised patch. The code path is only valid for WITH_STAPI and only for the internal readers => other serial readers on these plattforms should work with the regular code.

comment:20 by Admin, 11 years ago

Please give feedback so that I may commit it.

comment:21 by kroki, 11 years ago

For me, without stapi it works ....

comment:22 by Admin, 11 years ago

Resolution: fixed
Status: reopenedclosed

Committed now in r8069.

comment:23 by ngc1927, 11 years ago

Sorry ..i see too late your request of test, ..yes in stapi work ok.
Thx @theparasol and @Admin

comment:24 by N3m3515, 11 years ago

after r8069 my sh4 without stapi lags on reading on my internal reader. slow initialisation and reader timeouts with the internal reader because my times are over 5000ms. on 8068 everything works fine. everything is reported in this thread: http://www.streamboard.tv/wbb2/thread.php?threadid=36758&page=3

Last edited 11 years ago by N3m3515 (previous) (diff)

comment:25 by N3m3515, 11 years ago

alborland found a fix:

http://www.streamboard.tv/wbb2/thread.php?postid=446190#post446190

can someone include this?

comment:26 by N3m3515, 11 years ago

Resolution: fixed
Status: closedreopened

comment:27 by Admin, 11 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in r8113.

Note: See TracTickets for help on using tickets.