1

How will the Linux detect that I connected a USB Audio Peripheral?

If I connect a USB Charger it will charge my mobile and it does not show any Headset icon on my status bar(Android).

But when I connect the USB Audio Headset to the same USB type c port it is detecting it as Audio Device.

I am interested in how the kernel handles all these?

Any call flow diagram or any starting point for me to look into this?

optimus prime
  • 111
  • 1
  • 4

1 Answers1

1

USB provides a lot of information in a standardized way to the host. Use lsusb -v to see what is available about your attached devices. Among this information is the vendor and device number, similar to PCI devices. There are also several defined device classes, like storage, input or audio. This allows a driver ho handle a device class even if it doesn't know about this particular device.

In your case, the USB Headset is identified as an audio device, and the USB audio driver handles the headset. The charger on the other hand will identify as a charger and let the phone know how much power it can get. Simple chargers doen't do this, and to be safe the phone only uses a lower current and takes longer to load.

RalfFriedl
  • 8,816
  • 6
  • 23
  • 34