irrecord does not recognize Yamaha audio remote with strange protocol

Ognyan Manchev <[email protected]> Sat, 25 Apr 2020 23:46:35 +0300
Newsgroups gmane.comp.hardware.lirc
Message-ID <CAOx-N7qgG=P9hfm72zExrZJQkoZ0ZdTr8HZ=X1iAeHFomWpYMw@mail.gmail.com>
Hello guys,

I want to command my Linux-based audio station with the remote control of
my amplifier. The amp is Yamaha A-S500 and its remote model is RAS5
WV50010. It is a combined remote, with buttons for amps, receivers and cd
player controls. An image is readily available on the Internet, so you can
see what it looks like.

I am using a Girs receiver on an Android Nano. Girs properly reads the
remote, I can also read the TSOP output with a logic analyzer and it
confirms what Girs produces.

It appears that the remote uses a strange flavor of the NEC protocol, which
is described as NEC-y2 here:
http://www.hifi-remote.com/johnsfine/DecodeIR.html#NEC. The only thing off
is that the first bit of the last byte is not inverted. This makes irrecord
go crazy: the first phase, where I randomly press buttons works fine, but
when learning keys I get the message that "Something went wrong".

I am missing the final bit of information how to manually tell LIRC what
the protocol is, how can I do that?

Thanks,
Oggy