ts1 / PiIR

IR remote control for Raspberry Pi
MIT License
33 stars 5 forks source link

Noise from speaker instead of sending signals #5

Open ErfolgreichCharismatisch opened 1 year ago

ErfolgreichCharismatisch commented 1 year ago

piir play --gpio 22 --file "/home/pi/Infrarot/harmankardon.json" 'Off'

It worked quite well from the start, recording and playing back, great library. That being said, sometimes no codes are being sent but instead I hear a weird noise coming from the speakers plugged into the stereo jack of the pi as if the signals were routed to the speakers. A reboot normally solves the issue. How do I solve it without reboot? Raspi 1 B, Bullseye.

ErfolgreichCharismatisch commented 1 year ago

Here is the weird noise: https://user-images.githubusercontent.com/18123801/206899788-2c57882f-e144-4743-b58d-253e5d2985c5.MP4

ts1 commented 1 year ago

It seems like a hardware issue, and I have no idea how to fix it using software.

ErfolgreichCharismatisch commented 1 year ago

How to reproduce:

  1. piir play your parameters
  2. aplay wave file
  3. piir play your parameters
ts1 commented 1 year ago

Maybe it will work if you try using a different GPIO.

ErfolgreichCharismatisch commented 1 year ago

I found https://raspberrypi.stackexchange.com/questions/72696/how-to-configure-pigpiod-to-prevent-being-affected-by-aplay, there is no solution, but the mentioned command affects the speaker for it to produce constant interference. The root cause is in the pigpiod which you are wrapping. As you wrapped it, you know it well, so where could this come from?

ts1 commented 1 year ago

Good find, PiIR uses pigpio's wave function for IR transmission. If I remember correctly, this is accomplished using a DMA-like function. Maybe this is a problem that cannot be fundamentally fixed. But I think there is a slight chance to try to change the GPIO port.

ErfolgreichCharismatisch commented 1 year ago

I switched from GPIO22 to GPIO24, same result unfortunately.