From ac9aac9bab0ee5e9a809222c7a34b4090df8e7e8 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sat, 20 Jan 2018 11:07:45 +0100 Subject: [PATCH 1/2] v4l-utils: bump to 1.14.1 all backport patches can be dropped, they are already in upstream Signed-off-by: Matthias Reichl --- packages/sysutils/v4l-utils/package.mk | 4 +- .../v4l-utils-01-relax-protocol-naming.patch | 79 -------- ...tils-02-irctl-fix-multiple-scancodes.patch | 176 ------------------ .../v4l-utils-03-irctl-fix-rc6-on-32bit.patch | 29 --- 4 files changed, 2 insertions(+), 286 deletions(-) delete mode 100644 packages/sysutils/v4l-utils/patches/v4l-utils-01-relax-protocol-naming.patch delete mode 100644 packages/sysutils/v4l-utils/patches/v4l-utils-02-irctl-fix-multiple-scancodes.patch delete mode 100644 packages/sysutils/v4l-utils/patches/v4l-utils-03-irctl-fix-rc6-on-32bit.patch diff --git a/packages/sysutils/v4l-utils/package.mk b/packages/sysutils/v4l-utils/package.mk index 7f4dbca6a9..a23b06851f 100644 --- a/packages/sysutils/v4l-utils/package.mk +++ b/packages/sysutils/v4l-utils/package.mk @@ -19,8 +19,8 @@ # with 1.0.0 repeat delay is broken. test on upgrade PKG_NAME="v4l-utils" -PKG_VERSION="1.12.3" -PKG_SHA256="5a47dd6f0e7dfe902d94605c01d385a4a4e87583ff5856d6f181900ea81cf46e" +PKG_VERSION="1.14.1" +PKG_SHA256="7974e5626447407d8a1ed531da0461c0fe00e599a696cb548a240d17d3519005" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://linuxtv.org/" diff --git a/packages/sysutils/v4l-utils/patches/v4l-utils-01-relax-protocol-naming.patch b/packages/sysutils/v4l-utils/patches/v4l-utils-01-relax-protocol-naming.patch deleted file mode 100644 index 4b1e87f6df..0000000000 --- a/packages/sysutils/v4l-utils/patches/v4l-utils-01-relax-protocol-naming.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 52a487063684299c20a27ba8b1028aeaaa08ddc6 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Sun, 12 Mar 2017 12:53:50 +0100 -Subject: [PATCH] ir-keytable: be more permissive on protocol name - -Allowed the protocol to be specified with or without underscores or -dashes. This also solves the problem of not being able to load -the streamzap keymap. - -./ir-keytable -w rc_keymaps/streamzap -Protocol RC5_SZ invalid - -Reported-by: Matthias Reichl -Signed-off-by: Sean Young -Signed-off-by: Matthias Reichl ---- - utils/keytable/keytable.c | 24 ++++++++++++++++++++---- - 1 file changed, 20 insertions(+), 4 deletions(-) - -diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c -index a6ecc9e..f61a1d5 100644 ---- a/utils/keytable/keytable.c -+++ b/utils/keytable/keytable.c -@@ -120,9 +120,7 @@ const struct protocol_map_entry protocol_map[] = { - { "other", NULL, SYSFS_OTHER }, - { "lirc", NULL, SYSFS_LIRC }, - { "rc-5", "/rc5_decoder", SYSFS_RC5 }, -- { "rc5", NULL, SYSFS_RC5 }, - { "rc-5x", NULL, SYSFS_INVALID }, -- { "rc5x", NULL, SYSFS_INVALID }, - { "rc-5-sz", NULL, SYSFS_RC5_SZ }, - { "jvc", "/jvc_decoder", SYSFS_JVC }, - { "sony", "/sony_decoder",SYSFS_SONY }, -@@ -134,7 +132,6 @@ const struct protocol_map_entry protocol_map[] = { - { "mce_kbd", NULL, SYSFS_MCE_KBD }, - { "mce-kbd", NULL, SYSFS_MCE_KBD }, - { "rc-6", "/rc6_decoder", SYSFS_RC6 }, -- { "rc6", NULL, SYSFS_RC6 }, - { "rc-6-0", NULL, SYSFS_INVALID }, - { "rc-6-6a-20", NULL, SYSFS_INVALID }, - { "rc-6-6a-24", NULL, SYSFS_INVALID }, -@@ -145,6 +142,25 @@ const struct protocol_map_entry protocol_map[] = { - { NULL, NULL, SYSFS_INVALID }, - }; - -+static bool str_like(const char *a, const char *b) -+{ -+ while (*a && *b) { -+ if (*a == '-' || *a == '_') { -+ a++; -+ continue; -+ } -+ if (*b == '-' || *b == '_') { -+ b++; -+ continue; -+ } -+ if (tolower(*a) != tolower(*b)) -+ return false; -+ a++; b++; -+ } -+ -+ return !*a && !*b; -+} -+ - static enum sysfs_protocols parse_sysfs_protocol(const char *name, bool all_allowed) - { - const struct protocol_map_entry *pme; -@@ -156,7 +172,7 @@ static enum sysfs_protocols parse_sysfs_protocol(const char *name, bool all_allo - return ~0; - - for (pme = protocol_map; pme->name; pme++) { -- if (!strcasecmp(name, pme->name)) -+ if (str_like(name, pme->name)) - return pme->sysfs_protocol; - } - --- -2.1.4 - diff --git a/packages/sysutils/v4l-utils/patches/v4l-utils-02-irctl-fix-multiple-scancodes.patch b/packages/sysutils/v4l-utils/patches/v4l-utils-02-irctl-fix-multiple-scancodes.patch deleted file mode 100644 index 39963a2d2b..0000000000 --- a/packages/sysutils/v4l-utils/patches/v4l-utils-02-irctl-fix-multiple-scancodes.patch +++ /dev/null @@ -1,176 +0,0 @@ -From c3d7ae58a87018b39f0cca9a49c4a7b553135b22 Mon Sep 17 00:00:00 2001 -From: Sean Young -Date: Wed, 29 Nov 2017 17:08:04 +0000 -Subject: [PATCH 1/2] ir-ctl: fix multiple scancodes in one file - -A file with contents: - -scancode sony12:0x100015 -space 25000 -scancode sony12:0x100015 - -Will produce bogus results. - -Reported-by: Matthias Reichl -Tested-by: Matthias Reichl -Signed-off-by: Sean Young ---- - utils/ir-ctl/ir-ctl.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c -index 544ad3415..8538ec5db 100644 ---- a/utils/ir-ctl/ir-ctl.c -+++ b/utils/ir-ctl/ir-ctl.c -@@ -230,8 +230,8 @@ static struct file *read_file(const char *fname) - char *scancodestr; - - if (!expect_pulse) { -- fprintf(stderr, _("error: %s:%d: space must precede scancode\n"), fname, lineno); -- return NULL; -+ f->buf[len++] = IR_DEFAULT_TIMEOUT; -+ expect_pulse = true; - } - - scancodestr = strchr(p, ':'); -@@ -268,7 +268,8 @@ static struct file *read_file(const char *fname) - else - f->carrier = carrier; - -- len += protocol_encode(proto, scancode, f->buf); -+ len += protocol_encode(proto, scancode, f->buf + len); -+ expect_pulse = false; - continue; - } - --- -2.11.0 - - -From 26eca33b62f988ecbc4df8134ebdef20f9f75c97 Mon Sep 17 00:00:00 2001 -From: Sean Young -Date: Wed, 29 Nov 2017 17:54:32 +0000 -Subject: [PATCH 2/2] ir-ctl: set the gap between scancodes or files - -Between sending multiple scancodes or pulse space files, there is -a gap of 125 milliseconds. Allow this to be set. - -Tested-by: Matthias Reichl -Signed-off-by: Sean Young ---- - utils/ir-ctl/ir-ctl.1.in | 6 +++++- - utils/ir-ctl/ir-ctl.c | 18 +++++++++++++----- - 2 files changed, 18 insertions(+), 6 deletions(-) - -diff --git a/utils/ir-ctl/ir-ctl.1.in b/utils/ir-ctl/ir-ctl.1.in -index 05550fb12..641b11152 100644 ---- a/utils/ir-ctl/ir-ctl.1.in -+++ b/utils/ir-ctl/ir-ctl.1.in -@@ -93,6 +93,10 @@ Comma separated list of emitters to use for sending. The first emitter is - number 1. Some devices only support enabling one emitter (the winbond-cir - driver). - .TP -+\fB\-g\fR, \fB\-\-gap\fR=\fIGAP\fR -+Set the gap between scancodes or the gap between files when multiple files -+are specified on the command line. The default is 125000 microseconds. -+.TP - \fB\-?\fR, \fB\-\-help\fR - Prints the help message - .TP -@@ -220,7 +224,7 @@ To send the pulse and space file \fBplay\fR on emitter 3: - .br - \fBir\-ctl \-e 3 \-\-send=play\fR - .PP --To send the rc-5 hauppuage '1' scancode: -+To send the rc-5 hauppauge '1' scancode: - .br - \fBir\-ctl \-S rc5:0x1e01 - .PP -diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c -index 8538ec5db..6fb05b1aa 100644 ---- a/utils/ir-ctl/ir-ctl.c -+++ b/utils/ir-ctl/ir-ctl.c -@@ -82,6 +82,7 @@ struct arguments { - int wideband; - unsigned carrier_low, carrier_high; - unsigned timeout; -+ unsigned gap; - int carrier_reports; - int timeout_reports; - unsigned carrier; -@@ -111,6 +112,7 @@ static const struct argp_option options[] = { - { "carrier", 'c', N_("CARRIER"), 0, N_("set send carrier") }, - { "duty-cycle", 'D', N_("DUTY"), 0, N_("set duty cycle") }, - { "emitters", 'e', N_("EMITTERS"), 0, N_("set send emitters") }, -+ { "gap", 'g', N_("GAP"), 0, N_("set gap between files or scancodes") }, - { } - }; - -@@ -130,6 +132,7 @@ static const char doc[] = N_( - " CARRIER - the carrier frequency to use for sending\n" - " DUTY - the duty cycle to use for sending\n" - " EMITTERS - comma separated list of emitters to use for sending, e.g. 1,2\n" -+ " GAP - gap between pulse and files or scancodes in microseconds\n" - " RANGE - set range of accepted carrier frequencies, e.g. 20000-40000\n" - " TIMEOUT - set length of space before recording stops in microseconds\n" - " SCANCODE - protocol:scancode, e.g. nec:0xa814\n\n" -@@ -185,7 +188,7 @@ static unsigned parse_emitters(char *p) - return emit; - } - --static struct file *read_file(const char *fname) -+static struct file *read_file(struct arguments *args, const char *fname) - { - bool expect_pulse = true; - int lineno = 0, lastspace = 0; -@@ -230,7 +233,7 @@ static struct file *read_file(const char *fname) - char *scancodestr; - - if (!expect_pulse) { -- f->buf[len++] = IR_DEFAULT_TIMEOUT; -+ f->buf[len++] = args->gap; - expect_pulse = true; - } - -@@ -486,6 +489,11 @@ static error_t parse_opt(int k, char *arg, struct argp_state *state) - if (arguments->emitters == 0) - argp_error(state, _("cannot parse emitters `%s'"), arg); - break; -+ case 'g': -+ arguments->gap = strtoint(arg, ""); -+ if (arguments->gap == 0) -+ argp_error(state, _("cannot parse gap `%s'"), arg); -+ break; - case 'D': - arguments->duty = strtoint(arg, "%"); - if (arguments->duty == 0 || arguments->duty >= 100) -@@ -494,7 +502,7 @@ static error_t parse_opt(int k, char *arg, struct argp_state *state) - case 's': - if (arguments->record || arguments->features) - argp_error(state, _("send can not be combined with record or features option")); -- s = read_file(arg); -+ s = read_file(arguments, arg); - if (s == NULL) - exit(EX_DATAERR); - -@@ -884,7 +892,7 @@ err: - - int main(int argc, char *argv[]) - { -- struct arguments args = {}; -+ struct arguments args = { .gap = IR_DEFAULT_TIMEOUT }; - - #ifdef ENABLE_NLS - setlocale (LC_ALL, ""); -@@ -912,7 +920,7 @@ int main(int argc, char *argv[]) - while (s) { - struct file *next = s->next; - if (s != args.send) -- usleep(IR_DEFAULT_TIMEOUT); -+ usleep(args.gap); - - rc = lirc_send(&args, fd, features, s); - if (rc) { --- -2.11.0 - diff --git a/packages/sysutils/v4l-utils/patches/v4l-utils-03-irctl-fix-rc6-on-32bit.patch b/packages/sysutils/v4l-utils/patches/v4l-utils-03-irctl-fix-rc6-on-32bit.patch deleted file mode 100644 index 31053e4d65..0000000000 --- a/packages/sysutils/v4l-utils/patches/v4l-utils-03-irctl-fix-rc6-on-32bit.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 9a20a75e132e26f6c49971f9818c6fad053875f2 Mon Sep 17 00:00:00 2001 -From: Sean Young -Date: Wed, 2 Aug 2017 11:47:23 -0400 -Subject: [PATCH] ir-ctl: "ir-ctl -S rc6_mce:0x800f0410" does not work on - 32-bit - -0x800f0410 does not fit in 32-bit signed long. - -Signed-off-by: Sean Young ---- - utils/ir-ctl/ir-ctl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c -index 3d66063af..562a05da3 100644 ---- a/utils/ir-ctl/ir-ctl.c -+++ b/utils/ir-ctl/ir-ctl.c -@@ -152,7 +152,7 @@ static int strtoint(const char *p, const char *unit) - static bool strtoscancode(const char *p, unsigned *ret) - { - char *end; -- long arg = strtol(p, &end, 0); -+ long long arg = strtoll(p, &end, 0); - if (end == NULL || end[0] != 0) - return false; - --- -2.11.0 - From 7b337bd25ae7b658b82673989fcbb7733849a567 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 23 Jan 2018 17:18:05 +0100 Subject: [PATCH 2/2] v4l-utils: add multi keymap for Amlogic devices This keymap supports the common remotes (MCE, Xbox 360 etc) plus the Odroid an Wetek Hub remote. It is used with the meson-ir driver unless one of the other supported keymaps was explicitly chosen in devicetree. By default meson-ir uses the rc-empty map, Odroid C2 DT sets it to rc-odroid and Wetek Hub DT sets it to rc-wetek-hub. As rc-maps.cfg doesn't contain a mapping for these the amlogic multi-map will be used. Signed-off-by: Matthias Reichl --- packages/sysutils/v4l-utils/package.mk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/sysutils/v4l-utils/package.mk b/packages/sysutils/v4l-utils/package.mk index a23b06851f..986d679fcb 100644 --- a/packages/sysutils/v4l-utils/package.mk +++ b/packages/sysutils/v4l-utils/package.mk @@ -97,6 +97,8 @@ post_makeinstall_target() { default_multi_maps="rc6_mce xbox_360 zotac_ad10 hp_mce xbox_one cubox_i" create_multi_keymap libreelec_multi "RC6 NEC" $default_multi_maps + create_multi_keymap libreelec_multi_amlogic "RC6 NEC" $default_multi_maps \ + odroid wetek_hub # use multi-keymap instead of default one sed -i '/^\*\s*rc-rc6-mce\s*rc6_mce/d' $INSTALL/etc/rc_maps.cfg @@ -105,10 +107,9 @@ post_makeinstall_target() { # Custom LibreELEC configuration starts here # # use combined multi-table on MCE receivers -# * rc-rc6-mce rc6_mce -* rc-rc6-mce libreelec_multi -# additional non-upstreamed keymaps -* rc-odroid odroid -* rc-wetek-hub wetek_hub +# * rc-rc6-mce rc6_mce +* rc-rc6-mce libreelec_multi +# multi-table for amlogic devices +meson-ir * libreelec_multi_amlogic EOF }