Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

pwm-ir-tx reports successful transmit but PWM is never enabled on 6.18.50+rpt-rpi-v7 (works on 6.12.75, Pi 3B+)

Aperta
#7,678 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, linux

Direzione di ricerca

The suspect code is the pwm-ir-tx driver and its interaction with the pwm-bcm2835 driver, plus the PWM core apply path. A useful first step is to compare the two kernel versions with /sys/kernel/debug/pwm and ir-ctl traces, then check whether the apply call returns an error. Done means identifying why the transmit does not reach the hardware on 6.18, with a fix or a clear root-cause write-up.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

Summary

On Raspberry Pi OS Trixie (armhf) with kernel 6.18.50+rpt-rpi-v7, the pwm-ir-tx overlay loads and /dev/lirc1 is registered with all expected capabilities, but nothing is transmitted. ir-ctl --send exits with 0, no kernel messages appear, and the IR LED stays dark. With the same hardware, the same config.txt and the same userland, kernel 6.12.75+rpt-rpi-v7 transmits correctly (the receiver of the amplifier responds).

Driving the same PWM channel through the generic sysfs PWM interface on 6.18 works, so the PWM hardware and pin mux appear fine. The problem looks specific to the pwm-ir-tx path.

Hardware / software
Raspberry Pi 3B+, Raspberry Pi OS Trixie, armhf
Kernel: 6.18.50+rpt-rpi-v7 (package 1:6.18.50-1+rpt1), raspi-firmware 1:1.20260915-1
Last known working: 6.12.75+rpt-rpi-v7 (same install, only the boot directory/kernel differs; modules for each kernel come from their own package)
IR LED on GPIO12 (PWM0, ALT0) via 680ohm series resistor (less than 10cm transmiter-receiver distance).
Also working on the same hardware: 6.12.96 and 6.12.109 (Bookworm, separate root partition)

Relevant config.txt:

dtoverlay=gpio-ir,gpio_pin=26,rc-map-name=rc-empty
dtoverlay=pwm-ir-tx,gpio_pin=12,func=4
dtoverlay=hifiberry-digi
dtoverlay=disable-bt
dtoverlay=disable-wifi
dtoverlay=dwc2,dr_mode=host
What happens on 6.18.50
lsmod: pwm_ir_tx, pwm_bcm2835, gpio_ir_recv loaded
dmesg:
rc rc1: PWM IR Transmitter as /devices/platform/pwm-ir-transmitter/rc/rc1
rc rc1: lirc_dev: driver pwm-ir-tx registered at minor = 1, no receiver, raw IR transmitter

No errors or warnings.

ir-ctl -d /dev/lirc1 --features shows: can send raw IR, IR scancode encoder, set carrier, set duty cycle
pinctrl get 12 → a0 -- | lo // GPIO12 = PWM0
ir-ctl -d /dev/lirc1 -S necx: → exit code 0, no IR output
Raw test: a single pulse 200000 sent with ir-ctl --carrier=38000 --send=file in a loop (20×) → exit code 0 each time, LED dark (checked with a phone camera)
A receiver on the same Pi (gpio-ir, /dev/lirc0) did not register the transmission either
/sys/kernel/debug/pwm while idle: pwm-0 (pwm-ir-transmitter): requested, requested configuration disabled, 13158/26316 ns

What was tested and ruled out

Mismatched kernel/modules: ruled out. Kernel image, initramfs, dtbs, overlays and /lib/modules/6.18.50+rpt-rpi-v7 all come from the same package and are installed in a dedicated boot directory.
Pin mux / hardware PWM: rmmod pwm_ir_tx, then echo 0 > /sys/class/pwm/pwmchip0/export, period=26316, duty_cycle=13158, enable=1 → the IR LED lights up (steady glow visible on a phone camera). So pwm-bcm2835 and the pin work on 6.18.
Overlay parameters: identical to the working 6.12.75 setup.

Observation (possibly unrelated)

With the sysfs PWM enabled and the LED visibly on, /sys/kernel/debug/pwm shows actual configuration: disabled, 0/0 ns while requested configuration: enabled, 13158/26316 ns. This may just be a reporting quirk in the debugfs output, but it could also indicate that applied state is not read back correctly in this kernel.

Interference from other overlays: ruled out. Same behaviour with gpio-ir (RX on GPIO26) and hifiberry-digi disabled; only pwm-ir-tx loaded.

Hypotheses (not verified)

6.17/6.18 reworked the PWM core (new waveform API) and several drivers; the pwm-ir-tx apply path may end up as a no-op with pwm-bcm2835 while still returning success.
pwm-ir-tx in recent kernels transmits from an hrtimer/atomic context; if the PWM apply is rejected or deferred for pwm-bcm2835, the failure may not be propagated to userspace.

I did not read the driver code in detail, so these are guesses only.

Happy to run further tests (e.g. ftrace on pwm_* functions or a bisect between 6.12 and 6.18 if you can point me to builds).

Steps to reproduce the behaviour

Raspberry Pi 3B+, Trixie armhf, kernel 6.18.50+rpt-rpi-v7
dtoverlay=pwm-ir-tx,gpio_pin=12,func=4 in config.txt
Connect an IR LED (or check the pin with a scope / phone camera)
ir-ctl -d /dev/lirc1 --carrier=38000 --send=<file with "pulse 200000">
Expected: 200 ms of 38 kHz carrier on GPIO12. Actual: exit code 0, no output.

Device (s)

Raspberry Pi 3 Mod. B+

System

Essential information described above.

Logs

No response

Additional context

No response

Lingua principale
C
Stelle
13.2k
Fork
5.5k
Merge medio
2g 4h
PR unite (30g)
20

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di raspberrypi/linux

Tutte le issue di raspberrypi/linux

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.