Hi Takashi,
Which hardware? If it's Intel LPE HDMI thing, -EPIPE report doesn't mean always an XRUN, but may imply just an unconnected device.
I've tested your patch on Audio over HDMI. Not sure if LPE thing, but I can look into the details.
My kernel is configured with : # CONFIG_HDMI_LPE_AUDIO is not set
So I guess it's fine to assume it's not the LPE HDMI thing. Additionally, description in /proc/asound/card0 never mention that.
However the hardware i'm interested in is an Audio USB device, this model to be more precise : https://www.minidsp.com/products/usb-audio-interface/usbstreamer [...] Since I applied your patch, I only tried with HDMI, but I could give a shot to the Audio USB Device just to make sure. What do you think?
So I've run with the Audio USB card with your patch, and the behaviour is the same as with HDMI, meaning that echo 1 > xrun_injection outputs a xrun in /sys/kernel/tracing/trace, but apart from that, I never have an xrun.
Thanks,
Raphael