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

HDHomerun integration #425

Closed
wants to merge 1 commit into from
Closed

HDHomerun integration #425

wants to merge 1 commit into from

Conversation

pakar
Copy link
Contributor

@pakar pakar commented Jun 18, 2014

Initial support for hdhomerun devices (dvb-c/t) that has been tested for ~48 hours without any issues. Ready for testing by a wider range of users.

@perexg
Copy link
Contributor

perexg commented Jun 18, 2014

@pakar : Please, could you rebase your changes to the latest tvheadend tree to eliminate the merges?

@Frank-NL
Copy link

Really looking forward to testing this. Is there an issue why this can't be pulled in yet?

@pakar
Copy link
Contributor Author

pakar commented Jun 26, 2014

Need to seperate some of the items in this PR into several.. Did not read up on the PR policy of tvheadend..
Have quite a bit to do at the moment so have put it on hold, but should be able to find some time this weekend at the latest to do the needed corrections.

@Frank-NL
Copy link

Thanks. I'll try a build from your git in the meantime. Unfortunately I cannot support you with bitcoin. No paypal donations possible?

@adamsutton
Copy link
Contributor

@pakar as @perexg said, can you get this rebased and split to remove unrelated stuff.

Also this cannot be merged now until we branch 4.0, which when I finally get some time we'll probably do pretty soon.

Personally I think this is a perfect candidate for the yet to be created plugin framework. But that remains to be seen.

Just so it's explicitly listed here, I can personally confirm that @pakar has signed the CLA, he's just not done it via clahub. For the reference @pakar, why haven't you signed via clahub? This is the preferred method for current/future committers via github PRs.

@pakar pakar changed the title HDHomerun integration and minor bugfixes HDHomerun integration Jun 27, 2014
@pakar
Copy link
Contributor Author

pakar commented Jun 27, 2014

@adamsutton, Have just been quite busy the last few weeks. But now it's done.
About the CLA, i used the link here on github that pointed me to the agreement. Ie the one you get next to the commit when a commit is rejected due to not having signed it.

@Frank-NL, a donation to FSFE (https://fsfe.org) is also appreciated.

@Frank-NL
Copy link

@pakar Done! Thanks again for the work done, I'll wait patiently now :)

@Frank-NL
Copy link

Frank-NL commented Jul 2, 2014

I compiled this into an OpenELEC addon:

https://dl.dropboxusercontent.com/u/110443863/service.multimedia.tvheadend-4.1.9.zip

Did a quick test and it's working well so far.
Really nice work. Very happy this is finally getting integrated.

@bergvoll
Copy link

bergvoll commented Jul 2, 2014

@pakar Very nice work! I've been using it for some days now, without any issues at all. Thank you!

@pakar
Copy link
Contributor Author

pakar commented Jul 2, 2014

To not get this PR too cluttered, and for me to be able to keep track, please submit any bugreports to https://github.com/pakar/tvheadend-hdhomerun (Nice if you would post your setup in the "tested devices" issue)

Thanks for your support @Frank-NL @bergvoll and nice work with the openelec plugin.

@adamsutton
Copy link
Contributor

@pakar are you US based and do you use Schedules Direct at all?

@pakar
Copy link
Contributor Author

pakar commented Jul 3, 2014

@adamsutton : i'm based in Sweden and do not use schedules direct..

On Thu, Jul 3, 2014 at 11:07 AM, Adam Sutton notifications@github.com
wrote:

@pakar https://github.com/pakar are you US based and do you use
Schedules Direct at all?


Reply to this email directly or view it on GitHub
#425 (comment).

@adamsutton
Copy link
Contributor

@pakar I've just noted the real name ;) apologies, schoolboy error.

Well since this is about HDHR and someone here MUST be in the US and possibly use Schedules Direct! If you do, please let me know.

@bfennema
Copy link
Contributor

bfennema commented Jul 8, 2014

@adamsutton I think there is a free 7 day trial membership to Schedules Direct. I'm in the US and could sign up if there is something you need tested.

@allebone
Copy link

Didn't notice this until now, but I'm in the US, with a full Schedules Direct account. I use the HDHOMERUN Prime -- 6 Tuner version, with Cox Cable in Omaha (dual cablecard). I'm primarily OPENElec on a 4 Raspberry Pi device network. Currently, I am using strm generators to watch live tv, but that's it. I tested tvheadend in a VM to no avail, plus I don't have a dedicated server (other than a 1813+ Synology), so this would work great I imagine. Let me know what I can do. I installed the service version for OpenElec above, but it doesn't seem to work for tvheadend, for me. I am in the business of purchasing a NUC eventually, so this might be a good reason!

@pakar
Copy link
Contributor Author

pakar commented Jul 25, 2014

@allebone - Are you running the tvheadend-hdhomerun fork of tvheadend? If running in a VM make sure you use bridged networking. Some vm's do not allow multicast forwarding (needed for discovery) either so you might need to look into that.

This has not been tested on the prime devices at all, but should work as long as libhdhomerun behaves the same as for the non-prime devices.

Easiest way for you to test this would be to build this manually, on a linux-machine, and manually start it and post the log. (please use issue https://github.com/pakar/tvheadend-hdhomerun/issues/1 for this)

@allebone
Copy link

I will certainly give it a try tonight. I haven't forked into the hdhomerun specific, but I've tried regular and MythTV. I installed the service plugin for openelec posted above, but it doesn't appear to do anything on my raspberry pi openelec system. Sadly, I got rid of most of my dedicated server equipment in the move to synology (and saving electricity). I'll install a linux dedicated to my Boot Camp partition on a Macbook Pro, that I have (rocking an SSD and 16GB of ram). I use red hat and ubuntu at work mostly...anyone have a suggestion on which to start with to get the best valid test? Also, I am at work, so my Googling is fairly blocked...is there a good source on how to setup tvheadend with schedules direct? I can do it myself when I get home, but thought I'd ask!

Thanks. Happy to help.

@aminebizid
Copy link

Red hat sucks.
Le 25 juil. 2014 17:39, "Bryan Allebone" notifications@github.com a écrit
:

I will certainly give it a try tonight. I haven't forked into the
hdhomerun specific, but I've tried regular and MythTV. I installed the
service plugin for openelec posted above, but it doesn't appear to do
anything on my raspberry pi openelec system. Sadly, I got rid of most of my
dedicated server equipment in the move to synology (and saving
electricity). I'll install a linux dedicated to my Boot Camp partition on a
Macbook Pro, that I have (rocking an SSD and 16GB of ram). I use red hat
and ubuntu at work mostly...anyone have a suggestion on which to start with
to get the best valid test? Also, I am at work, so my Googling is fairly
blocked...is there a good source on how to setup tvheadend with schedules
direct? I can do it myself when I get home, but thought I'd ask!

Thanks. Happy to help.


Reply to this email directly or view it on GitHub
#425 (comment).

@ProfYaffle
Copy link
Member

Or, more positively, Debian-based distros seem to have broadest support, with 'buntu winning ahead of 'genuine' Debian, based on what I see. I'm not saying you'd get fewer problems, you're just more likely to find people who've faced them down previously...

@pakar
Copy link
Contributor Author

pakar commented Jul 25, 2014

I would recommend you to use Ubuntu 14.04 for testing ( since it has the
version of libhdhomerun that has been used for testing ).
Guide for how to build packages for the hdhomerun-branch of tvheadend have
a look at http://pakar.github.io/tvheadend-hdhomerun/

On Fri, Jul 25, 2014 at 5:46 PM, Ian notifications@github.com wrote:

Or, more positively, Debian-based distros seem to have broadest support,
with 'buntu winning ahead of 'genuine' Debian, based on what I see. I'm not
saying you'd get fewer problems, you're just more likely to find people
who've faced them down previously...


Reply to this email directly or view it on GitHub
#425 (comment).

@allebone
Copy link

Sounds good. I'll hop on it soon! Let you all know. Question, while I am at it, I see the GitHub instructions you posted show DVB-C setting...is there something I should be considering since I am a Cablecard user, and my provider is using CABLE-HRC for frequency ranges?

@bfennema
Copy link
Contributor

@allebone - The only issue I had with building the hdhomerun support on Fedora 20 was that Fedora installs the header files in /usr/include/hdhomerun and Ubuntu puts them in /usr/include/libhdhomerun (one line change to src/input/mpegts/tvhdhomerun/tvhdhomerun_private.h fixes it)

Also, the Fedora 20 default firewall blocked whatever the hdhomerun library uses to find the tuner (so I disabled it)

For Schedules Direct, just run /usr/bin/tv_grab_na_dd --configure as the same user you are running tvheadend as. Then pick the tv_grab_na_dd grabber in tvheadend.

@MartinAyla
Copy link

@pakar (or others) - I would love to try this on Mac OS X 10.9.

I tried to build this branch, but hdhomerun is disabled during ./configure.

Since Tvheadend, from what I can read, now compiles on OS X, I guess the 'missing link' is to edit the path to libhdhomerun.

I have installed the latest .dmg straight from SiliconDust, after installing, I have, among others, these directories/files:

/Applications/hdhomerun_config_gui.app/Contents/Resources/lib/libhdhomerun.dylib

Could someone point me in the right direction, as to where can I tell tvheadend-hdhomerun the correct path to the OS X version of the hdhomerun library?

I really hope someone has the time to help, and thanks a lot for the work done on this!

Regards from Denmark
Martin

@MartinAyla
Copy link

Update:

I tried to edit 'configure' with this change (I'm in over my head here, please help :) :

# HDHomeRun - libhdhomerun
#
if enabled_or_auto hdhomerun_client; then
  #if check_cc_lib hdhomerun; then
    enable  hdhomerun_client
    #LDFLAGS="$LDFLAGS -lhdhomerun"
     LDFLAGS="$LDFLAGS -L/Users/martin/Downloads/libhdhomerun"
  #fi
fi

Then I do './configure' and 'make', but it fails with this error:

CC              src/descrambler/capmt.o
CC              src/descrambler/ffdecsa/ffdecsa_interface.o
CC              tvheadend
Undefined symbols for architecture x86_64:
  "_hdhomerun_debug_create", referenced from:
      _tvhdhomerun_init in tvhdhomerun.o
  "_hdhomerun_debug_destroy", referenced from:
      _tvhdhomerun_device_destroy in tvhdhomerun.o
  "_hdhomerun_debug_enable", referenced from:
      _tvhdhomerun_init in tvhdhomerun.o
  "_hdhomerun_debug_set_filename", referenced from:
      _tvhdhomerun_init in tvhdhomerun.o
  "_hdhomerun_device_create", referenced from:
      _tvhdhomerun_discovery_timer_cb in tvhdhomerun.o
      _tvhdhomerun_frontend_create in tvhdhomerun_frontend.o
  "_hdhomerun_device_destroy", referenced from:
      _tvhdhomerun_discovery_timer_cb in tvhdhomerun.o
      _tvhdhomerun_frontend_delete in tvhdhomerun_frontend.o
  "_hdhomerun_device_get_model_str", referenced from:
      _tvhdhomerun_discovery_timer_cb in tvhdhomerun.o
  "_hdhomerun_device_get_tuner_status", referenced from:
      _tvhdhomerun_frontend_monitor_cb in tvhdhomerun_frontend.o
  "_hdhomerun_device_set_tuner_channel", referenced from:
      _tvhdhomerun_frontend_start_mux in tvhdhomerun_frontend.o
  "_hdhomerun_device_set_tuner_filter", referenced from:
      _tvhdhomerun_device_update_pid_filter in tvhdhomerun_frontend.o
  "_hdhomerun_device_stream_recv", referenced from:
      _tvhdhomerun_frontend_input_thread in tvhdhomerun_frontend.o
  "_hdhomerun_device_stream_start", referenced from:
      _tvhdhomerun_frontend_input_thread in tvhdhomerun_frontend.o
  "_hdhomerun_device_stream_stop", referenced from:
      _tvhdhomerun_frontend_input_thread in tvhdhomerun_frontend.o
  "_hdhomerun_device_wait_for_lock", referenced from:
      _tvhdhomerun_frontend_start_mux in tvhdhomerun_frontend.o
  "_hdhomerun_discover_find_devices_custom", referenced from:
      _tvhdhomerun_discovery_timer_cb in tvhdhomerun.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/martin/tvheadend-hdhomerun/build.darwin/tvheadend] Error 1

Any ideas what I'm doing wrong?

@InuSasha
Copy link
Contributor

InuSasha commented Sep 9, 2014

@MartnAyla
you had removed the "-lhdhomerun" from LDFlags. Add it again
for example

    #LDFLAGS="$LDFLAGS -lhdhomerun"
     LDFLAGS="$LDFLAGS -lhdhomerun -L/Users/martin/Downloads/libhdhomerun"

@MartinAyla
Copy link

@InuSasha Thanks, I got it working with some help at pakar's github repo.

However it seems it's pretty unsuable at the moment, on OS X, because tvheadend does a 'segfault 11' every single time, within a couple of minutes/seconds.

pakar needs a coredump but I can't deliver it as gdb isn't working in OS X anymore :/

@beralt
Copy link
Contributor

beralt commented Oct 7, 2014

I have rewritten parts of the tvhdhomerun plugin and synced it with the current tree:(https://github.com/beralt/tvheadend/tree/test_cleanhdhr).

A number of mutex'es have been dropped, leaving only the one required due to the thread-safety issues of libhdhomerun. I also dropped the implementation of libhdhomerun to receive the network stream, and implemented the UDP unicast approach (tvhpoll and using a pipe for IPC just like the linuxdvb plugin). Overall I tried to reflect the structure of the linuxdvb plugin more closely. I've tested with a HDHR3-4DC only, but it seems to be working fine.

I think the following work might further improve the pull request (and increase maintainability):

  • properly moving code to a tvhdhomerun_device and tvhdhomerun_frontend files
  • implement PID removal: I did not implement removing a PID from the filter (gets reset every retune anyway)

Feedback is very welcome!

@allebone
Copy link

allebone commented Oct 8, 2014

What is the current guidance on best starting out from scratch with hdhomerun prime?

Is there a fork or dev working at this time?

Thanks!

Bryan

Sent from my iPhone

On Oct 7, 2014, at 09:41, Beralt Meppelink notifications@github.com wrote:

I have rewritten parts of the tvhdhomerun plugin and synced it with the current tree:(https://github.com/beralt/tvheadend/tree/test_cleanhdhr).

A number of mutex'es have been dropped, leaving only the one required due to the thread-safety issues of libhdhomerun. I also dropped the implementation of libhdhomerun to receive the network stream, and implemented the UDP unicast approach (tvhpoll and using a pipe for IPC just like the linuxdvb plugin). Overall I tried to reflect the structure of the linuxdvb plugin more closely. I've tested with a HDHR3-4DC only, but it seems to be working fine.

I think the following work might further improve the pull request (and increase maintainability):

properly moving code to a tvhdhomerun_device and tvhdhomerun_frontend files
implement PID removal: I did not implement removing a PID from the filter (gets reset every retune anyway)
Feedback is very welcome!


Reply to this email directly or view it on GitHub.

@beralt
Copy link
Contributor

beralt commented Oct 8, 2014

My branch at https://github.com/beralt/tvheadend/tree/test_cleanhdhr seems to be working fine as far as I can tell. I've been running it for a couple of days now, with live TV and recordings. But nobody has tested it besides me (using a HDHR3-4DC), so additional tests are appreciated.

@bfennema
Copy link
Contributor

bfennema commented Oct 9, 2014

@beralt I've got your branch running on my HDHR4-2US without any issues so far. I did notice the hfe->hf_input_thread_mutex is destroyed twice.

@beralt
Copy link
Contributor

beralt commented Oct 10, 2014

@bfennema Thanks for testing. I pushed a commit to my branch which removes some of the mutex'es that were not in use and also properly does init/destroy for the ones that are in use.

@perexg
Copy link
Contributor

perexg commented Oct 14, 2014

@beralt : Please, create another PR for your code... I'll review and possibly merge...

@Frank-NL
Copy link

I can confirm that the changes to @pakar branch by @beralt are working really well. I had troubles using the hdhomerun implementation on OpenELEC but using the latest commits from @beralt make it really stable!

@perexg
Copy link
Contributor

perexg commented Oct 14, 2014

The updated code was merged to tvh. Closing.

@perexg perexg closed this Oct 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet