Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Strange buffer overruns...



Hello!

I experience strange buffer overruns.  I have:

- Called DMX_SET_BUFFER_SIZE to set 256*1024 byte buffer.

- Set up 16 PID filters (DMX_OUT_TS_TAP and DMX_PES_OTHER) to get 8 programs
  from the dvr device.

- I have opened 8 files (one file for each program) to write the output
  after I demux the contents.  Writes to the files occur nonblocking,
  usually in 3kb..8kb chunks per write.

- I read from the dvr device in 188*21*32 byte chunks (that is approx 128KB)
  in nonblocking mode, usually returning about 39KB per read.

- I use select() to check whether I can read/write.


With this setup, top shows about 86% idle.  But about every five seconds
I can hear the HD heads move, select() is blocked for about one second,
and the read() from the dvr device reports EOVERFLOW.

My first assumtion was that flushing disks caused the overflows.  Then I
tried to manually sync.  Strange enough, with this manually sync the disk
was active for about two minutes without _any_ EOVERFLOWs while syncing.
When sync was ready, the EOVERFLOWs came back again in 5 second intervalls.
(I would have expected the opposite behavior).

My next experiment was to "while sleep 1; do sync; done".  With this command
(run in a different terminal) the EOVERFLOWs disappeared completely.

Any ideas what is causing the EOVERFLOWs?  And why do they disappear for
the duration of a manual sync?  Is it because the regular sync runs in
kernel-mode?  Is it possible to change the syncing behavior to avoid
this blocking?

BTW: The system is a 450MHz P2 with 256KB RAM.  Here's the output from hdparm:

vdr:~# hdparm -tT /dev/hda

/dev/hda:
 Timing cached reads:   560 MB in  2.01 seconds = 278.61 MB/sec
 Timing buffered disk reads:   46 MB in  3.02 seconds =  15.23 MB/sec

vdr:~# hdparm  /dev/hda

/dev/hda:
 multcount    = 16 (on)
 IO_support   =  1 (32-bit)
 unmaskirq    =  1 (on)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 readonly     =  0 (off)
 readahead    =  8 (on)
 geometry     = 1027/255/63, sectors = 8455200768, start = 0

vdr:~# uname -a
Linux vdr1.local 2.4.27-ctvdr-1 #1 Fri Oct 15 18:38:29 UTC 2004 i686 GNU/Linux

-- 
Please visit and sign and http://www.ffii.org
-- Josef Wolf -- jw@raven.inka.de --




Home | Main Index | Thread Index