![]() |
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 |
Quote:
|
Quote:
Code:
int SageGetSatelliteTble( void* Capture, SAT_NAME *sat_name, int max_sat ) |
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 |
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. |
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 Code:
public void startEncoding(CaptureDeviceInput cdi, String encodeFile, String channel) throws EncodingException |
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. |
That's appreciated!
Yeah, that file name took some finding with some increasingly desperate grepping... |
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. |
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. |
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. |
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.
|
No worries! I'll have a play with it and see what I can figure out.
Rich. |
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 |
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....
|
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 |
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. :coffee: R |
Great work!
|
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. |
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 |
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 |
Much appreciated, thanks :)
|
All times are GMT -6. The time now is 12:09 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.