SAT>IP not (yet) on tvos?

iOS, iPad, iPhone, tvOS specific usage questions
fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 07 Dec 2021 11:51

Thanks for all your debugging. I'm puzzled that the variables are not retained the way they should be. I'll see if I can do something there. The way you understood it, is exactly how it is supposed to be done and how I designed it 5 years ago.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 13 Dec 2021 19:58

I finally got my channel list and Panasonic SAT>IP streams to play not only on an iPad but also on a couple of AppleTVs. That required bypassing several problems in vlc-ios, VLCKit, and libvlc. Unfortunately, my hacks will not help anyone who has a different setup, and I don't have much insight into the underlying problems.

One point that can be easily fixed (unless I overlook something), is the mismatch "auto" - "Auto" described here:https://forum.videolan.org/viewtopic.ph ... 98#p522997. With this fix, the server channel list is loaded instead of an imaginary auto.m3u.

But Panasonic server list is useless for VLC. So a custom list should be loaded with the new option kindly added by @fkuehne on iOS and tvOS. Unfortunately, even though this setting is passed to libvlc, it does not have an effect later on. I could not see why. On the way there, a null pointer has to be fixed in any case, as described here https://forum.videolan.org/viewtopic.ph ... 98#p522850.

The third problem is that the IP of the server found in the discovery is not retrieved correctly later. This is described here: https://forum.videolan.org/viewtopic.ph ... 98#p523054. I have no clue why this works on MacOS but not on mobile.

And finally, uniquely for tvOS, only one service for a given UPnP host is shown. My Panasonic TV has two services, one media server and one SAT>IP server. Only one of them shows up on AppleTV, usually the media server, while both show up correctly on the iPad. I had to disable discovery of the media server to get around this. This is described with screenshots here: https://forum.videolan.org/viewtopic.ph ... 98#p522803.

At this point, I got what I wanted, but it requires building and installing my own version of the app, hacked beyond recognition, which seems to expire quite often. If anyone has any hints about the problems above, I can try solutions, but I am not familiar enough with the code to debug further on my own.

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 14 Dec 2021 08:16

Can you provide patches regarding your findings so we can make the fixes available to everyone?

For the IP transversal within VLC, I have an idea that I need to validate for which I didn't find the time yet. It might be that this is due to an occurrence of undefined behavior within the C implementation.

For the unique tvOS discovery problem, i have no explanation as the code is exactly the same for iPad. Is your Apple TV connected to WiFi or Ethernet to discover the Panasonic device?
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 15 Dec 2021 20:00

I am not quite capable of creating a patch... The two clear improvements are:

In vlc-ios/SharedSources/General/VLCLocalNetworkServiceBrowserMediaDiscoverer.m, replace line 44:

NSUserDefaults *defaults;

with

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

Second fix concerns vlc/modules/services_discovery/upnp.cpp (branch 3.0.x) lines 127-128:

add_string( "satip-channelist", "auto", SATIP_CHANNEL_LIST,
SATIP_CHANNEL_LIST, false )

which then is matched against "Auto" (instead of "auto") on line 626. This has been fixed in the master branch, where both "auto" and "Auto" are tested on line 654.

The other two changes - hardcoding custom channel list URL and server IP address - would break a lot of functionality for a lot of people so a better solution should be found...

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 15 Dec 2021 20:07

Is your Apple TV connected to WiFi or Ethernet to discover the Panasonic device?
Both Apple TV and iPad are connected to WiFi and the same router, so the network settings should be the same.

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 15 Dec 2021 22:44

In an effort to dominate this thread, here is another post. I found why only one service is listed on tvOS. In vlc-ios/Apple-TV/VLCServerListTVViewController.m, line 388 we see the code:

if(![addedNetworkServices containsObject:mappedName]) {
[addedNetworkServices addObject:mappedName];
[newNetworkServices addObject:service];
}

So if a service name already appears in the list, it is not added again. My two services (media server and SAT>IP server) have exactly the same name, so only the first one found is displayed. In iOS version, I don't see such a code. I wonder why this check was added here. If I remove the if statement, I get both servers displayed on Apple TV just like on the iPad.

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 16 Dec 2021 10:08

You should get started on https://code.videolan.org and contribute to our project :)
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 16 Dec 2021 11:08

FYI, I have two merge requests ready to address some of the issues you pointed. Will share later!
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 16 Dec 2021 16:11

VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 16 Dec 2021 22:26

That looks really great, I plan to update and test when they're merged. And will continue to look at the other issues when time allows...

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 20 Dec 2021 14:05

All merged :)
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 21 Dec 2021 13:26

All merged :)
Cool! So far I tested the VLC merge. That works as expected (Server list loaded by default, no auto.m3u anymore). I will check out VLC-iOS soon (for now I was using my equivalent modification).

In the meantime, I was trying to find out why custom channel list toggle and URL, which are passed to libvlc properly, do not show up inside. Basically in vlc/modules/services_discovery/upnp.cpp:MediaServerList::parseSatipServer, the lines:

590: char *psz_satip_channellist = config_GetPsz(m_sd, "satip-channelist");

603: char *psz_satip_playlist_url = config_GetPsz(m_sd, "satip-channellist-url" );

both return null. But when I change them to

char *psz_satip_channellist = var_InheritString(m_sd, "satip-channelist");

char *psz_satip_playlist_url = var_InheritString(m_sd, "satip-channellist-url" );

they get the proper values which were passed to libvlc instance. And the custom channel list is properly loaded by the app.

I see similar changes in some past commits. What is the difference between config_GetPsz and var_InheritString?? They seem to have the same interface and functionality? Anyway, that's the possible fix for the new preferences in iOS/tvOS client.

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 25 Dec 2021 17:21

The second remaining issue preventing SAT>IP out-of-the-box (next to the previous post) is the loss of the IP address of the server. After more debugging, I am pretty sure it is because storing "satip-host" in upnp.cpp is done to the extra libvlc instance (as created by VLCLocalNetworkServiceBrowserMediaDiscoverer), and the reading "satip-host" in satip.c is done on shared libvlc instance. That also would explain why the issue does not affect MacOS, only iOS/tvOS. So I wonder why it was necessary for @fkuehne to create that extra libvlc instance in vlc-ios? Would setting the new channel list options on shared library not work? Thank you for any insight; without it, it's hard to suggest fixes or a patch.

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 26 Dec 2021 09:19

Hi, happy holidays!

Indeed, we should use var_inherit here as it will fetch the options we set on the library and the plugin instead of trying to read them from a config file that is not available on tvOS/iOS. I'll propose a patch for that and have it back-ported to the 3.0 branch.

We need to use another instance here because options cannot be added to an existing instance once started. I could expose a variable setter on libvlc for runtime changes, but this would involve a bit of overhead. The loss of the IP could be caused by something else though. I'm not 100% sure the VLCMedia object triggered by the user through a list in the app is the same as returned by the discoverer. It is possible, that is being recreated and the option is not copied. I will investigate on that.

Thank you for the continued debugging on this matter!
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 26 Dec 2021 19:34

Merry Christmas, @fkuehne! Great to read about the next merge request. I hope var_Inhertit... will not affect adversely the MacOS/desktop version, since I did not have a chance to build and test that (it is working pretty well as it is).

With the disappearing IP, thanks for the explanation of the extra instance. I realize you may not have SAT>IP hardware anymore, so if there is something I can look up, let me know!

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 01 Jan 2022 17:50

FYI, the inheritance fix was merged to master. The backport to the 3.0 branch will be soon and afterwards, I'll update VLCKit.

Regarding the satip-host option, the problem indeed seems to be that the VLC GUI on tvOS/iOS recreates the server based on the URL after discovery and thereby drops any options set internally. I'll see how to improve that.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 01 Jan 2022 19:49

Could you try this MR? https://code.videolan.org/videolan/vlc- ... quests/519

Note that it depends on the inheritance patch.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 01 Jan 2022 22:15

That looks really great! The three changed files in vlc-ios seem to do the trick, and now in satip.c the host IP is properly retrieved and substituted. So far, I tested on the iPad, will try it on Apple TV soon. It will take me a while to take out all my hacks, but it does look like updated VLC will work with the SAT>IP server "as is". Thank you so much for looking into this, @fkuehne! I hope this helps others, as VLC seems to be the best option to get Panasonic streams on AppleTV.

behr
Blank Cone
Blank Cone
Posts: 27
Joined: 20 Nov 2021 13:33
Operating System: Mac OS
Location: Belgium

Re: SAT>IP not (yet) on tvos?

Postby behr » 03 Jan 2022 22:35

Today I also built the tvOS version. It does play the SAT>IP streams without any further modifications!

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: SAT>IP not (yet) on tvos?

Postby fkuehne » 04 Jan 2022 10:24

Thanks a lot for the confirmation and for helping so much to make this work!
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 23 guests