enternoescape / opendct

Open source digital cable tuner for SageTV.
Apache License 2.0
9 stars 7 forks source link

eu-cable support for HDHR3-4DC #276

Closed webernissle closed 7 years ago

webernissle commented 8 years ago

Support for eu-cable.

Currently it raises an exception with my eu-cable tuner: INFO | jvm 1 | 2016/05/22 00:33:21.353 | 00:33:21.301 [HDHomeRunDiscoveryReceive-37] ERROR DeviceLoaderImpl - Unable to load the capture device 'HDHomeRun HDHR3-4DC Tuner 14104392-0', id -1945501120 => opendct.tuning.discovery.CaptureDeviceLoadException: The program currently does not know how to use the channel map 'eu-cable'.

webernissle commented 8 years ago

The EU_CABLE is missing in the static table lookup at https://github.com/enternoescape/opendct/blob/master/src/main/java/opendct/channel/Frequencies.java

I would see a reference on wikipedia: https://en.wikipedia.org/wiki/European_cable_television_frequencies

enternoescape commented 8 years ago

This is not an oversight. I didn't think anyone other than people using US Cable would really have any interest in this program. I can add the tables and allow the device to be loaded, but I have no way to test and ensure it's working prior to release.

I'm also not really clear on what advantage you will get from using this software. SageTV already supports the HDHomeRun devices. Are you looking to be able to share your tuners with other software?

enternoescape commented 8 years ago

When OpenDCT can tune us-cable, it's because either a CableCARD is inserted which is taking care of the mappings or because a device with a CableCARD is being used as a reference for another device without a CableCARD.

If you can help me wrap my head around this a little, it will definitely speed things up.

  1. Open the HDHomeRun View app and tune into any channel that you know is on cable.
  2. Open a command prompt.
  3. CD /D "C:\Program Files\Silicondust\HDHomeRun"
  4. Get the device id's with this command: hdhomerun_config.exe discover
  5. hdhomerun_config.exe <device_id> get /tuner0/streaminfo
  6. hdhomerun_config.exe <device_id> get /tuner1/streaminfo
  7. If you're not sure what HDHomeRun actually tuned the channel in, repeat steps 5 and 6 on every device id you got from step 4.

Post the output of the streaminfo commands. If it's anything like ATSC, I can probably work with it.

enternoescape commented 8 years ago

That Wikipedia page is extremely ambiguous as to what's actually relevant for this implementation. The problem is that it's basically saying everything listed is a possibility. I'm not sure if the Superband and Hyperband channels are something I should be concerned with or if the HDHomeRun could even use them. The HDHomeRun documentation says that it supports QAM annex A/C, but I can't figure out what that actually refers to. I made the changes that should be needed for your tuner to work, but I'd like to at least get the frequency table correct the first time.

webernissle commented 8 years ago

The main reason why I came across your solution is a pending issue on sagetv opensource with linux 64bit, EPG reading from the cable provider and native hdhomerun. Your approach is a bit different to the native driver, so I thought to have a closer look at it and to see if there is a difference with the EPG handling.

I could probably do the changes by myself, but I'm confused with the HIGH and LOW setting, this is not given, I just get 1 frequency.

I have two HDHR devices:

Martins-Mac-mini-2:~ mwn$ hdhomerun_config 1220A344 get /sys/hwmodel
HDHR3-EU
Martins-Mac-mini-2:~ mwn$ hdhomerun_config 1220A344 get /sys/model
hdhomerun3_dvbtc
Martins-Mac-mini-2:~ mwn$ hdhomerun_config 1220A344 get /sys/features
channelmap: eu-bcast eu-cable au-bcast au-cable tw-bcast tw-cable
modulation: t8qam64 t8qam16 t8qpsk t7qam64 t7qam16 t7qpsk t6qam64 t6qam16 t6qpsk a8qam256-* a8qam128-* a8qam64-* a7qam256-* a7qam128-* a7qam64-* a6qam256-* a6qam128-* a6qam64-*
auto-modulation: auto auto8t auto7t auto6t auto8c auto7c auto6c

Martins-Mac-mini-2:~ mwn$ hdhomerun_config 14104392 get /sys/hwmodel
HDHR3-4DC
Martins-Mac-mini-2:~ mwn$ hdhomerun_config 14104392 get /sys/model
hdhomerun3_dvbc
Martins-Mac-mini-2:~ mwn$ hdhomerun_config 14104392 get /sys/features
channelmap: eu-cable au-cable tw-cable
modulation: a8qam256-* a8qam128-* a8qam64-* a6qam256-* a6qam128-* a6qam64-*
auto-modulation: auto auto8c auto6c

Here's the output of the stream:

Martins-Mac-mini-2:~ mwn$ hdhomerun_config 14104392 get /tuner0/streaminfo
9012: 0 TF 1 HD
9013: 0 France 2 HD
9014: 0 M6 HD
9029: 0 SRF info HD
9509: 0 Gulli HD
tsid=0x00A9

Martins-Mac-mini-2:~ mwn$ hdhomerun_config 14104392 get /tuner1/streaminfo
680: 663 Hayat Plus (encrypted)
697: 697 697 Test (encrypted)
9041: 2 RTS Deux HD
9042: 350 RSI LA 1 HD
9043: 351 RSI LA 2 HD
tsid=0x0059
onid=0x0001

Martins-Mac-mini-2:~ mwn$ hdhomerun_config 14104392 get /tuner2/streaminfo
7001: 500 TC Cinema (encrypted)
7005: 501 TC Star (encrypted)
7010: 502 TC Prime (encrypted)
7015: 503 MGM (encrypted)
7017: 504 13th Street (encrypted)
7018: 505 Sky Atlantic (encrypted)
7020: 506 Fox (encrypted)
7025: 507 Krimi (encrypted)
7030: 508 Discovery (encrypted)
7031: 509 Romance TV (encrypted)
7032: 510 Animal Planet (encrypted)
7035: 511 Disney Cinemagi (encrypted)
7038: 513 Disney XD (encrypted)
7040: 514 TC Sport 1 (encrypted)
7045: 515 TC Sky Sport 2 (encrypted)
7050: 516 Sky Sport 1 (encrypted)
7055: 517 Sky Bundesliga (encrypted)
7098: 0 TC_SW_Kaon_HD (no data)
tsid=0x00DC
onid=0x0001

Martins-Mac-mini-2:~ mwn$ hdhomerun_config 14104392 get /tuner3/streaminfo
3005: 9 Vorschau On Dem
5040: 0 Horizon data (control)
5050: 0 (control)
tsid=0x008D
onid=0x0001

Martins-Mac-mini-2:~ mwn$ hdhomerun_config 1220A344 get /tuner0/streaminfo
9010: 4 3+ HD
9051: 92 SAT.1 HD (encrypted)
9052: 93 ProSieben HD (encrypted)
9053: 96 kabel eins HD (encrypted)
tsid=0x005B
onid=0x0001

Martins-Mac-mini-2:~ mwn$ hdhomerun_config 1220A344 get /tuner1/streaminfo
9: 14 RTL
10: 15 SAT.1
11: 16 ProSieben
13: 21 VOX
41: 46 Eurosport 1
63: 78 euronews
tsid=0x0046
onid=0x0001

I live in Switzerland and the provider is UPC. I accept if it is to much effort, I would agree to stop such changes as no else is request eu_cable support so far.

enternoescape commented 8 years ago

I think I am about to disappoint you. OpenDCT currently doesn't parse any EPG data.

The HIGH, LOW was something I did before I realized it wasn't relevant. I'll push what I have so you can take a look.

webernissle commented 8 years ago

Thanks, it's not about parsing. As it works on Windows with the standard dvb-c driver for HDHomeRun it must be something how the sagetv linux native libraries interact with sagetv java parts. My main interest was to compare with a similar implementation, that is where your drivers could provide that for me.

enternoescape commented 8 years ago

I see. I pushed the changes to master. I was looking at how SageTV does lookups for this standard and it looks like it mostly uses exactly the same frequencies as they use in the US.

I changed this file to just use the middle frequencies like I probably should have a while ago. Let me know if we need any changes. https://github.com/enternoescape/opendct/blob/master/src/main/java/opendct/channel/Frequencies.java

If you have the JDK installed, you should be able to build your own install packages fairly easily using gradle. git clone https://github.com/enternoescape/opendct.git cd opendct ./gradlew packageLinux32 packageLinux64

The install packages will be under ./build/distributions.

webernissle commented 8 years ago

I get issues with compiling. Do you have some references how to build or better what is the needed environment? I tried under ubuntu with java version "1.8.0_91" (basically the SageTV recommended environment) - but I get an error /home/mwn/working/opendct/src/main/java/opendct/util/Util.java:19: error: package com.sun.xml.internal.messaging.saaj.util does not exist import com.sun.xml.internal.messaging.saaj.util.Base64;

enternoescape commented 8 years ago

Don't bother doing this; I removed the annoying import. You will probably need the Oracle Java JDK to compile. All of the required binaries are pre-compiled, so the JDK should be the only major thing if you're compiling for Linux. Also right now I'm in a bit of transition to FFmpeg 3.0.2 and the compiling is inconsistent between Windows and Linux while JavaCPP works out what's wrong. Those issues however are unrelated to the error you're seeing. com.sun as far as I know is only going to be present in Oracle.

0.5.5 was compiled with the changes that you requested.

enternoescape commented 8 years ago

I removed the com.sun import. It's not actually needed anymore. I generally try to avoid those since OpenJDK doesn't have very many of them. If you grab the latest master, you should be in business.

./gradlew clean packageLinux32 packageLinux64
webernissle commented 8 years ago

OK it compiles now and it finds the the tuners as well in SageTV v9.0.4! I will do more testing later but in general it works with both of my HDHR devices in Europe/Switzerland.

enternoescape commented 8 years ago

Excellent! My intention is to not be the headache that some projects can be to compile.