While recording a SAMSUNG 10340G remotes TV part, irrecord quits after gap detection.
Checking for ambient light creating too much disturbances.
Please don't press any buttons, just wait a few seconds...
No significant noise (received 0 bytes)
Enter name of remote (only ascii, no spaces) :samsung3
Using samsung3.lircd.conf as output filename
Now start pressing buttons on your remote control.
It is very important that you press many different buttons randomly
and hold them down for approximately one second. Each button should
generate at least one dot but never more than ten dots of output.
Don't stop pressing buttons until two lines of dots (2x80) have
been generated.
Press RETURN now to start recording.
................................................................................
Got gap (89285 us)}
Please keep on pressing buttons like described above.
...............................................................................[
Note the square bracket at the end. It leaves behind an empty ( length 0 )
irrecord-tmp-ywp1NU
Althoug /etc/lirc/lirc_options.conf contains a logfile definition there is no log generated, even if called as
sudo irrecord -U /usr/lib/lirc/plugins -Dtrace2 -O /etc/lirc/lirc_options.conf
Using the irrecord from GIT
I cannot reproduce this. There should be a tool which could record the raw data you feed irrecord with so we could use that input somewhere else. However, there isn't. Something like irtee...
As for the logfile, irrecord does not obey the logfile directive in [lircd]. As stated in the manpage it's in ~/.cache/irrecord.log (or $XDG_CAXCHE_HOME/irrecord.log).
EDIT: What are irrecord's driver and device (as reported directly after invocation)) ?
Last edit: Alec Leamas 2015-10-03
OK, found the log, attaching it...
P.S. wouldn't it be nice if irrecord logged to the location given in lirc_options.conf ?
OK, you are running ito trouble when trying to get the header... Is this happening for each and every remote you try, or just this one?
No, using lircd's logfile would be a disaster, it needs it's own logs left-alone. And re-directing all applications to the same default logfile would probably be a bad idea anyway.
EDIT: Looking at the code get_header_length in lib/irrecord.c it looks suspicious. Is there any difference if you apply this patch?
Last edit: Alec Leamas 2015-10-04
Just this one.
OK, but I really didn't mean output to the same file, but rather same directory. I am used to search/place logs to /var/log not really hidden places like .cache
Good shot ! After patching it works as expected.
While perusing irrecord.c I found that there are other instances of
("No Header
returning 1, you might want to check if they need correcting too.
/var/log doesn't really work for applications (as opposed to servers) for various reasons, permissions being one of them. And while the ~/.cache is indeed hidden, it's according to the freedesktop standards [1]. This is not the last time you will meet an application which puts files here. I guess.
Great!
Yes... I think I'll just patch this one in the release branch (smallest change) while making a more thorough fix in master.
Thanks for help with bug hunting! There will be a 0.9.4a; in the meantime I presume you now have a working lirc. Still, be aware of [#148 ] which possibly might affect also you (seems that both of you are using RC5 remotes).
[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Related
Tickets:
#148Last edit: Alec Leamas 2015-10-04
Hm., some double-checking... When you say that after patching it "works as expected", what does that mean? A clean failure, or that the remote is identified?
My expectations are always positive ;-)
So, in fact it means irrecord records the device properly.
Btw can I answer to a bug report via Email ?
The problem is that I don't understand the code paths here.. Could you possibly attach a log from a successful run also?
Like github? Not sure, but I don't think so. You could always make a try...
Last edit: Alec Leamas 2015-10-10
Well, it took a while, but...
I managed to get logs for fail and working case for lirc-0.9.3 as well as lirc-0.9.3git.
For the git variant the behaviour was weird in the "should work" case, as it would let me name a key to be detected, but refuse to detedt it.
P.S. Did you ever visit eastern Germany and die on the return trip ?
And case #2
I gave the git version some more tries, only when pressing few keys instead of all randomly during detection would I finally succeed.
Well, I'm obviously not dead. The rest is a secret well kept ;) Good catch!
And thanks for the logs! Very useful...
That said, this is really tricky. I don't understand this code well enough to actually merge the patch. If you have time, I'd need some more help. It's about the following code around line 1515 in lib/irrecord.c:
It seems that the difference the patch makes is that the rest of that statement isn't evaluated. If you have possibilities to run irrecord under gdb and single-step after a breakpoint on the first line (and no patch installed) until it breaks it should be really valuable.
Running under gdb requires some extra steps, partly due to libtool. See CONTRIBUTE.md.
Good you are still alive :-)
I managed to load irrecord.c into gdb, alas I don't seem to be able to set a break point:
rewards me with
Now where would I find a "symbol table" to feed gdb with ?
Edit: I obviously needed to compile the stuff :-(
After compile a breakpoint is accepted for line 1515
Stay tuned...
Last edit: T. Chelovek 2015-10-14
You should list line 1515. Chance is that it's in the wrong file, Try this:
OK now, there seems to be some subtlety about this. I use a directory under home/tchelovek to expand and compile 0.9.3 / 0.9.4 versions. Running irrecord from there gives me the problem, where gap detection completes, but button is not recognized.
I believe the reason to be, that installed ( via pacman package ) is 0.9.4-devel and the defaults are used from there. ( /etc/lirc/lirc_options.conf and the places it points to )
I now reinstalled the 0.9.3 and, running irrecord with gdb get an error after gap detection comes to an end.
Not sure how to secure the information you need from here :-(
I leave everything as is, so you can direct me to the right places.
Last edit: T. Chelovek 2015-10-14
Now, this is actually great. Issue the 'bt' command which will show the backtrace (see CONTRIBUTE.md)
EDIT: OOPS: That's from the system library! Seems that those are preferred before the local ones. The easy path might be to just remove the installed version. You really need to use the libs which you have compiled....
Last edit: Alec Leamas 2015-10-14
That should fit as I reinstalled a freshly compiled 0.9.3 as package, anyway I will remove the installed stuff altogether and rerun from the locally compiled version..
I redid it from zero, to be sure.
Download and compile lirc-0.9.3a from SF
Edit:
One last iteration for today:
I reran
As it happens, the break occurs after the first row of dots is completed, afterwards its breaking for every dot of the second row. When simply continuing it runs into the above segfault again.
Last edit: T. Chelovek 2015-10-14
hm...what about this patch?
Sure looks good
This was a simple copy-paste error + an untested code path. What's worse: I did that mistake...
Many thanks for your help, this would have been impossible to fix without it, in particular without that stacktrace.
Fixed in [6f704b] (release) and [fbfa7d] (master)
Related
Commit: [6f704b]
Commit: [fbfa7d]
Last edit: Alec Leamas 2015-10-15
Gee, thank you, for helping me help you :-)
Who knows what scrapped remotes are good for...