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

[Question/Request]Support for DVB-T channels? #42

Closed
PrinceOfAbyss opened this issue Feb 13, 2021 · 4 comments
Closed

[Question/Request]Support for DVB-T channels? #42

PrinceOfAbyss opened this issue Feb 13, 2021 · 4 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@PrinceOfAbyss
Copy link

Since last week I face a very frustrating situation. A telecommunications company in my country offers an IPTV service for which they use this fantastic, all-in-one, little device; an Android TV box that even has a built-in TV tuner. The box comes with their own app* pre-installed, that manages the streaming of their IPTV content as well as cooperates with the TV-tuner to receive and deliver free-to-air, terrestrial channels (television and radio) under the same interface.

So, after using their service for some years, a couple of months ago I moved to another telecommunications company for some irrelevant reason (I was in need of fast internet through FTTH), so the previous company's IPTV service wasn't available anymore to me. In order to keep the TV box functional and useful, I installed Live Channels, which after a re-scan found again the free-to-air, terrestrial channels, so I kept using it ever since for watching those channels, casting content through Chromecast, etc... Ah, at this point I should mention that, at some point in January, the box was automatically updated to Android TV v9, which apart from the nicer interface didn't change anything in regard to the box's operation/functionality.

All this until this Monday, when I stupidly decided to do a factory reset to the box to set it up all over again. The factory reset went fine of course, but, this time, Live Channels behaved very strangely. As soon as the scanning was completed (it found the usual for my area 46 channels - 39 for television and 6 for radio), a popup came that said No channels added (video is sped-up to 2x). What's worse is that I'm totally clueless about the reason this happened. Is it that Android TV v9 doesn't yet cooperate so well with Live Channels? Is it that the unified app* I mentioned before prohibits somehow Live Channels to store the scanned channels in its DB (if that's even possible)? Is it something else? I'm totally clueless... There is only one thing I'm sure about: If the channels were somehow already stored to Live Channels' DB, they would play fine, as they had been playing fine until Monday when I performed that disastrous factory reset...

So, coming finally to the million dollar question/feature request: Can TVirl be used to add, not URLs, but rather frequencies to Live Channels' DB? Having looked in the Wiki it seems like it doesn't (at least yet) support that feature. I got the idea from VLC, which uses a syntax like the one below to play a channel if an appropriate TV tuner device is attached to the computer:

#EXTM3U

#EXTINF:0,STAR <- channel's name
#EXTVLCOPT:program=700 <- a special value involved in DVB-T reception, named SID or ServiceID
dvb-t://frequency=546000000

If you wouldn't be willing to add that functionality, would you at least be willing to advise me, since you've studied so well Google's TIF, on what kind of data Live Channels expects in order to store a terrestrial channel in its DB, so that I could add the frequencies manually myself through an appropriate app like SQLite Editor? I'd be really grateful if you could help me on this, and I'd definitely become an active supporter of TVirl app as well!

Thanks in advance for your response!

@stari4ek
Copy link
Owner

Hey.
As you correctly mentioned all those channels played by Live Channels app are added by pre-installed TV Tuner Input or apps like TVirl (which is also a TV Input Service) and they are stored in the same system DB (managed by com.android.providers.tv) through TIF (TV Input Framework).
I am afraid 3rd party apps (=TVirl) cannot have access to tuner (hardware) itself, so I do not see how TVirl can help you here.

You can check reference Live TV app and some open source tuner samples here:

But I do not think that manually adding entries to the DB will work for you, since it always work in pair.
TV Input Service (tuner for example) stores entries in the DB which has enough information to play channel and the same TV Input Service plays stream using those data stored in DB.

@stari4ek
Copy link
Owner

Talking about weird behavior with "no channels added"
I am seeing this kind of issue when TV App is installed/enabled after channels are installed. So, if those channels are added to the DB before TV App is fully working, it will fail to see them (some weird caching issue I believe).

As an example:
ADT-3 (developer focused Android TV device) has "Live TV" TV App pre-installed.

  1. Add channels using TVirl to the DB (TIF)
  2. Live TV app will have them
  3. Install "Live Channels" TV App, which is kind of extended propriety Google's version of "Live TV""
  4. Open "Live Channels" - does not see installed channels
  5. Delete All channels using TIF
  6. Install them once again - Live Channels still do not see them
  7. Clean "TV Provider" and "Live Channels" data using system settings
  8. Add channels using TIF once again
  9. Both TV Apps see channels

So it might be the same issue in your case. There are entries in the DB. But Live Channels does not see them.
I would recommend you to clean data for TIF and Live Channels and system TV App if you have another one pre-installed. And perform scan after it.
And just to be sure - double check that all channels are enabled (all newly added channels are disabled by default, except initial installation).

@stari4ek stari4ek added duplicate This issue or pull request already exists question Further information is requested and removed duplicate This issue or pull request already exists labels Feb 14, 2021
@PrinceOfAbyss
Copy link
Author

Hi again. Thanks a lot for your reply.

Maybe I wasn't clear enough, but I wouldn't expect TVirl to do the frequency scanning, I know that's not what it's intended for. I already have the frequencies of the channels at hand. I got them from a television in the house that has an export channels list feature, producing some sdb.xml file, which contains everything: frequencies, service ID of each channel in the same bouquet, etc... But since TVirl is, like you said, a TV input service, I don't see why it can add streaming URLs into the DB but not channel frequencies.

Sorry for my persistence here, it comes with the desperation to keep using my device the way I used to do before I stupidly decided to reset it to its factory defaults. And since I had been using Live Channels to watch free-to-air channels before, I strongly believe I could be able to do so again after/if I overcome the obstacle of Live Channels not being able to add the channels itself (after the system update to Android TV v9)...

Even from a profit point of view, I know for a fact that there are dozens of people in my country, ex customers of this telecommunications company, who put aside this fantastic box just because they couldn't use it anymore after they cancelled the IPTV service. Giving those people the chance to use it as a regular TV tuner, besides the rest of its capabilities (casting media, etc), would definitely turn them into paying customers for your app.

About your suggestion to use another app to tune the channels, I have already tried that (I extracted an app from the ROM of another Android TV box), and it failed because there is already an app installed with the same package name but different signature...

Screenshot 2021-02-14 201949

Generally, before I decided to open this request topic, I had exhausted every other possible solution known to me. Of course, if the box was rooted, the possibilities/options would be different, but being unrooted, I believe, the only option to make it work is to somehow write the frequencies manually in the DB...

Please consider adding this functionality to TVirl. If you need me to send you any further technical info on the matter, as you don't have the device at hand, please let me know.

@stari4ek
Copy link
Owner

But since TVirl is, like you said, a TV input service, I don't see why it can add streaming URLs into the DB but not channel frequencies.

please read carefully what I wrote before.
Those DB is populated with human-readable info used by a TV App (channel's title, program's description, logo, and so on). And with proprietary encoded binary blob with any other information. Every TV Input Service uses their own binary scheme to encode this info. There is no field like "frequency for DBT-T" or anything else. You can check all available fields here: https://developer.android.com/reference/android/media/tv/TvContract.Channels
On top of that, TIF works in isolation. Each TV Input Service has access to own fields only, and only system apps can access them all. So there is no way TVirl adds info for other TV Service.

About your suggestion to use another app to tune the channels, I have already tried that

I did not suggest that.
My suggestion was about performing TV tuner scan in the specific way and applying some additional steps before.
With an example that I saw same error in specific case related to the order of installation steps.

BTW, you are trying to install "TvSettings.apk" which has nothing with TIF.

@stari4ek stari4ek added the wontfix This will not be worked on label Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants