|
SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
DVB-S2 Scanning and tuning
I've made some changes in this pull request to enable DVB-S scanning and DVB-S2 tuning on 64-bit Linux.
I would be grateful for any review, comments or help from anyone who is familiar with the DVBCapture library. I can only test this on the hardware I have (A Hauppauge NOVA-HD-S2 card, on which I have it working), but it would be better if it could be tested on more hardware. It's my aim to get the open-source SageTV working on 64-bit Linux to the same functionality as I had on 32-bit Windows XP with my DVB cards. So far it's the DVB-S(2) tuning and config which has been problematic. Many thanks, echoes |
#2
|
||||
|
||||
I will switch to Linux as soon as Satellite Channel Routing / Single Cable Distribution (SCR/CSS CENELEC EN50494) is available. I talked to DigitalDevices, then company building my DVB-S2 card, because on Windows SCR support is done by device driver. Unfortunately they told me on linux application software has to take care by itself.
|
#3
|
|||
|
|||
Quote:
Code:
int SageGetSatelliteTble( void* Capture, SAT_NAME *sat_name, int max_sat ) { //it's for DiSeqC, to be implemented soon. return 0; } |
#4
|
|||
|
|||
LNB config file
I noticed that the following file is written holding my LNB configuration:
Code:
Digital-Conexant-CX24116-CX24118-0000-06-05-2-0.lnb As a workaround I used a soft link. Anyone know what is the 'correct' file name? echoes |
#5
|
||||
|
||||
Quote:
However, that .lnb file looks like it was written by the Windows software because nothing in the Linux code will write out a .lnb file (but it's there in the Windows code). On Linux, it only reads the .cfg file instead. And I'm not sure if both of them store the same kind of information or not.
__________________
Jeffrey Kardatzke Founder of SageTV |
#6
|
|||
|
|||
I found that the STV XML file determines the lnb filename, and configures a regexp replace on troublesome characters (replacing them with '-').
The .lnb file name was definitely produced by SageTV on Linux. The .frq files use the 'adapterX-DVB-[C|T|S].frq pattern. There is some code to copy the lnb file to the 'adapterX-X.lnb (bear with me) pattern whenever an encoder is opened in sage.DVBCaptureDevice.startEncoding) Now the native c code is trying to open adapterX.cfg, so I've made a couple of changes (that you might see in a pull request soon): 1) Use the same regex replacement to find the .lnb file that the Java code wrote. 2) If found, copy the .lnb file to 'adapterX.cfg' and not 'adapterX-X.lnb' I'm unsure if the file formats of the .lnb and .cfg are exactly the same, but on my system this now works - the contents of the .cfg file are successfully used to determine the Intermediate Frequencies for the native DVB-S tune. So that's OK! Are the native .cfg files used for any other purposes other than supplying LNB info? Thanks for your help! Since code is worth a thousand words... Before: Code:
public void startEncoding(CaptureDeviceInput cdi, String encodeFile, String channel) throws EncodingException { if (Sage.DBG) System.out.println("startEncoding for DVB capture device file=" + encodeFile + " chan=" + channel); // Rename the .lnb file properly if its been set java.io.File lnbFile = new java.io.File(captureDeviceName + "-" + captureDeviceNum + ".lnb"); if (lnbFile.isFile()) { java.io.File targetFile = new java.io.File(new java.io.File(linuxVideoDevice).getName() + "-" + captureDeviceNum + ".lnb"); if (Sage.DBG) System.out.println("Copying LNB file to device specific name from " + lnbFile + " to " + targetFile); try { IOUtils.copyFile(lnbFile, targetFile); } catch (java.io.IOException ioe) { if (Sage.DBG) System.out.println("ERROR Failed copying LNB file for video device of:" + ioe); } } ... Code:
public void startEncoding(CaptureDeviceInput cdi, String encodeFile, String channel) throws EncodingException { if (Sage.DBG) System.out.println("startEncoding for DVB capture device file=" + encodeFile + " chan=" + channel); // Rename the .lnb file properly if its been set String lnbFilename = (captureDeviceName + "-" + captureDeviceNum).replaceAll("[^A-Za-z0-9_-]", "-") + ".lnb"; File lnbFile = new java.io.File(lnbFilename); if (lnbFile.isFile()) { //java.io.File targetFile = new java.io.File(new java.io.File(linuxVideoDevice).getName() + "-" + captureDeviceNum + ".lnb"); File targetFile = new File(new File(linuxVideoDevice).getName() + ".cfg"); if (Sage.DBG) System.out.println("Copying LNB file to device specific name from " + lnbFile + " to " + targetFile); try { IOUtils.copyFile(lnbFile, targetFile); } catch (java.io.IOException ioe) { if (Sage.DBG) System.out.println("ERROR Failed copying LNB file for video device of:" + ioe); } } Last edited by echoes; 04-13-2016 at 06:04 PM. Reason: Added code |
#7
|
||||
|
||||
Lol...yeah, I forgot to look at the Java and STV code...I forgot we did stuff to modify those files in there too.
I really don't know what we had in the .cfg or the .lnb files...that was written by Qian, not myself. I'll send him an email and ask him if he remembers.
__________________
Jeffrey Kardatzke Founder of SageTV |
#8
|
|||
|
|||
That's appreciated!
Yeah, that file name took some finding with some increasingly desperate grepping... |
#9
|
||||
|
||||
This was the answer I got, hopefully this helps:
a .cfg file is a configuration file that is given to a satellite LNB device to scan DVB-s channel by iterating directions and channel frequencies. a .lnb file has LNB data that are used to control LNB device to pick up a direction to lock up a frequency.
__________________
Jeffrey Kardatzke Founder of SageTV |
#10
|
|||
|
|||
That's good to know. Looks like it just needed consistent naming in the java, stv and native code. I'll submit a pull request soon.
Many thanks. |
#11
|
|||
|
|||
Update: I've tested this with another DVB-S2 tuner card: DVBSky S952 V3 with no problems.
I've had some trouble with a DVB-S channel scan on Linux64. I will be trying to get this working in the near future. I'm wondering if anyone else has been able to channel scan DVB-S(2) using Sage 9.x on Linux-64 successfully? A couple of scanning questions: 1) Does the channel scanner use the NIT table to generate tuning information? 2) Are these modulation value mappings correct and consistent: 30 = DVB-S2, QPSK 31 = DVB-S2, QPSK 32 = DVB-S2, 8PSK I can see some use of '30' being used for either 8PSK or QPSK, depending on where I look. e.g. line 485 of DVBPSIParser.c (UnpackNIT) assigns '30' for 8PSK/DVB-S2. |
#12
|
||||
|
||||
Sorry, don't know those answers....I'm sure you've already used grep to try to figure out more, that's what I'd be doing. If you really get stuck, let me know and I'll ping the dev that wrote that code to see if he recalls how it works...but I try not to bother him too much.
__________________
Jeffrey Kardatzke Founder of SageTV |
#13
|
|||
|
|||
No worries! I'll have a play with it and see what I can figure out.
Rich. |
#14
|
|||
|
|||
Been playing around with the DVB-S scan and discovered the following issues:
1) Could not get a scan to start unless the mmc/dvbs_region property was set (in my case to "Astra (28.2)"). I couldn't find anywhere where this property was set in code or STV. I think this property should be more properly picked up from the .lnb / .cfg file though. 2) The scan does use the NIT information to determine the subsequent tuning frequencies. 3) On first look, the DVB-S/S2 and modulation bits in the NIT descriptors are not being interpreted correctly. More investigation needed here. Just an update for now. Rich |
#15
|
||||
|
||||
It looks like we have code in the STV for setting the region for DVBT and DVBC...but apparently not for DVBS. I'm not sure why it was done that way....
__________________
Jeffrey Kardatzke Founder of SageTV |
#16
|
|||
|
|||
I'm guessing that the region may have multiple values in case of a diseqc setup. In which case the region, along with the rest of the LNB config would be in sections of the the lnb/cfg file for that adapter. It always worked for me on Windows with v7. Perhaps the Windows native code does things a bit differently. More things to check...
R |
#17
|
|||
|
|||
Some progress
Have got the DVBPSIParser to correctly read the modulation type and modulation system bits, as defined in the DVB BlueBook A038 Oct 2015 (a thoroughly riveting bedtime read) and map them to the integer values which Sage uses for tuning: DVB-S: 1 (16QAM), 20 (QPSK), 22 (8PSK) DVB-S2: 31 (QPSK), 32 (8PSK) The tuneDVBSFrequency function then maps these values to the required API constants. I've got this to do a full channel scan, and all the expected DVB-S and DVB-S2 entries in the NIT were scanned and tested - so now I have a complete, SageV9-produced DVBS frq file for the first time. I assume a DVB-S only card will just refuse to tune a DVB-S2 tuning entry - but that would seem natural. Next I'll investigate the DVB-S region setting and see how that should be read. But that's for another day. R Last edited by echoes; 05-23-2016 at 04:30 PM. |
#18
|
||||
|
||||
Great work!
__________________
Jeffrey Kardatzke Founder of SageTV |
#19
|
|||
|
|||
Just found this thread, thanks for the work on this - I've been trying to get my TBS 8921 working, see https://forums.sagetv.com/forums/showthread.php?t=64961
After setting mmc/dvbs_region to "Astra (28.2)" I could get sage to actually start a scan but it immediately crashes ./startsagecore: line 55: 114 Aborted java -Djava.awt.headless=$HEADLESS $JAVAMEM -XX:+UseAdaptiveSizePolicy -XX:MaxGCPauseMillis=25 -XX:GCTimeRatio=24 $(if [[ $EUID -eq 0 ]]; then echo '-XX:ThreadPriorityPolicy=1'; fi) $JAVAOPTS -cp Sage.jar:JARs/lucene-core-3.6.0.jar:/:$(echo JARs/*.jar | sed 's/ */:/g') sage.Sage 0 0 x "sagetv Sage.properties" 0>&- Cannot see any dump file or useful data in native.log or sagetv_0.txt to help me debug it any further.
__________________
2 X HD300, 2 X HD100 & KVM unRAID Host with SageTV Docker using TBS 6285 Quad DVB-T2 & TBS 6984 Quad DVB-S2 Tuners |
#20
|
|||
|
|||
Hi starfire,
This sounds familiar. I remember encountering something like this, and I did manage to fix it, but with the day job taking over, I didn't get round to committing the code. From memory, the scan terminated immediately, but didn't terminate the process, but details are hazy. I'll see if my fix will merge into the code as soon as I get a chance. Echoes |
Tags |
dvb-s, dvb-s2 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
hdhr3 tuning and sagetv tuning | granto | Hardware Support | 2 | 09-06-2011 09:06 AM |
6.5.3 and QAM scanning | SageGk | SageTV Beta Test Software | 3 | 12-13-2008 11:02 AM |
DVB-S Scanning problem | Bacon2002 | Hardware Support | 0 | 01-29-2008 03:09 PM |
4.1.8 / DVB-T and scanning | antplugger | SageTV Beta Test Software | 6 | 02-25-2006 10:18 PM |
Scanning/Scrolling | KeDruff | SageTV Beta Test Software | 1 | 02-07-2004 09:57 PM |