~ubuntu-branches/ubuntu/oneiric/libffado/oneiric

« back to all changes in this revision

Viewing changes to src/rme/rme_avdevice.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Knoth
  • Date: 2011-05-31 17:27:58 UTC
  • mfrom: (8.3.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110531172758-s0bhfz5ufsahm422
Tags: 2.0.99+svn1985-1
Imported Upstream version 2.0.99+svn1985 (Closes: #601659)

Show diffs side-by-side

added added

removed removed

Lines of Context:
791
791
    signed int n_analog, n_phones, n_adat, n_spdif;
792
792
    signed int sample_rate = getSamplingFrequency();
793
793
 
794
 
    /* Work out the number of analog, spdif and ADAT channels as determined
795
 
     * by the current sample rate and the device model.
 
794
    /* Apply bandwidth limit if selected.  This effectively sets up the
 
795
     * number of adat and spdif channels assuming single-rate speed.
796
796
     */
797
 
    n_analog = (m_rme_model==RME_MODEL_FIREFACE800)?10:8;
798
 
    n_phones = 0;
799
797
    n_spdif = 2;
800
 
    if (sample_rate < MIN_DOUBLE_SPEED) {
801
 
      n_adat = 8;
802
 
    } else
803
 
    if (sample_rate < MIN_QUAD_SPEED) {
804
 
      n_adat = 4;
805
 
    } else {
806
 
      n_adat = 0;
807
 
    }
808
 
    if (m_rme_model == RME_MODEL_FIREFACE800)
809
 
      n_adat *= 2;
810
 
 
811
 
    if (direction == Streaming::Port::E_Capture) {
812
 
        s_processor = m_receiveProcessor;
813
 
    } else {
814
 
        s_processor = m_transmitProcessor;
815
 
        /* Phones count as two of the analog outputs */
816
 
        n_analog -= 2;
817
 
        n_phones = 2;
818
 
    }
819
 
 
820
 
    /* Apply bandwidth limit if selected */
821
798
    switch (dev_config->settings.limit_bandwidth) {
822
799
      case FF_SWPARAM_BWLIMIT_ANALOG_ONLY:
823
800
        n_adat = n_spdif = 0;
834
811
        n_adat = (m_rme_model==RME_MODEL_FIREFACE800)?16:8;
835
812
    }
836
813
 
 
814
    /* Work out the number of analog channels based on the device model and
 
815
     * adjust the spdif and ADAT channels according to the current sample
 
816
     * rate.
 
817
     */
 
818
    n_analog = (m_rme_model==RME_MODEL_FIREFACE800)?10:8;
 
819
    n_phones = 0;
 
820
    if (sample_rate>=MIN_DOUBLE_SPEED && sample_rate<MIN_QUAD_SPEED) {
 
821
      n_adat /= 2;
 
822
    } else
 
823
    if (sample_rate >= MIN_QUAD_SPEED) {
 
824
      n_adat = 0;
 
825
      n_spdif = 0;
 
826
    }
 
827
 
 
828
    if (direction == Streaming::Port::E_Capture) {
 
829
        s_processor = m_receiveProcessor;
 
830
    } else {
 
831
        s_processor = m_transmitProcessor;
 
832
        /* Phones count as two of the analog outputs */
 
833
        n_analog -= 2;
 
834
        n_phones = 2;
 
835
    }
 
836
 
837
837
    id = std::string("dev?");
838
838
    if (!getOption("id", id)) {
839
839
        debugWarning("Could not retrieve id parameter, defaulting to 'dev?'\n");