- Timestamp:
- 10/27/17 18:54:53 (6 years ago)
- Location:
- titan/titan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/frontenddev.h
r41048 r41054 260 260 char* tmpstr = NULL, *tmpnr = NULL, *aktnr = NULL; 261 261 int i, orbitalpos = 0, band = 0; 262 262 int found = 0; 263 //char *CharPtrTmp[20]; 264 struct dvbdev* CharPtrTmp[20]; 265 263 266 if(dvbfirst != NULL) 264 267 dvbnode = dvbfirst; … … 284 287 continue; 285 288 } 286 289 //if(flag != 1) printf("****** test tuner0 %s\n", dvbnode->feshortname); 287 290 if(dvbnode->type == FRONTENDDEV && dvbnode->feinfo->type == tpnode->fetype) 288 291 { … … 298 301 dvbnode->feakttransponder = tpnode; 299 302 if(flag != 1) debug(200, "found tuner with same orbitalpos/frequency/pol/band %s", dvbnode->feshortname); 303 //if(flag != 1) printf("------ found tuner with same orbitalpos/frequency/pol/band %s\n", dvbnode->feshortname); 300 304 return(dvbnode); 301 305 } … … 329 333 } 330 334 335 found = 0; 336 //check if tuner is main tuner 337 if(getconfig(dvbnode->feshortname, NULL) != NULL) 338 { 339 dvbnode = dvbnode->next; 340 continue; 341 } 331 342 //check if tuner is loop and looptuner is locked 332 343 tmpstr = getconfigbyval(dvbnode->feshortname, NULL); 333 if(tmpstr != NULL) //found loop tuner344 while(tmpstr != NULL) //found loop tuner 334 345 { 335 346 tmpdvbnode = fegetbyshortname(tmpstr); 347 //if(flag != 1) printf("****** test tuner1 %s -> %s\n", dvbnode->feshortname, tmpdvbnode->feshortname); 336 348 if(tmpdvbnode != NULL && tmpdvbnode->feakttransponder != NULL && (tmpdvbnode->feaktpolarization != tpnode->polarization || tmpdvbnode->feakttransponder->orbitalpos != tpnode->orbitalpos) && (tmpdvbnode->felock != 0 || (flag == 2 && tmpdvbnode->felock == 0))) 337 349 { 338 dvbnode = dvbnode->next;339 continue;350 found = 0; 351 break; 340 352 } 353 else 354 { 355 CharPtrTmp[found] = tmpdvbnode; 356 found = found + 1; 357 } 358 tmpstr = getconfigbyval(tmpstr, NULL); //loop tuner also loop ? 341 359 } 342 360 CharPtrTmp[found] = NULL; 361 362 if(found == 0) 363 { 364 dvbnode = dvbnode->next; 365 continue; 366 } 367 343 368 tmpstr = ostrcat(dvbnode->feshortname, "_sat", 0, 0); 344 369 for(i = 1; i <= getmaxsat(dvbnode->feshortname); i++) … … 354 379 else 355 380 band = calclof(dvbnode, tpnode, aktnr, 1); 356 if(tmpdvbnode != NULL && tmpdvbnode->feaktband != band && (tmpdvbnode->felock != 0 || (flag == 2 && tmpdvbnode->felock == 0))) 381 found = 0; 382 while(CharPtrTmp[found] != NULL) 357 383 { 384 //if(flag != 1) printf("++++++ test band1 %s\n", CharPtrTmp[found]->feshortname); 385 if(CharPtrTmp[found] != NULL && CharPtrTmp[found]->feaktband != band && (CharPtrTmp[found]->felock != 0 || (flag == 2 && CharPtrTmp[found]->felock == 0))) 386 { 387 found = 99; 388 break; 389 } 390 found = found + 1; 391 } 392 //if(tmpdvbnode != NULL && tmpdvbnode->feaktband != band && (tmpdvbnode->felock != 0 || (flag == 2 && tmpdvbnode->felock == 0))) 393 //{ 394 // free(tmpnr); tmpnr = NULL; 395 // continue; 396 //} 397 if(found == 99) 398 { 399 found = 0; 358 400 free(tmpnr); tmpnr = NULL; 359 401 continue; 360 } 402 } 361 403 if(flag == 1) 362 404 { … … 382 424 free(tmpnr); tmpnr = NULL; 383 425 if(flag != 1) debug(200, "found free tuner witch same orbitalpos %s", dvbnode->feshortname); 426 //if(flag != 1) printf("------ found free tuner witch same orbitalpos %s\n", dvbnode->feshortname); 384 427 return dvbnode; 385 428 } … … 409 452 continue; 410 453 } 411 412 454 if(dvbnode->type == FRONTENDDEV && dvbnode->feinfo->type == tpnode->fetype && dvbnode->felock == 0) 413 455 { … … 417 459 continue; 418 460 } 419 461 if(getconfig(dvbnode->feshortname, NULL) == NULL) 462 { 463 dvbnode = dvbnode->next; 464 continue; 465 } 466 //check if tuner is loop and an other loopt is locked 467 found = 0; 468 tmpstr = getconfigbyval(dvbnode->feshortname, NULL); 469 while(tmpstr != NULL) //found loop tuner 470 { 471 tmpdvbnode = fegetbyshortname(tmpstr); 472 //if(flag != 1) printf("****** test tuner2 %s -> %s\n", dvbnode->feshortname, tmpdvbnode->feshortname); 473 if(tmpdvbnode != NULL && tmpdvbnode->feakttransponder != NULL && (tmpdvbnode->feaktpolarization != tpnode->polarization || tmpdvbnode->feakttransponder->orbitalpos != tpnode->orbitalpos) && (tmpdvbnode->felock != 0 || (flag == 2 && tmpdvbnode->felock == 0))) 474 { 475 found = 0; 476 break; 477 } 478 else 479 { 480 CharPtrTmp[found] = tmpdvbnode; 481 found = found + 1; 482 } 483 tmpstr = getconfigbyval(tmpstr, NULL); //loop tuner also loop ? 484 } 485 if(found == 0) 486 { 487 dvbnode = dvbnode->next; 488 continue; 489 } 420 490 //check if tuner is loop an looptuner is locked 421 491 tmpstr = getconfig(dvbnode->feshortname, NULL); 422 if(tmpstr != NULL) //found loop tuner492 while(tmpstr != NULL) //found loop tuner 423 493 { 424 494 tmpdvbnode = fegetbyshortname(tmpstr); 495 //if(flag != 1) printf("****** test tuner1 %s -> %s\n", dvbnode->feshortname, tmpdvbnode->feshortname); 425 496 if(tmpdvbnode != NULL && tmpdvbnode->feakttransponder != NULL && (tmpdvbnode->feaktpolarization != tpnode->polarization || tmpdvbnode->feakttransponder->orbitalpos != tpnode->orbitalpos) && (tmpdvbnode->felock != 0 || (flag == 2 && tmpdvbnode->felock == 0))) 426 497 { 427 dvbnode = dvbnode->next;428 continue;498 found = 0; 499 break; 429 500 } 501 else 502 { 503 CharPtrTmp[found] = tmpdvbnode; 504 found = found + 1; 505 } 506 tmpstr = getconfig(tmpstr, NULL); 430 507 } 431 else 508 CharPtrTmp[found] = NULL; 509 if(found == 0) 432 510 { 433 511 dvbnode = dvbnode->next; 434 512 continue; 435 513 } 436 514 437 515 tmpstr = ostrcat(tmpdvbnode->feshortname, "_sat", 0, 0); 438 516 for(i = 1; i <= getmaxsat(tmpdvbnode->feshortname); i++) … … 447 525 else 448 526 band = calclof(dvbnode, tpnode, aktnr, 1); 449 if(tmpdvbnode != NULL && tmpdvbnode->feaktband != band && (tmpdvbnode->felock != 0 || (flag >= 2 && tmpdvbnode->felock == 0))) 527 found = 0; 528 while(CharPtrTmp[found] != NULL) 450 529 { 530 //if(flag != 1) printf("++++++ test band2 %s\n", CharPtrTmp[found]->feshortname); 531 if(CharPtrTmp[found] != NULL && CharPtrTmp[found]->feaktband != band && (CharPtrTmp[found]->felock != 0 || (flag >= 2 && CharPtrTmp[found]->felock == 0))) 532 { 533 found = 99; 534 break; 535 } 536 found = found + 1; 537 //if(tmpdvbnode != NULL && tmpdvbnode->feaktband != band && (tmpdvbnode->felock != 0 || (flag >= 2 && tmpdvbnode->felock == 0))) 538 //{ 539 // free(tmpnr); tmpnr = NULL; 540 // continue; 541 //} 542 } 543 if(found == 99) 544 { 545 found = 0; 451 546 free(tmpnr); tmpnr = NULL; 452 547 continue; 453 548 } 549 454 550 if(flag == 1) 455 551 { … … 473 569 free(tmpstr); tmpstr = NULL; 474 570 free(tmpnr); tmpnr = NULL; 475 if(flag != 1) debug(200, "found free looptuner witch same orbitalpos/polarization/band %s", dvbnode->feshortname); 571 if(flag != 1) debug(200, "found free looptuner witch same orbitalpos/polarization/band %s main: %s", dvbnode->feshortname, tmpdvbnode->feshortname); 572 //if(flag != 1) printf("------ found free looptuner witch same orbitalpos/polarization/band %s main: %s\n", dvbnode->feshortname, tmpdvbnode->feshortname); 476 573 return dvbnode; 477 574 } … … 1892 1989 { 1893 1990 int i, y, fd = -1, count = 0; 1894 char *buf = NULL, *frontenddev = NULL, *fehyprid = NULL, *tmpstr = NULL ;1991 char *buf = NULL, *frontenddev = NULL, *fehyprid = NULL, *tmpstr = NULL, *tmpstr1 = NULL; 1895 1992 struct dvb_frontend_info* feinfo = NULL; 1896 1993 struct dvbdev* dvbnode = NULL; … … 1928 2025 tmpstr = ostrcat(tmpstr, oitoa(y), 1, 1); 1929 2026 tmpstr = ostrcat(tmpstr, "_hyprid", 1, 0); 2027 tmpstr1 = ostrcat(tmpstr, "_last", 0, 0); 2028 addconfig(tmpstr1, "999"); //first set 2029 free(tmpstr1), tmpstr1 = NULL; 1930 2030 #ifndef MIPSEL 1931 2031 if(getconfig(tmpstr, NULL) != NULL) … … 2036 2136 p[1].cmd = DTV_DELIVERY_SYSTEM; 2037 2137 p[1].u.data = SYS_UNDEFINED; 2038 2138 char* buf = NULL, *hypridtuner = NULL; 2039 2139 int type = 0; 2140 int ret = 0; 2040 2141 char* realname = gethypridtunerchoicesvaluename(tuner->devnr, value); 2041 2142 2042 //printf("**** > realname: %s\n", realname); 2143 2144 printf("**** > realname: %s\n", realname); 2043 2145 2044 2146 if(realname != NULL && ostrstr(realname, "DVB-S") != NULL) … … 2092 2194 debug(200, "data %d",p[1].u.data ); 2093 2195 if (ioctl(tuner->fd, FE_SET_PROPERTY, &cmdseq) == -1) 2094 err("FE_SET_PROPERTY failed -> system tuner %d mode %s type %d ",tuner->devnr ,value, type); 2095 return 1; //true 2196 { 2197 err("FE_SET_PROPERTY failed -> use procfs to switch delivery system tuner %d mode %s type %d",tuner->devnr ,value, type); 2198 hypridtuner = getconfig("hypridtuner", NULL); 2199 if(hypridtuner != NULL) 2200 { 2201 buf = malloc(MINMALLOC); 2202 if(buf == NULL) 2203 { 2204 err("no memory"); 2205 return 0; 2206 } 2207 } 2208 sprintf(buf, hypridtuner, tuner->devnr); 2209 if(file_exist(buf)) 2210 { 2211 if(tuner->fd > -1) 2212 { 2213 feclose(tuner, -1); 2214 ret = writesys(buf, value, 0); 2215 tuner->fd = feopen(tuner, NULL); 2216 } 2217 else 2218 ret = writesys(buf, value, 0); 2219 printf("set %s to %s RC:%i\n", buf, value, ret); 2220 } 2221 err("set system tuner to %d ... file not found -> %s", value, buf); 2222 free(buf); buf = NULL; 2223 return 1; //true 2224 } 2225 return 0; //true 2096 2226 2097 2227 #else //if DVB_API_VERSION < 5 2228 printf("Hinweis -> DVB API kleiner Version 5\n"); 2229 if(sethypridtuner(tuner, value) == 0) 2230 return 1; 2098 2231 return 0; //false 2099 2232 #endif -
titan/titan/global.h
r41052 r41054 6736 6736 int ret = 0; 6737 6737 6738 char* buf = NULL, *hypridtuner = NULL, *tmpstr = NULL;6738 char* tmpstr = NULL; 6739 6739 char* buf1 = NULL; 6740 6741 hypridtuner = getconfig("hypridtuner", NULL); 6742 6743 if(hypridtuner != NULL) 6744 { 6745 buf = malloc(MINMALLOC); 6746 if(buf == NULL) 6747 { 6748 err("no memory"); 6749 return 0; 6750 } 6751 } 6752 6753 sprintf(buf, hypridtuner, tuner->devnr); 6754 if(buf != NULL) 6755 { 6756 printf("set %s to %s\n", buf, value); 6757 if(file_exist(buf)) 6758 { 6740 6741 tmpstr = ostrcat(tuner->feshortname, "_hyprid_last", 0, 0); 6742 if(ostrcmp(getconfig(tmpstr, NULL), value) == 0) 6743 { 6744 printf("set hyprid.. new value %s eq old value %s\n",getconfig(tmpstr, NULL), value); 6745 free(tmpstr), tmpstr = NULL; 6746 return 0; 6747 } 6748 6749 if(fechangetype(tuner, value) == 0) 6750 { 6751 if(getconfigint("need_delivery_system_workaround" , NULL) == 1) 6752 { 6759 6753 buf1 = readsys("/sys/module/dvb_core/parameters/dvb_shutdown_timeout",1); 6760 6754 ret = writesys("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "0", 1); … … 6764 6758 { 6765 6759 feclose(tuner, -1); 6766 printf("set %s to %s\n", buf, value);6767 ret = writesys(buf, value, 0);6768 6760 tuner->fd = feopen(tuner, NULL); 6769 }6770 else6771 {6772 printf("set %s to %s\n", buf, value);6773 ret = writesys(buf, value, 0);6774 6761 } 6775 6762 writesys("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", buf1, 1); … … 6778 6765 } 6779 6766 else 6780 { 6781 fechangetype(tuner, value); 6782 //return 0; 6783 } 6784 tmpstr = ostrcat(tuner->feshortname, "_hyprid", 0, 0); 6785 addconfigtmp(tmpstr, value); 6786 free(tmpstr); tmpstr = NULL; 6787 } 6788 free(buf); buf = NULL; 6767 printf("Hinweis -> hypridtuner workaround NOT active\n"); 6768 } 6769 6770 addconfig(tmpstr, value); 6771 free(tmpstr), tmpstr = NULL; 6789 6772 6790 6773 return 0; … … 6814 6797 if(buf != NULL) 6815 6798 { 6816 printf(" set %s to %s\n", buf, value);6799 printf("old -> set %s to %s\n", buf, value); 6817 6800 ret = writesys(buf, value, 0); 6818 6801 free(tmpstr); tmpstr = NULL;
Note: See TracChangeset
for help on using the changeset viewer.