LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   USB ON hook event is coming when USB is disconnected from the device (https://www.linuxquestions.org/questions/linux-software-2/usb-on-hook-event-is-coming-when-usb-is-disconnected-from-the-device-4175659454/)

ameerbhargavkilari 08-20-2019 04:50 AM

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

TB0ne 08-20-2019 07:41 AM

Quote:

Originally Posted by ameerbhargavkilari (Post 6027183)
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.

This ties in nicely with your other threads:
https://www.linuxquestions.org/quest...el-4175651115/
https://www.linuxquestions.org/quest...et-4175648755/

ameerbhargavkilari 08-20-2019 10:23 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

TB0ne 08-20-2019 11:18 AM

Quote:

Originally Posted by ameerbhargavkilari (Post 6027296)
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??

ameerbhargavkilari 08-20-2019 11:26 AM

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

TB0ne 08-20-2019 12:00 PM

Quote:

Originally Posted by ameerbhargavkilari (Post 6027340)
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.


All times are GMT -5. The time now is 01:58 AM.