fHDHR / fHDHR_plugin_origin_ceton

Do What The F*ck You Want To Public License
1 stars 4 forks source link

Ceton, Direct Stream Breaks with Second Device #24

Closed arrmo closed 2 years ago

arrmo commented 2 years ago

OK, a bit perplexed here - was sure this was working the other day, but now I'm getting a bit of an odd error. If I set up direct with Ceton, the first tuner is fine. For example, tuning to Ch. 593, log info below. And ... tuner status in API is fine / correct. Ceton in the UI not showing quite right, but it wasn't before => longer story there 🤣. Perhaps this is being used now, but I'm not sure. In any case, this all looks very normal to me, and working well.

[2022-02-27 10:01:46,748] p757639 {/mnt/ProgSSD/fHDHR/fHDHR_web/__init__.py:168} - DEBUG - Client GET requested /api/tuners Opening
[2022-02-27 10:01:46,755] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/__init__.py:70} - DEBUG - Instantiating Stream_OBJ Object
[2022-02-27 10:01:46,756] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:123} - DEBUG - Attempting to gather stream information for ceton channel 593 Golf HD Golf HD.
[2022-02-27 10:01:46,807] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:79} - INFO - Selected Ceton tuner#: 0
[2022-02-27 10:01:46,808] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:91} - INFO - Ceton tuner 0 to be started
[2022-02-27 10:01:46,935] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:206} - INFO - Preparing Ceton tuner 0 on port: 43222
[2022-02-27 10:01:47,729] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:220} - INFO - Initiate PCIe direct streaming, channel 593 from Ceton tuner#: 0 
[2022-02-27 10:01:47,730] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:225} - INFO - Ceton tuner 0 streamurl set, to: /dev/ceton/ctn91xx_mpeg0_0
[2022-02-27 10:01:47,731] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:99} - INFO - Attempting to Select an available tuner for this stream.
[2022-02-27 10:01:47,732] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/device/tuners/tuner.py:76} - INFO - Tuner #0 Acquired.
[2022-02-27 10:01:47,733] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:107} - INFO - ceton Tuner #0 to be used for stream.
[2022-02-27 10:01:47,734] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:109} - INFO - Preparing Stream...
[2022-02-27 10:01:47,734] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/__init__.py:62} - INFO - Stream Method Detected as a /dev/ hardware device.
[2022-02-27 10:01:47,735] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:73} - INFO - Client has requested stream for ceton channel 593 Golf HD Golf HD.
[2022-02-27 10:01:47,735] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:79} - INFO - Selected Stream Parameters:method=direct duration=0 origin_quality=None transcode_quality=None.
[2022-02-27 10:01:47,736] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/__init__.py:112} - INFO - Tuning Stream...
[2022-02-27 10:01:47,737] p757639 {/mnt/ProgSSD/fHDHR/fHDHR_web/__init__.py:182} - DEBUG - Client GET requested /api/tuners Closing
[2022-02-27 10:01:47,740] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:27} - INFO - Direct Hardware Stream from device: /dev/ceton/ctn91xx_mpeg0_0
[2022-02-27 10:01:47,740] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:36} - DEBUG - Operating System is: Linux
[2022-02-27 10:01:47,741] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:37} - DEBUG - Command is: cat /dev/ceton/ctn91xx_mpeg0_0
[2022-02-27 10:01:48,356] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:46} - DEBUG - Pulling Chunk fHDHR/fHDHR#1
[2022-02-27 10:01:48,358] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/__init__.py:156} - DEBUG - Adding Chunk fHDHR/fHDHR#1 to the buffer.
[2022-02-27 10:01:48,359] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/__init__.py:213} - DEBUG - Buffer has 1/3 chunks. Continuing to build buffer. Not Serving chunk(s).

But then, with the above running, I try to add a client, to use Ch. 570. All heck breaks loose ... LOL. Log info below.

[2022-02-27 10:06:20,161] p757639 {/mnt/ProgSSD/fHDHR/fHDHR_web/__init__.py:168} - DEBUG - Client GET requested /api/tuners Opening
[2022-02-27 10:06:20,166] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/__init__.py:70} - DEBUG - Instantiating Stream_OBJ Object
[2022-02-27 10:06:20,167] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:123} - DEBUG - Attempting to gather stream information for ceton channel 570 ESPN HD ESPN HD.
[2022-02-27 10:06:20,193] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:79} - INFO - Selected Ceton tuner#: 0
[2022-02-27 10:06:20,195] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:91} - INFO - Ceton tuner 0 to be started
[2022-02-27 10:06:20,264] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:206} - INFO - Preparing Ceton tuner 0 on port: 45476
[2022-02-27 10:06:20,280] p757639 {/mnt/ProgSSD/fHDHR/fHDHR_web/__init__.py:168} - DEBUG - Client GET requested /api/tuners Opening
[2022-02-27 10:06:20,283] p757639 {/mnt/ProgSSD/fHDHR/fHDHR_web/__init__.py:182} - DEBUG - Client GET requested /api/tuners Closing
[2022-02-27 10:06:20,287] p757639 {/home/rmorris/.local/lib/python3.9/site-packages/gevent/pywsgi.py:1226} - INFO - 192.168.2.66 - - [2022-02-27 10:06:20] "GET /api/tuners?method=status HTTP/1.1" 200 4504 0.007796
[2022-02-27 10:06:21,162] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:220} - INFO - Initiate PCIe direct streaming, channel 570 from Ceton tuner#: 0 
[2022-02-27 10:06:21,164] p757639 {/mnt/ProgSSD/fHDHR/plugins/fHDHR_plugin_origin_ceton/origin/__init__.py:225} - INFO - Ceton tuner 0 streamurl set, to: /dev/ceton/ctn91xx_mpeg0_0
[2022-02-27 10:06:21,166] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:99} - INFO - Attempting to Select an available tuner for this stream.
[2022-02-27 10:06:21,167] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/device/tuners/tuner.py:76} - INFO - Tuner fHDHR/fHDHR#1 Acquired.
[2022-02-27 10:06:21,168] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:107} - INFO - ceton Tuner fHDHR/fHDHR#1 to be used for stream.
[2022-02-27 10:06:21,169] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:109} - INFO - Preparing Stream...
[2022-02-27 10:06:21,170] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/__init__.py:62} - INFO - Stream Method Detected as a /dev/ hardware device.
[2022-02-27 10:06:21,171] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:73} - INFO - Client has requested stream for ceton channel 570 ESPN HD ESPN HD.
[2022-02-27 10:06:21,173] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream_obj.py:79} - INFO - Selected Stream Parameters:method=direct duration=0 origin_quality=None transcode_quality=None.
[2022-02-27 10:06:21,174] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/__init__.py:112} - INFO - Tuning Stream...
[2022-02-27 10:06:21,175] p757639 {/mnt/ProgSSD/fHDHR/fHDHR_web/__init__.py:182} - DEBUG - Client GET requested /api/tuners Closing
[2022-02-27 10:06:21,178] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:27} - INFO - Direct Hardware Stream from device: /dev/ceton/ctn91xx_mpeg0_0
[2022-02-27 10:06:21,179] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:36} - DEBUG - Operating System is: Linux
[2022-02-27 10:06:21,180] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:37} - DEBUG - Command is: cat /dev/ceton/ctn91xx_mpeg0_0
cat: /dev/ceton/ctn91xx_mpeg0_0: Device or resource busy
[2022-02-27 10:06:21,194] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:46} - DEBUG - Pulling Chunk fHDHR/fHDHR#1
[2022-02-27 10:06:21,197] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:27} - INFO - Direct Hardware Stream from device: /dev/ceton/ctn91xx_mpeg0_0
[2022-02-27 10:06:21,199] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:36} - DEBUG - Operating System is: Linux
[2022-02-27 10:06:21,200] p757639 {/mnt/ProgSSD/fHDHR/fHDHR/streammanager/stream/direct_hardware_stream.py:37} - DEBUG - Command is: cat /dev/ceton/ctn91xx_mpeg0_0
cat: /dev/ceton/ctn91xx_mpeg0_0: Device or resource busy

OK, looking at this a bit more closely => fHDHR is selecting Tuner 1, but Ceton is saying Tuner 0. Hmmm ... and then direct_hardware_stream goes with the Ceton (plugin) selection - is that right? Did it used to do that? If it were to use the info from the (fHDHR) API, then the selection would all be correct. I may have this wrong, by all means comment. And - did this logic change recently?

Thanks!

deathbybandaid commented 2 years ago

It's almost like I thought methods for these thing would be useful

arrmo commented 2 years ago

It's almost like I thought methods for these thing would be useful

Very cool, makes 100% sense. Nice and clean too - origin object. I like it!

DanAustinGH commented 2 years ago

I'm glad you got this working. Since I only was using a single 'client; to access the plugin, I never got it out of sync.

And if you want to present the relationship between Ceton tuner and fHDHR tuner, you could add that to the Ceton status page.

arrmo commented 2 years ago

And if you want to present the relationship between Ceton tuner and fHDHR tuner, you could add that to the Ceton status page.

Yep, makes sense - but inside Ceton, we don't know the fhdhr instance ... agreed? At least I don't think we do 😆.

arrmo commented 2 years ago

Closing this one - yell if you disagreed! But addressed I believe, #33. Will follow the other issues (vars not being used) in the Testing Talk thread.

Thanks!