Changeset 2049
- Timestamp:
- 02/28/12 04:57:45 (11 years ago)
- Files:
-
- trunk/libffado/src/dice/dice_eap.cpp (modified) (10 diffs)
- trunk/libffado/src/dice/dice_eap.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/dice/dice_eap.cpp
r1955 r2049 201 201 return false; 202 202 } 203 setupSources(); 204 setupDestinations(); 203 m_router->update(); 205 204 206 205 // add the router to the EAP control container … … 213 212 } 214 213 214 215 void 216 EAP::update() 217 { 218 // update EAP from the last init 219 // update router sources and destinations 220 if (m_router) { 221 m_router->update(); 222 } 223 } 224 215 225 void 216 226 EAP::setupSources() { 217 // add the routing sources and destinations for a DICE chip 227 // define router sources (possibly depending on the samplerate) 228 switch(m_device.getCurrentConfig()) { 229 case Device::eDC_Low: setupSources_low(); return; 230 case Device::eDC_Mid: setupSources_mid(); return; 231 case Device::eDC_High: setupSources_high(); return; 232 default: 233 debugError("Unsupported configuration mode\n"); 234 return; 235 } 236 } 237 238 void 239 EAP::setupSources_low() { 240 // add the routing sources for a DICE chip 218 241 switch(m_general_chip) { 219 242 case DICE_EAP_CAP_GENERAL_CHIP_DICEII: … … 248 271 249 272 void 273 EAP::setupSources_mid() { 274 setupSources_low(); 275 } 276 277 void 278 EAP::setupSources_high() { 279 setupSources_low(); 280 } 281 282 void 250 283 EAP::setupDestinations() { 251 // add the routing sources and destinations for a DICE chip 284 switch(m_device.getCurrentConfig()) { 285 case Device::eDC_Low: setupDestinations_low(); return; 286 case Device::eDC_Mid: setupDestinations_mid(); return; 287 case Device::eDC_High: setupDestinations_high(); return; 288 default: 289 debugError("Unsupported configuration mode\n"); 290 return; 291 } 292 } 293 294 void 295 EAP::setupDestinations_low() { 296 // add the routing destinations for a DICE chip 252 297 switch(m_general_chip) { 253 298 case DICE_EAP_CAP_GENERAL_CHIP_DICEII: … … 280 325 break; 281 326 } 327 } 328 void 329 EAP::setupDestinations_mid() { 330 setupDestinations_low(); 331 } 332 void 333 EAP::setupDestinations_high() { 334 setupDestinations_low(); 282 335 } 283 336 … … 794 847 } 795 848 796 // ----------- Mixer ------------- 849 // -------------------------------- Mixer ---------------------------------- 850 // Dice matrix-mixer is a one-dimensional array with inputs index varying 851 // first 852 // 853 // "ffado convention" is that inputs are rows and outputs are columns 854 // 797 855 EAP::Mixer::Mixer(EAP &p) 798 856 : Control::MatrixMixer(&p.m_device, "MatrixMixer") … … 974 1032 int cnt; 975 1033 1034 // 1035 // Caution the user that, displaying as further, because inputs index varies first 1036 // inputs will appears as columns at the opposite of the "ffado convention" 1037 printMessage(" -- inputs index -->>\n"); 976 1038 cnt = 0; 977 1039 for(int j=0; j < nb_inputs; j++) { … … 1033 1095 } 1034 1096 int nb_inputs = m_eap.m_mixer_nb_tx; 1035 int addr = ((nb_inputs * row) + col) * 4;1097 int addr = ((nb_inputs * col) + row) * 4; 1036 1098 quadlet_t tmp = (quadlet_t) val; 1037 1099 if(!m_eap.writeRegBlock(eRT_Mixer, 4+addr, &tmp, 4)) { … … 1046 1108 { 1047 1109 int nb_inputs = m_eap.m_mixer_nb_tx; 1048 int addr = ((nb_inputs * row) + col) * 4;1110 int addr = ((nb_inputs * col) + row) * 4; 1049 1111 quadlet_t tmp; 1050 1112 if(!m_eap.readRegBlock(eRT_Mixer, 4+addr, &tmp, 4)) { … … 1123 1185 1124 1186 void 1187 EAP::Router::update() 1188 { 1189 // Clear and 1190 // define new sources and destinations for the router 1191 m_sources.clear(); 1192 m_eap.setupSources(); 1193 m_destinations.clear(); 1194 m_eap.setupDestinations(); 1195 return; 1196 } 1197 1198 void 1125 1199 EAP::Router::addSource(const std::string& basename, enum eRouteSource srcid, 1126 1200 unsigned int base, unsigned int cnt, unsigned int offset) … … 1188 1262 { 1189 1263 stringlist n; 1264 1190 1265 for (std::map<std::string, int>::iterator it=m_sources.begin(); it!=m_sources.end(); ++it) 1191 1266 n.push_back(it->first); trunk/libffado/src/dice/dice_eap.h
r1806 r2049 395 395 ~Router(); 396 396 397 void update(); 397 398 void show(); 398 399 … … 465 466 bool init(); 466 467 468 /// update EAP 469 void update(); 470 467 471 /// Show information about the EAP 468 472 void show(); … … 510 514 To ease custom device support, this function is not in EAP::Router but here. 511 515 */ 512 virtual void setupSources(); 516 void setupSources(); 517 virtual void setupSources_low(); 518 virtual void setupSources_mid(); 519 virtual void setupSources_high(); 513 520 /** 514 521 @brief Setup all the available destinations … … 520 527 To ease custom device support, this function is not in EAP::Router but here. 521 528 */ 522 virtual void setupDestinations(); 529 void setupDestinations(); 530 virtual void setupDestinations_low(); 531 virtual void setupDestinations_mid(); 532 virtual void setupDestinations_high(); 523 533 524 534 /**