Releasing tuner locks

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
bpauquette
Posts: 1
Joined: Wed Sep 12, 2018 9:05 pm

Releasing tuner locks

Postby bpauquette » Wed Sep 12, 2018 9:17 pm

Hi guys! I really like your product(s). I currently own the model that allows only two active channels to stream at a time.

I didn't really like the gui that came with your product and also didn't like the guis that come with vlc so I wrote my own media-browser in java that is based on vlc4jplayer and vlc. It includes an integrated database so I can search for movies, music videos etc etc. It handles switching between fullscreen mode and non-fullscreen mode and works well on linux and windows and even supports multiple monitors and multiple running players.

I noticed that when I switch channels either my code or plex media server (recording modules) is not releasing the "resource locks" associated with each individual tuner. I'm trying to determine if the problem is in plex media server (maybe) or my code (probably) and
if there is some way I can coax vlc into releasing the tuner properly. The model I am using is HDHR4-2US. I am using the latest release version of vlc and I have been testing with fedora,ubuntu and windows 10.

Can you point me at some documentation that explains how the tuner resource locks work and give me some advice on how to test if the tuner lock is being released properly. This is a snippet of code that shows how I am currently switching channels.

protected void prevChannel() {

SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
log.info("currentChannelIndex=" + currentChannelIndex);
if (currentChannelIndex == 0) {
currentChannelIndex = channels.size() - 1;
} else {
currentChannelIndex = currentChannelIndex - 1;
}
currentChannel = channels.get(currentChannelIndex);
channelLabel.setText(currentChannel.getTitle());
mediaPlayerComponent.getMediaPlayer().stop();
mrl = currentChannel.getSource();
mediaPlayerComponent.getMediaPlayer().playMedia(mrl);
}
});

}


Thanks!

jasonl
Silicondust
Posts: 12778
Joined: Sun Oct 28, 2007 9:23 pm

Re: Releasing tuner locks

Postby jasonl » Tue Sep 18, 2018 3:49 pm

If you're streaming with HTTP, the locking is controlled by the TCP connection. Once it closes, the lock will be released.


Return to “Development Support”

Who is online

Users browsing this forum: No registered users and 1 guest