[linux-dvb] problems and workaround when tuning to a channel with DD enabled

Wolfgang Rohdewald wolfgang at rohdewald.de
Fri Jun 10 13:57:32 CEST 2005


On Donnerstag 09 Juni 2005 13:09, Dr. Werner Fink wrote:
> I've a firmware ready which will allow abort the
> OSDSetBlock command during loading the data with
> the command ReleaseBmp.

Would it be safe if OSDSetBlock always calls ReleaseBmp
at the end? Or should it only do so after success or -ERESTARTSYS?
The latter is what I coded for now.

I suppose for FW before 261e ReleaseBmp should only be called 
on success

with the code below and your firmware from yesterday
I now get this, looks fine I think. If you think the code is
correct like this I will produce a new patch.

Jun 10 13:42:45 mm vdr[28938]: switching to channel 2
Jun 10 13:42:45 mm vdr[29114]: receiver on device 1 thread started (pid=29114, tid=213000)
Jun 10 13:42:45 mm kernel: dvb-ttpci: OSDSetBlock(): returns -512
Jun 10 13:42:45 mm kernel: dvb-ttpci: ReleaseBitmap(): ReleaseBitmap called while BMP_LOADING
Jun 10 13:42:45 mm kernel: dvb-ttpci: av7110_osd_cmd(): av7110_osd_cmd(13) returns with -ERESTARTSYS
Jun 10 13:42:45 mm vdr[29113]: transfer thread started (pid=29113, tid=196615)

btw if I change the channel via OSD channel menu no ERESTARTSYS ever happens. Strange.

With the previous fw I got this while replaying a DolbySurround recording (ARD Nachtkonzert):
Jun 10 13:53:58 mm kernel: av7110_fw_request: timeout waiting for COMMAND to complete
Jun 10 13:53:58 mm kernel: dvb-ttpci: StartHWFilter error  buf 0b07 0010 044c b96a  ret ffffff92  handle c042
Jun 10 13:53:58 mm kernel: StopHWFilter tried to stop invalid filter ffff, filter type = 1

Now these messages don't come anymore but the problem (dropouts) is still exactly the same, 
maybe a little less often.

I just got this driver buffer overflow while watching ZDF with Dolby Digital, never saw it before:

Jun 10 13:43:00 mm vdr[28947]: changing transponder data of channel 1718 from S19.2E:12825:v:27500:3 to S19.2E:12285:v:27500:3
Jun 10 13:45:22 mm vdr[29115]: ERROR: driver buffer overflow on device 1
Jun 10 13:47:28 mm vdr[28938]: switching to channel 3
Jun 10 13:47:28 mm vdr[29113]: transfer thread ended (pid=29113, tid=196615)
Jun 10 13:47:29 mm vdr[29115]: TS buffer on device 1 thread ended (pid=29115, tid=229385)
Jun 10 13:47:29 mm vdr[29114]: buffer stats: 91932 (4%) used
Jun 10 13:47:29 mm vdr[29114]: receiver on device 1 thread ended (pid=29114, tid=213000)
Jun 10 13:47:29 mm vdr[28938]: cTS2PES got 0 TS errors, 1 TS continuity errors

static inline int ReleaseBitmap(struct av7110 *av7110)
{
        dprintk(4, "%p\n", av7110);

        if (av7110->bmp_state != BMP_LOADED && FW_VERSION(av7110->arm_app) < 0x261e)
                return -1;
        av7110->bmp_state = BMP_NONE;
        return av7110_fw_cmd(av7110, COMTYPE_OSD, ReleaseBmp, 0);
}

static int OSDSetBlock(struct av7110 *av7110, int x0, int y0,
                       int x1, int y1, int inc, u8 __user * data)
{
        uint w, h, bpp, bpl, size, lpb, bnum, brest;
        int i;
        int rc;

        w = x1 - x0 + 1;
        h = y1 - y0 + 1;
        if (inc <= 0)
                inc = w;
        if (w <= 0 || w > 720 || h <= 0 || h > 576)
                return -EINVAL;
        bpp = av7110->osdbpp[av7110->osdwin] + 1;
        bpl = ((w * bpp + 7) & ~7) / 8;
        size = h * bpl;
        lpb = (32 * 1024) / bpl;
        bnum = size / (lpb * bpl);
        brest = size - bnum * lpb * bpl;

        if (av7110->bmp_state == BMP_LOADING) {
                /* possible if syscall is repeated by -ERESTARTSYS and if firmware cannot abort */
                BUG_ON (FW_VERSION(av7110->arm_app) >= 0x261e);
                rc = WaitUntilBmpLoaded(av7110);
                if (rc)
                        return rc;
                /* just continue. This should work for older fw versions
                 * if bnum==1 && !brest && (LoadBitmap was successful)
                 */
        }

        rc = 0;
        for (i = 0; i < bnum; i++) {
                rc = LoadBitmap(av7110, w, lpb, inc, data);
                if (rc)
                        break;
                rc = BlitBitmap(av7110, x0, y0 + i * lpb);
                if (rc)
                        break;
                data += lpb * inc;
        }
        if (!rc && brest) {
                rc = LoadBitmap(av7110, w, brest / bpl, inc, data);
                if (!rc)
                        rc = BlitBitmap(av7110, x0, y0 + bnum * lpb);
        }
        if (rc)
                dprintk(1,"returns %d\n",rc);
        if (!rc || FW_VERSION(av7110->arm_app) >= 0x261e) {
                int relrc = ReleaseBitmap(av7110);
                if (rc!=-ERESTARTSYS)
                        rc = relrc;
        }
        return rc;
}


-- 
Wolfgang




More information about the linux-dvb mailing list