Meson-IR for the C2

Post Reply
Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Meson-IR for the C2

Unread post by Raybuntu » Mon Apr 11, 2016 7:25 pm

I'd like to use the internal ir with lirc. On the C1+ I could just use meson-ir.
I've backported meson-ir and it's building fine but the device tree entry is missing? What are the values for the registers and interrupts for the C2?

kind regards

joy
Posts: 726
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 0
Been thanked: 3 times
Contact:

Re: Meson-IR for the C2

Unread post by joy » Tue Apr 12, 2016 11:32 am

Hello Raybuntu,

Here is the patch for LIRC on C2.
( ATTACHMENT : odroid-c2_support_lirc.diff.zip )
You can find the interrupt number and register address in /arch/arm64/boot/dts/meson64_odroidc2.dts.

Code: Select all

From b86fd3e9f2519deafea967eebbe8bf0668e2c5c6 Mon Sep 17 00:00:00 2001
From: Joy Cho <joy.cho@hardkernel.com>
Date: Wed, 16 Mar 2016 18:33:20 +0900
Subject: [PATCH] ODROID-C2: Add meson IR driver and support lirc

Change-Id: Iffa52b31821b1f93aab860f4fa50b5becfd34e16
---

diff --git a/arch/arm64/boot/dts/amlogic/mesongxbb.dtsi b/arch/arm64/boot/dts/amlogic/mesongxbb.dtsi
index aa21680..7d04947 100644
--- a/arch/arm64/boot/dts/amlogic/mesongxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/mesongxbb.dtsi
@@ -692,15 +692,6 @@
 		};
 
 	};
-	meson-remote {
-		compatible = "amlogic, aml_remote";
-		dev_name = "meson-remote";
-		status = "ok";
-		remote_ao_offset = <0x580>; /* 0x400 + (0x20 + idx)<<2 -- old ; 0x400 + (0x60 +idx)<<2 --new   */
-		interrupts = <0 196 1>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&remote_pins>;
-	};
 
 	rng {
 		compatible = "amlogic,meson-rng";
diff --git a/arch/arm64/boot/dts/meson64_odroidc2.dts b/arch/arm64/boot/dts/meson64_odroidc2.dts
index 3c9313c..f0c5350 100644
--- a/arch/arm64/boot/dts/meson64_odroidc2.dts
+++ b/arch/arm64/boot/dts/meson64_odroidc2.dts
@@ -756,6 +756,17 @@
 			spi-max-frequency = <500000>;
 		};
 	};
+
+	meson-ir {
+                compatible = "amlogic, meson6-ir";
+                reg = <0x0 0xc8100580 0x0 0x20>;
+                interrupts = <0 196 1>;
+                pinctrl-names = "default";
+                pinctrl-0 = <&remote_pins>;
+                pulse-inverted;
+                status = "ok";
+        };
+
 };
 
 &i2c_a {
diff --git a/arch/arm64/configs/odroidc2_defconfig b/arch/arm64/configs/odroidc2_defconfig
index 4b895d2..98d2aac 100644
--- a/arch/arm64/configs/odroidc2_defconfig
+++ b/arch/arm64/configs/odroidc2_defconfig
@@ -1079,7 +1079,7 @@
 # CONFIG_AML_HDMI_TX_14 is not set
 # CONFIG_AML_RTC is not set
 CONFIG_AML_VRTC=y
-# CONFIG_AM_IRBLASTER is not set
+CONFIG_AM_IRBLASTER=y
 # CONFIG_AML_DEBUG is not set
 CONFIG_AML_REG_ACCESS=y
 
@@ -2643,15 +2643,16 @@
 CONFIG_RC_CORE=y
 CONFIG_RC_MAP=y
 CONFIG_RC_DECODERS=y
-# CONFIG_LIRC is not set
-CONFIG_IR_NEC_DECODER=y
-CONFIG_IR_RC5_DECODER=y
-CONFIG_IR_RC6_DECODER=y
-CONFIG_IR_JVC_DECODER=y
-CONFIG_IR_SONY_DECODER=y
-CONFIG_IR_RC5_SZ_DECODER=y
-CONFIG_IR_SANYO_DECODER=y
-CONFIG_IR_MCE_KBD_DECODER=y
+CONFIG_LIRC=m
+CONFIG_IR_LIRC_CODEC=m
+CONFIG_IR_NEC_DECODER=m
+CONFIG_IR_RC5_DECODER=m
+CONFIG_IR_RC6_DECODER=m
+CONFIG_IR_JVC_DECODER=m
+CONFIG_IR_SONY_DECODER=m
+CONFIG_IR_RC5_SZ_DECODER=m
+CONFIG_IR_SANYO_DECODER=m
+CONFIG_IR_MCE_KBD_DECODER=m
 CONFIG_RC_DEVICES=y
 CONFIG_RC_ATI_REMOTE=m
 CONFIG_IR_IMON=m
@@ -2663,6 +2664,7 @@
 CONFIG_RC_LOOPBACK=m
 CONFIG_IR_GPIO_CIR=m
 CONFIG_MEDIA_USB_SUPPORT=y
+CONFIG_IR_MESON=m
 
 #
 # Webcam devices
@@ -3783,6 +3785,7 @@
 CONFIG_USB_MSI3101=m
 # CONFIG_VIDEO_TCM825X is not set
 # CONFIG_USB_SN9C102 is not set
+# CONFIG_LIRC_STAGING is not set
 
 #
 # Android
diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
index 904f113..4a99501 100644
--- a/drivers/media/rc/Kconfig
+++ b/drivers/media/rc/Kconfig
@@ -206,6 +206,16 @@
 	   To compile this driver as a module, choose M here: the
 	   module will be called fintek-cir.
 
+config IR_MESON
+	tristate "Amlogic Meson IR remote receiver"
+	depends on RC_CORE
+	---help---
+	   Say Y if you want to use the IR remote receiver available
+	   on Amlogic Meson SoCs.
+
+	   To compile this driver as a module, choose M here: the
+	   module will be called meson-ir.
+
 config IR_NUVOTON
 	tristate "Nuvoton w836x7hg Consumer Infrared Transceiver"
 	depends on PNP
diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
index f4eb32c..b6aaa95 100644
--- a/drivers/media/rc/Makefile
+++ b/drivers/media/rc/Makefile
@@ -20,6 +20,7 @@
 obj-$(CONFIG_IR_ITE_CIR) += ite-cir.o
 obj-$(CONFIG_IR_MCEUSB) += mceusb.o
 obj-$(CONFIG_IR_FINTEK) += fintek-cir.o
+obj-$(CONFIG_IR_MESON) += meson-ir.o
 obj-$(CONFIG_IR_NUVOTON) += nuvoton-cir.o
 obj-$(CONFIG_IR_ENE) += ene_ir.o
 obj-$(CONFIG_IR_REDRAT3) += redrat3.o
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index ed2c8a1..98893a8 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -42,11 +42,17 @@
 		return -EINVAL;
 
 	/* Packet start */
-	if (ev.reset)
-		return 0;
+	if (ev.reset) {
+		/* Userspace expects a long space event before the start of
+		 * the signal to use as a sync.  This may be done with repeat
+		 * packets and normal samples.  But if a reset has been sent
+		 * then we assume that a long time has passed, so we send a
+		 * space with the maximum time value. */
+		sample = LIRC_SPACE(LIRC_VALUE_MASK);
+		IR_dprintk(2, "delivering reset sync space to lirc_dev\n");
 
 	/* Carrier reports */
-	if (ev.carrier_report) {
+	} else if (ev.carrier_report) {
 		sample = LIRC_FREQUENCY(ev.carrier);
 		IR_dprintk(2, "carrier report (freq: %d)\n", sample);
 
diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
new file mode 100644
index 0000000..67cf585
--- /dev/null
+++ b/drivers/media/rc/meson-ir.c
@@ -0,0 +1,244 @@
+/*
+ * Driver for Amlogic Meson IR remote receiver
+ *
+ * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/spinlock.h>
+
+#include <media/rc-core.h>
+
+#include <linux/amlogic/iomap.h>
+
+#define DRIVER_NAME		"meson-ir"
+
+#define IR_DEC_LDR_ACTIVE	0x00
+#define IR_DEC_LDR_IDLE		0x04
+#define IR_DEC_LDR_REPEAT	0x08
+#define IR_DEC_BIT_0		0x0c
+#define IR_DEC_REG0		0x10
+#define IR_DEC_FRAME		0x14
+#define IR_DEC_STATUS		0x18
+#define IR_DEC_REG1		0x1c
+
+#define REG0_RATE_MASK		(BIT(11) - 1)
+
+#define REG1_MODE_MASK		(BIT(7) | BIT(8))
+#define REG1_MODE_NEC		(0 << 7)
+#define REG1_MODE_GENERAL	(2 << 7)
+
+#define REG1_TIME_IV_SHIFT	16
+#define REG1_TIME_IV_MASK	((BIT(13) - 1) << REG1_TIME_IV_SHIFT)
+
+#define REG1_IRQSEL_MASK	(BIT(2) | BIT(3))
+#define REG1_IRQSEL_NEC_MODE	(0 << 2)
+#define REG1_IRQSEL_RISE_FALL	(1 << 2)
+#define REG1_IRQSEL_FALL	(2 << 2)
+#define REG1_IRQSEL_RISE	(3 << 2)
+
+#define REG1_POL                BIT(1)
+
+#define REG1_RESET		BIT(0)
+#define REG1_ENABLE		BIT(15)
+
+#define STATUS_IR_DEC_IN	BIT(8)
+
+#define MESON_TRATE		10	/* us */
+
+#define AO_RTI_PIN_MUX_REG (0x14)
+
+struct meson_ir {
+	void __iomem	*reg;
+	struct rc_dev	*rc;
+	int		irq;
+	spinlock_t	lock;
+};
+
+static void meson_ir_set_mask(struct meson_ir *ir, unsigned int reg,
+			      u32 mask, u32 value)
+{
+	u32 data;
+
+	data = readl(ir->reg + reg);
+	data &= ~mask;
+	data |= (value & mask);
+	writel(data, ir->reg + reg);
+}
+
+static irqreturn_t meson_ir_irq(int irqno, void *dev_id)
+{
+	struct meson_ir *ir = dev_id;
+#if !defined(CONFIG_ARCH_MESON64_ODROIDC2)
+	u32 duration;
+	DEFINE_IR_RAW_EVENT(rawir);
+#endif
+	spin_lock(&ir->lock);
+
+#if defined(CONFIG_ARCH_MESON64_ODROIDC2)
+	ir_raw_event_store_edge(ir->rc,
+		(readl(ir->reg + IR_DEC_STATUS) & STATUS_IR_DEC_IN)
+		? IR_PULSE : IR_SPACE);
+	ir_raw_event_handle(ir->rc);
+#else
+	duration = readl(ir->reg + IR_DEC_REG1);
+	duration = (duration & REG1_TIME_IV_MASK) >> REG1_TIME_IV_SHIFT;
+	rawir.duration = US_TO_NS(duration * MESON_TRATE);
+
+	rawir.pulse = !!(readl(ir->reg + IR_DEC_STATUS) & STATUS_IR_DEC_IN);
+
+	ir_raw_event_store_with_filter(ir->rc, &rawir);
+	ir_raw_event_handle(ir->rc);
+#endif
+
+	spin_unlock(&ir->lock);
+
+	return IRQ_HANDLED;
+}
+
+static int meson_ir_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct device_node *node = dev->of_node;
+	struct resource *res;
+	const char *map_name;
+	struct meson_ir *ir;
+	bool pulse_inverted = false;
+	int ret;
+	unsigned int reg_val;
+
+	ir = devm_kzalloc(dev, sizeof(struct meson_ir), GFP_KERNEL);
+	if (!ir)
+		return -ENOMEM;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	ir->reg = devm_ioremap_resource(dev, res);
+	if (IS_ERR(ir->reg)) {
+		dev_err(dev, "failed to map registers\n");
+		return PTR_ERR(ir->reg);
+	}
+
+	ir->irq = platform_get_irq(pdev, 0);
+	if (ir->irq < 0) {
+		dev_err(dev, "no irq resource\n");
+		return ir->irq;
+	}
+
+	ir->rc = rc_allocate_device();
+	if (!ir->rc) {
+		dev_err(dev, "failed to allocate rc device\n");
+		return -ENOMEM;
+	}
+
+	ir->rc->priv = ir;
+	ir->rc->input_name = DRIVER_NAME;
+	ir->rc->input_phys = DRIVER_NAME "/input0";
+	ir->rc->input_id.bustype = BUS_HOST;
+	map_name = of_get_property(node, "linux,rc-map-name", NULL);
+	ir->rc->map_name = map_name ? map_name : RC_MAP_EMPTY;
+	ir->rc->dev.parent = dev;
+	ir->rc->driver_type = RC_DRIVER_IR_RAW;
+	ir->rc->allowed_protos = RC_BIT_ALL;
+	ir->rc->rx_resolution = US_TO_NS(MESON_TRATE);
+	ir->rc->timeout = MS_TO_NS(200);
+	ir->rc->driver_name = DRIVER_NAME;
+	pulse_inverted = of_property_read_bool(node, "pulse-inverted");
+
+	spin_lock_init(&ir->lock);
+	platform_set_drvdata(pdev, ir);
+
+	ret = rc_register_device(ir->rc);
+	if (ret) {
+		dev_err(dev, "failed to register rc device\n");
+		goto out_free;
+	}
+
+	ret = devm_request_irq(dev, ir->irq, meson_ir_irq, 0, "ir-meson", ir);
+	if (ret) {
+		dev_err(dev, "failed to request irq\n");
+		goto out_unreg;
+	}
+
+	/* Set remote_input alternative function - GPIOAO.BIT7 */
+	reg_val = aml_read_aobus(AO_RTI_PIN_MUX_REG);
+	reg_val |= 0x1;
+	aml_write_aobus(AO_RTI_PIN_MUX_REG, reg_val);
+
+	reg_val = aml_read_aobus(AO_RTI_PIN_MUX_REG);
+	dev_info(dev, "AO_RTI_PIN_MUX : 0x%x\n", reg_val);
+
+	/* Reset the decoder */
+	meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, REG1_RESET);
+	meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, 0);
+	/* Set general operation mode */
+	meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK, REG1_MODE_GENERAL);
+	/* Set rate */
+	meson_ir_set_mask(ir, IR_DEC_REG0, REG0_RATE_MASK, MESON_TRATE - 1);
+	/* IRQ on rising and falling edges */
+	meson_ir_set_mask(ir, IR_DEC_REG1, REG1_IRQSEL_MASK,
+			REG1_IRQSEL_RISE_FALL);
+	/* Set polarity Invert input polarity */
+	meson_ir_set_mask(ir, IR_DEC_REG1, REG1_POL,
+			pulse_inverted ? REG1_POL : 0);
+	/* Enable the decoder */
+	meson_ir_set_mask(ir, IR_DEC_REG1, REG1_ENABLE, REG1_ENABLE);
+
+	dev_info(dev, "receiver initialized\n");
+
+	return 0;
+out_unreg:
+	rc_unregister_device(ir->rc);
+	ir->rc = NULL;
+out_free:
+	rc_free_device(ir->rc);
+
+	return ret;
+}
+
+static int meson_ir_remove(struct platform_device *pdev)
+{
+	struct meson_ir *ir = platform_get_drvdata(pdev);
+	unsigned long flags;
+
+	/* Disable the decoder */
+	spin_lock_irqsave(&ir->lock, flags);
+	meson_ir_set_mask(ir, IR_DEC_REG1, REG1_ENABLE, 0);
+	spin_unlock_irqrestore(&ir->lock, flags);
+
+	rc_unregister_device(ir->rc);
+
+	return 0;
+}
+
+static const struct of_device_id meson_ir_match[] = {
+	{ .compatible = "amlogic, meson6-ir" },
+	{ },
+};
+
+static struct platform_driver meson_ir_driver = {
+	.probe		= meson_ir_probe,
+	.remove		= meson_ir_remove,
+	.driver = {
+		.name		= DRIVER_NAME,
+		.of_match_table	= meson_ir_match,
+	},
+};
+
+module_platform_driver(meson_ir_driver);
+
+MODULE_DESCRIPTION("Amlogic Meson IR remote receiver driver");
+MODULE_AUTHOR("Beniamino Galvani <b.galvani@gmail.com>");
+MODULE_LICENSE("GPL v2");

We've confirmed the normal LIRC operation for IR custom using irrecord and irw.
But it's more sensitive for light noise like fluorescent lamp than ODROID-C1.
So when you test it, please cover top of the IR receiver with case cover or something.
I think it's not a hw issue but noise filter or configuration issue, so we are under checking it.
If there is update, I will share it here and release it.

And you can refer to the following lircd.conf file.
'gap', 'min_repeat', 'suppress_repeat' options affect it.
I removed 'gap' and added 'min_repeat' and 'suppress_repeat' parameters.

Code: Select all

begin remote

  name  lircd.conf
  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       8964  4507
  one           544  1692
  zero          544   561
  ptrail        544
  pre_data_bits   16
  pre_data       0x4DB2
  min_repeat   1
  suppress_repeat 5
  toggle_bit_mask 0x0

      begin codes
          KEY_LEFT                 0x9966
          KEY_RIGHT                0x837C
          KEY_UP                   0x53AC
          KEY_DOWN                 0x4BB4
          KEY_ENTER                0x738C
          KEY_HOME                 0x41BE
          KEY_MUTE                 0x11EE
          KEY_MENU                 0xA35C
          KEY_BACK                 0x59A6
          KEY_VOLUMEDOWN           0x817E
          KEY_VOLUMEUP             0x01FE
          KEY_POWER                0x3BC4

      end codes
end remote
Attachments
odroid-c2_support_lirc.diff.zip
(4.28 KiB) Downloaded 112 times

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Tue Apr 12, 2016 6:05 pm

Nice! Thanks. Can we get your patch merged upstream with the main HK git?

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: Meson-IR for the C2

Unread post by odroid » Tue Apr 12, 2016 6:13 pm

After couple of weeks of test, we will merge it.
So your test will be really helpful to shorten the test period.

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Tue Apr 12, 2016 6:32 pm

I'll give it a try and report back.

User avatar
TeHashX
Posts: 171
Joined: Wed Aug 13, 2014 4:14 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by TeHashX » Wed Apr 13, 2016 11:13 pm

So, we need to recompile hk kernel and apply the patch?
I have original HK remote control and want to test with Kodi on Ubuntu 16.04

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: Meson-IR for the C2

Unread post by odroid » Thu Apr 14, 2016 10:43 am

Yes, you need to compile the kernel with the patch.

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Fri Apr 15, 2016 1:52 am

I've finally been able to test it and it works great!! Thanks @joy. I've used my the lirc config for mceusb from debian. And I didn't see any problems with light sensitivity of the sensor. I have the official black case with my C2 so maybe that's the reason it's not irritating. If I see an issue I'll post it here.
Do you have a git branch with your patch so I can pull changes you make? I've pushed a branch to my github.

joy
Posts: 726
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 0
Been thanked: 3 times
Contact:

Re: Meson-IR for the C2

Unread post by joy » Fri Apr 15, 2016 10:48 am

Hello Raybuntu,
Thank you for sharing your test result. Good news~
It helped for us. :D
About release on HK github, we need to check and test more in case there is any issue about remote control functionality with changing to LIRC.
I don't want our users suffer from inconveniences with it. ;)
After some test, we will push this patch on HK git branch and release image.
I will share the status here for you.
And if you have any issue, please let us know.

Thanks~

User avatar
wrxtasy
Posts: 1292
Joined: Wed May 13, 2015 1:59 pm
languages_spoken: english
ODROIDs: C1, C1+, C2
Location: Australia
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by wrxtasy » Fri Apr 15, 2016 10:59 am

Working well when testing with LibreELEC and LIRC, thx guys :)
LibreELEC Krypton C1(+) HERE
LibreELEC Krypton C2 HERE

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Fri Apr 15, 2016 2:54 pm

joy wrote:Hello Raybuntu,
Thank you for sharing your test result. Good news~
It helped for us. :D
About release on HK github, we need to check and test more in case there is any issue about remote control functionality with changing to LIRC.
I don't want our users suffer from inconveniences with it. ;)
After some test, we will push this patch on HK git branch and release image.
I will share the status here for you.
And if you have any issue, please let us know.

Thanks~
Thanks joy. I think you misunderstood me. I didn't want you to push it to the main HK git. I was just wondering if there was a test branch of this patch somewhere.

User avatar
wrxtasy
Posts: 1292
Joined: Wed May 13, 2015 1:59 pm
languages_spoken: english
ODROIDs: C1, C1+, C2
Location: Australia
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by wrxtasy » Fri Apr 15, 2016 3:12 pm

I've got a version of LibreELEC that will be up shortly with it all working, I even have a Mini guide to create your own lircd.conf with LE if needed here:
http://forum.kodi.tv/showthread.php?tid ... pid2291663

Joy's HK lircd.conf is packaged for operation with the HK remote control, no need to do anything. :)

BTW gdach's and your massaged libCEC and HDMI CEC work is in there as well and working nicely. Thx for that RB. :D
LibreELEC Krypton C1(+) HERE
LibreELEC Krypton C2 HERE

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Sat Apr 16, 2016 3:01 am

wrxtasy wrote:I've got a version of LibreELEC that will be up shortly with it all working, I even have a Mini guide to create your own lircd.conf with LE if needed here:
http://forum.kodi.tv/showthread.php?tid ... pid2291663

Joy's HK lircd.conf is packaged for operation with the HK remote control, no need to do anything. :)

BTW gdach's and your massaged libCEC and HDMI CEC work is in there as well and working nicely. Thx for that RB. :D
Thanks for your feedback wrxtasy. Yeah gdachs included me in the PR for libreELEC. Let me know if you have any issues with the kernel patch.

morpheouss
Posts: 40
Joined: Thu Mar 31, 2016 4:39 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by morpheouss » Sun Apr 17, 2016 6:50 pm

Can this be used with external IR receiver like TSOP4838 connected to GPIO?
If not, then maybe lirc_rpi can be adjusted to work with C2 like it was done with other Odroid boards?

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Sun Apr 17, 2016 8:44 pm

The patch includes lirc_dev module in the defconfig so you might be able to build an own lirc module to work with gpio. You can try porting lirc_rpi.

morpheouss
Posts: 40
Joined: Thu Mar 31, 2016 4:39 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by morpheouss » Sun Apr 17, 2016 10:29 pm

I dont have such skills :(
I found lirc_rpi and lirc_odroid. Second one is ported from rpi to some odroid, but both contains hardware-specific code (RPi or Exynos).
I also found lirc_gpioblaster but it only features transmitting, while I am interested in receiving.

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Sun Apr 17, 2016 11:01 pm

Yes you do hav the skills :). Don't give up. If you already found a lirc_odroid you can probably just edit it to use the right gpio pin's according to the spec.
Why do you want a TSOP4838 connected to gpio anyway? There already is a good ir sensor on the board which you can use with this patch.

morpheouss
Posts: 40
Joined: Thu Mar 31, 2016 4:39 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by morpheouss » Mon Apr 18, 2016 12:36 am

The problem is that lirc_odroid even does not build for me, it includes some non-existen file, specific to Samsung Exynos.
I would like to use TSOP4838, because I could connect it with cables and mount in front of case. The built-in one is located on the right side of board, when you close the C2 in some case it is not working, and I would like to avoid soldering.

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Mon Apr 18, 2016 2:00 am

morpheouss wrote:The problem is that lirc_odroid even does not build for me, it includes some non-existen file, specific to Samsung Exynos.
I would like to use TSOP4838, because I could connect it with cables and mount in front of case. The built-in one is located on the right side of board, when you close the C2 in some case it is not working, and I would like to avoid soldering.
I see. I'm using mine in the original black case and it's working for me.

morpheouss
Posts: 40
Joined: Thu Mar 31, 2016 4:39 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by morpheouss » Tue Apr 19, 2016 4:39 am

Any chance to get lirc_odroid ported to C2?

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Tue Apr 19, 2016 8:04 pm

You can try locating the initial developer and convice him to port it. I don't have such device so I can't help you with that.

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: Meson-IR for the C2

Unread post by odroid » Wed Apr 20, 2016 10:01 am

Joy will merge the new driver into our Github within a few days.
I believe we can release a kernel update early next week with a lirc example.

Raybuntu
Posts: 1337
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: Meson-IR for the C2

Unread post by Raybuntu » Thu Apr 21, 2016 5:09 am

Thank you.

hyphop
Posts: 68
Joined: Tue Dec 01, 2015 4:22 pm
languages_spoken: english
ODROIDs: ODROID-C1+ & C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by hyphop » Sat Apr 23, 2016 1:23 pm

everybody still wait! please notify as when is ready )

Thun
Posts: 12
Joined: Fri Apr 15, 2016 5:57 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by Thun » Sat Apr 23, 2016 5:10 pm

From github, commited 3 days ago:

Code: Select all

Merge "ODROID-C2: dts: Add meson-ir device" into odroidc2-3.14.y
So I guess it was added
Edit: It works properly now
Last edited by Thun on Sun Apr 24, 2016 4:11 am, edited 2 times in total.

morpheouss
Posts: 40
Joined: Thu Mar 31, 2016 4:39 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by morpheouss » Sat Apr 23, 2016 7:09 pm

What about plugging external IR to the GPIO?
Can anyone help?

User avatar
TeHashX
Posts: 171
Joined: Wed Aug 13, 2014 4:14 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Meson-IR for the C2

Unread post by TeHashX » Wed Apr 27, 2016 1:44 am

What should I choose from the list when I install lirc for original HK remote?
none
custom
Actisys
...

joy
Posts: 726
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 0
Been thanked: 3 times
Contact:

Re: Meson-IR for the C2

Unread post by joy » Wed Apr 27, 2016 10:15 am

TeHashX wrote:What should I choose from the list when I install lirc for original HK remote?
none
custom
Actisys
...
Hi TeHashX,
Select 'none'.

And please refer to the following page. :)
http://odroid.com/dokuwiki/doku.php?id=en:c2_lirc

In the wiki page, you can find the 'hardware.conf' and 'lircd.conf' for HK remote controller.

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 2 guests