Page 1 of 1

Science behind IR (Using Android instead of JP1)

Posted: Fri Nov 15, 2013 1:27 pm
by blipton
With the crop of smartphones that are coming out with IR blasters, I'm curious if any of the great work done on JP1 (software / codes) can be applied. There's also IR transmitters that plug into the audio jack (i.e. looq system).

For example, I understand EFCs are UEI brand/hardware dependent, but the OBC that KM/RM generates, is the actual raw data bytes that get shifted out via IR, no?

If so, the OBC doesn't contain any information about the protocol itself (Sony20bit, device, subdevice,etc). That information that describes how to transmit the data (frequency, etc) would need to be setup ahead of time by the device containing the IR transmitter (JP1 Remote or smartphone in general).

So, is the implementation of these device protocols ultimately what makes this a difficult task for non-JP1 remotes? For example, even for a common carrier frequency of 38khz, you can't just transmit that via the audio jack (2-20khz) that has an ir led connected to it...

Would love to hear any thoughts on how this works, and how much of a leap is to go from JP1/OBC to a DIY IR transmitter.

Posted: Fri Nov 15, 2013 2:37 pm
by Barf
Welcome blipton! :D

Love to hear the word "science"...

JP1 in the sense of RM/KM/RDSs will not buy you much outside of the UEI word. But there is more to it. There is a lot of both theory (protocols classified, IRP-notation, etc) and software (DecodeIR, IrScope, MakeHex, IrpMaster, IrMaster, IrScrutinizer) to be used.

The "actual raw data bytes" you get from a protocol, together with values of its parameters (device, OBC, sometimes others) rendered by a rendering engine, like MakeHex (old), IrpMaster (new), or the executor in an UEI remote. There are two ways of doing this: either compute the data (a set of durations together with a modulation frequency) offline, on a PC of some sort, or you compute them "just in time" on the device, like in an UEI remote. You can also achieve the latter for e.g. a future Android application, by embedding a renderer like IrpMaster in an application.
For example, even for a common carrier frequency of 38khz, you can't just transmit that via the audio jack (2-20khz) that has an ir led connected to it
Yes you can. This is described at many places in the internet, and in this forum. Basically, by double rectifying a sine, you arrive at a signal with the double frequency. Doubly rectifying a signal from e.g. an audio plug can be achieved by connecting two IR LEDs in antiparallel.

Please check out the interactive program IrScrutinizer and the portable Java library IrpMaster

Personally, I was so disappointed when I found out that the published API for the Sony Tablet S only allows for transmitting the codes Sony already knows... :(

Posted: Fri Nov 15, 2013 8:42 pm
by blipton
Thanks, you're right, it's possible to generate 38khz, but I'm not sure that technique would work on those devices requiring much higher frequencies 56, 60, 455khz,etc
http://web.archive.org/web/201011010828 ... .php/about

So the command-line IRPMaster is used to render the IRPNotation (which describes the IR pattern completely) to something that is ready to run on hardware... but I assume it must be generating a file that's very device / hardware specific, no?

Otherwise, for example, the output of the renderer is still just bytes... but in order to ultimately play the IR sequence on hardware, it has to be formatted to the way a particular device expects.. ex. LIRC Config File format for the IR Toy, IR Widget Decoder (Tommy Tyler), JP1's Device Upgrade, etc...

BTW, I couldn't find any reference for IrScrutizer (successor to the meta-gui IRMaster) over at harctoolbox.. did I just miss it?

I recently contributed to the Blumoo project (Indigogo), but honestly, this is much more the type of project I'd like to support... the amount of quality open-source work never ceases to amaze me! BTW, it seems that IrScrutizer/IRPMaster are the next-gen tools after KM/RM.. is there a reason one would need to switch back and forth between toolsets? (ex. to use existing DV/RM files in IRMaster)?

Regarding Android porting, I believe developing for Android is done in Java.. what challenges would you see for someone wanting to port IRPMaster)?

Posted: Sat Nov 16, 2013 1:27 am
by Barf
blipton wrote:Thanks, you're right, it's possible to generate 38khz, but I'm not sure that technique would work on those devices requiring much higher frequencies 56, 60, 455khz,etc
Yes. I have never been a fan of misusing the audio port, although my software can generate wave files for it. I think it would be a much better idea to try to "free" the IR-Port found on Sonys, Samsungs, etc. That would mean "JP1 for Android hardware"! Another route (cf. OpenRemote, iRule,...) would be to access networked hardware like GlobalCache.

So the command-line IRPMaster is used to render the IRPNotation (which describes the IR pattern completely) to something that is ready to run on hardware... but I assume it must be generating a file that's very device / hardware specific, no?
No. Talking API, what comes out is an org.harctoolbox.irpmaster.IrSignal, which is a modulation frequency, and thee org.harctoolbox.irpmaster.IrSequence's, (known as beginning, repeat, ending sequneces) each being a sequence of durations in microseconds. ("CCF" is basically the same.) Then it is the work of the "drivers" in the HarcHardware package to access the hardware, in Java terminology, implement the interface IRawIrSender.
BTW, I couldn't find any reference for IrScrutizer (successor to the meta-gui IRMaster) over at harctoolbox.. did I just miss it?
It is there, unfinished, but not yet linked from the other stuff. Working on it...
I recently contributed to the Blumoo project (Indigogo),
Will have a look at it .
but honestly, this is much more the type of project I'd like to support... the amount of quality open-source work never ceases to amaze me!
:D :D
BTW, it seems that IrScrutizer/IRPMaster are the next-gen tools after KM/RM.. is there a reason one would need to switch back and forth between toolsets? (ex. to use existing DV/RM files in IRMaster)?
To me, there is a crystal clear demarcation between RM (including "RMIR") and my work: RM is for programming UEI remotes, my stuff does nothing UEI specific. Remains to have IrScrutinizer and RM to communicate: For this I intend to implement import and export of "Girr format" files in RM, which is a very general xml-based exchange format, that I have not been talking about yet...
Regarding Android porting, I believe developing for Android is done in Java.. what challenges would you see for someone wanting to port IRPMaster)?
DecodeIR is written in portable C++, and not necessary for most use cases. Otherwise it is just pure Java, no need to "port" it.

Posted: Sun Nov 17, 2013 5:20 pm
by blipton
Ahh, gotcha... so if on a PC/Mac, what software could be used to take IRPmaster's output (.IrSignal & .IrSequences) to make a computer playable wav file? I'd love to see the resulting wave from the sound card (ASUS Xonar STX) on a scope!

(BTW, I've recently read that Matlab/Simulink can be used for generating carrier frequencies above 38khz.. but for anything less Audacity/Ladspa vocoder is the simpler approach).

On an unrelated note, any idea why RF remotes (the small key-fob type for example) have no universal learning remote equivalent? I get there's many operating frequencies, but if you assume a common one (315mhz, 433mhz, etc), what makes those waves immune from learning? I don't have a spectrum analyzer, but I'd love to see what that looks like too!)

Posted: Mon Nov 18, 2013 11:25 am
by Barf
blipton wrote:Ahh, gotcha... so if on a PC/Mac, what software could be used to take IRPmaster's output (.IrSignal & .IrSequences) to make a computer playable wav file?
IrScrutinizer and IrMaster. The latter has even more options, although the practical use may be questionable (that is why I left them out from IrScrutinizer). They generate wave files directly, or send them to an audio device. Talking API, IrpMaster contains a Wave class, that takes an IrSequence into a wave file.
I'd love to see the resulting wave from the sound card (ASUS Xonar STX) on a scope!
I will not be really too interesting. You can open a wavefile from (e.g.) IrScrutinizer with Audacity. But it will only differ from the plot in IrScrutinizer/IrMaster by the modulation.
(BTW, I've recently read that Matlab/Simulink can be used for generating carrier frequencies above 38khz.. but for anything less Audacity/Ladspa vocoder is the simpler approach).
You can do everything with IrScrutinizer and IrMaster. Matlab (even more Simulink) will not buy you anything here.
On an unrelated note, any idea why RF remotes (the small key-fob type for example) have no universal learning remote equivalent? I get there's many operating frequencies, but if you assume a common one (315mhz, 433mhz, etc), what makes those waves immune from learning? I don't have a spectrum analyzer, but I'd love to see what that looks like too!)
I plan to write a page on my website on this issue. In short, for sending and receiving you can use simple and cheap RF modules connected to e.g. a Raspberry Pi running LIRC. One common protocol (433MHz) is Arctech (in IrScrutinizer, in IrpMaster and IrMaster still called Intertechno).

Posted: Mon Nov 18, 2013 3:19 pm
by blipton
Interesting times! So many great things to learn and experiment with.. TI sells a $50 USB RF Capture device (CC2531 http://www.ti.com/tool/packet-sniffer ) that might be the next best thing for recording an RF protocol.

Thanks for all your help, and valuable insight!