Player hangs after watching RTP stream on iOS 6.1.3

macOS specific usage questions
jbrunken
New Cone
New Cone
Posts: 6
Joined: 18 Mar 2013 17:46

Player hangs after watching RTP stream on iOS 6.1.3

Postby jbrunken » 05 Aug 2013 22:22

I've been playing around with the iOS VLC client and trying to get it to play a multicast stream via RTP.

The actual playback works fine, but when I click on the "Done" button, the app hangs and stops responding.

I downloaded/compiled the source code and it does seem to work properly on the simulator. I can repeatedly close and re-open the stream with no problems at all.

When I try and debug on the actual device, I see the exact same behavior that I see in the store version. Pressing the "done" button results in the app hanging up without any exception being thrown.

Is this a known issue with RTP/Multicast?

Thanks,

-JB

alex5723
Blank Cone
Blank Cone
Posts: 36
Joined: 25 Jul 2013 05:45

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby alex5723 » 06 Aug 2013 06:42

There is a free small and great application for iOS called YASC - Yet Another System Console :
https://itunes.apple.com/us/app/yet-ano ... 20006?mt=8

Yet Another System Console is just that, it gives you access to a console with log messages generated by applications and system processes that are running on your device. To help you make use of those logs it has many really nice features including:

- Natural top-down order of log messages.
- Bottom info bar that can also be used to scroll to bottom of the log.
- Filtering log messages by application or system process that generated them.
- Select and copy interface with native look and feel.
- Searching for the selected text on the internet using your favorite search engine (Google, Yahoo! or Bing).
- Sending selected log messages to either Email, Dropbox or Evernote.
- Customizing the way log messages are displayed. ...

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

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby fkuehne » 06 Aug 2013 16:04

This isn't a known issue. Do you get any debug message when deploying on device stating the reason why the playback view controller fails to be dismissed?
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

jbrunken
New Cone
New Cone
Posts: 6
Joined: 18 Mar 2013 17:46

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby jbrunken » 06 Aug 2013 17:31

No, that's the odd thing. I don't see anything in the console log at all and no exception is thrown. The app just stops responding.

I'm still digging at it. If I come up with any additional information, I will post it here.

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

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby fkuehne » 06 Aug 2013 17:58

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

jbrunken
New Cone
New Cone
Posts: 6
Joined: 18 Mar 2013 17:46

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby jbrunken » 06 Aug 2013 18:11

I did a bit of debugging and tracked it down to the closePlayback method in VLCViewController.m

- (IBAction)closePlayback:(id)sender
{
[self setControlsHidden:NO animated:NO];
[self.navigationController popViewControllerAnimated:YES];
}

It goes into the popViewControllerAnimated method, but it never returns.

If I comment out the code that created the mediaPlayer object, the popViewControllerAnimated methods works as expected. It seems like something in the media player might be deadlocking when the object is getting released. I'm not much of a C coder, so it's hard for me to dig much deeper.

jbrunken
New Cone
New Cone
Posts: 6
Joined: 18 Mar 2013 17:46

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby jbrunken » 06 Aug 2013 21:46

After a bit more digging, it appears that the problem is in "stop" method of the media player. When I comment that line out of the _stopPlayback method (which is called by the viewWillDisappear handler method), the done button works as expected. However, immediately after the player view disappears, the app throws an exception.

2013-08-06 14:37:42.466 VLC for iOS[341:6f3b] *** Assertion failure in -[VLCMediaPlayer dealloc], /Users/Jason/Documents/XCodeProjects/VLC/ImportedSources/VLCKit/Sources/VLCMediaPlayer.m:229
2013-08-06 14:37:42.467 VLC for iOS[341:6f3b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You released the media player before ensuring that it is stopped'

So it seems like the "stop" method is required, but not behaving properly in some circumstances.

jbrunken
New Cone
New Cone
Posts: 6
Joined: 18 Mar 2013 17:46

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby jbrunken » 06 Aug 2013 21:55

Ok, I have a hack fix in place.

I looked at "stop" method in VLCMediaPlayer.m and just above it, there is a "pause" method that has a temporary hack fix noted in the code where it forces the command to run on the background thread instead of the main thread.

I duplicated that code in the stop method, and now it's working as expected:

- (void)stop
{
if ([NSThread isMainThread]) {
/* Hack because we create a dead lock here, when the vout is stopped
* and tries to recontact us on the main thread */
/* FIXME: to do this properly we need to do some locking. We may want
* to move that to libvlc */
[self performSelectorInBackground:@selector(stop) withObject:nil];
return;
}

libvlc_media_player_stop(_playerInstance);
}

Chuck55
New Cone
New Cone
Posts: 2
Joined: 07 Aug 2013 19:22

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby Chuck55 » 07 Aug 2013 19:39

May I kindly ask how you managed to receive a rtp stream on an iOS device?
I tried both, an iPad3 as well as an iPhone5.
Each time I tried to receive a multicast stream (IP TV) it stops after round about 1 to 2 minutes. Then vlc hangs and it has to be killed. Receiving the same rtp stream with the actual VLC on a Mac works flawlessly. The source for the stream is a fritz.box 7390 with actual firmware.
I remember a similar problem appeared with VLC for Mac OS in the beginning of 2012. Some later version of VLC had the bug fixed, but in between also the fritz.box firmware had changed, so I can't say for sure that the bug was solely on VLC side.

The following is the information extracted from the console log:

Aug 07 19:45:33 VLC for iOS[6789] <Warning> this is a cat three device
Aug 07 19:45:33 VLC for iOS[6789] <Warning> Initializing db in /var/mobile/Applications/650A491B-C060-4AF8-8D66-A362CAD821CA/Library
Aug 07 19:45:33 VLC for iOS[6789] <Warning> Fetching
Aug 07 19:45:33 VLC for iOS[6789] <Warning> Done
Aug 07 19:45:36 VLC for iOS[6789] <Warning> Reachability Flag Status: -R ------d localWiFiStatusForFlags
Aug 07 19:45:42 VLC for iOS[6789] <Warning> set starttime to 0
Aug 07 19:45:42 VLC for iOS[6789] <Warning> Warning: Attempt to dismiss from view controller <UINavigationController: 0x1ddbe2d0> while a presentation or dismiss is in progress!
Aug 07 19:46:54 MobileMail[91] <Warning> ERROR: MFMessageErrorDomain/Command Failed -
Aug 07 19:48:01 VLC for iOS[6789] <Warning> Cancelling file parsing
Aug 07 19:48:06 yasc[6786] <Warning> APIHandler did start config update.
Aug 07 19:48:07 yasc[6786] <Warning> APIHandler did update config.

jbrunken
New Cone
New Cone
Posts: 6
Joined: 18 Mar 2013 17:46

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby jbrunken » 07 Aug 2013 20:26

I'm able to view the RTP stream for a long period without any issues, so I'm not sure why you are not able to view your stream for longer periods. However, I'd be willing to bet that the lockup issue is related to the the "stop" method issue I posted above.

For our RTP stream, we are using a custom solution written by one of our network engineers, but from what I've been told it's just a standard RTP stream.

Chuck55
New Cone
New Cone
Posts: 2
Joined: 07 Aug 2013 19:22

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby Chuck55 » 07 Aug 2013 21:25

Thanx for your reply.
Might be the following log is helpful for further analysing the Problem.
Aug 07 21:16:01 backboardd[26] <Warning> VLC for iOS[277] has active assertions beyond permitted time:
{(
<BKProcessAssertion: 0x1e09e830> identifier: Suspending process: VLC for iOS[277] permittedBackgroundDuration: 10.000000 reason: suspend owner pid:26 preventSuspend preventThrottleDownCPU preventThrottleDownUI
)}
Aug 07 21:16:01 backboardd[26] <Warning> Forcing crash report of VLC for iOS[277]...
Aug 07 21:16:01 backboardd[26] <Warning> Finished crash reporting.
Aug 07 21:16:01 backboardd[26] <Warning> Application 'UIKitApplication:org.videolan.vlc-ios[0x1190]' exited abnormally with signal 9: Killed: 9

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

Re: Player hangs after watching RTP stream on iOS 6.1.3

Postby fkuehne » 07 Aug 2013 21:27

@jbrunken: I had a quick look at the git history and in fact your proposed hack was originally applied both to Pause() and Stop(). I have no idea when and why it was removed for the latter, but I re-added it to VLCKit now.

Thanks a lot for your thorough investigation!
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 2 guests