USB ON hook event is coming when USB is disconnected from the device
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
USB ON hook event is coming when USB is disconnected from the device
Hi,
We are building an android phone with USB capability, when an USB headset is connected to the device and in the OFF hook(KEY_MEDIA->down) state (USB headset selected state), when we remove the USB, along with USB disconnection event we are also receiving ON hook (KEY_MEDIA->up) event. Due to which call is getting disconnected, so can you please point out where KEY_MEDIA event is sending when USB is disconnecting in the linux. Thanks in advance for the support
Hi,
We are building an android phone with USB capability, when an USB headset is connected to the device and in the OFF hook(KEY_MEDIA->down) state (USB headset selected state), when we remove the USB, along with USB disconnection event we are also receiving ON hook (KEY_MEDIA->up) event. Due to which call is getting disconnected, so can you please point out where KEY_MEDIA event is sending when USB is disconnecting in the linux. Thanks in advance for the support
Sorry, but what do you think we're going to be able to tell you??? YOU are building this custom Android phone, and have ostensibly written the software....we know nothing about this device. You tell us nothing about it, the version/distro of Linux you're using, or where you're even seeing this message.
Hi,
Linux source code is not customized, we are seeing the events from the kernel itself, not from Android stack. When USB headset is detached then we are getting a KEY event (KEY_MEDIA) from HID interface along with USB detached event from the USB core. We are using linux 4.16
Last edited by ameerbhargavkilari; 08-20-2019 at 10:57 AM.
Hi,
Linux source code is not customized, we are seeing the events from the kernel itself, not from Android stack. When USB headset is detached then we are getting a KEY event (KEY_MEDIA) from HID interface along with USB detached event from the USB core. We are using linux 4.16
Again, you provide zero details about your device, what you've done/written, etc. And saying "linux 4.16" says very little...how about what version/distro of Linux? Installed on what hardware? Connected TO what hardware?
We aren't going to guess as to everything. Short answer: your code is broken, go fix it. You say it's not from Android...yet you have an Android phone that is SENDING that message, and you don't say how the two are working together. Are you using the Linux system as a speaker-phone, then trying to disconnect? What's the function of the Linux system while the phone is in operation??
Hi,
We are using torvalds 4-16 linux kernel running on NXP board which has ARM processor in it. We connected a plantronics USB headset, and we are using Skype call on the device. When USB is unplugged from the device as said above we received KEY_MEDIA due to which call is getting disconnected, after that we are receiving USB disconnect event
Hi,
We are using torvalds 4-16 linux kernel running on NXP board which has ARM processor in it.
So where did you get the build you're using, if you didn't customize it for your hardware???
Quote:
We connected a plantronics USB headset, and we are using Skype call on the device. When USB is unplugged from the device as said above we received KEY_MEDIA due to which call is getting disconnected, after that we are receiving USB disconnect event
Which 'device'?? If the headset it connected to the phone (which you say you're building), then it's doing something it shouldn't. Again, this is your custom Android code on a device you won't say anything about; your code is broken somewhere. Since we don't have your code, or ANY details about your device, there is zero we can tell you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.