Re: [PATCH] ALSA: pcm: Show closed for DISCONNECTED state
From: Takashi Iwai
Date: Tue Jun 16 2026 - 03:25:03 EST
On Tue, 16 Jun 2026 04:06:01 +0200,
Ai Chao wrote:
>
> Hello Takashi
>
> >Hmm, why it must be that? The state is shown as "DISCONNECTED".
> >
> >IOW, does this matter for which application and how do we have to
> >imitate as if the file got closed?
>
> Test Environment: Dual-boot Linux and Android system.
>
> Issue: When a recording app is opened in Linux, the system is switched to Android,
> and then switched back to Linux, the recording app fails to save the recording
> and keeps prompting "generating recording file".
>
> Note: The USB hub resets during the system switching process.
>
> Root Cause Analysis (from App Engineer): The recording app relies on the driver to
> report the IN_CLOSE_WRITE event. Upon receiving this, the audio service
> checks /proc/asound/card0/pcm0*/sub0/status. If the value is not "close", it assumes
> the sound card is occupied and skips loading; if the value is "close", it considers
> the sound card available and loads it normally.
> syslog:
> [ 1140.495952] retire_capture_urb: 17 callbacks suppressed
> [ 1140.583090] usb 1-2.4.2: USB disconnect, device number 53
> [ 1140.583965] usb 1-2.4.2: cannot submit urb (err = -19)
> [ 1140.588816] usb 1-2.4.2: cannot submit urb 0, error -19: no device
> [ 1140.662630] usb 2-4.3: USB disconnect, device number 15
> [ 1140.722584] usb 1-2.3: USB disconnect, device number 51
> [ 1140.722605] usb 1-2.3.2: USB disconnect, device number 52
> [ 1140.805724] usb 2-4.4: USB disconnect, device number 16
> [ 1141.352341] usb 1-2.3.3: USB disconnect, device number 54
> [ 1141.558840] hub 1-2.4:1.0: hub_ext_port_status failed (err = -71)
> [ 1141.613714] usb 1-2.3.5: USB disconnect, device number 55
> [ 1141.757651] usb 1-2.4: USB disconnect, device number 49
> [ 1144.324836] usb 1-2.4: new high-speed USB device number 56 using xhci_hcd
> [ 1144.473047] usb 1-2.4: New USB device found, idVendor=1a40, idProduct=0101, bcdDevice= 1.11
> [ 1144.473065] usb 1-2.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0
> [ 1144.473072] usb 1-2.4: Product: USB 2.0 Hub
> [ 1144.473738] hub 1-2.4:1.0: USB hub found
> [ 1144.473765] hub 1-2.4:1.0: 4 ports detected
Thanks, it's a bit clearer. But it still means that it's a cargo fix
only for that specific application. The program should receive an
error for any further syscalls, so that it can close gracefully by
itself. Or it doesn't work as expected?
Takashi