ddbridge: m4: fix ISDB-S TSID handling#47
Open
tomiy-0x62 wants to merge 1 commit into
Open
Conversation
For ISDB-S, Linux DVB API uses DTV_STREAM_ID to pass the Transport Stream ID. However, Max M4 currently sets isdbs_search.flags bit 0 to 1 for normal 16-bit stream IDs, causing the MCI firmware to interpret the value as a relative stream number instead of a Transport Stream ID. As a result, tuning may select a different transport stream than the requested TSID. Set flags bit 0 to 0 and pass the lower 16 bits of DTV_STREAM_ID as the MCI TSID.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes ISDB-S
DTV_STREAM_IDhandling for Max M4/Max M2.Currently,
ddbridge-m4.cpasses a valid 16-bit ISDB-SDTV_STREAM_IDto the MCI firmware as a relative stream number. However, according to the Linux DVB API, the validDTV_STREAM_IDrange for ISDB is1..65535, and userspace applications pass the ISDB-S Transport Stream ID through this property.The Max M4 MCI API supports both modes:
However, the current code does this:
For normal ISDB-S TSIDs such as
0x4090,0x4092,0x40f1,0x40f2, or0x48f3, the upper 16 bits are zero. Therefore,flagsbecomes1, causing the firmware to interpret the value as a relative stream number instead of a Transport Stream ID.This PR changes ISDB-S handling so that a valid
DTV_STREAM_IDis passed to the MCI firmware as a Transport Stream ID.Background
I observed that ISDB-S tuning on DD Max M4/DD Max M2 selected the wrong transport stream when using
DTV_STREAM_ID.For example, userspace requested the following TSIDs:
With the current driver, the actual output was:
This behavior matches the lower bits of the TSID being interpreted as a relative stream number:
Verification
I added a temporary debug print just before
ddb_mci_cmd()insearch_isdbs():After applying this fix, the log showed that the Transport Stream ID mode was used:
The resulting transport streams were then selected correctly:
Compatibility notes
This changes the behavior for users who rely on the current dddvb-specific behavior by setting ISDB-S
DTV_STREAM_ID/STREAM_IDto relative stream numbers such as0,1, or2.However, according to the Linux DVB API, the valid
DTV_STREAM_IDrange for ISDB is1..65535, and values outside the valid range disable filtering. Therefore, relative stream numbers are not valid Linux DVB APIDTV_STREAM_IDvalues for ISDB-S.Userspace applications such as recisdb-rs and dvbv5-zap pass actual ISDB-S Transport Stream IDs through
DTV_STREAM_ID, so this change makes the driver behavior consistent with the Linux DVB API.Notes
This PR only changes
search_isdbs().search_isdbc()has similar-looking logic, but I have not tested ISDB-C behavior, so this PR intentionally leaves ISDB-C unchanged.