Changes in new streamfile format breaks regexp
Symptom
alsa-capabilities error in alsa_uac_endpoint:
unable to determine UAC Endpoint type from streamfile using regexp `^[[:space:]]*Endpoint: ([0-9]+) OUT \((ADAPTIVE|ASYNC|SYNC|NONE)\)'.
streamfile: `/proc/asound/card1/stream0'
Contents of the streamfile:
Endpoint: 0x01 (1 OUT) (ASYNC)
# ^^^^^ not matched by regexp (space)
Cause
Output string changed in ALSA: usb-audio: Show sync endpoint information in proc outputs on 23 Nov 2020. Line 111 in https://github.com/torvalds/linux/blob/master/sound/usb/proc.c:
snd_iprintf(buffer, " Endpoint: 0x%02x (%d %s) (%s)\n",
fp->endpoint,
fp->endpoint & USB_ENDPOINT_NUMBER_MASK,
fp->endpoint & USB_DIR_IN ? "IN" : "OUT",
sync_types[(fp->ep_attr & USB_ENDPOINT_SYNCTYPE) >> 2]);
So the printf template for the string returned changed:
- " Endpoint: %d %s (%s)\n"
+ " Endpoint: 0x%02x (%d %s) (%s)\n"
Solution
Fix the regexp.
Edited by Ronald van Engelen