diff options
Diffstat (limited to 'abs/core-testing/tweaker/bin/twk_tuners.pl')
-rwxr-xr-x | abs/core-testing/tweaker/bin/twk_tuners.pl | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/abs/core-testing/tweaker/bin/twk_tuners.pl b/abs/core-testing/tweaker/bin/twk_tuners.pl index f928ea7..22c6a23 100755 --- a/abs/core-testing/tweaker/bin/twk_tuners.pl +++ b/abs/core-testing/tweaker/bin/twk_tuners.pl @@ -105,9 +105,11 @@ my @capture_card_patterns = ( # [ "bt878-based frame grabbers", [".*0400.*109e.*036e.*", ".*0480.*109e.*0878.*"], # ["V4L", ["NTSC"]]], - ); + # USB patterns -# USB patterns + [ "Dvico Dual Digital 4 rev2", [".* 0fe9:db98 .*"], + ["DVB", ["DVB-T"]]], + ); # "Hauppauge Nova-T 500 Dual DVB-T" @@ -148,8 +150,8 @@ sub implement_option { if (connect_to_db("DBI:mysql:$dbconnectionstring")) { my $logger = get_logger('tweaker.script'); - # Get a list of all PCI devices for later processing - my @lspci = split('\n', execute_shell_command("lspci -mn")); + # Get a list of all PCI and USB devices for later processing + my @device_list = split('\n', execute_shell_command("lspci -mn ; lsusb")); # Iterate through the list of known tuner cards, then the list of known network tuners. # For each known tuner, configure a safe default for it if it's found. Set up @@ -338,22 +340,22 @@ sub implement_option { # Configure each supported tuner/capture device detected on the system. - # built-in, PCI, or PCI Express - $logger->debug("Processing local devices..."); - for my $pci_device (@lspci) { - $logger->debug("DEVICE: $pci_device"); + # built-in, PCI, PCI Express, or USB + $logger->debug("Processing built-in, PCI, PCI Express or USB devices..."); + for my $a_device (@device_list) { + $logger->debug("DEVICE: $a_device"); my $match=0; - for my $pci_device_data (@capture_card_patterns) { - $logger->debug("\tIs there a @$pci_device_data[0] at this location?"); + for my $device_data (@capture_card_patterns) { + $logger->debug("\tIs there a @$device_data[0] at this location?"); - for my $patterns (@$pci_device_data[1]) { + for my $patterns (@$device_data[1]) { for my $pattern (@$patterns) { if ($match) { next; } else { $logger->debug("\t\tPATTERN: $pattern"); - $match += ($pci_device =~ m/$pattern/i); + $match += ($a_device =~ m/$pattern/i); if ($match) { $global_device_count++; # 1-indexed @@ -364,10 +366,10 @@ sub implement_option { # The sub_types are used to populate the videosource table. # The device type and "best" sub_type are used to set the 'sourceid' field of the cardinput table. - for my $typeblock (@$pci_device_data[2]) { - my $pci_device_type = @$typeblock[0]; - $logger->debug("\t\tDEVICE TYPE: $pci_device_type"); # e.g. "DVB", "MPEG", etc. - $cardtypes{$pci_device_type}++; + for my $typeblock (@$device_data[2]) { + my $device_type = @$typeblock[0]; + $logger->debug("\t\tDEVICE TYPE: $device_type"); # e.g. "DVB", "MPEG", etc. + $cardtypes{$device_type}++; my $sourceid = -1; for my $sub_types (@$typeblock[1]) { for my $sub_type (@$sub_types) { @@ -387,7 +389,7 @@ sub implement_option { # # POPULATE capturecard table # - my $defaultinput = make_capturecard_SQL($global_device_count, $cardtypes{$pci_device_type}-1, $pci_device_type, -1); + my $defaultinput = make_capturecard_SQL($global_device_count, $cardtypes{$device_type}-1, $device_type, -1); # # POPULATE cardinput table @@ -457,10 +459,6 @@ sub implement_option { close(SHELL2); } # else: don't scan the internet! - # USB devices - $logger->debug("Processing USB devices..."); - $logger->debug("\t(no USB devices supported yet)"); - # Filesystem Tweaks for tuners # This only works with the Nova-T-500 card, but it doesn't hurt any other cards execute_shell_command("echo \"#switch on onboard amplifier on Nova-T-500 card\" > /etc/modprobe.d/dvb-usb-dib0700"); |