Changeset 2339

Show
Ignore:
Timestamp:
06/22/13 23:47:43 (11 years ago)
Author:
jwoithe
Message:

rme: cleanups in read_device_flash_settings(), mostly prompted by ticket #370. Note that the fix for the problem reported in ticket #370 was primarily in r2338.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/rme/fireface_flash.cpp

    r2338 r2339  
    11/* 
    2  * Copyright (C) 2009 by Jonathan Woithe 
     2 * Copyright (C) 2009-2013 by Jonathan Woithe 
    33 * 
    44 * This file is part of FFADO 
     
    276276    if (err != 0) { 
    277277        debugOutput(DEBUG_LEVEL_WARNING, "Error reading device flash settings: %d\n", i); 
     278        return -1; 
     279    } 
     280 
     281    debugOutput(DEBUG_LEVEL_VERBOSE, "Device flash settings:\n"); 
     282    if (hw_settings.clock_mode == FF_DEV_FLASH_INVALID) { 
     283        debugOutput(DEBUG_LEVEL_VERBOSE, "  Clock mode: not set in device flash\n"); 
    278284    } else { 
    279         debugOutput(DEBUG_LEVEL_VERBOSE, "Device flash settings:\n"); 
    280         if (hw_settings.clock_mode == FF_DEV_FLASH_INVALID) { 
    281             debugOutput(DEBUG_LEVEL_VERBOSE, "  Clock mode: not set in device flash\n"); 
    282         } else { 
    283             debugOutput(DEBUG_LEVEL_VERBOSE, "  Clock mode: %s\n", 
    284               hw_settings.clock_mode==FF_DEV_FLASH_CLOCK_MODE_MASTER?"Master":"Slave"); 
    285         } 
    286         if (hw_settings.sample_rate == FF_DEV_FLASH_INVALID) { 
    287             debugOutput(DEBUG_LEVEL_VERBOSE, "  Sample rate: not set in device flash\n"); 
    288         } else 
    289         if (hw_settings.sample_rate == FF_DEV_FLASH_SRATE_DDS_INACTIVE) { 
    290             debugOutput(DEBUG_LEVEL_VERBOSE, "  Sample rate: DDS not active\n"); 
    291         } else { 
    292             debugOutput(DEBUG_LEVEL_VERBOSE, "  Sample rate: %d Hz (DDS active)\n", hw_settings.sample_rate); 
    293         } 
     285        debugOutput(DEBUG_LEVEL_VERBOSE, "  Clock mode: %s\n", 
     286          hw_settings.clock_mode==FF_DEV_FLASH_CLOCK_MODE_MASTER?"Master":"Slave"); 
     287    } 
     288    if (hw_settings.sample_rate == FF_DEV_FLASH_INVALID) { 
     289        debugOutput(DEBUG_LEVEL_VERBOSE, "  Sample rate: not set in device flash\n"); 
     290    } else 
     291    if (hw_settings.sample_rate == FF_DEV_FLASH_SRATE_DDS_INACTIVE) { 
     292        debugOutput(DEBUG_LEVEL_VERBOSE, "  Sample rate: DDS not active\n"); 
     293    } else { 
     294        debugOutput(DEBUG_LEVEL_VERBOSE, "  Sample rate: %d Hz (DDS active)\n", hw_settings.sample_rate); 
    294295    } 
    295296 
     
    368369            dsettings->input_opt[2] = hw_settings.mic_plug_select[1] + 1; 
    369370        } 
    370     } 
    371  
    372     /* If debug is enabled, show what's been read from the flash */ 
    373     debugOutput(DEBUG_LEVEL_VERBOSE, "Settings read from flash:\n"); 
    374     if (m_rme_model == RME_MODEL_FIREFACE800) { 
    375         debugOutput(DEBUG_LEVEL_VERBOSE, "  Phantom: %d %d %d %d\n"
    376             dsettings->mic_phantom[0], dsettings->mic_phantom[1], 
    377             dsettings->mic_phantom[2], dsettings->mic_phantom[2]); 
    378  
    379     } else  
    380     if (m_rme_model == RME_MODEL_FIREFACE400) { 
    381         debugOutput(DEBUG_LEVEL_VERBOSE, "  Phantom: %d %d\n", 
    382             dsettings->mic_phantom[0], dsettings->mic_phantom[1]); 
    383         debugOutput(DEBUG_LEVEL_VERBOSE, "  Input pad: %d %d\n", 
    384             dsettings->ff400_input_pad[0], dsettings->ff400_input_pad[1]); 
    385     } 
    386     debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif input mode: %d\n", dsettings->spdif_input_mode); 
    387     debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif output emphasis: %d\n", dsettings->spdif_output_emphasis); 
    388     debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif output pro: %d\n", dsettings->spdif_output_pro); 
    389     debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif output nonaudio: %d\n", dsettings->spdif_output_nonaudio); 
    390     debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif output mode: %d\n", dsettings->spdif_output_mode); 
    391     debugOutput(DEBUG_LEVEL_VERBOSE, "  clock mode: %d\n", dsettings->clock_mode); 
    392     debugOutput(DEBUG_LEVEL_VERBOSE, "  sync ref: %d\n", dsettings->sync_ref); 
    393     debugOutput(DEBUG_LEVEL_VERBOSE, "  tms: %d\n", dsettings->tms); 
    394     debugOutput(DEBUG_LEVEL_VERBOSE, "  limit bandwidth: %d\n", dsettings->limit_bandwidth); 
    395     debugOutput(DEBUG_LEVEL_VERBOSE, "  stop on dropout: %d\n", dsettings->stop_on_dropout); 
    396     debugOutput(DEBUG_LEVEL_VERBOSE, "  input level: %d\n", dsettings->input_level); 
    397     debugOutput(DEBUG_LEVEL_VERBOSE, "  output level: %d\n", dsettings->output_level); 
    398     if (m_rme_model == RME_MODEL_FIREFACE800) { 
    399         debugOutput(DEBUG_LEVEL_VERBOSE, "  filter: %d\n", dsettings->filter); 
    400         debugOutput(DEBUG_LEVEL_VERBOSE, "  fuzz: %d\n", dsettings->fuzz); 
    401     } else 
    402     if (m_rme_model == RME_MODEL_FIREFACE400) { 
    403         debugOutput(DEBUG_LEVEL_VERBOSE, "  instr input 0: %d\n", dsettings->ff400_instr_input[0]); 
    404         debugOutput(DEBUG_LEVEL_VERBOSE, "  instr input 1: %d\n", dsettings->ff400_instr_input[1]); 
    405     } 
    406     debugOutput(DEBUG_LEVEL_VERBOSE, "  limiter: %d\n", dsettings->limiter); 
    407     debugOutput(DEBUG_LEVEL_VERBOSE, "  sample rate: %d\n", dsettings->sample_rate); 
    408     debugOutput(DEBUG_LEVEL_VERBOSE, "  word clock single speed: %d\n", dsettings->word_clock_single_speed); 
    409     if (m_rme_model == RME_MODEL_FIREFACE400) { 
    410       debugOutput(DEBUG_LEVEL_VERBOSE, "  phones level: %d\n", dsettings->phones_level); 
    411     } else 
    412     if (m_rme_model == RME_MODEL_FIREFACE800) { 
    413       debugOutput(DEBUG_LEVEL_VERBOSE, "  input opts: %d %d %d\n"
    414         dsettings->input_opt[0], dsettings->input_opt[1], 
    415         dsettings->input_opt[2]); 
     371 
     372        /* If debug is enabled, show what's been read from the flash */ 
     373        debugOutput(DEBUG_LEVEL_VERBOSE, "Settings acquired from flash:\n"); 
     374        if (m_rme_model == RME_MODEL_FIREFACE800) { 
     375            debugOutput(DEBUG_LEVEL_VERBOSE, "  Phantom: %d %d %d %d\n", 
     376                dsettings->mic_phantom[0], dsettings->mic_phantom[1]
     377                dsettings->mic_phantom[2], dsettings->mic_phantom[2]); 
     378 
     379        } else  
     380        if (m_rme_model == RME_MODEL_FIREFACE400) { 
     381            debugOutput(DEBUG_LEVEL_VERBOSE, "  Phantom: %d %d\n", 
     382                dsettings->mic_phantom[0], dsettings->mic_phantom[1]); 
     383            debugOutput(DEBUG_LEVEL_VERBOSE, "  Input pad: %d %d\n", 
     384                dsettings->ff400_input_pad[0], dsettings->ff400_input_pad[1]); 
     385        } 
     386        debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif input mode: %d\n", dsettings->spdif_input_mode); 
     387        debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif output emphasis: %d\n", dsettings->spdif_output_emphasis); 
     388        debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif output pro: %d\n", dsettings->spdif_output_pro); 
     389        debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif output nonaudio: %d\n", dsettings->spdif_output_nonaudio); 
     390        debugOutput(DEBUG_LEVEL_VERBOSE, "  spdif output mode: %d\n", dsettings->spdif_output_mode); 
     391        debugOutput(DEBUG_LEVEL_VERBOSE, "  clock mode: %d\n", dsettings->clock_mode); 
     392        debugOutput(DEBUG_LEVEL_VERBOSE, "  sync ref: %d\n", dsettings->sync_ref); 
     393        debugOutput(DEBUG_LEVEL_VERBOSE, "  tms: %d\n", dsettings->tms); 
     394        debugOutput(DEBUG_LEVEL_VERBOSE, "  limit firewire bandwidth: %d\n", dsettings->limit_bandwidth); 
     395        debugOutput(DEBUG_LEVEL_VERBOSE, "  stop on dropout: %d\n", dsettings->stop_on_dropout); 
     396        debugOutput(DEBUG_LEVEL_VERBOSE, "  input level: %d\n", dsettings->input_level); 
     397        debugOutput(DEBUG_LEVEL_VERBOSE, "  output level: %d\n", dsettings->output_level); 
     398        if (m_rme_model == RME_MODEL_FIREFACE800) { 
     399            debugOutput(DEBUG_LEVEL_VERBOSE, "  filter: %d\n", dsettings->filter); 
     400            debugOutput(DEBUG_LEVEL_VERBOSE, "  fuzz: %d\n", dsettings->fuzz); 
     401        } else 
     402        if (m_rme_model == RME_MODEL_FIREFACE400) { 
     403            debugOutput(DEBUG_LEVEL_VERBOSE, "  instr input 0: %d\n", dsettings->ff400_instr_input[0]); 
     404            debugOutput(DEBUG_LEVEL_VERBOSE, "  instr input 1: %d\n", dsettings->ff400_instr_input[1]); 
     405        } 
     406        debugOutput(DEBUG_LEVEL_VERBOSE, "  limiter: %d\n", dsettings->limiter); 
     407        debugOutput(DEBUG_LEVEL_VERBOSE, "  sample rate: %d\n", dsettings->sample_rate); 
     408        debugOutput(DEBUG_LEVEL_VERBOSE, "  word clock single speed: %d\n", dsettings->word_clock_single_speed); 
     409        if (m_rme_model == RME_MODEL_FIREFACE400) { 
     410            debugOutput(DEBUG_LEVEL_VERBOSE, "  phones level: %d\n", dsettings->phones_level); 
     411        } else 
     412        if (m_rme_model == RME_MODEL_FIREFACE800) { 
     413            debugOutput(DEBUG_LEVEL_VERBOSE, "  input opts: %d %d %d\n", 
     414                dsettings->input_opt[0], dsettings->input_opt[1]
     415                dsettings->input_opt[2]); 
     416        } 
    416417    } 
    417418