Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid removing PID filters when using virtual channel tuning #906

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

SteveErl
Copy link
Contributor

@SteveErl SteveErl commented Jun 1, 2024

The first step is to improve the error messages. In two
places the "UpdateFilters called in wrong tune mode"
message has been updated to specify the value of the
wrong tune mode.

After these updates, an example of the error message is:

mythbackend: mythbackend[779282]: E HDHRStreamHandler
hdhrstreamhandler.cpp:242 (UpdateFilters) HDHRSH[4]
(13249773): UpdateFilters called in wrong tune mode, 4

The tune mode was hdhrTuneModeVChannel (= 4), and
we know that UpdateFilters was called, but in
hdhrstreamhandler.cpp, the only call to it is avoided for
Vchan tuning.

108 void HDHRStreamHandler::run(void)
...
140             UpdateFiltersFromStreamData();
141             if (m_tuneMode != hdhrTuneModeVChannel)
142                 UpdateFilters();

Code examination reveals that the offending invocation of
UpdateFilters() is in StreamHandler::RemoveAllPIDFilters().

This routine is called unconditionally in

108 void HDHRStreamHandler::run(void)
...
183     LOG(VB_RECORD, LOG_INFO, LOC + "RunTS(): " + "shutdown");
184
185     RemoveAllPIDFilters();

The solution is to condition the call to RemoveAllPIDFilters() in the same way the call to UpdateFilters() was previously conditioned. If we're using Virtual Channel Tuning, then don't bother removing filters which were never created in the first place.

After applying this solution, the UpdateFilters called in wrong tune
mode
error messages no longer appear in mythbackend.log.

Resolves #905

Checklist

The first step is to improve the error messages. In two places
the "UpdateFilters called in wrong tune mode" message has been
updated to specify the value of the wrong tune mode.

After this update, an example of the error message is:

 mythbackend: mythbackend[779282]: E HDHRStreamHandleri
   hdhrstreamhandler.cpp:242 (UpdateFilters) HDHRSH[4](13249773):i
   UpdateFilters called in wrong tune mode, 4

From this, we know that the tune mode was hdhrTuneModeVChannel.
We know that UpdateFilters was called, but in hdhrstreamhandler.cpp,
the only call to it is avoided for Vchan tuning.

108 void HDHRStreamHandler::run(void)
...
140             UpdateFiltersFromStreamData();
141             if (m_tuneMode != hdhrTuneModeVChannel)
142                 UpdateFilters();

Code examination revealed that the offending invocation of
UpdateFilters() is in RemoveAllPIDFilters().

This routine is called unconditionally in

108 void HDHRStreamHandler::run(void)
...
183     LOG(VB_RECORD, LOG_INFO, LOC + "RunTS(): " + "shutdown");
184
185     RemoveAllPIDFilters();

The solution is to condition the call to RemoveAllPIDFilters()
in the same way the call to UpdateFilters() was previously
conditioned. If we're using Virtual Channel Tuning, then don't
bother removing filters which were never created in the first
place.

Resolves MythTV#905
@kmdewaal
Copy link
Contributor

kmdewaal commented Jun 1, 2024

I cannot test this myself but it looks good.

@kmdewaal kmdewaal merged commit a448cbe into MythTV:master Jun 1, 2024
7 of 12 checks passed
@SteveErl SteveErl deleted the erlMerge18 branch June 2, 2024 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UpdateFilters called in wrong tune mode for HDHomerun Prime
2 participants