HiassofT
Posts: 221
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: lirc_rpi.c won't compile under latest media_tree & 4.9.2

Thu Jul 06, 2017 9:49 am

FYI: A few days ago a patchset was posted on linux-media to add generic bit-banging and pwm-supported IR transmission:

http://www.mail-archive.com/linux-media ... 14958.html

so long,

Hias

HiassofT
Posts: 221
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: lirc_rpi.c won't compile under latest media_tree & 4.9.2

Fri Jul 21, 2017 8:47 pm

Today I built an IR transmitter and tested the gpio-ir-tx and pwm-ir-tx drivers mentioned above. Except for a minor issue (gpio polarity was wrong in gpio-ir-tx) they worked fine.

Recent versions of v4l-utils include "ir-ctl" which provides a really easy way to send IR signals. It can encode the common IR protocols (like RC-5) on it's own so you only need to specify protocol and scancode - eg ir-ctl -S rc5:0x101A

These drivers should hopefully be in 4.14, I'll PR the overlays (and maybe backports to 4.13) when they are merged.

so long,

Hias

langlulach
Posts: 8
Joined: Sat Jul 22, 2017 8:48 pm

Re: lirc_rpi.c won't compile under gcc 7.1.0 & kernel 4.9.28

Sat Jul 22, 2017 9:55 pm

justme123 wrote:@6by9

"media_build is the absolute latest and greatest V4L2 and DVB development tree. That is what will be going in to kernel 4.12.
RPi is currently using 4.9 as that is the current latest that has been blessed with Long Term Support (LTS) status so should be maintained for several (2 IIRC) years. 4.14 is due to be the next to get that status.
media_build is therefore ahead of the Pi tree, and whilst they fix up all drivers that are in the mainline kernel whenever they make an API change, they can't do that for these random "out-of-tree" drivers that people have written. "

Thank you for the good news! I'm pretty sure that if you (RPi Foundation) will let them know officially about the lirc_pi implementation and that RPi is widely used (over 10 million units sold), they'll incorporate lirc_pi in their tree. Well, at least it's worth trying, again, officially. I'm aware that I won't have any chance on my own, well, at least I'm' sure I'll be able to annoy them. ;)

As for me, I'm in a special unfortunate situation. I own a well performing (no need to change) Technisat Skystar USB 2 HD CI DVB Tuner that is unsupported but has a rejected patch that makes it work flawlessly. It's an old, at the time of purchase pretty expensive, DVB tuner that has two internal tuners, one for DVB-S and one for DVB-S2, and was presumably bought by Technisat form some Chinese manufacturer and re-branded. What Technisat did wrong was to mess up the internal firmware and that's why it needs a patch.

https://www.linuxtv.org/wiki/index.php/ ... SB_2_HD_CI
"To make DVB-S2 working, you have to compile the recent drivers from git://linuxtv.org/media_build.git with the following patch: https://patchwork.linuxtv.org/patch/22003/ - the patch has been rejected because of the bad quality, but is currently your only chance to make it working. (and is working fine, at least with my two tuners (Rev. 1 and 2))"

Regarding the kernel compilation, I'm doing it all the time on x86 systems under Slackware. Is just that for RPi it's a little bit over-complicated mainly due to the proprietary Broadcom blobs structure/availability and the ARM toolchain (I'm still not sure which one to use, as there are several ones). I was happy with the media_build recompilation until now - it took me 15-20 minutes to get the new kernel, kernel headers and media_build compiled.

I guess I'll stick with my actual working (tuner patched & lirc_pi working) 4.4.50-v7+ for the moment.


[ 5.202838] WARNING: You are using an experimental version of the media stack.
As the driver is backported to an older kernel, it doesn't offer
enough quality for its usage in production.
Use it with care.
Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
3622d3e77ecef090b5111e3c5423313f11711dfa [media] ov2640: print error if devm_*_optional*() fails
9eb9db3a0f92b75ec710066202e0b2accb45afa9 [media] atmel-isc: Fix the static checker warning
d72b196f96e2afad1656c9332da7ffe3b07e17cb [media] ov2640: add support for MEDIA_BUS_FMT_YVYU8_2X8 and MEDIA_BUS_FMT_VYUY8_2X8
[ 5.331116] lirc_dev: IR Remote Control driver registered, major 244
[ 5.646847] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[ 5.663313] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 83) (baudrate 100000)
[ 5.678806] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[ 5.717812] i2c /dev entries driver
[ 6.240042] media: Linux media interface: v0.10
[ 6.283005] WARNING: You are using an experimental version of the media stack.
As the driver is backported to an older kernel, it doesn't offer
enough quality for its usage in production.
Use it with care.
Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
3622d3e77ecef090b5111e3c5423313f11711dfa [media] ov2640: print error if devm_*_optional*() fails
9eb9db3a0f92b75ec710066202e0b2accb45afa9 [media] atmel-isc: Fix the static checker warning
d72b196f96e2afad1656c9332da7ffe3b07e17cb [media] ov2640: add support for MEDIA_BUS_FMT_YVYU8_2X8 and MEDIA_BUS_FMT_VYUY8_2X8
[ 6.438929] lirc_rpi: auto-detected active low receiver on GPIO pin 17
[ 6.455628] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0
[ 6.468636] lirc_rpi: driver registered!
[ 11.538744] dvb-usb: found a 'Technisat SkyStar USB 2 HD CI' in cold state, will try to load a firmware
[ 11.556055] dvb-usb: downloading firmware from file 'dvb-usb-az6027-03.fw'
[ 11.572171] random: nonblocking pool is initialized
[ 11.637646] dvb-usb: found a 'Technisat SkyStar USB 2 HD CI' in warm state.
[ 11.650537] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 11.855770] dvbdev: DVB: registering new adapter (Technisat SkyStar USB 2 HD CI)
[ 11.868638] usb 1-1.5: media controller created
[ 11.880890] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered.
[ 12.595075] stb0899_attach: Attaching STB0899
[ 12.605021] stb6100_attach: Attaching STB6100
[ 12.614852] dvbdev: dvb_create_media_entity: media entity 'dvb-ca-en50221' registered.
[ 12.629073] usb 1-1.5: DVB: registering adapter 0 frontend 0 (STB0899 Multistandard)...
[ 12.646118] dvbdev: dvb_create_media_entity: media entity 'STB0899 Multistandard' registered.
[ 12.666083] dvb-usb: Technisat SkyStar USB 2 HD CI successfully initialized and connected.
[ 12.680309] usbcore: registered new interface driver dvb_usb_az6027

Thanks again for all your help!
@justme123
Man please help me, i also have Skystar USB 2 HD CI, i installed it but only can watch the DVB-S channels, please can You teach me how to patch it with the rejected beta driver so that DVB-S2 can work?
I am a total newbie with this Raspberry pi thingy.

HiassofT
Posts: 221
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: lirc_rpi.c won't compile under latest media_tree & 4.9.2

Wed Sep 20, 2017 5:50 pm

HiassofT wrote:
Fri Jul 21, 2017 8:47 pm
Today I built an IR transmitter and tested the gpio-ir-tx and pwm-ir-tx drivers mentioned above. Except for a minor issue (gpio polarity was wrong in gpio-ir-tx) they worked fine.

Recent versions of v4l-utils include "ir-ctl" which provides a really easy way to send IR signals. It can encode the common IR protocols (like RC-5) on it's own so you only need to specify protocol and scancode - eg ir-ctl -S rc5:0x101A

These drivers should hopefully be in 4.14, I'll PR the overlays (and maybe backports to 4.13) when they are merged.
FYI: gpio-ir-tx and pwm-ir-tx have made it into kernel 4.14 and the overlays to use these have been included in the rpi-4.14.y tree.

See the PR for more details: https://github.com/raspberrypi/linux/pull/2204

so long,

Hias

Return to “Device Tree”