LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 08-20-2019, 04:50 AM   #1
ameerbhargavkilari
LQ Newbie
 
Registered: Feb 2019
Posts: 8

Rep: Reputation: Disabled
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
 
Old 08-20-2019, 07:41 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by ameerbhargavkilari View Post
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/
 
Old 08-20-2019, 10:23 AM   #3
ameerbhargavkilari
LQ Newbie
 
Registered: Feb 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
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.
 
Old 08-20-2019, 11:18 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by ameerbhargavkilari View Post
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??
 
Old 08-20-2019, 11:26 AM   #5
ameerbhargavkilari
LQ Newbie
 
Registered: Feb 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
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
 
Old 08-20-2019, 12:00 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by ameerbhargavkilari View Post
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.
 
  


Reply

Tags
usb headphones



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Run an event while another event is running in wxWidgets GUI? Sarathsankar Programming 11 10-24-2017 09:30 AM
Print ID of important event which don't have associated click event raheel_com88 Linux - Server 1 05-31-2013 09:21 AM
[SVN - post-commit hook] hook failed, did not exit cleanly G00fy Programming 0 01-21-2009 02:15 AM
How to implement an onWrite event hook? boughtonp Linux - General 2 01-21-2008 04:49 PM
Fire Event from other event in Visual C++ Express Edition chrisliando Programming 1 11-08-2007 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration