GithubHelp home page GithubHelp logo

chinachu / mirakurun Goto Github PK

View Code? Open in Web Editor NEW
591.0 68.0 98.0 1.75 MB

A Modern DVR Tuner Server for Japanese TV.

Home Page: https://chinachu.moe

License: Apache License 2.0

JavaScript 16.09% TypeScript 81.59% Shell 0.99% Dockerfile 0.19% CSS 0.64% HTML 0.51%
isdb dtv dvr openapi middleware server client typescript javascript epg

mirakurun's Issues

Recbond+Mirakurunで録画すると、動画の画像・音声が乱れる

Environment

  • Version of Mirakurun: 2.5.5
  • Version of Node: v6.11.2
  • Version of NPM: 3.10.10
  • Platform:Ubuntu 17.04
  • Architecture: x64
    Chinachuγ(ubuntu17.04 on Windows10 Hyper-V)→mirakurun→recbond→BondriverProxy→BondriverproxyEX(Windows10)→Spinel(デコード実施)→PT3

Issue

mirakurun経由で録画を実施すると
Recbond単体による録画時には見られない映像の乱れが起きます。
実行環境が特殊すぎるため、環境依存だと思いますが
解決の切り口をいただければと思います。

チャンネルスキャンが既存のエンドポイント/オプションで動作しなくなっている。

Environment

Issue

チャンネルスキャンが既存のエンドポイント/オプションで動作しなくなっていました。

$ sudo curl -X PUT "http://localhost:40772/api/config/channels/scan"
channel scanning... (type: "GR")

-> total 0 channels (of Takeover is 0) found and 46 channels stored.

channel scan has completed and saved successfully.
**RESTART REQUIRED** to apply changes.

#79 の PR が契機と思われます。

挙動としてはminCh/maxChを指定すると動作するため、

$ sudo curl -X PUT "http://localhost:40772/api/config/channels/scan?type=GR"
channel scanning... (type: "GR")

-> total 0 channels (of Takeover is 0) found and 46 channels stored.

channel scan has completed and saved successfully.
**RESTART REQUIRED** to apply changes.
$ sudo curl -X PUT "http://localhost:40772/api/config/channels/scan?type=GR&minCh=13&maxCh=67"
channel scanning... (type: "GR")

channel: "13" ...
-> 3 services found.
-> {"name":"NHKEテレ","type":"GR","channel":"13"}

channel: "14" ...

以下で判定が想定通りで無いように見えました。

case common.ChannelTypes.GR:
option.startCh = option.startCh === undefined ? 13 : option.startCh;
option.endCh = option.endCh === undefined ? 62 : option.endCh;


以下は推測です。

API定義上のデフォルト値も消えている。

{
in: "query",
name: "minCh",
type: "integer",
description: "Specifies the minimum number of channel numbers to scan."
},
{
in: "query",
name: "maxCh",
type: "integer",
description: "Specifies the maximum number of channel numbers to scan."
},

fw? middleware? に何を使っているのか把握出来ていないのですが、
GRとかのデフォルト値が扱われているところをみると、
type: "integer" で、 0 に丸められる挙動になってしまっているのでは無いでしょうか。

failed on B_CAS_CARD::init() : code=-3と書かれたエラー

Issue

...

[TAILING] Tailing last 15 lines for [mirakurun-server] process (change the value with --lines option)
/usr/local/var/log/mirakurun.stderr.log last 15 lines:
3|mirakuru | { Error: write EPIPE
3|mirakuru |     at WriteWrap.afterWrite (net.js:779:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' }
3|mirakuru | error - failed on B_CAS_CARD::init() : code=-3
3|mirakuru | { Error: write EPIPE
3|mirakuru |     at WriteWrap.afterWrite (net.js:779:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' }
3|mirakuru | error - failed on B_CAS_CARD::init() : code=-3
3|mirakuru | { Error: write EPIPE
3|mirakuru |     at WriteWrap.afterWrite (net.js:779:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' }
3|mirakuru | error - failed on B_CAS_CARD::init() : code=-3
3|mirakuru | { Error: write EPIPE
3|mirakuru |     at WriteWrap.afterWrite (net.js:779:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' }
3|mirakuru | error - failed on B_CAS_CARD::init() : code=-3
3|mirakuru | { Error: write EPIPE
3|mirakuru |     at WriteWrap.afterWrite (net.js:779:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' }
3|mirakuru | error - failed on B_CAS_CARD::init() : code=-3

表題のようにmirakurun log serverを実行し、ログを見てみるとこのようなエラーが発生してしまいます。

EPGStationを使用し、録画は正常に成功するのですが、ライブ視聴で出来ない状態です

RaspberryPi3に正しくインストール・設定できない

Environment

  • Version of Mirakurun: 2.13.0
  • Version of Node: v12.13.1
  • Version of NPM: 6.12.1
  • Platform: Raspbian buster

Issue

上記の環境にてmirakurunをインストールしようと試みましたが、下記のエラーログが出力されて各種設定がうまくできません。

0|mirakuru |     '    ^'
0|mirakuru | }
0|mirakuru | YAMLException: end of the stream or a document separator is expected at line 40, column 1:
0|mirakuru |     types:
0|mirakuru |     ^
0|mirakuru |     at generateError (/usr/local/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
0|mirakuru |     at throwError (/usr/local/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:173:9)
0|mirakuru |     at readDocument (/usr/local/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:1539:5)
0|mirakuru |     at loadDocuments (/usr/local/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:1575:5)
0|mirakuru |     at load (/usr/local/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:1596:19)
0|mirakuru |     at Object.safeLoad (/usr/local/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:1618:10)
0|mirakuru |     at load (/usr/local/lib/node_modules/mirakurun/lib/Mirakurun/Mirakurun/config.ts:114:17)
0|mirakuru |     at Object.loadTuners (/usr/local/lib/node_modules/mirakurun/lib/Mirakurun/Mirakurun/config.ts:95:12)
0|mirakuru |     at Object.<anonymous> (/usr/local/lib/node_modules/mirakurun/lib/server.ts:56:26)
0|mirakuru |     at Module._compile (internal/modules/cjs/loader.js:959:30)

これらのエラーを解消する方法を教えていただけますでしょうか?

...

EPGデータの文字化け

Environment

  • Version of Mirakurun: 2.5.7
  • Version of Node: v6.10.3
  • Version of NPM: 3.10.10
  • Platform:Ubuntu 16.04
  • Architecture: x64

Issue

EPGの番組表データが一部文字化けしています
当方の環境ではUTF-8のテキストデータとしてprograms.jsonを開き、\u0を検索すると異常箇所がヒットします

Mirakurun死なないでDVBチュナーをlockupさせる

Environment

  • Version of Mirakurun: latest from git
  • Version of Node: v6.5.0
  • Version of NPM: 3.10.3
  • Platform:
  • Architecture: x64

Issue

PT3チュナーがlockupされて、強制的にPCを再起動やらないとダメな状態になりました。
これは最近なことです、mirakurunを更新した後のことです。
having my PT3 card getting locking up, I have to make a forced reboot.
This is a recent situation, started to happen afer a mirakurun update.

問題はrecpt1のプロセスが起動しすぎて、やがてPT3カードがlockupすることになりそうです。
Problem is triggered by too much recpt1 processes getting started making the PT3 card lock up.

まず気になるのは同時にmirakurunプロセスが二つがあって、「sudo murakurun stop」を実行しても一つが残る:
First I'm intrigued by having two mirakurun processes running simultaneously, even after issuing a "sudo mirakurun stop" one is still left.

起動状態
At system boot up

chinachu@goelette:~$ ps auwx | grep -i miraku
root       952 55.8  4.8 995800 99100 ?        S<sl 22:48   1:26 Mirakurun: Server
root       976 34.0  3.6 978252 75280 ?        S<sl 22:48   0:51 Mirakurun: Server

chinachu@goelette:~$ ps auwx | grep -i recpt
root      1432  3.5  0.1  38608  2252 ?        S<l  22:49   0:03 recpt1 --device /dev/pt3video1 --lnb 15 BS15_0 - -

chinachu@goelette:~$ pstree -halup
systemd,1 noplymouth
  ├─PM2 v2.6.1: God,935
  │   ├─Mirakurun: Serv,976
  │   │   ├─{V8 WorkerThread},978
  │   │   ├─{V8 WorkerThread},979
  │   │   ├─{V8 WorkerThread},980
  │   │   ├─{V8 WorkerThread},981
  │   │   ├─{node},977
  │   │   ├─{node},1037
  │   │   ├─{node},1038
  │   │   ├─{node},1039
  │   │   └─{node},1040
  │   ├─node /home/chin,982,chinachu
  │   │   ├─{V8 WorkerThread},984
  │   │   ├─{V8 WorkerThread},985
  │   │   ├─{V8 WorkerThread},986
  │   │   ├─{V8 WorkerThread},987
  │   │   ├─{node},983
  │   │   ├─{node},1061
  │   │   ├─{node},1062
  │   │   ├─{node},1063
  │   │   └─{node},1064
  │   ├─node /home/chin,990,chinachu
  │   │   ├─{V8 WorkerThread},992
  │   │   ├─{V8 WorkerThread},993
  │   │   ├─{V8 WorkerThread},994
  │   │   ├─{V8 WorkerThread},995
  │   │   ├─{node},991
  │   │   ├─{node},1065
  │   │   ├─{node},1066
  │   │   ├─{node},1067
  │   │   └─{node},1068
  │   ├─{PM2 v2.6.1: God},972
  │   ├─{PM2 v2.6.1: God},973
  │   ├─{PM2 v2.6.1: God},974
  │   ├─{PM2 v2.6.1: God},975
  │   ├─{V8 WorkerThread},937
  │   ├─{V8 WorkerThread},938
  │   ├─{V8 WorkerThread},939
  │   ├─{V8 WorkerThread},940
  │   └─{node},936
  ├─node,848 /usr/local/lib/node_modules/pm2/bin/pm2 resurrect --no-daemon
  │   ├─Mirakurun: Serv,952
  │   │   ├─recpt1,1432 --device /dev/pt3video1 --lnb 15 BS15_0 - -
  │   │   │   ├─{recpt1},1437
  │   │   │   ├─{recpt1},1438
  │   │   │   └─{recpt1},1439
  │   │   ├─{V8 WorkerThread},954
  │   │   ├─{V8 WorkerThread},955
  │   │   ├─{V8 WorkerThread},956
  │   │   ├─{V8 WorkerThread},957
  │   │   ├─{node},953
  │   │   ├─{node},962
  │   │   ├─{node},963
  │   │   ├─{node},964
  │   │   └─{node},965
  │   ├─{V8 WorkerThread},865
  │   ├─{V8 WorkerThread},866
  │   ├─{V8 WorkerThread},867
  │   ├─{V8 WorkerThread},868
  │   ├─{node},863
  │   ├─{node},948
  │   ├─{node},949
  │   ├─{node},950
  │   └─{node},951
 ├─chinachu,903,chinachu /home/chinachu/Chinachu-gamma/chinachu service wui execute
  │   ├─node,916 app-wui.js
  │   │   ├─{V8 WorkerThread},922
  │   │   ├─{V8 WorkerThread},923
  │   │   ├─{V8 WorkerThread},924
  │   │   ├─{V8 WorkerThread},925
  │   │   ├─{node},921
  │   │   ├─{node},968
  │   │   ├─{node},969
  │   │   ├─{node},970
  │   │   └─{node},971
  │   └─tee,917 -a ./log/wui
  ├─chinachu,904,chinachu /home/chinachu/Chinachu-gamma/chinachu service operator execute
  │   ├─node,919 app-operator.js
  │   │   ├─{V8 WorkerThread},927
  │   │   ├─{V8 WorkerThread},928
  │   │   ├─{V8 WorkerThread},929
  │   │   ├─{V8 WorkerThread},930
  │   │   ├─{node},926
  │   │   ├─{node},944
  │   │   ├─{node},945
  │   │   ├─{node},946
  │   │   └─{node},947
  │   └─tee,920 -a ./log/operator

mirakurunをstopしようとしたら
After issuing a stop command to mirakurun

chinachu@goelette:~$ sudo mirakurun stop

chinachu@goelette:~$ sudo pm2 status
┌───────────────────┬────┬──────┬─────┬─────────┬─────────┬────────┬─────┬────────────┬──────┬──────────┐
│ App name          │ id │ mode │ pid │ status  │ restart │ uptime │ cpu │ mem        │ user │ watching │
├───────────────────┼────┼──────┼─────┼─────────┼─────────┼────────┼─────┼────────────┼──────┼──────────┤
│ chinachu-operator │ 2  │ fork │ 990 │ online  │ 0       │ 5m     │ 0%  │ 38.1 MB    │ root │ disabled │
│ chinachu-wui      │ 1  │ fork │ 982 │ online  │ 0       │ 5m     │ 0%  │ 124.0 MB   │ root │ disabled │
│ mirakurun-server  │ 0  │ fork │ 0   │ stopped │ 0       │ 0      │ 0%  │ 0 B        │ root │ disabled │
└───────────────────┴────┴──────┴─────┴─────────┴─────────┴────────┴─────┴────────────┴──────┴──────────┘
 Use `pm2 show <id|name>` to get more details about an app

chinachu@goelette:~$ ps auwx | grep -i recpt
root      3292  5.1  0.1  38912  2480 ?        S<l  22:52   0:05 recpt1 --device /dev/pt3video0 --lnb 15 CS4 - -

chinachu@goelette:~$ ps auwx | grep -i miraku
root       952 59.0  7.6 1025196 155940 ?      S<sl 22:48   3:35 Mirakurun: Server

chinachu@goelette:~$ pstree -halup
systemd,1 noplymouth
  ├─node,848 /usr/local/lib/node_modules/pm2/bin/pm2 resurrect --no-daemon
  │   ├─Mirakurun: Serv,952
  │   │   ├─recpt1,3292 --device /dev/pt3video0 --lnb 15 CS4 - -
  │   │   │   ├─{recpt1},3297
  │   │   │   ├─{recpt1},3298
  │   │   │   └─{recpt1},3299
  │   │   ├─recpt1,3799 --device /dev/pt3video2 16 - -
  │   │   ├─{V8 WorkerThread},954
  │   │   ├─{V8 WorkerThread},955
  │   │   ├─{V8 WorkerThread},956
  │   │   ├─{V8 WorkerThread},957
  │   │   ├─{node},953
  │   │   ├─{node},962
  │   │   ├─{node},963
  │   │   ├─{node},964
  │   │   └─{node},965
  │   ├─{V8 WorkerThread},865
  │   ├─{V8 WorkerThread},866
  │   ├─{V8 WorkerThread},867
  │   ├─{V8 WorkerThread},868
  │   ├─{node},863
  │   ├─{node},948
  │   ├─{node},949
  │   ├─{node},950
  │   └─{node},951

mirakurunとrecpt1プロセスは永久に残っている。
どこかに二重の起動が行われている。
There are mirakurun and recpt1 processes running continuously.
Somewhere, processes are started twice.

どこに調査すればいいでしょう?
Where should I look up ?

【報告】channels.yml変更後に視聴できなくなった

Environment

  • Version of Mirakurun: 2.7.0
  • Version of Node: v8.10.0
  • Version of NPM: 6.0.0
  • Platform: Windows10 home
  • Architecture: x64

Issue

たびたびお世話になります。

Windows環境で利用させていただいており、先日のBSプレミアムのトランスポンダ変更に伴い、BonRecTestおよびMirakurunのチャンネル設定を変更する必要がありましたが、その後EPGStationからの試聴・録画ができなくなりました。(TVTestからはチャンネルスキャンをすることで視聴できています)

services.jsonを見るとchannels.yml変更後の内容が反映されていなかったので、services.jsonとprograms.jsonを削除の上Mirakurunを再起動したところ、正常に視聴できるようになりました。

そもそも仕様としてそうなのか、あるいはバグなのかはわかりませんでしたが、念のため報告します。

クリーンインストール後に動作しない

Environment

  • Version of Mirakurun: 2.7.0
  • Version of Node: v8.11.3
  • Version of NPM: 5.6.0
  • Platform: Windows10 home
  • Architecture: x64

Issue

OSのクリーンインストール前には問題なく動作したいたのですが、クリーンインストール後に再びインストールしたところ動作しなくなりました。mirakurun UIでは「Connection Failed」と
表示されます。エラーログは下記のようになっています。

2018-07-17T19:40:18.190+09:00 error: { Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (net.js:364:12)
at resolve (C:\Users\scotto\AppData\Roaming\npm\node_modules\mirakurun\lib\Mirakurun\TunerDevice.js:301:41)
at new Promise ()
at TunerDevice. (C:\Users\scotto\AppData\Roaming\npm\node_modules\mirakurun\lib\Mirakurun\TunerDevice.js:296:19)
at Generator.next ()
at C:\Users\scotto\AppData\Roaming\npm\node_modules\mirakurun\lib\Mirakurun\TunerDevice.js:7:71
at new Promise ()
at __awaiter (C:\Users\scotto\AppData\Roaming\npm\node_modules\mirakurun\lib\Mirakurun\TunerDevice.js:3:12)
at TunerDevice._kill (C:\Users\scotto\AppData\Roaming\npm\node_modules\mirakurun\lib\Mirakurun\TunerDevice.js:288:16)
at Timeout.setTimeout [as _onTimeout] (C:\Users\scotto\AppData\Roaming\npm\node_modules\mirakurun\lib\Mirakurun\TunerDevice.js:172:26) code: 'EPIPE' }

インストールエラー(windows10home)

Environment

  • Version of Mirakurun: 2.5.7
  • Version of Node: v6.12.3
  • Version of NPM: 3.10.10
  • Platform: windows10 [home]
  • Architecture: x64

Issue

Mirakurunのインストールでエラーが出てしまいます。
windows非サポートなのは承知してますが、対応していただけたらありがたいです。
npm-debug.log

配信にUDPマルチキャストはどうでしょうか?

Chinachu/BonDriver_Mirakurun#3
同上の理由(帯域削減)と遅延の関係で
TCP or UDPの切り替えが出来るよう検討していただけないでしょうか。

具体的にはconfでUDP指定時に
・視聴するPCが複数ある場合UDP
・同じ番組を選択した場合UDPマルチキャスト
・例外指定IP(Chinachuγ等)はTCP
にて送信

ご検討のほど宜しくお願いします。

windows8.1でのインストールエラー

Environment

  • Version of Mirakurun: 2.11.0
  • Version of Node: v8.9.4
  • Version of NPM: 6.4.1
  • Platform: windows8.1 HOME
  • Status of Mirakurun: https://gist.github.com/... (from http://mirakurun-server-ip:40772/api/status)

Issue

windows8.1で、Mirakurunのインストールが出来ません。
osはすでに最新版にアップデートしております。
以前epgstationと一緒に構築しようとしていました。
powershellは管理者権限です。

なぜか以前インストールしたときは問題なく起動し、コンピューターの再起動をしても起動しました。
しかし、epgstationをコンピュータ起動時に起動する.batファイルを作ってスタートアップに登録してから、再起動すると、.batファイルが起動してからMirakurunが起動しませんでした。

それからいろいろ試しても解決せず、epgstationとMirakurun,nodejs,winser,batファイルを、すべて削除してからmirakurunを再インストールしようとしました。しかし以前できた方法でインストールできません。

windowsは非サポートなのは承知しておりますが、
対応いただければ幸いです。

以下ログです。

使用した.bat cd c:\epgstation

npm start

powershellの内容

Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> npm install mirakurun@latest -g --production

[email protected] preinstall C:\Users\kazu\AppData\Roaming\npm\node_modules\mirakurun
node bin/preinstall.js

C:\Users\kazu\AppData\Roaming\npm\mirakurun-epgdump -> C:\Users\kazu\AppData\Roaming\npm\node_modules\mirakurun\bin\epgd
ump.js
C:\Users\kazu\AppData\Roaming\npm\mirakurun -> C:\Users\kazu\AppData\Roaming\npm\node_modules\mirakurun\bin\cli.sh

[email protected] postinstall C:\Users\kazu\AppData\Roaming\npm\node_modules\mirakurun\node_modules\core-js
node postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:

https://opencollective.com/core-js
https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

[email protected] postinstall C:\Users\kazu\AppData\Roaming\npm\node_modules\mirakurun
node bin/postinstall.js && opencollective-postinstall

Version: [email protected] [OK]
Version: [email protected] [OK]
No rights to manage services.
child_process.js:624
throw err;
^

Error: Command failed: winser.cmd -i -a --startuptype auto --startcmd node.exe bin\init.win32.js --set AppPriority ABOVE
_NORMAL_PRIORITY_CLASS --set Type SERVICE_WIN32_OWN_PROCESS --set AppStdout C:\Users\kazu\AppData\Local\Mirakurun\stdout
--set AppStderr C:\Users\kazu\AppData\Local\Mirakurun\stderr --env USERPROFILE=C:\Users\kazu --env LOCALAPPDATA=C:\User
s\kazu\AppData\Local --env USING_WINSER=1
at checkExecSyncError (child_process.js:601:13)
at Object.execFileSync (child_process.js:621:13)
at Object. (C:\Users\kazu\AppData\Roaming\npm\node_modules\mirakurun\bin\postinstall.js:154:19)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node bin/postinstall.js && opencollective-postinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kazu\AppData\Roaming\npm-cache_logs\2019-10-30T12_03_47_954Z-debug.log

2019-10-30T12_03_47_954Z-debug.log

アップデート失敗&起動不可

Environment

  • Version of Mirakurun: 2.1.0
  • Version of Node: v6.10.3
  • Version of NPM: 3.10.10
  • Platform: Cent OS 7
  • Architecture: x64

Issue

Mirakurun UIからアップデートのAPIを叩いたら再起動後、起動せず。
アップデート失敗。その後起動不可に。
コマンドラインからのアップデートは試してないです(UIのため)。

Error: Cannot find module 'promise-queue'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Function._load (/usr/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:62:21)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/mirakurun/lib/Mirakurun/Mirakurun/queue.ts:18:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)

特定チャンネルのデータが出力されない

rivarun経由でMirakurunからのストリームデータ取り出しをしていますが、
特定のチャンネルで、Mirakurunからデータが出てきません。

MirakurunをインストールしているPCで、recpt1を実行した場合、データは出てきます。
また、rivarunを使わず、直接REST叩いて、該当チャンネルをGETしても、Mirakurunが無反応です。
statusも帰って来ないので、何が起こっているのか、イマイチ分かりません。

recpt1ではデータが取れるのと、Mirakurunがステータスすら返さない事から、
なんとなく、recpt1のストリームデータをMirakurunが受け取れてないのかな?って思えます。

おかしい所のログを抜き出しました。
Mirakurun_log.txt

1~14行 正常
15~28行 なんかおかしい

channnel設定

  • name: ショップチャンネル
    type: CS
    channel: CS8
    serviceId: 55
    isDisabled: false
  • name: GAORA
    type: CS
    channel: CS12
    serviceId: 254
    isDisabled: false

Request to add <frequency> and <polarity> options to channels.yml for DVB-S2 (SKY) channels

Issue

Currently there is no easy way to synchronize DVB-S2 tuning with data in channels.yml. Need to maintain zap.conf with redundant data for tuning.

Suggestion

  • Add frequency: xxxxx to channel specification. This will be passed to command as <frequency>
  • Add polarity: <H> or <V> to channel specification. This will be passed to command as <polarity>

The above would result in a command line for example:

--freq 12598 --satellite JCSAT4B --polarity H

and tuners.yml would have something like

recapp --freq <frequency> --satellite <satelite> --polarity <polarity>

Which means immediate tuning can be done (freq, polarity, tone are known).
Complete channels.yml would look something like this:

- name: AT-X
  type: SKY
  channel: CH667
  freq: 12718
  polarity: V
  serviceId: 33435
  satelite: JCSAT3A

Also, "satellite" has two ll.

Please consider it.

CS4のServiceIdがchannelsに登録されない

channelsに登録した、CS4のservieIdがMirakurunのchannelsに反映されません。
よって、EPGも取得できていません。
検索用に登録しているsid 100は出ますが、それ以外の227,223,250,342,363が反映されていません

CentOS 7.2-x64
[email protected]

チャンネル設定

  • name: ND4
    type: CS
    channel: CS4
    serviceId: 100
    isDisabled: false

/api/channelsの結果一部
{
"type": "CS",
"channel": "CS4",
"name": "ND4",
"services": [
{
"id": 700100,
"serviceId": 100,
"networkId": 7,
"name": "スカパー!プロモ"
}
]
},

Mirakurunログ

stderrには、何も吐かれていませんでした。

2016-06-05T02:00:07.737Z debug: TunerDevice#1 released
2016-06-05T02:00:07.805Z info: TunerDevice#0 > device = /dev/pt3video0
2016-06-05T02:00:07.807Z info: TunerDevice#0 > C/N = 15.810147dB
2016-06-05T02:00:07.807Z info: TunerDevice#0 > Recording...
2016-06-05T02:00:07.898Z debug: TSFilter detected NIT PID=16
2016-06-05T02:00:07.898Z debug: TSFilter detected PMT PID=1025 as serviceId=100 (unregistered)
2016-06-05T02:00:07.898Z debug: TSFilter detected PMT PID=1027 as serviceId=223 (unregistered)
2016-06-05T02:00:07.898Z debug: TSFilter detected PMT PID=1029 as serviceId=227 (unregistered)
2016-06-05T02:00:07.898Z debug: TSFilter detected PMT PID=1037 as serviceId=250 (unregistered)
2016-06-05T02:00:07.898Z debug: TSFilter detected PMT PID=1026 as serviceId=342 (unregistered)
2016-06-05T02:00:07.898Z debug: TSFilter detected PMT PID=1028 as serviceId=363 (unregistered)
2016-06-05T02:00:10.298Z debug: TunerDevice#0 end stream for user Mirakurun:getServices() (priority=-1)...
2016-06-05T02:00:10.298Z info: TunerDevice#0 end streaming to user Mirakurun:getServices() (priority=-1)
2016-06-05T02:00:10.298Z debug: TSFilter has closed (serviceId=null, eventId=null)
2016-06-05T02:00:10.299Z debug: ChannelItem#"ND4" services: [
{
"networkId": 7,
"serviceId": 100,
"name": "スカパー!プロモ"
},
{
"networkId": 7,
"serviceId": 223,
"name": "映画・chNECO"
},
{
"networkId": 7,
"serviceId": 227,
"name": "ザ・シネマ"
},
{
"networkId": 7,
"serviceId": 250,
"name": "スカイA"
},
{
"networkId": 7,
"serviceId": 342,
"name": "ヒストリーチャンネル"
},
{
"networkId": 7,
"serviceId": 363,
"name": "囲碁・将棋チャンネル"
}
]
2016-06-05T02:00:10.299Z info: ChannelItem#"ND4" service scan has finished

TSFilterでバッファーがあふれると,`TSFilter._write()`が呼び出されなくなる

Environment

  • Version of Mirakurun: 2.10.1
  • Version of Node: v10.15.3
  • Version of NPM: x6.4.1
  • Platform: 理論上どこでも発生

Issue

TSFilterでバッファーがあふれたとき,callbackを呼び出していません.そのため,chunkはまだ処理中であるとNode.jsは判断し,TSFilter._write()は二度と呼び出されなくなります.

TSFilter. _overflowTimerは常にタイムアウトし,オーバーフロー状態が回復することはありません.

確認方法

ソースコードを書き換えるのが一番簡単です.以下はコンパイル後のTSFilter.js

        this.highWaterMark = 1024 * 1024 * 0;  // 大抵の場合,すぐにデータが読み出されるので,これでも動きます
        this._overflowTimeLimit = 1000 * 5;  // 30s待ちたくないので..
    ...
    _write(chunk, encoding, callback) {
        if (this._closed === true) {
            callback(new Error("TSFilter has closed already"));
            return;
        }
        if (this._overflowTimer !== null) {
            // オーバーフローすると上記条件になります
            // 再び_writeが呼び出されるなら,以下が出力されるはず...
            log.info("==================================");
        }

サービスのスキャンやEGP情報の収集などが一段落して落ち着いてきたら,ストリームをリクエスト

$ curl -sSL http://mirakurun:40772/api/channels/GR/26/stream?encode=1 >/dev/null

TSFilter._writeが呼び出されないことが確認できます.

2019-04-26T22:40:47.655+09:00 info: TSFilter has created (serviceId=null, eventId=null)
2019-04-26T22:40:47.658+09:00 debug: TunerDevice#0 start stream for user `172.17.0.1:35010` (priority=0)...
2019-04-26T22:40:47.660+09:00 debug: TunerDevice#0 spawn...
2019-04-26T22:40:47.681+09:00 info: TunerDevice#0 process has spawned by command `node lib/remote mirakurun-remote 40772 GR 26` (pid=637)
2019-04-26T22:40:47.684+09:00 info: TunerDevice#0 streaming to user `172.17.0.1:35010` (priority=0)
2019-04-26T22:40:48.458+09:00 info: TunerDevice#0 > remote: { host: 'mirakurun-remote',
  port: 40772,
  type: 'GR',
  channel: '26',
  decode: false }
2019-04-26T22:40:49.429+09:00 debug: TSFilter detected NIT PID=16
2019-04-26T22:40:49.431+09:00 debug: TSFilter detected PMT PID=496 as serviceId=1032 (NHKEテレ1東京)
2019-04-26T22:40:49.432+09:00 debug: TSFilter parsing serviceId=1032 (NHKEテレ1東京)
2019-04-26T22:40:49.434+09:00 debug: TSFilter parsing serviceId=1033 (NHKEテレ2東京)
2019-04-26T22:40:49.435+09:00 debug: TSFilter parsing serviceId=1034 (NHKEテレ3東京)
2019-04-26T22:40:49.437+09:00 debug: TSFilter parsing serviceId=1416 (NHK携帯2)
2019-04-26T22:40:49.438+09:00 debug: TSFilter detected PMT PID=1008 as serviceId=1033 (NHKEテレ2東京)
2019-04-26T22:40:49.439+09:00 debug: TSFilter detected PMT PID=1264 as serviceId=1034 (NHKEテレ3東京)
2019-04-26T22:40:49.441+09:00 debug: TSFilter detected PMT PID=8136 as serviceId=1416 (NHK携帯2)
2019-04-26T22:40:50.257+09:00 warn: TSFilter is overflowing the buffer...
2019-04-26T22:40:53.242+09:00 debug: saving programs...
2019-04-26T22:40:53.246+09:00 info: save db `/usr/local/var/db/mirakurun/programs.json` w/ integirty (xxx=)
2019-04-26T22:40:55.258+09:00 error: TSFilter will closing because reached time limit of overflowing the buffer...
2019-04-26T22:40:55.261+09:00 info: TSFilter has closed (serviceId=null, eventId=null)
2019-04-26T22:40:55.263+09:00 debug: TunerDevice#0 end stream for user `172.17.0.1:35010` (priority=0)...
2019-04-26T22:40:55.264+09:00 info: TunerDevice#0 end streaming to user `172.17.0.1:35010` (priority=0)
2019-04-26T22:40:55.272+09:00 info: 172.17.0.1 - GET /api/channels/GR/26/stream?encode=1 HTTP/1.1 200 - - 1965.872 ms curl/7.54.0
2019-04-26T22:40:58.265+09:00 debug: TunerDevice#0 kill...
2019-04-26T22:40:58.271+09:00 info: TunerDevice#0 > remote: exit.
2019-04-26T22:40:58.301+09:00 info: TunerDevice#0 process has closed with exit code=0 by signal `null` (pid=637)
2019-04-26T22:40:58.418+09:00 debug: TunerDevice#0 released

修正方法

chunkは捨てられるのでcallbackを呼び出だすだけでOK(後ほどPRを出します).

NHK総合のEPGが取得できません…

Ubuntu 16.10(Desktop) に新規で Chinachu(γ) + Mirakurunをインストールし、テストしています。
recpt1やrivarun 単体でのテスト録画できているのですが、Chinachuの番組表に"NHK総合のみ"表示されません。
テスト機・メイン機 共に同様のことが起こっていますのでバグかなと思うのですが、どうでしょうか…?

mirakurun: 2.0.0-rc.13
OS: ubuntu 16.10 (Desktop、apt upgradeで最新の状態)
PC: x64、 Pentium N3700
api status:
{
"version": "2.0.0-rc.13",
"process": {
"arch": "x64",
"platform": "linux",
"versions": {
"http_parser": "2.7.0",
"node": "7.4.0",
"v8": "5.4.500.45",
"uv": "1.10.1",
"zlib": "1.2.8",
"ares": "1.10.1-DEV",
"modules": "51",
"openssl": "1.0.2j",
"icu": "58.2",
"unicode": "9.0",
"cldr": "30.0.3",
"tz": "2016j"
},
"pid": 1350,
"memoryUsage": {
"rss": 80736256,
"heapTotal": 32485376,
"heapUsed": 25173336,
"external": 2956740
}
},
"epg": {
"gatheringNetworks": [
32391
],
"storedEvents": 8101
},
"streamCount": {
"tunerDevice": 1,
"tsFilter": 1,
"decoder": 0
},
"errorCount": {
"uncaughtException": 0,
"bufferOverflow": 0,
"tunerDeviceRespawn": 0
},
"timerAccuracy": {
"last": 0.87,
"m1": {
"avg": 447.6444833333333,
"min": -692.991,
"max": 4542.68
},
"m5": {
"avg": -2761.8058866666665,
"min": -999705.726,
"max": 11449.298
},
"m15": {
"avg": -920.6019622222223,
"min": -999705.726,
"max": 11449.298
}
}
}

[質問] バッファーあふれに関連する実装上の質問

Environment

  • Version of Mirakurun: master
  • Version of Node: 質問なので省略
  • Version of NPM: 質問なので省略
  • Platform: 質問なので省略
  • Status of Mirakurun: 質問なので省略

Issue

はじめに,ソフトウェアを開発・公開してくださった方々に感謝致します.

利用している間にいくつか気になる現象を見つけ,それに関連する質問が3点あります.

確認の結果,不具合・改善点と判断された場合は,修正を試みようと思います.

TSFilter._writeでhighWaterMarkを超えるとcallbackを呼び出さない

Writable._writeの説明によると,callbackが呼び出されることを期待していますが,highWaterMarkを超えた場合,callbackを呼び出しません.

これは意図したことでしょうか?

関連性の確認は出来ていませんが,_overflowTimerのタイムアウトが発生すると,decodeのプロセスが残ったままになる現象を確認しています.

callbackを呼び出さないと,chunkはいつまでも処理中だと判断され,Node.jsはそれを開放することができません.恐らく,chunkを保持しているクロージャーも残り続けると思われます.この辺りが原因で,endやcloseのイベントが発生せず,decodeのプロセスが残り続けているのかもしれません.

あと,動いているようなので今のままでもいいのかもしれませんが,pushは_readで呼び出すことが期待されているように読めます._writeではchunkをどこかに保存して,_readが呼び出されたらpushするのが正しいように思えます.

Program. findByNetworkIdAndReplaceが非同期処理になっていない

asyncがついていますが,処理の途中でイベントループに戻ることはありません.

これは実装漏れでしょうか?

BSチャンネルが登録されている場合,NetworkId#4がたくさんあるので,プログラム数が4000を超えることがあり,それなりの時間このメソッドから戻ってこなくなります.

Rock64で確認した限りだと,10秒以上かかることがあるみたいです.

Tuner. _getStreamでのasync await common.sleep(1000)の意図

前の質問に関連しますが,このコードの意図を教えてください.

Program. findByNetworkIdAndReplaceで長時間ブロックされるので,溜まったTSデータを読み書きすることを期待しているのかと推測しています.

ただ,私が手元でTSFilter.{_read|_write}にログを入れて確認した限りでは,チューナープロセスからのTSFilterへの書き込みは行われますが,TSFilterからdecodeプロセスなどへの書き込みは必ずしもこのスリープ中に行われるというものでもないように見えます.

SIDでスプリットしたBS朝日とBSフジがTVTestで見られない

Environment

  • Version of Mirakurun: 2.7.0
  • Version of Node: v8.9.6
  • Version of NPM: 5.6.0
  • Platform: Docker Container on Ubuntu 17.10 (docker-ce 17.12.1ce-0ubuntu)
  • Architecture: x64

Issue

Ubuntu 17.10が稼働しているマシンにPT2を刺してdvbドライバで動作させ、https://github.com/Chinachu/docker-mirakurun-chinachu によるDockerfile/docker-composeに
小変更(v4l-utils-dvbv5パッケージをインストール)を加えてMirakurunをdockerコンテナ内で
動作させています。

Windows10にはTVTest(2018/03/13時点のソースからビルドしたもの)とBonDriver_Mirakurun v1.5を
インストールし、BonDriver_Mirakurun.iniにてSERVICE_SPLIT=1と設定してTVTestでMirakurunからの
ストリームを再生させようとすると、BS朝日とBSフジのみ画面が真っ暗となり再生できません。

Mirakurunではdvbv5-zapにてチューニングを行っており、チャンネル定義ファイルは
https://github.com/Chinachu/dvbconf-for-isdb/ から取得しています。tuners.ymlと
channels.ymlは以下のように記述しています。

tuners.yml

- name: PT2-0-S0
  types:
    - BS
    - CS
  command: dvbv5-zap -a 0 -c /usr/local/etc/mirakurun/dvbv5_channels_isdbs.conf -r -P <channel>
  dvbDevicePath: /dev/dvb/adapter0/dvr0
  decoder: arib-b25-stream-test

channels.yml

- name: BS01_0
  type: BS
  channel: 'BS01_0'

- name: BS13_1
  type: BS
  channel: 'BS13_1'

BonDriver_Mirakurun.iniにてSERVICE_SPLIT=0とした場合は問題ありません。

Mirakurunによるサービススプリット前のストリームである
http://mirakurun:40772/api/channels/BS/BS01_0/stream?decode=1

http://mirakurun:40772/api/channels/BS/BS13_1/stream?decode=1
をBonDriver_HTTPに
食わせてみると正常に再生でき、TVTestからサービスの切り替えもできますが、
スプリット後のストリームである
http://mirakurun:40772/api/channels/BS/BS01_0/services/151/stream?decode=1

http://mirakurun:40772/api/channels/BS/BS13_1/services/181/stream?decode=1

BonDriver_HTTPに食わせると再生できないため、BonDriver_Mirakurun特有の問題ではなく、
Mirakurunによるスプリット結果がTVTestの気に食わないようです。

TVTestのバージョンや使用するデコーダを複数用意し、様々な組み合わせで試してみましたが、
結果は同様でした。

なお、上記スプリット後ストリームをVLCに食わせると正常に再生でき、また、Chinachu上でも
ライブ視聴・録画・再生はできるのですが、Chinachuで当該チャンネルを録画して生成された
TSファイルをTVTest+BonDriver_Pipe+TvtPlayで再生させることはできませんでした。
(VLCでは再生できるものの、Windows Media Playerでは画像が乱れる)

問題が発生している際のMirakurunのログは以下の通りですが、問題が出ていない
(Mirakurunで正常にスプリットできている)チャンネル受信時と、特に差はないように
見えます。

> [email protected] start /usr/local/lib/node_modules/mirakurun
> node --max_old_space_size=256 lib/server.js

2018-03-15T16:28:09.993+09:00 info: load config `/usr/local/etc/mirakurun/server.yml`
2018-03-15T16:28:09.995+09:00 info: load config `/usr/local/etc/mirakurun/channels.yml`
2018-03-15T16:28:09.995+09:00 info: load config `/usr/local/etc/mirakurun/tuners.yml`
2018-03-15T16:28:09.996+09:00 debug: loading tuners...
2018-03-15T16:28:09.997+09:00 debug: TunerDevice#0 initialized
2018-03-15T16:28:09.997+09:00 info: 1 of 1 tuners loaded
2018-03-15T16:28:09.997+09:00 debug: loading channels...
2018-03-15T16:28:09.998+09:00 debug: loading services...
2018-03-15T16:28:09.998+09:00 info: load db `/usr/local/var/db/mirakurun/services.json`
2018-03-15T16:28:10.000+09:00 debug: loading programs...
2018-03-15T16:28:10.000+09:00 info: load db `/usr/local/var/db/mirakurun/programs.json`
2018-03-15T16:28:27.759+09:00 info: listening on http+unix://%2Fvar%2Frun%2Fmirakurun.sock
2018-03-15T16:28:27.759+09:00 info: listening on http://172.19.0.2:40772
2018-03-15T16:28:27.759+09:00 info: listening on http://127.0.0.1:40772
2018-03-15T16:28:27.760+09:00 debug: saving services...
2018-03-15T16:28:27.760+09:00 info: save db `/usr/local/var/db/mirakurun/services.json`
2018-03-15T16:28:29.807+09:00 debug: saving programs...
2018-03-15T16:28:29.809+09:00 info: save db `/usr/local/var/db/mirakurun/programs.json`
192.168.100.21 - GET /api/services HTTP/1.1 200 - - 0.895 ms -
2018-03-15T16:29:07.525+09:00 info: TSFilter has created (serviceId=151, eventId=null)
2018-03-15T16:29:07.525+09:00 debug: TSFilter is waiting for serviceId=151, eventId=null
2018-03-15T16:29:07.526+09:00 debug: TunerDevice#0 start stream for user `172.19.0.1:47958` (priority=0)...
2018-03-15T16:29:07.526+09:00 debug: TunerDevice#0 spawn...
2018-03-15T16:29:07.539+09:00 info: TunerDevice#0 process has spawned by command `dvbv5-zap -a 0 -c /usr/local/etc/mirakurun/dvbv5_channels_isdbs.conf -r -P BS01_0` (pid=45)
2018-03-15T16:29:07.540+09:00 info: TunerDevice#0 streaming to user `172.19.0.1:47958` (priority=0)
2018-03-15T16:29:07.548+09:00 info: TunerDevice#0 > using demux 'dvb0.demux0'
reading channels from file '/usr/local/etc/mirakurun/dvbv5_channels_isdbs.conf'
2018-03-15T16:29:07.549+09:00 info: TunerDevice#0 > tuning to 1049480 Hz
ERROR    Need a LNBf to work
pass all PID's to TS
2018-03-15T16:29:07.549+09:00 info: TunerDevice#0 > dvb_set_pesfilter 8192
2018-03-15T16:29:07.628+09:00 info: TunerDevice#0 > RF     (0x01) C/N= 11.53%
2018-03-15T16:29:07.629+09:00 info: TunerDevice#0 >
2018-03-15T16:29:07.843+09:00 debug: TSFilter detected NIT PID=16
2018-03-15T16:29:07.844+09:00 debug: TSFilter detected PMT PID=257 as serviceId=151 (BS朝日1)
2018-03-15T16:29:07.844+09:00 debug: TSFilter parsing serviceId=151 (BS朝日1)
2018-03-15T16:29:07.844+09:00 debug: TSFilter parsing serviceId=152 (BS朝日2)
2018-03-15T16:29:07.844+09:00 debug: TSFilter parsing serviceId=153 (BS朝日3)
2018-03-15T16:29:07.844+09:00 debug: TSFilter parsing serviceId=181 (BSフジ・181)
2018-03-15T16:29:07.844+09:00 debug: TSFilter parsing serviceId=182 (BSフジ・182)
2018-03-15T16:29:07.844+09:00 debug: TSFilter parsing serviceId=183 (BSフジ・183)
2018-03-15T16:29:07.844+09:00 debug: TSFilter detected PMT PID=513 as serviceId=152 (BS朝日2)
2018-03-15T16:29:07.844+09:00 debug: TSFilter detected PMT PID=515 as serviceId=153 (BS朝日3)
2018-03-15T16:29:07.849+09:00 info: TSFilter is now ready for serviceId=151
2018-03-15T16:29:08.661+09:00 info: TunerDevice#0 > Lock   (0x13) C/N= 7.05%
2018-03-15T16:29:08.661+09:00 info: TunerDevice#0 >
2018-03-15T16:29:08.676+09:00 info: TunerDevice#0 > Lock   (0x13) C/N= 7.04%
2018-03-15T16:29:08.677+09:00 info: TunerDevice#0 >
2018-03-15T16:29:08.708+09:00 info: TunerDevice#0 > Lock   (0x13) C/N= 7.05%
2018-03-15T16:29:08.709+09:00 info: TunerDevice#0 > DVR interface '/dev/dvb/adapter0/dvr0' can now be opened
2018-03-15T16:29:08.740+09:00 info: TunerDevice#0 > Lock   (0x13) C/N= 7.05%
2018-03-15T16:29:08.741+09:00 info: TunerDevice#0 >
2018-03-15T16:29:09.812+09:00 info: TunerDevice#0 > Lock   (0x13) C/N= 7.07%
2018-03-15T16:29:09.999+09:00 debug: Network#4 EPG gathering has queued
2018-03-15T16:29:09.999+09:00 info: Network#4 EPG gathering has started
2018-03-15T16:29:10.000+09:00 info: TSFilter has created (serviceId=null, eventId=null)
2018-03-15T16:29:10.001+09:00 debug: TSFilter is waiting for serviceId=null, eventId=null
2018-03-15T16:29:10.001+09:00 debug: TunerDevice#0 start stream for user `Mirakurun:getEPG()` (priority=-1)...
2018-03-15T16:29:10.001+09:00 info: TunerDevice#0 streaming to user `Mirakurun:getEPG()` (priority=-1)
2018-03-15T16:29:10.009+09:00 debug: TSFilter detected NIT PID=16
2018-03-15T16:29:10.009+09:00 debug: TSFilter detected PMT PID=257 as serviceId=151 (BS朝日1)
2018-03-15T16:29:10.009+09:00 debug: TSFilter detected PMT PID=513 as serviceId=152 (BS朝日2)
2018-03-15T16:29:10.009+09:00 debug: TSFilter detected PMT PID=515 as serviceId=153 (BS朝日3)
2018-03-15T16:29:10.805+09:00 info: TunerDevice#0 > Lock   (0x13) C/N= 7.06%
2018-03-15T16:29:10.805+09:00 info: TunerDevice#0 >
2018-03-15T16:29:11.836+09:00 info: TunerDevice#0 > Lock   (0x13) C/N= 7.05%
2018-03-15T16:29:11.837+09:00 info: TunerDevice#0 >
2018-03-15T16:29:12.868+09:00 info: TunerDevice#0 > Lock   (0x13) C/N= 7.06%

以上、何か問題解決の方法はないでしょうか。
よろしくお願いいたします。

【要望】MirakurunからBonDriver_Mirakurunへの送信をチャンネルごとではなくサービスごとに(ネットワーク帯域削減のため)

LinuxでMirakurunを導入し、Windows側でBonDriver_Mirakurunを使って視聴する場合、現在はワンセグも含めて、チャンネル内のすべてのサービスが送信されるようになっています。そのため、特にCSを視聴する場合にネットワークの帯域が圧迫されてしまいます。

そこで下のリンクのような要領で、
https://github.com/u-n-k-n-o-w-n/BonDriverProxy_Linux/blob/master/BonDriver_Splitter.conf
Mirakurunの方であらかじめ1チャンネル1サービスにスプリットしてから(この際に不要なPSI/SIを削除できるとなお良い)BonDriver_Mirakurunに送信できるようにしていただけると大変ありがたいです。

スプリットする/しない、削除するPSI/SIについてはBonDriver_Mirakurun.iniで指定できると良いと思いますが、Mirakurunのserver.ymlでもいいかもしれません。

ご考慮いただけましたら幸いです。

Mirakurun UIに接続できない

Environment

  • Version of Mirakurun: 2.5.7
  • Version of Node: v6.5.0
  • Version of NPM: 5.6.0
  • Platform:Windows 10 pro
  • Architecture: x64

Issue

TVTest/EDCB環境で使用しておりました。
今回Node.jsで動くということでMirakurunを試してみようと思いインストールしたのですが、
Mirakurun UIにて接続が確認できません。
Connection failedと出てしまいます。

・MirakurunUIには自身のIPアドレスおよびMirakurunにて使用するポート番号を指定しております。
・ポート自体はTCP/UDP送受信ともに開けております。
・タスクマネージャによるとMirakurunサービスは実行中のようです。

何か設定忘れ等ございますでしょうか。
AppData\Local\Mirakurun 内のエラーログを添付いたします。

stderr.txt

pm2によるPC起動時の実行において、他のPCからアクセスできない

Environment

  • Version of Mirakurun: 2.11.0
  • Version of Node: v10.15.3
  • Version of NPM: 6.9.0
  • Platform: Linux Debian Stretch
  • Status of Mirakurun: https://gist.github.com/... (from http://mirakurun-server-ip:40772/api/status)

Issue

...
設定(.yml)ファイルを適切なフォルダに入れ
sudo npm install mirakurun -g --unsafe-perm --production
にてインストールを行った直後は、同じLANの他のPCからBonDriver_Mirakurunや
http://mirakurun-server-ip:40772/api/statusでアクセスできるが、
一旦再起動すると、他のPCからアクセスできなくなります。
なお、この状態でも「pm2 list」で正常に起動しているのが確認できますし、
実際に「ps aux」で「Mirakurun: Server」のプロセスも確認できます。

ここで「pm2 restart mirakurun-server」を行うと再びアクセスできるようになります。

なお、古いバージョン(2.9.0)では問題ありませんでした。

IPv6で固定IPをlistenしていない

早速IPv6を試させて頂いていますが、
固定のIPv6がlistenされず、繋がりません。

loopbackとリンクローカルはListenしているので、localhostでは繋がります。

環境
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.10

[email protected]

server.yml
# logLevel: <number>
logLevel: 2

# path: <string>
path: /var/run/mirakurun.sock

# port: <number>
# You can change this if port conflicted.
# Don't expose this port on the internet, not even with NAPT.
# Use this in LAN or VPN.
# `~` to disable TCP port listening.
port: 40772
host: ~

mirakurun起動時ログ
2016-12-03T20:52:46.453+09:00 info: listening on http://192.168.0.217:40772
2016-12-03T20:52:46.453+09:00 info: listening on http://127.0.0.1:40772
2016-12-03T20:52:46.453+09:00 info: listening on http://[fe80::225:90ff:fe54:a0d8]:40772 (bond0)
2016-12-03T20:52:46.453+09:00 info: listening on http://::1:40772

interface
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
        inet 192.168.0.217  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6  2001:db8:403:100::217  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::225:90ff:fe54:a0d8  prefixlen 64  scopeid 0x20<link>
        ether 00:25:90:54:a0:d8  txqueuelen 1000  (Ethernet)
        RX packets 24604  bytes 2366780 (2.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 112495  bytes 161185319 (161.1 MB)
        TX errors 0  dropped 38 overruns 0  carrier 0  collisions 0

※説明用にIPv6のアドレスは変えてあります。

TCP ポートが有効化されている場合、プライベートな IPv4 アドレスのない環境で起動しない

Environment

  • Version of Mirakurun: 2.13.0
  • Version of Node: v8.10.0
  • Version of NPM: 3.5.2
  • Platform: Ubuntu 18.04

Issue

システムに非プライベートな IPv4 アドレスのみが設定されている環境にて(試していませんが、恐らく IPv6-only な環境でも)、Mirakurun のサーバー設定で TCP ポートの listen が有効化されている場合、起動中に延々と Server hasn't detected IPv4 addresses... のログが吐かれ続けるだけで、TCP / UNIX ドメインソケットどちらにもサーバーが立ち上がりません。

エラー文から探ったところ、コミット ff603b4 (v2.12.0+) が原因のようです。

#60 のような問題への解決策としては、Mirakurun に 0.0.0.0 / :: へ bind させる手段を用意して、細かいアクセス制御はユーザーに別途ファイアウォールで行ってもらうのが最も簡単なのではないかと思います。

BS/CSの局ロゴが取得できない

Mirakurun -> BonDriver_Mirakurun -> TVTestでBS15_0をしばらく受信したのですが、Mirakurunが局ロゴを取得しませんでした。
TVTest側はロゴを全局取得できていたので、データは通過してきているようです。

[要望] logを出力しない設定値

現在、最低でもFATALのlogは出力するようになっておりますが、
可能でしたらlogを全く出力しない設定値を作って頂けませんでしょうか。

Mirakurunの起動エラー

環境
CentOS Linux 7.2.1511
X64

[email protected]
node -v v6.9.1

事象
Mirakurunが mirakurun startでOnlineにはなるものの
/var/run/mirakurun.sock が生成されず
TCPポートも開かない。

mirakurun-server x fork x online x 1 x 0% x 8.6 MB

起動ログ

YAMLException: bad indentation of a sequence entry at line 2, column 2:
     types:
     ^
    at generateError (/usr/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:162:10)
    at throwError (/usr/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:168:9)
    at readBlockSequence (/usr/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:932:7)
    at composeNode (/usr/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:1326:12)
    at readDocument (/usr/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:1489:3)
    at loadDocuments (/usr/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:1545:5)
    at load (/usr/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:1562:19)
    at Object.safeLoad (/usr/lib/node_modules/mirakurun/node_modules/js-yaml/lib/js-yaml/loader.js:1580:10)
    at load (/source/Mirakurun/config.ts:108:17)
    at Object.loadTuners (/source/Mirakurun/config.ts:89:12)

【質問】channels.ymlの記述方法について

Environment

  • Version of Mirakurun: 2.7.2
  • Version of Node: v8.11.3
  • Version of NPM: 5.6.0
  • Platform: Windows 10
  • Architecture: x64

Issue

PX-Q3PE→Mirakurun→EPGStationという構成にて便利に使っております。
CSで一部の番組(ナショジオやカートゥーンネットワークなど)がEPGStationの番組表に出ていないことに気づきました。試しに:40772/api/channelsをチェックしたところ、Mirakurun上でチャンネルとして認識されていないようです。

bondriver_Mirakurun→TVTestでチャンネルスキャンを行うとこれらのチャンネルは検出され、受信できております。channels.ymlの記述がおかしいのかと編集しようと思ったのですが、必要な情報(有効なサービスIDの調べ方)等がなかなかわかりません。

TVTestでチャンネルスキャンして得られたch2ファイルとchannels.ymlを比較して記述を改めようと思いましたが、写っているチャンネル同士でも値が違いうまくいきません。

channnels.ymlの記述方法についてどなたかヒントいただけないでしょうか。

manページを作る

Issue

manページを作り、そこで設定ファイルの値について記述してはどうでしょうか。

【要望】EPGデータ処理の無効化オプション

Environment

  • Version of Mirakurun: 2.8.3
  • Version of Node: v10.15.1
  • Version of NPM: 6.4.1
  • Platform: Windows 10
  • Architecture: x64

Issue

本来Chinachuを利用することを前提に作られているわけですので、もし可能であれば・・・の要望です。

当方MirakurunからBonDriver_Mirakurunを経由して、EDCB(EpgDataCap_Bon)を利用して録画を行っております。
この構成ですと、Mirakurun側でEPGデータを取得していても、全く利用していない形になります。
先ほど要望として投稿させていただきました Issue #48
が発生した場合、チューナーがオープンできず、録画に失敗します。

つきましては、Mirakurun側でのEPGデータ取得を行わないオプションを実装いただけないでしょうか。

以上、よろしくお願いいたします。

Windows10 インストールエラー

Environment

  • Version of Mirakurun: 2.15.2
  • Version of Node: v10.21.0 & v12.18.0 & v14.4.0
  • Version of NPM: 6.14.4
  • Platform: Windows 10 v1909
  • Status of Mirakurun: N/A

Issue

mirakurunを新規インストールで下記のエラーで落ちました。

node v10もv12もv14上でも試しても同じエラーです。Windowsもちゃんとアップデートしまったが変わりません。

どうすれば解決できるでしょうか?
よろしくお願いします~

> [email protected] postinstall C:\Users\username\AppData\Roaming\npm\node_modules\mirakurun
> node bin/postinstall.js && opencollective-postinstall

Version: [email protected] [OK]
Version: [email protected] [OK]
Use start command "node.exe bin\init.win32.js".
The program "mirakurun" was installed as a service.
  n v i r o n m e n t   s h o u l d   c o m p r i s e   s t r i n g s   o f   t h e   f o r m   K E Y = V A L U E .
 E r r o r   s e t t i n g   p a r a m e t e r   " A p p E n v i r o n m e n t E x t r a "   f o r   s e r v i c e   " m i r a k u r u n " !

Can't set environment for service
child_process.js:632
    throw err;
    ^

Error: Command failed: winser.cmd -i -a --startuptype auto --startcmd node.exe bin\init.win32.js --set AppPriority ABOVE_NORMAL_PRIORITY_CLASS --set Type SERVICE_WIN32_OWN_PROCESS --set AppStdout C:\Users\username\AppData\Local\Mirakurun\stdout --set AppStderr C:\Users\username\AppData\Local\Mirakurun\stderr --env USERPROFILE=C:\Users\username --env LOCALAPPDATA=C:\Users\username\AppData\Local --env USING_WINSER=1
    at checkExecSyncError (child_process.js:611:11)
    at Object.execFileSync (child_process.js:629:15)
    at Object.<anonymous> (C:\Users\username\AppData\Roaming\npm\node_modules\mirakurun\bin\postinstall.js:154:19)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 1168,
  stdout: null,
  stderr: null
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node bin/postinstall.js && opencollective-postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

【要望】programs.json破損時のJSONファイル破棄処理

Environment

  • Version of Mirakurun: 2.8.3
  • Version of Node: v10.15.1
  • Version of NPM: 6.4.1
  • Platform: Windows 10
  • Architecture: x64

Issue

便利に利用させていただいております。
TV録画環境としてMirakurunを常時稼働させておりますが、たまにprogram.jsonの末尾部が欠損し、JSON構文が崩れてしまい、Mirakurunが正常に稼働しなくなってしまうことがあります。

例えば
[{"id":70016144185,"eventId":44185,"serviceId":161,(中略)ntType":179},"audio":{"samplingRate":48000,"componentType":3},"genres":[{"lv1":2,"lv2":4,"un1":15,"un2":15}]},{"id":70030048923,"eventId":4
といった形で、 "eventId":4 以降に本来出力されるデータが飛んで、以降空白(スペース)となっている状況です。

Mirakurun側で、このようにJSONに欠落が発生した場合、一旦program.jsonを破棄し、再度取得させるような仕組みを設けることは可能でしょうか。

以上お手数ですがよろしくお願いいたします。

dvbconf-for-isdb/conf/dvbv5_channels_isdbs.conf がコンテナ内にない

Environment

Issue

https://github.com/Chinachu/Mirakurun/blob/master/doc/Platforms.md#install--uninstall--update
クイックスタート通りにコンテナを立ち上げましたが、サブモジュールになっているdvbv5_channels_isdbs.confがコンテナ内に存在しないためかエラーになっています。

$ docker-compose logs
mirakurun_1  | 
mirakurun_1  | > [email protected] start /app
mirakurun_1  | > node -r source-map-support/register --max_old_space_size=512 lib/server.js
mirakurun_1  | 
mirakurun_1  | 2020-08-01T18:12:02.076+09:00 info: load server config `/app-config/server.yml`
mirakurun_1  | 2020-08-01T18:12:02.081+09:00 info: load server config (merged w/ env): {"logLevel":2,"path":"/var/run/mirakurun.sock","port":40772,"disableIPv6":true}
mirakurun_1  | 2020-08-01T18:12:02.082+09:00 info: load channels config `/app-config/channels.yml`
mirakurun_1  | 2020-08-01T18:12:02.092+09:00 info: load tuners config `/app-config/tuners.yml`
mirakurun_1  | 2020-08-01T18:12:02.097+09:00 info: 4 of 4 tuners loaded
mirakurun_1  | 2020-08-01T18:12:02.101+09:00 info: load db `/app-data/services.json` w/ integrity (NzG9o3GEy8Ga5hbYBPGcTbscZVvZSATtawVp8O5W/HM=)
mirakurun_1  | 2020-08-01T18:12:02.102+09:00 info: db `/app-data/services.json` is not exists
mirakurun_1  | 2020-08-01T18:12:02.102+09:00 info: load db `/app-data/programs.json` w/ integrity (NzG9o3GEy8Ga5hbYBPGcTbscZVvZSATtawVp8O5W/HM=)
mirakurun_1  | 2020-08-01T18:12:02.103+09:00 info: db `/app-data/programs.json` is not exists
mirakurun_1  | 2020-08-01T18:12:04.603+09:00 info: ChannelItem#'BS:BS15_0' serviceId=101 check has started
mirakurun_1  | 2020-08-01T18:12:04.607+09:00 info: TSFilter has created (serviceId=null, eventId=null)
mirakurun_1  | 2020-08-01T18:12:04.674+09:00 info: TunerDevice#0 process has spawned by command `dvbv5-zap -a 0 -c ./config/dvbconf-for-isdb/conf/dvbv5_channels_isdbs.conf -r -P BS15_0` (pid=42)
mirakurun_1  | 2020-08-01T18:12:04.676+09:00 info: listening on http+unix://%2Fvar%2Frun%2Fmirakurun.sock
mirakurun_1  | 2020-08-01T18:12:04.678+09:00 info: listening on http://172.20.0.2:40772
mirakurun_1  | 2020-08-01T18:12:04.678+09:00 info: listening on http://127.0.0.1:40772
mirakurun_1  | 2020-08-01T18:12:04.679+09:00 info: TunerDevice#0 streaming to user `Mirakurun:getServices()` (priority=-1)
mirakurun_1  | 2020-08-01T18:12:04.773+09:00 info: TunerDevice#0 process has closed with exit code=255 by signal `null` (pid=42)
mirakurun_1  | 2020-08-01T18:12:05.819+09:00 info: TunerDevice#0 process has spawned by command `dvbv5-zap -a 0 -c ./config/dvbconf-for-isdb/conf/dvbv5_channels_isdbs.conf -r -P BS15_0` (pid=44)
mirakurun_1  | 2020-08-01T18:12:05.876+09:00 info: TunerDevice#0 process has closed with exit code=255 by signal `null` (pid=44)
mirakurun_1  | 2020-08-01T18:12:06.917+09:00 info: TunerDevice#0 process has spawned by command `dvbv5-zap -a 0 -c ./config/dvbconf-for-isdb/conf/dvbv5_channels_isdbs.conf -r -P BS15_0` (pid=46)
mirakurun_1  | 2020-08-01T18:12:06.965+09:00 info: TunerDevice#0 process has closed with exit code=255 by signal `null` (pid=46)
mirakurun_1  | 2020-08-01T18:12:08.019+09:00 info: TunerDevice#0 process has spawned by command `dvbv5-zap -a 0 -c ./config/dvbconf-for-isdb/conf/dvbv5_channels_isdbs.conf -r -P BS15_0` (pid=48)
mirakurun_1  | 2020-08-01T18:12:08.076+09:00 info: TunerDevice#0 process has closed with exit code=255 by signal `null` (pid=48)
mirakurun_1  | 2020-08-01T18:12:09.123+09:00 info: TunerDevice#0 process has spawned by command `dvbv5-zap -a 0 -c ./config/dvbconf-for-isdb/conf/dvbv5_channels_isdbs.conf -r -P BS15_0` (pid=50)
mirakurun_1  | 2020-08-01T18:12:09.180+09:00 info: TunerDevice#0 process has closed with exit code=255 by signal `null` (pid=50)

ソースを見るにgit submoduleを拾えていないように見えたので、コンテナ内に https://github.com/Chinachu/dvbconf-for-isdb.git を配置したところうまく動いているようです。

EITセクションのバージョンチェックの条件について

Environment

  • Version of Mirakurun: 2.13.0

Issue

以下,実際に動かして問題を見つけたわけではなく,コードのみを見て判断しています.なので,私の認識に誤りがある可能性もあります.

8538fd4 にてEITセクションのバージョン番号のチェックが行われるようになりましたが,この修正だと,以下の場合に問題があると思われます.

  • バージョン番号が0に戻ったとき
    • バージョン番号は5ビットなので,15の次は0になります
    • この場合,verDiffは-15となり,L675の条件はfalseとなります
  • verDiff === -1の意味
    • EITセクションが短い期間に15回更新された場合,verDiffが-1になる場合があります(バージョン番号が一周してverDiff = (N - 1) - Nとなるような場合)
    • この場合のみ特別扱いするとは考えにくいので,恐らく条件式が間違っているものと推測されます

sub-tableを正しく処理するようにすると修正量が多くなりますし,また,sub-tableが実際にどのように運用されているかもはっきりしません(仮に仕様があったとしても,それに沿って運用されていないということもあり得る).そこで,mirakc-aribではバージョン番号を無視することにしました.これはnode-aribtsと同じ動作です.

mirakcでは,台風発生に伴いNHKの番組表が更新されたときも正しくEPGデータが更新できていたようだったので,バージョン番号を無視しても大きな影響はないと考えています.ただ,MirakurunとmirakcではEPGデータの更新方法に違いがありますし,実装方針はソフトウェアごとに異なります.ですので,最終判断はお任せします.

rootでなくユーザーで動かしたい

 [hoge@localhost ~]$ mirakurun init
Error: root please.
[hoge@localhost ~]$ 

mirakurunをrootでなくユーザーで動かしたいのですが、できないでしょうか?
mirakurunがrootを要求している理由はどういったものでしょうか?

mirakurunをrootで動かしたくない理由ですが、ユーザーでnodejsの管理を行なっているからです。ユーザーのanyenv(nodenv)でnodejsを管理しており、その管理下にnpmおよびmirakurunを導入したため、rootからはフルパスを指定しないと操作できません(導入にsudoは使用しないのではなくできません)。

[root@localhost ~]# mirakurun restart  
bash: mirakurun: コマンドが見つかりません
[root@localhost  ~]# /home/VTomonC/.anyenv/envs/nodenv/shims/mirakurun restart
Use --update-env to update environment variables
...

[root@localhost ~]# 

アップデートでエラーorz

userでも同じだったのでrootで実行してみたのですが以下のエラーで悩んでます。
何が原因なのでしょうか?バージョンが新しすぎる!?

npm install mirakurun -g --unsafe --production

[email protected] preinstall /usr/local/lib/node_modules/mirakurun
node bin/preinstall.js

/usr/local/bin/mirakurun -> /usr/local/lib/node_modules/mirakurun/bin/cli.sh
/usr/local/bin/mirakurun-epgdump -> /usr/local/lib/node_modules/mirakurun/bin/epgdump.js

[email protected] postinstall /usr/local/lib/node_modules/mirakurun
node bin/postinstall.js

Version: [email protected] [NG] Expected: ^8.9.4 < 9
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node bin/postinstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-02-21T23_26_44_480Z-debug.log
root@debian:~# node -v
v9.5.0

空の動画ファイルが生成される

Environment

Environment

  • Version of Mirakurun: 2.5.5
  • Version of Node: v6.5.0
  • Version of NPM: 3.10.3
  • Platform:Linux-Ubuntu
  • Architecture: x64

Issue

空の録画ファイルが生成される、さらに架空の録画データが無限生成される

Chinachuを開くと録画件数が膨大になっていて、なにが録画されたのか確認したところ
録画済みのページに同じタイトルが無限生成されていました
実際にファイルを探したところ、空のファイルが一つ生成されているだけで、それを消したうえでクリーンアップを行ったところ無限生成されていたタイトルはすべて消えました

なお、recpt1コマンドで直接録画コマンドを入力すると正常に録画されました

よろしくお願いいたします。

Screenshot

snapcrab_noname_2018-1-7_1-45-46_no-00

Chinachu開発者様に感謝申し上げます。

Web UIが利用できない

Environment

  • Version of Mirakurun: 3.1.1
  • Version of Node: v14.4.0
  • Version of NPM: 6.14.5
  • Platform: Linux Debian buster

Issue

リリースいただいたので早速web UIの動作を確認しようとしたところ403が出て閲覧できませんでした。
環境としてはtraefikの下にmirakurunを置いているような感じです。
お手数おかけしますが確認のほどよろしくお願い致します。

(スクリーンショット削除済)

録画コマンドの置き場所について

Mirakurun 3.0.0ではdvbではない録画コマンドを使用する場合/usr/local/mirakurun/opt以下に置く必要があるようですが、これはFHS 3.0に違反しています。
/usr/local以下にプログラム固有のディレクトリを作ってはなりません( /直下にディレクトリを作ってそこにインストールするのが望ましくないのと同じです )。
/opt/mirakurunなどの適切なディレクトリに移動してはどうでしょうか。

出典: https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf (PDF注意)

【要望】BS/CSチャンネルスキャンの機能について

Environment

  • Version of Mirakurun: 2.8.3
  • Version of Node: v10.15.0
  • Version of NPM: 6.6.0
  • Platform: Debian
  • Architecture: x64

Issue

お世話になっております。
有用なアプリケーションを作っていただきありがとうございます。
現状のチャンネルスキャン機能は地上波にしか対応していませんがBS/CSも対応する予定はありますでしょうか。
BS/CSはチャンネル名やチャンネル番号の変更が多いため、必要性を感じます。
channels.ymlの設定を手動で行うと間違いが起こりやすいので欲しいです。
以上お手数ですがよろしくお願いいたします。

アップデート時に pm2-root でエラーorz

npm install mirakurun@latest -g --unsafe --production

[email protected] preinstall /usr/local/lib/node_modules/.staging/mirakurun-d2df8319
node bin/preinstall.js

/usr/local/bin/mirakurun -> /usr/local/lib/node_modules/mirakurun/bin/cli.sh
/usr/local/bin/mirakurun-epgdump -> /usr/local/lib/node_modules/mirakurun/bin/epgdump.js

[email protected] postinstall /usr/local/lib/node_modules/mirakurun
node bin/postinstall.js

[PM2] Init System found: systemd
Platform systemd
Template
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target

[Service]
Type=forking
User=root
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/usr/local/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/root/.pm2
PIDFile=/root/.pm2/pm2.pid

ExecStart=/usr/local/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/local/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/local/lib/node_modules/pm2/bin/pm2 kill

[Install]
WantedBy=multi-user.target

Target path
/etc/systemd/system/pm2-root.service
Command list
[ 'chmod +x /etc/systemd/system/pm2-root.service',
'systemctl enable pm2-root',
'systemctl start pm2-root',
'systemctl daemon-reload',
'systemctl status pm2-root' ]
[PM2] Writing init configuration in /etc/systemd/system/pm2-root.service
[PM2] Making script booting at startup...

Executing chmod +x /etc/systemd/system/pm2-root.service
[DONE]
Executing systemctl enable pm2-root
[DONE]
Executing systemctl start pm2-root
Job for pm2-root.service failed. See 'systemctl status pm2-root.service' and 'journalctl -xn' for details.
[ERROR] Exit code : 1
[PM2][ERROR] systemctl start pm2-root failed, see error above.
child_process.js:526
throw err;
^

Error: Command failed: pm2 startup
at checkExecSyncError (child_process.js:483:13)
at Object.execSync (child_process.js:523:13)
at Object. (/usr/local/lib/node_modules/mirakurun/bin/postinstall.js:62:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "mirakurun@latest" "-g" "--unsafe" "--production"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node bin/postinstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node bin/postinstall.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mirakurun package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node bin/postinstall.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mirakurun
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls mirakurun
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/npm-debug.log

systemctl start pm2-root

Job for pm2-root.service failed. See 'systemctl status pm2-root.service' and 'journalctl -xn' for details.

systemctl status pm2-root.service

● pm2-root.service - PM2 process manager
Loaded: loaded (/etc/systemd/system/pm2-root.service; enabled)
Active: failed (Result: timeout) since 金 2017-05-05 06:49:54 JST; 2min 23s ago
Docs: https://pm2.keymetrics.io/
Process: 580 ExecStart=/usr/local/lib/node_modules/pm2/bin/pm2 resurrect (code=killed, signal=TERM)

5月 05 06:47:29 debian systemd[1]: Starting PM2 process manager...
5月 05 06:47:40 debian pm2[580]: [PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
5月 05 06:49:54 debian systemd[1]: pm2-root.service start operation timed out. Terminating.
5月 05 06:49:54 debian systemd[1]: Failed to start PM2 process manager.
5月 05 06:49:54 debian systemd[1]: Unit pm2-root.service entered failed state.

journalctl -xn

-- Logs begin at 金 2017-05-05 06:47:22 JST, end at 金 2017-05-05 06:50:58 JST. --
5月 05 06:50:58 debian su[1549]: pam_unix(su:session): session opened for user root by root(uid=0)
5月 05 06:50:58 debian su[1549]: pam_unix(su:session): session closed for user root
5月 05 06:50:58 debian sudo[1547]: pam_unix(sudo:session): session closed for user root
5月 05 06:50:58 debian sudo[1552]: ^[[1;39mroot : TTY=pts/1 ; PWD=/usr/local/Chinachu ; USER=root ; COMMAND=/etc/init.d/chinachu-wui start
^[[0m
5月 05 06:50:58 debian sudo[1552]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 05 06:50:58 debian su[1558]: Successful su for root by root
5月 05 06:50:58 debian su[1558]: + /dev/pts/1 root:root
5月 05 06:50:58 debian su[1558]: pam_unix(su:session): session opened for user root by root(uid=0)
5月 05 06:50:58 debian su[1558]: pam_unix(su:session): session closed for user root
5月 05 06:50:58 debian sudo[1552]: pam_unix(sudo:session): session closed for user root

色々と思い当たることをやってみたがダメぽいです。お力をお貸し下さい。

decoderプロセスが残り続ける場合がある

Environment

  • Version of Mirakurun: 2.10.1 (master HEAD)
  • Version of Node: v10.15.3
  • Version of NPM: x6.4.1
  • Platform: Linux 5cdcda4fae55 4.4.174-rockchip64 #6 SMP Sun Feb 10 10:43:16 CET 2019 aarch64 GNU/Linux

構成

  • mirakurun-master + arib-b25-stream-test (rock64 machine1)
  • mirakurun-remote + tuner device (rock64 machine2)
    • GR/BSのみ

すべてDockerコンテナとして実行しています.

 Version:           18.09.5
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        e8ff056
 Built:             Thu Apr 11 04:47:02 2019
 OS/Arch:           linux/arm64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.5
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       e8ff056
  Built:            Thu Apr 11 04:11:17 2019
  OS/Arch:          linux/arm64
  Experimental:     false

Issue

以下のようなスクリプトを実行すると発生します.

// reproduce_bug.js
const http = require('http');

http.get('http://mirakurun-master:40772/api/channels/GR/26/stream?decode=1', (res) => {
  # データの読み込みを阻害し,TSFilterなどにデータが溜まり続ける状態にする
  res.on('data', () => { for (;;) {} });
});
$ timeout 5s node reproduce_bug.js

ホスト名は環境に合わせて書き換えてください.

理由は不明ですが,発生しなかったこともあったので,確実に発生するとは言い切れません.また,上記の環境でしか確認してないので,他の環境で発生するかは分かりません.

log

レベルはDEBUG.IPやポート番号,ホスト名などは書き換えてあります.

2019-04-26T21:18:56.326+09:00 info: TSFilter has created (serviceId=null, eventId=null)
2019-04-26T21:18:56.327+09:00 debug: TunerDevice#0 start stream for user `10.1.2.3:12345` (priority=0)...
2019-04-26T21:18:56.329+09:00 debug: TunerDevice#0 spawn...
2019-04-26T21:18:56.355+09:00 info: TunerDevice#0 process has spawned by command `node lib/remote mirakurun-remote 40772 GR 26` (pid=37)
2019-04-26T21:18:56.361+09:00 info: TunerDevice#0 streaming to user `10.1.2.3:12345` (priority=0)
2019-04-26T21:18:57.192+09:00 info: TunerDevice#0 > remote: { host: 'mirakurun-remote',
  port: 40772,
  type: 'GR',
  channel: '26',
  decode: false }
2019-04-26T21:18:58.091+09:00 debug: TSFilter detected NIT PID=16
2019-04-26T21:18:58.092+09:00 debug: TSFilter detected PMT PID=496 as serviceId=1032 (NHKEテレ1東京)
2019-04-26T21:18:58.093+09:00 debug: TSFilter parsing serviceId=1032 (NHKEテレ1東京)
2019-04-26T21:18:58.094+09:00 debug: TSFilter parsing serviceId=1033 (NHKEテレ2東京)
2019-04-26T21:18:58.096+09:00 debug: TSFilter parsing serviceId=1034 (NHKEテレ3東京)
2019-04-26T21:18:58.097+09:00 debug: TSFilter parsing serviceId=1416 (NHK携帯2)
2019-04-26T21:18:58.098+09:00 debug: TSFilter detected PMT PID=1008 as serviceId=1033 (NHKEテレ2東京)
2019-04-26T21:18:58.099+09:00 debug: TSFilter detected PMT PID=1264 as serviceId=1034 (NHKEテレ3東京)
2019-04-26T21:18:58.100+09:00 debug: TSFilter detected PMT PID=8136 as serviceId=1416 (NHK携帯2)
2019-04-26T21:19:01.211+09:00 info: 10.1.2.3 - GET /api/channels/GR/26/stream?decode=1 HTTP/1.1 200 - - 1882.012 ms -
2019-04-26T21:19:01.216+09:00 info: TSFilter has closed (serviceId=null, eventId=null)
2019-04-26T21:19:01.217+09:00 debug: TunerDevice#0 end stream for user `10.1.2.3:12345` (priority=0)...
2019-04-26T21:19:01.218+09:00 info: TunerDevice#0 end streaming to user `10.1.2.3:12345` (priority=0)
2019-04-26T21:19:04.068+09:00 debug: saving programs...
2019-04-26T21:19:04.079+09:00 info: save db `/usr/local/var/db/mirakurun/programs.json` w/ integirty (xxx=)
2019-04-26T21:19:04.388+09:00 debug: TunerDevice#0 kill...
2019-04-26T21:19:04.393+09:00 info: TunerDevice#0 > remote: exit.
2019-04-26T21:19:04.552+09:00 info: TunerDevice#0 process has closed with exit code=0 by signal `null` (pid=37)
2019-04-26T21:19:04.653+09:00 debug: TunerDevice#0 released

現時点でわかっていること

  • decoder.stdinfinishイベントが起こらず,decoder.kill("SIGKILL")が呼び出されない
    • tsFilterでcloseは発生するので,decoder.stdin.end()は呼び出されています
  • Nodejsのドキュメントによると,stdinにデータが残っているとend()を呼び出してもfinishが発生しない
  • TSFilterのバッファがあふれなくても発生する
    • TSはだいたい2MB/sなので,5秒で10MB<24MB
    • 実際ログを見てもあふれていない

arib-b25-stream-testのコードをざっと見た限りでは,arib-b25-stream-testの不具合ではなさそうに見えます.

Error: smsusb:smsusb_onresponse

Environment

  • Mirakurun Docker, and local
  • Ubuntu 20.04
  • PX-Q1UD

Issue

/var/log/syslog is filled with the following error.

smsusb:smsusb_onresponse: error, urb status -71, 0 bytes

Server is freezing randomly even after fresh install, wondering if this is the cause. Might not be directly related to Mirakurun, but even a 'Yes, this is expected' will be very helpful. Any ideas?

mirarkun新規インストールとpm2バージョン

Environment

  • Version of Mirakurun: 2.7.0
  • Version of Node: v8.11.3
  • Version of NPM: 5.6.0
  • Platform: ubuntu 16.04 LTS
  • Architecture: x64

Issue

Version: [email protected] [OK]
3.0.0

Version: [email protected] [NG] Expected: >=2.4.0 <3.0.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node bin/postinstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/hide/.npm/_logs/2018-07-11T03_30_00_648Z-debug.log

PM2のバージョンが3.0.0以下と指定になっていますが、現在の標準ではsudo npm install pm2 -gの結果、PM2が3.0.0がインストールされてしまいます。
PM2のVersion Historyを見ますと、3.0.0は7 days agoでアップグレードしてしまったようです。
一旦、pm2を2.10.4に落としてインストールしますが、スクリプトのご変更をお願いいたします。

番組のストリームが取得できない

Environment

  • Version of Mirakurun: 2.8.4
  • Version of Node: v10.15.3
  • Version of NPM: 6.4.1
  • Platform: Arch Linux
  • Architecture: x64

Issue

お世話になります.

2週間ほど前から,ライブ視聴は可能ですが,番組録画ができなくなりました.

確認したところ,
/api/channels/{type}/{channel}/streamのストリームは取得できますが,
/api/programs/{id}/streamのストリームは取得できなくなっていました.

/api/programs/{id}/streamのストリームを取得した際のlogは以下の通りです.

2019-03-10T12:07:16.249+00:00 info: TSFilter has created (serviceId=2072, eventId=10123)
2019-03-10T12:07:16.249+00:00 debug: TSFilter is waiting for serviceId=2072, eventId=10123
2019-03-10T12:07:16.249+00:00 debug: TunerDevice#4 start stream for user `10.30.1.1:51370` (priority=0)...
2019-03-10T12:07:16.249+00:00 debug: TunerDevice#4 spawn...
2019-03-10T12:07:16.270+00:00 info: TunerDevice#4 process has spawned by command `recpt1 --device /dev/px4video2 15 - -` (pid=1256)
2019-03-10T12:07:16.271+00:00 info: TunerDevice#4 streaming to user `10.30.1.1:51370` (priority=0)
2019-03-10T12:07:16.291+00:00 info: TunerDevice#4 > using device: /dev/px4video2
2019-03-10T12:07:17.389+00:00 info: TunerDevice#4 > device = /dev/px4video2
2019-03-10T12:07:17.400+00:00 info: TunerDevice#4 > C/N = 29.465197dB
2019-03-10T12:07:17.465+00:00 info: TunerDevice#4 > (PID:1256)(CH:T15) Recording...
2019-03-10T12:07:17.537+00:00 debug: TSFilter detected NIT PID=16
2019-03-10T12:07:17.538+00:00 debug: TSFilter detected PMT PID=2072 as serviceId=2072 (ABCテレビ1)
2019-03-10T12:07:17.538+00:00 debug: TSFilter parsing serviceId=2072 (ABCテレビ1)
2019-03-10T12:07:17.538+00:00 debug: TSFilter parsing serviceId=2073 (ABCテレビ2)
2019-03-10T12:07:17.538+00:00 debug: TSFilter parsing serviceId=2074 (ABCテレビ3)
2019-03-10T12:07:17.538+00:00 debug: TSFilter parsing serviceId=2456 (ABCテレビ携帯)
2019-03-10T12:07:17.538+00:00 debug: TSFilter detected PMT PID=2073 as serviceId=2073 (ABCテレビ2)
2019-03-10T12:07:17.538+00:00 debug: TSFilter detected PMT PID=2074 as serviceId=2074 (ABCテレビ3)
2019-03-10T12:07:17.538+00:00 debug: TSFilter detected PMT PID=8136 as serviceId=2456 (ABCテレビ携帯)

Ver 2.7.2 壊れてる?

Environment

  • Version of Mirakurun: 2.7.2

Issue

Ver.2.7.2にアップデートしてみたんですが、何か壊れていませんか?
/usr/bin/mirakurnがエラーで実行出来なかったので、ファイルの中身みてみたら、
改行コードがCRLFになってるみたいなんですが。

#!/bin/bash
^M
#   Copyright 2016 Yuki KAN^M
#^M
#   Licensed under the Apache License, Version 2.0 (the "License");^M
#   you may not use this file except in compliance with the License.^M
#   You may obtain a copy of the License at^M
#^M
#       http://www.apache.org/licenses/LICENSE-2.0^M
#^M
#   Unless required by applicable law or agreed to in writing, software^M
#   distributed under the License is distributed on an "AS IS" BASIS,^M
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.^M
#   See the License for the specific language governing permissions and^M
#   limitations under the License.^M
^M
if [ `whoami` != "root" ]; then^M
  echo "Error: root please."^M
  exit 1^M
fi^M
^M
shopt -s extglob^M
^M
main () {^M
  local SELF_PATH DIR SYM^M
...

Munin Pluginのshebang行でエラー

Environment

  • Version of Mirakurun: 2.14.0
  • Version of Node: v10.19.0
  • Version of NPM: 6.13.4
  • Platform: Ubuntu 18.04.4 LTS

Issue

Munin Pluginを動作確認すると以下のエラーが発生します

$ sudo munin-run mirakurun_status
/usr/bin/env: 'node¥r': No such file or directory

d23fd6b#diff-3fa19187042b21381f9577cd32dd7784 で改行コードがCR+LFに変更されたためと思います。mirakurun_status.js からCRを削除したら動きました。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.