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+)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 一周以上
- 新手友好度
- 15/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- c, linux
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- C
- 星标
- 13.2k
- 派生
- 5.5k
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 21
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
raspberrypi/linux 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
raspberrypi/linux#7415 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app未关闭
难度 2/5 1-3 小时 新手友好度 72/100
raspberrypi/linux#7399 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
raspberrypi/linux#7357 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
raspberrypi/linux#7054 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 15/100
raspberrypi/linux#7683 · 2 条评论 ·
维护者通常 1 天内回复
查看 raspberrypi/linux 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
-
test/command failure with filtered `listxattr` syscall可能已有人在做 @Kiskae 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 82/100
-
难度 1/5 1 小时以内 新手友好度 85/100