Changeset 1657 for trunk

Show
Ignore:
Timestamp:
09/06/09 05:27:13 (15 years ago)
Author:
jwoithe
Message:

RME: lay some groundwork for the management of iso resources used for audio data transfer to/from the device.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/rme/fireface_def.h

    r1616 r1657  
    388388#define FF_DEV_FLASH_SPDIF_OUTPUT_PRO_ON       0x00000001 
    389389#define FF_DEV_FLASH_SPDIF_OUTPUT_NONAUDIO_ON  0x00000001 
     390#define FF_DEV_FLASH_BWLIMIT_SEND_ALL_CHANNELS 0x00000001 
     391#define FF_DEV_FLASH_BWLIMIT_NO_ADAT2          0x00000002  // FF800 only 
     392#define FF_DEV_FLASH_BWLIMIT_ANALOG_SPDIF_ONLY 0x00000003 
     393#define FF_DEV_FLASH_BWLIMIT_ANALOG_ONLY       0x00000004 
    390394#define FF_DEV_FLASH_CLOCK_MODE_MASTER         0x00000002 
    391395#define FF_DEV_FLASH_CLOCK_MODE_AUTOSYNC       0x00000001 
     
    454458#define FF_SWPARAM_SPDIF_OUTPUT_PRO_ON         FF_DEV_FLASH_SPDIF_OUTPUT_PRO_ON 
    455459#define FF_SWPARAM_SPDIF_OUTPUT_NONAUDIO_ON    FF_DEV_FLASH_SPDIF_OUTPUT_NONAUDIO_ON 
     460#define FF_SWPARAM_BWLIMIT_SEND_ALL_CHANNELS   FF_DEV_FLASH_BWLIMIT_SEND_ALL_CHANNELS 
     461#define FF_SWPARAM_BWLIMIT_NO_ADAT2            FF_DEV_FLASH_BWLIMIT_NO_ADAT2 
     462#define FF_SWPARAM_BWLIMIT_ANALOG_SPDIF_ONLY   FF_DEV_FLASH_BWLIMIT_ANALOG_SPDIF_ONLY 
     463#define FF_SWPARAM_BWLIMIT_ANALOG_ONLY         FF_DEV_FLASH_BWLIMIT_ANALOG_ONLY 
    456464#define FF_SWPARAM_CLOCK_MODE_MASTER           FF_DEV_FLASH_CLOCK_MODE_MASTER 
    457465#define FF_SWPARAM_CLOCK_MODE_AUTOSYNC         FF_DEV_FLASH_CLOCK_MODE_AUTOSYNC 
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r1629 r1657  
    8383    , m_rme_model( RME_MODEL_NONE ) 
    8484    , num_channels( 0 ) 
    85     , samples_per_packet( 0 ) 
     85    , frames_per_packet( 0 ) 
    8686    , speed800( 0 ) 
    8787    , m_MixerContainer( NULL ) 
     
    506506Device::prepare() { 
    507507 
    508         debugOutput(DEBUG_LEVEL_NORMAL, "Preparing Device...\n" ); 
    509  
    510         return true; 
     508    signed int mult; 
     509 
     510    debugOutput(DEBUG_LEVEL_NORMAL, "Preparing Device...\n" ); 
     511 
     512    // The number of frames transmitted in a single packet is solely 
     513    // determined by the sample rate. 
     514    mult = multiplier_of_freq(getSamplingFrequency()); 
     515    switch (mult) { 
     516        case 2: frames_per_packet = 15; break; 
     517        case 4: frames_per_packet = 25; break; 
     518    default: 
     519        frames_per_packet = 7; 
     520    } 
     521 
     522    // The number of active channels depends on sample rate and whether 
     523    // bandwidth limitation is active.  First set up the number of analog 
     524    // channels (which differs between devices), then add SPDIF channels if 
     525    // relevant.  Finally, the number of channels available from each ADAT 
     526    // interface depends on sample rate: 0 at 4x, 4 at 2x and 8 at 1x. 
     527    if (m_rme_model == RME_MODEL_FIREFACE800) 
     528        num_channels = 10; 
     529    else 
     530        num_channels = 8; 
     531    if (settings->limit_bandwidth != FF_SWPARAM_BWLIMIT_ANALOG_ONLY) 
     532        num_channels += 2; 
     533    if (settings->limit_bandwidth==FF_SWPARAM_BWLIMIT_NO_ADAT2 || 
     534        settings->limit_bandwidth==FF_SWPARAM_BWLIMIT_SEND_ALL_CHANNELS) 
     535        num_channels += (mult==4?0:(mult==2?4:8)); 
     536    if (settings->limit_bandwidth==FF_SWPARAM_BWLIMIT_SEND_ALL_CHANNELS) 
     537        num_channels += (mult==4?0:(mult==2?4:8)); 
     538 
     539    // TODO: We always must allocate a tx iso channel.  An rx iso channel is 
     540    // also allocated for the FF400.  For the FF800, the device itself will 
     541    // supply the iso channel we should listen on in zero-based byte 2 of 
     542    // the hardware status return. 
     543 
     544    return true; 
    511545} 
    512546 
  • trunk/libffado/src/rme/rme_avdevice.h

    r1629 r1657  
    123123 
    124124    signed int num_channels; 
    125     signed int samples_per_packet; 
     125    signed int frames_per_packet; // 1 frame includes 1 sample from each channel 
    126126    signed int speed800; 
    127127