The easiest solution i found to record IR Signals is a 38khz IR Receiver with a Breakout Board.
Connect
GND -> Ground
VCC -> 3,3V
DAT -> GPIO 18 # can be configured later
The first hit when searching for IR on Linux is Liirc. Yet Liirrc did not work with the remote for my RME ADI2 FS DAC that i needed to control.
Luckily i found piir.
PiIR is a client program for pigpio, the excellent hardware-timed GPIO library.
To install follow instructions given here.
Recording a signal is as easy as
piir record --gpio 18 --file rme.json
T send a signal add the Key to send
piir play --gpio 22 --file rme.json power-on