Moderator Control Panel ]

[SOLVED] Problem reacquiring lock

[SOLVED] Problem reacquiring lock

Postby jsveiga » Wed May 09, 2012 11:59 pm

Hi, I'm using a TBS8921 on a dish pointing system (no TV watching, just measuring level and snr).

The board is installed on a mini-ITX x86 board running linux debian 6.0 (squeeze), 2.6.32-5 kernel.

I have compiled and installed the linux-tbs-drivers from tbs-linux-drivers_v120424.zip.

Although I don't need the signal locked, it seems that when there is no lock the snr measurement is unstable, and the problem is that it looks like when the board loses the lock it does not reacquire it unless I reinitialize it.

For example, if after getting a lock I move the antenna away from the sat, lock is lost. Then moving back to the correct pointing does not reestablish the lock, but stopping/starting the measurement (for example, szap-s2) makes the lock come back.

I attached a sample log using szap-s2 (comments marked with @@).

Is there anything (for example, resetting the front end whenever lock is lost?) I can do to avoid this problem?

Thanks!

Joao S Veiga
Attachments
test.zip
(1.87 KiB) Downloaded 507 times
Last edited by jsveiga on Thu May 31, 2012 6:34 pm, edited 1 time in total.
jsveiga
 
Posts: 19
Joined: Wed Nov 17, 2010 3:25 am

Re: Problem reacquiring lock

Postby SergioDanielG » Thu May 10, 2012 5:23 am

Hi jsveiga.
I was reading szap source trying to find something, but no, nothing like bad there... Szap send tune command one time and then only check signals, but this is normal because is the tuner that lock signals and szap only check it. Unfortunatelly I haven't got a similar card or with a TDA10071 tuner to do a test.
Maybe you can try with other software like vdr or vlc and monitor signal with femon, I know this is not util for you, but you can test and comment us about it.

Best regards.
SergioDanielG
 
Posts: 356
Joined: Tue May 31, 2011 3:53 am
Location: Tostado (SF) Argentina

Re: Problem reacquiring lock

Postby jsveiga » Thu May 10, 2012 9:04 pm

Thank you Sergio,

I'll try to test with other sw - I haven't done it so far due to the "logistics" of it (I can't do it on the "PC" where the TBS8921 is installed, it's a stripped down no-gui, no display, debian on a 1GB flashdisk). I had the hopes there was just something missing in szap-s2 (on which I based my measurement program) to make the board retry to acquire the lock.

As soon as I make the tests I'll post the results here.

BR,

Joao S Veiga
jsveiga
 
Posts: 19
Joined: Wed Nov 17, 2010 3:25 am

Re: Problem reacquiring lock

Postby SergioDanielG » Thu May 10, 2012 10:58 pm

You are welcome.

Maybe you can try tune-s2 too, it's a little app without gui. ( http://updatelee.com/src/tune-s2.zip ) Actually this link don't work, but I have a copy in other pc. If you want, I can send you a copy.

Best regards.
SergioDanielG
 
Posts: 356
Joined: Tue May 31, 2011 3:53 am
Location: Tostado (SF) Argentina

Re: Problem reacquiring lock

Postby jsveiga » Thu May 17, 2012 1:51 am

Hi Sergio, sorry for the long time it took to return here; the antenna positioner is rigged on a small trailer which I have to drag outdoors for testing - and it has been raining a lot. I also took some beating trying to do everything on a live kubuntu 12.04 usb drive, and ended up giving up to a hard-disk-installed kubuntu 11.10.

Unfortunately I could not use another sw as you suggested (I tried mplayer); it looks like the default dvb-aware programs from debian/kubuntu cannot lock to the signals at all. If you can please post me a copy of tune-s2, I can try it too.

I attached a dvbtest.log with the tests, but here's a summary:

kubuntu: 11.10
Kernel: 3.0.0-12-generic
dvb-apps: 1.1.1+rev1355-1ubuntu2
tbs drivers/tools: from tbs-linux-drivers_v120424

I used szap-s2 (from tbs) to tune&lock to a channel, then scan-s2 (-c -o zap) to generate a single channel "list", then used this "list" for trying to tune with mplayer. I'm not sure if I did something wrong; I have never used a DVB board to watch TV, and actually do not need it for my app (only need signal and snr readings, for which I need to lock/re-lock to a channel).

szap-s2 (from tbs): tunes and locks to DVB-S channel, does not reacquire lock if antenna is moved away from sat then back

scan-s2 (from tbs): very hard to get channel info if tunning by itself ("tuning failed", but eventually gets the info after several retries), but gets channel info if channel is already tuned and locked by szap-s2

szap (from dvb-apps): tunes to channel, but never locks

mplayer: fails to lock on channel

So maybe the standard apps are just not compatible with the tbs8921 hardware/modules?

The attached file shows the commands/files I used, and the actual results.

I'm considering to try changing the szap-s2-based measuring program I'm using to periodically re-tune the same channel, but it would be interesting to understand if this could work and if it is the right solution. Maybe there's a "retry lock" or "reset locking state" command that could do it faster.

Again, it looks to me that when the tuner is commanded to a channel, it triggers a "search for lock" procedure, but once the lock is acquired, it does not expect it to be lost, so it never retries the procedure after the lock is gone.

BR,

Joao S Veiga
Attachments
dvbtest.log.zip
(2.15 KiB) Downloaded 475 times
jsveiga
 
Posts: 19
Joined: Wed Nov 17, 2010 3:25 am

Re: Problem reacquiring lock

Postby jsveiga » Fri May 18, 2012 2:25 am

Looking at my first log file's status codes and in frontend.h, it seems that after I point the antenna off, then back, the status gets FE_HAS_SIGNAL, but almost never gets to FE_HAS_CARRIER (when it does, it's on briefly, then off).

So it doesn't even get to FE_HAS_VITERBI (FEC stable), let alone FE_HAS_SYNC.

I'm looking at the dvb_frontend.c and the only difference I could locate between the first tuning and a lost lock comes from this:

Code: Select All Code
        /* don't actually do anything if we're in the LOSTLOCK state,
         * the frontend is set to FE_CAN_RECOVER, and the max_drift is 0 */
        if ((fepriv->state & FESTATE_LOSTLOCK) &&
            (fe->ops.info.caps & FE_CAN_RECOVER) && (fepriv->max_drift == 0)) {
                dvb_frontend_swzigzag_update_delay(fepriv, s & FE_HAS_LOCK);
                return;
        }


If we do not return here, a few lines below we can fall into "fast zigzag", which looks like will bring things up again.

So I'm wondering if we're maybe having a FE_CAN_RECOVER in the fe->ops.info.caps when we shouldn't, which is preventing the frontend to retry the tuning.

I'm going to comment this code out and make some tests (it's not raining, but I still have to drag the trailer...).

BR,

Joao S Veiga
jsveiga
 
Posts: 19
Joined: Wed Nov 17, 2010 3:25 am

Re: Problem reacquiring lock

Postby jsveiga » Fri May 18, 2012 10:47 pm

Ok,

The program never gets to that point, because that is in dvb_frontend_swsigzag, and TBS8921 returns DVBFE_ALGO_HW.

I modified dvb_frontend.c to printk the FESTATE, and noticed it was always TUNED after the first lock, no matter if I even disconnected the LNB cable.

I then modified dvb_frontend.c (dvb_frontend_thread) to ignore fe->ops.get_frontend_algo and always go to dvb_frontend_swzigzag.

That worked perfectly. I can quickly get a lock after tuning to a channel, and moving the antenna away from the sat or disconnecting the LNB makes the frontend go to FESTATE_ZIGZAG_FAST then FESTATE_ZIGZAG_SLOW, and soon after I have signal again, it reacquires a lock (even after >30s without lock).

Unfortunately I could not find a better way of forcing dvb_frontend to use the dvb_frontend_swsigzag instead of the hw algo - it asks fe->ops.get_frontend_algo and gets DVBFE_ALGO_HW, I assume that comes from tbs8921fe, but the source code is not on the tbs-linux-drivers_v120424.zip (is it available at all?).

I don't want to use this as a solution, because I'm actually "breaking" dvb_frontend.c for frontends that can work better with the hw algo.

So the questions are:

1 - Is this a known limitation of the 8921 hardware algo? (not reacquiring lock properly)

2 - Is there a way to (module load option?) force the use of the SW algo without messing with dvb_frontend.c?

3 - Now that the problem cause is somewhat located, can someone suggest me a better fix (other that modifying dvb_frontend.c)?

Thanks!

Joao S Veiga
jsveiga
 
Posts: 19
Joined: Wed Nov 17, 2010 3:25 am

Re: Problem reacquiring lock

Postby jsveiga » Fri May 25, 2012 9:56 pm

I've sent an email to the TBS support asking if there's a solution from the firmware side.
BR,
Joao S Veiga
jsveiga
 
Posts: 19
Joined: Wed Nov 17, 2010 3:25 am

Re: [SOLVED] Problem reacquiring lock

Postby jsveiga » Thu May 31, 2012 6:35 pm

Hello,

I've received an excellent support from the TBS guys, who sent me a binary driver which will use the SW algo, so it is working perfectly now!

Thanks!!
jsveiga
 
Posts: 19
Joined: Wed Nov 17, 2010 3:25 am


Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest

cron