MythTVがActive EIT Scanで非契約チャンネルに切り替えると、エラーと認識して動作しなくなってしまう。MythTVに無料番組だけ見るチャンネルを登録していると厄介だ。
syslog
Bad ret code[0x8902] in a ECM response. Card I/O failed too many times.
FUSE_b25はエラーカウントが一定数(5)溜まると動作しなくなる仕様になっている。ECMのリターンコードがエラーでもエラーカウントを上げてしまう。そこで、ECMが非契約のリターンコードを返してもエラーカウントを上げないようにする。
非契約のリターンコード(地上デジタルテレビジョン放送運用規定(TR-B14) 第3分冊より)
| 非契約 (Kwなし) | A103 |
| 非契約 (契約外) | 8901,8501,8301 |
| 非契約 (期限切れ) | 8902,8502,8302 |
| 非契約 (視聴制限) | 8903,8503,8303 |
bcas.cを変更して、非契約でもエラーカウントを上げないようにする。すべてのリターンコードをエラーに勘定しない場合は409行目を"goto through;"にして、399~406行を削除すればいい。
$ vi fuse_b25-0.4.8/src/bcas.c
394 retcode = rbuf[4] << 8 | rbuf[5];
395 if (retcode != CARD_RETCODE_GD_TIER &&
396 retcode != CARD_RETCODE_GD_PREPPV &&
397 retcode != CARD_RETCODE_GD_POSTPPV &&
398 retcode != CARD_RETCODE_PV_PREPPV && retcode != CARD_RETCODE_PV_POSTPPV) {
399 if (retcode == 0xa103 ||
400 (retcode >= 0x8901 && retcode <= 0x8903) ||
401 (retcode >= 0x8501 && retcode <= 0x8503) ||
402 (retcode >= 0x8301 && retcode <= 0x8303)) {
403 syslog (LOG_NOTICE,
404 "Ret code[0x%04x] in a ECM response.\n", retcode);
405 goto through;
406 }
407 syslog (LOG_NOTICE,
408 "Bad ret code[0x%04x] in a ECM response.\n", retcode);
409 goto failed;
410 }
441
442 through:
443 pthread_mutex_lock (&card->lock);
444 kinfo->status = CMD_S_FAILED;
445 pthread_mutex_unlock (&card->lock);
446 return;
447 }
パッチ
*** bcas.c.orig 2011-05-19 01:22:28.000000000 +0900
--- bcas.c 2012-08-04 17:21:55.558189838 +0900
***************
*** 396,401 ****
--- 396,409 ----
retcode != CARD_RETCODE_GD_PREPPV &&
retcode != CARD_RETCODE_GD_POSTPPV &&
retcode != CARD_RETCODE_PV_PREPPV && retcode != CARD_RETCODE_PV_POSTPPV) {
+ if (retcode == 0xa103 ||
+ (retcode >= 0x8901 && retcode <= 0x8903) ||
+ (retcode >= 0x8501 && retcode <= 0x8503) ||
+ (retcode >= 0x8301 && retcode <= 0x8303)) {
+ syslog (LOG_NOTICE,
+ "Ret code[0x%04x] in a ECM response.\n", retcode);
+ goto through;
+ }
syslog (LOG_NOTICE,
"Bad ret code[0x%04x] in a ECM response.\n", retcode);
goto failed;
***************
*** 430,435 ****
--- 438,449 ----
}
pthread_mutex_unlock (&card->lock);
return;
+
+ through:
+ pthread_mutex_lock (&card->lock);
+ kinfo->status = CMD_S_FAILED;
+ pthread_mutex_unlock (&card->lock);
+ return;
}
パッチの当て方
$ patch fuse_b25-0.4.8/src/bcas.c < bcas_mythtv-patch/bcas_uncontracted.patch
ビルド・インストール
$ cd fuse_b25-0.4.8/ $ ./configure $ make $ sudo make install
takaaki 8月 4th, 2012
Posted In: ソフトウェア