Changeset 1375

Show
Ignore:
Timestamp:
10/24/08 10:58:07 (12 years ago)
Author:
ppalmers
Message:

tweak the iso handler buffer settings some more

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/src/libieee1394/IsoHandlerManager.cpp

    r1373 r1375  
    839839 
    840840        // the receive buffer size doesn't matter for the latency, 
    841         // but it has a minimal value in order for libraw to operate correctly (300) 
    842         int buffers=1; 
    843         while(buffers < (int)packets_per_period && buffers < max_nb_buffers_recv) { 
    844             buffers *= 2; 
    845         } 
     841        // it does seem to be confined to a certain region for correct 
     842        // operation. However it is not clear how many. 
     843        int buffers = max_nb_buffers_recv; 
    846844 
    847845        // ensure at least 2 hardware interrupts per ISO buffer wraparound 
     
    883881        } 
    884882 
    885         // the SP specifies how many packets to ISO-buffer 
    886         int req_buffers = stream->getNbPacketsIsoXmitBuffer(); 
    887         int buffers=1;  
    888         while(buffers < (int)req_buffers && buffers < max_nb_buffers_xmit) { 
    889             buffers *= 2; 
    890         } 
    891  
    892         int irq_interval = req_buffers / min_interrupts_per_period; 
    893         if(irq_interval <= 0) irq_interval = 1; 
     883        int buffers = max_nb_buffers_xmit; 
     884        unsigned int packets_per_period = stream->getPacketsPerPeriod(); 
     885 
     886        int irq_interval = (packets_per_period-1) / min_interrupts_per_period; 
     887        if(irq_interval <= 0) irq_interval=1; 
    894888        // ensure at least 2 hardware interrupts per ISO buffer wraparound 
    895         if(irq_interval > buffers/2) irq_interval = buffers/2; 
     889        if(irq_interval > buffers/2) { 
     890            irq_interval = buffers/2; 
     891        } 
    896892 
    897893        debugOutput( DEBUG_LEVEL_VERBOSE, " creating IsoXmitHandler\n");