Changeset 1495

Show
Ignore:
Timestamp:
12/06/08 04:24:19 (12 years ago)
Author:
ppalmers
Message:

add a minimum for the max_packetsize parameter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/config.h.in

    r1486 r1495  
    133133// due to weirdness in the kernel layer 
    134134#define MAX_XMIT_PACKET_SIZE                         (2048-16) 
     135#define MIN_XMIT_PACKET_SIZE                               128 
    135136#define MAX_XMIT_NB_BUFFERS                                128 
    136137#define MAX_RECV_NB_BUFFERS                                 64 
     138#define MIN_RECV_PACKET_SIZE                               128 
    137139 
    138140// the default ISO receive mode.  
  • branches/libffado-2.0/src/libieee1394/IsoHandlerManager.cpp

    r1462 r1495  
    792792        int min_interrupts_per_period = MINIMUM_INTERRUPTS_PER_PERIOD; 
    793793        int max_nb_buffers_recv = MAX_RECV_NB_BUFFERS; 
     794        int min_packetsize_recv = MIN_RECV_PACKET_SIZE; 
    794795        if(config) { 
    795796            config->getValueForSetting("ieee1394.isomanager.iso_receive_mode", receive_mode_setting); 
     
    797798            config->getValueForSetting("ieee1394.isomanager.min_interrupts_per_period", min_interrupts_per_period); 
    798799            config->getValueForSetting("ieee1394.isomanager.max_nb_buffers_recv", max_nb_buffers_recv); 
     800            config->getValueForSetting("ieee1394.isomanager.min_packetsize_recv", min_packetsize_recv); 
    799801        } 
    800802 
    801803        // setup the optimal parameters for the raw1394 ISO buffering 
    802804        unsigned int packets_per_period = stream->getPacketsPerPeriod(); 
    803         unsigned int max_packet_size = stream->getMaxPacketSize() + 8; // bufferfill takes another 8 bytes for headers 
     805        // reserve space for the 1394 header too (might not be necessary) 
     806        unsigned int max_packet_size = stream->getMaxPacketSize() + 8; 
    804807        unsigned int page_size = getpagesize(); 
    805808 
     
    835838            return false; 
    836839        } 
     840        if (max_packet_size < (unsigned)min_packetsize_recv) { 
     841            debugError("min packet size (%u) < MIN_RECV_PACKET_SIZE (%u), using min value\n", 
     842                       max_packet_size, min_packetsize_recv); 
     843            max_packet_size = min_packetsize_recv; 
     844        } 
    837845 
    838846        // the interrupt/wakeup interval prediction of raw1394 is a mess... 
     
    868876        int max_nb_buffers_xmit = MAX_XMIT_NB_BUFFERS; 
    869877        int max_packetsize_xmit = MAX_XMIT_PACKET_SIZE; 
     878        int min_packetsize_xmit = MIN_XMIT_PACKET_SIZE; 
    870879        if(config) { 
    871880            config->getValueForSetting("ieee1394.isomanager.min_interrupts_per_period", min_interrupts_per_period); 
    872881            config->getValueForSetting("ieee1394.isomanager.max_nb_buffers_xmit", max_nb_buffers_xmit); 
    873882            config->getValueForSetting("ieee1394.isomanager.max_packetsize_xmit", max_packetsize_xmit); 
     883            config->getValueForSetting("ieee1394.isomanager.min_packetsize_xmit", min_packetsize_xmit); 
    874884        } 
    875885 
    876886        // setup the optimal parameters for the raw1394 ISO buffering 
    877         unsigned int max_packet_size = stream->getMaxPacketSize(); 
     887        // reserve space for the 1394 header too (might not be necessary) 
     888        unsigned int max_packet_size = stream->getMaxPacketSize() + 8; 
    878889 
    879890        if (max_packet_size > (unsigned)max_packetsize_xmit) { 
     
    881892                       max_packet_size, max_packetsize_xmit); 
    882893            return false; 
     894        } 
     895        if (max_packet_size < (unsigned)min_packetsize_xmit) { 
     896            debugError("min packet size (%u) < MIN_XMIT_PACKET_SIZE (%u), using min value\n", 
     897                       max_packet_size, min_packetsize_xmit); 
     898            max_packet_size = min_packetsize_xmit; 
    883899        } 
    884900