Show
Ignore:
Timestamp:
01/19/08 04:11:20 (15 years ago)
Author:
ppalmers
Message:

Introduce distinction between empty and silent packets. When shutting down a transmit SP, we now send silent (= valid, but all audio muted) packets instead of empty (w/o
payload) packets for a while. This should solve the shutdown issue with the motu's.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp

    r833 r857  
    316316 
    317317enum StreamProcessor::eChildReturnValue 
    318 MotuTransmitStreamProcessor::generateSilentPacketHeader ( 
     318MotuTransmitStreamProcessor::generateEmptyPacketHeader ( 
    319319    unsigned char *data, unsigned int *length, 
    320320    unsigned char *tag, unsigned char *sy, 
    321321    int cycle, unsigned int dropped, unsigned int max_length ) 
    322322{ 
    323     debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT NONE: CY=%04u, TSP=%011llu (%04u)\n", 
     323    debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT EMPTY: CY=%04u, TSP=%011llu (%04u)\n", 
    324324                cycle, m_last_timestamp, ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); 
    325325 
     
    332332    m_tx_dbc += fillNoDataPacketHeader ( (quadlet_t *)data, length ); 
    333333    return eCRV_OK; 
     334} 
     335 
     336enum StreamProcessor::eChildReturnValue 
     337MotuTransmitStreamProcessor::generateEmptyPacketData ( 
     338    unsigned char *data, unsigned int *length, 
     339    unsigned char *tag, unsigned char *sy, 
     340    int cycle, unsigned int dropped, unsigned int max_length ) 
     341{ 
     342    return eCRV_OK; // no need to do anything 
     343} 
     344 
     345enum StreamProcessor::eChildReturnValue 
     346MotuTransmitStreamProcessor::generateSilentPacketHeader ( 
     347    unsigned char *data, unsigned int *length, 
     348    unsigned char *tag, unsigned char *sy, 
     349    int cycle, unsigned int dropped, unsigned int max_length ) 
     350{ 
     351    debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT SILENT: CY=%04u, TSP=%011llu (%04u)\n", 
     352                cycle, m_last_timestamp, ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); 
     353 
     354    // Do housekeeping expected for all packets sent to the MOTU, even 
     355    // for packets containing no audio data. 
     356    *sy = 0x00; 
     357    *tag = 1;      // All MOTU packets have a CIP-like header 
     358    *length = 8; 
     359 
     360    m_tx_dbc += fillNoDataPacketHeader ( (quadlet_t *)data, length ); 
     361    return eCRV_Packet; 
    334362} 
    335363 
  • trunk/libffado/src/libstreaming/motu/MotuTransmitStreamProcessor.h

    r748 r857  
    6464                            unsigned char *tag, unsigned char *sy, 
    6565                            int cycle, unsigned int dropped, unsigned int max_length); 
     66    enum eChildReturnValue generateEmptyPacketHeader(unsigned char *data, unsigned int *length, 
     67                                    unsigned char *tag, unsigned char *sy, 
     68                                    int cycle, unsigned int dropped, unsigned int max_length); 
     69    enum eChildReturnValue generateEmptyPacketData(unsigned char *data, unsigned int *length, 
     70                                  unsigned char *tag, unsigned char *sy, 
     71                                  int cycle, unsigned int dropped, unsigned int max_length); 
    6672    enum eChildReturnValue generateSilentPacketHeader(unsigned char *data, unsigned int *length, 
    6773                                    unsigned char *tag, unsigned char *sy,