Summary of the invention
Main purpose of the present invention is to provide a kind of earphone compatible method and device and mobile terminal, is intended to the compatibility realized digital signal earphone and analog signal earphone, promotes Consumer's Experience.
To achieve these objectives, the present invention proposes a kind of earphone compatible device, comprises processing module, switch module and codec, and described processing module and codec, by described switch module frames connecting with headphone, receive the audio signal of earphone, wherein:
Processing module: for detecting whether the earphone of current insertion is digital signal earphone, if not, then send the first control signal to described switch module;
Switch module: it comprises one first diverter switch, described first diverter switch acquiescence is connected to described processing module, when receiving described first control signal, then disconnects the connection with described processing module, is connected to described codec;
Codec: for after receiving the audio signal of earphone, analog-to-digital conversion is carried out to this audio signal, then send described processing module to.
Preferably, described processing module is used for: send pulse signal to described earphone, and the feedback signal that described earphone feeds back according to described pulse signal if receive, then judge that described earphone is as digital signal earphone, otherwise judge that described earphone is as nonnumeric signal earphone.
Preferably, described switch module also comprises the second diverter switch be connected between the first diverter switch and earphone, described processing module is used for: the type of plug information obtaining described earphone, and sends the second control signal according to described type of plug information to described second diverter switch; Described second diverter switch is used for: according to described second control signal, is connected to each section of headset plug on circuit corresponding to earphone compatible device.
Preferably, described switch module also comprises the second diverter switch be connected between the first diverter switch and earphone, and described second diverter switch is for the P3 section of transmitter circuit and signal circuit circuit and headset plug that switches earphone compatible device and the annexation of P4 section; Described processing module is used for before and after described second diverter switch switches, apply forward voltage by described codec to described P3 section and P4 section and obtain two current values, and controlling described second diverter switch by the size comparing two current values the P3 section of headset plug and P4 section are connected on circuit corresponding to earphone compatible device.
The present invention proposes a kind of earphone compatible method simultaneously, comprises step:
Whether the earphone detecting current insertion is digital signal earphone;
If not, the first diverter switch of terminal then disconnects and being connected with the acquiescence of the processing module of terminal, then is connected to the codec of terminal, to make codec by the first diverter switch frames connecting with headphone;
Codec receives the audio signal of earphone, and sends processing module to after this audio signal is carried out analog-to-digital conversion.
Preferably, whether the earphone judging current insertion is that digital signal earphone comprises:
Terminal sends pulse signal to earphone;
If receive the feedback signal that earphone feeds back according to described pulse signal, then judge that earphone is as digital signal earphone, otherwise judge that earphone is as nonnumeric signal earphone.
Preferably, described method also comprises:
Obtain the type of plug information of earphone;
According to described type of plug information, each section of headset plug is connected on circuit corresponding to terminal.
Preferably, described method also comprises:
Terminal applies forward voltage to the P3 section of headset plug and P4 section, obtains one first current value;
Terminal is again applied forward voltage to P3 section and P4 section, obtains one second current value after once being switched described P3 section and the transmitter circuit of P4 section and terminal and the annexation of signal circuit circuit by the second diverter switch;
If described first current value is greater than the second current value, then switch back original annexation by the second diverter switch;
If described first current value is less than the second current value, then keep the annexation that the second diverter switch is current.
The present invention also proposes a kind of mobile terminal, it comprises earphone compatible device, and this earphone compatible device comprises processing module, switch module and codec, and described processing module and codec are by described switch module frames connecting with headphone, receive the audio signal of earphone, wherein:
Processing module: for detecting whether the earphone of current insertion is digital signal earphone, if not, then send the first control signal to described switch module;
Switch module: it comprises one first diverter switch, described first diverter switch acquiescence is connected to described processing module, when receiving described first control signal, then disconnects the connection with described processing module, is connected to described codec;
Codec: for after receiving the audio signal of earphone, analog-to-digital conversion is carried out to this audio signal, then send described processing module to.
A kind of earphone compatible method provided by the present invention, by judging the signal type of earphone, according to judged result, diverter switch switching is connected to processing module or codec, to make processing module directly receive the audio signal of earphone or receive audio signal after codec analog-to-digital conversion, make terminal can compatible digital Signal earphone and analog signal earphone.Further, by identifying that the type of plug of earphone carrys out the earphone of compatible various type of plug, finally can also achieve the earphone of compatible different type of plug and signal type simultaneously, improve compatibility, improve Consumer's Experience.
Embodiment
Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
See Fig. 1, propose earphone compatible method first embodiment of the present invention, said method comprising the steps of:
Step S101: earphone inserts terminal
Step S102: whether the earphone judging current insertion is digital signal earphone
After the processing module (as central processing unit) of terminal detects that earphone inserts the earphone jack of terminal, the signal type of Test earphone immediately, judges that the earphone of current insertion is digital signal earphone or analog signal earphone.
Because digital signal earphone is built-in with process chip, can automatic feedback one feedback signal when receiving pulse signal.Therefore, in specific implementation, processing module can send a pulse signal by the codec of terminal to earphone, if (as about 20ms) receives the feedback signal of earphone feedback within a certain period of time, then judge that this earphone is as digital signal earphone, otherwise be analog signal earphone.When first time, pulse signal did not receive feedback signal, processing module can send the pulse signal of certain number of times (as 2 ~ 3 times) again to earphone, to ensure the accuracy judged.
As processing module finally judges that earphone is as digital signal earphone, then enter step S103; As processing module finally judges that earphone is as analog signal earphone, then enter step S104.
Step S103: processing module directly receives the audio signal that earphone sends
Terminal has a diverter switch, the preferred triode switch of this diverter switch, the transmitter section (i.e. Mic section) of its one end frames connecting with headphone plug, the switchable connection handling module of the other end or codec, be sent to processing module or codec to make the audio signal of earphone.Diverter switch acquiescence connection handling module, only just switch after receiving the control signal of processing module and be connected to codec, namely under default conditions, audio signal is directly sent to processing module by earphone.
When earphone is digital signal earphone, its audio signal sent is then digital signal, and processing module then directly receives the audio signal that earphone sends, and identifies and process this audio signal.
Step S104: control diverter switch disconnection and be connected with the acquiescence of processing module, then be connected to the codec of terminal
When earphone is analog signal earphone, its audio signal sent is analog signal, and processing module can not identify this analog signal.Therefore processing module sends a control signal to diverter switch, and diverter switch disconnects according to this control signal and being connected with the acquiescence of processing module, then is connected to codec.When terminal extracted by earphone, diverter switch recovers Default Connected State automatically.
Step S105: codec receives the audio signal that earphone sends, and carries out analog-to-digital conversion to this audio signal
Audio signal is converted to digital signal from analog signal by codec, and the audio signal after conversion is sent to processing module.
Step S106: processing module receives the audio signal that codec sends
The audio signal that codec sends is digital signal, and processing module then identifies this audio signal of this audio frequency and processes.
Thus, by judging the signal type of earphone, according to judged result, diverter switch switching is connected to processing module or codec, directly receive the audio signal of earphone to make processing module or receive the audio signal after codec analog-to-digital conversion, make terminal can compatible digital Signal earphone and analog signal earphone, improve the compatibility of terminal, improve Consumer's Experience.
See Fig. 2, propose earphone compatible method second embodiment of the present invention, said method comprising the steps of:
Step S201: earphone inserts terminal
Step S202: the type of plug information obtaining the earphone of current insertion, is connected to each section of headset plug on circuit corresponding to terminal according to type of plug information
Existing earphone mainly comprises three sections of earphones and four sections of earphones, wherein the plug portion of four sections of earphones comprises P1 ~ P4 totally 4 sections, respectively corresponding L channel section, R channel section, transmitter (Mic) section and signal circuit () section, dissimilar earphone each section of difference that puts in order, three sections of earphones do not have transmitter section.
In specific implementation, can as prior art (as Chinese patent 201110241383.8), by obtaining the magnitude of voltage of each section, the size of more each section of magnitude of voltage obtains the type of plug information of earphone, then produce corresponding control signal according to the magnitude of voltage of each section, each section that controls headset plug is connected on circuit corresponding to terminal.The L channel circuit of terminal, R channel circuit, transmitter circuit and signal circuit circuit is connected to respectively by the L channel section of headset plug, R channel section, transmitter section and signal circuit section.
In view of conventional earphone standard in the market mainly comprises Europe superscript and American Standard, the difference of two kinds of earphones is only the position reciprocity of transmitter section and signal circuit section, and L channel section is identical with R channel section.Namely the P1 section ~ P4 section of Europe superscript headset plug is respectively L channel section, R channel section, transmitter section and signal circuit section, and the P1 section ~ P4 section of American Standard headset plug is respectively L channel section, R channel section, signal circuit section and transmitter section.Therefore, the present embodiment preferably only identifies the P3 section of headset plug and P4 section, and then their is switched and be connected on the corresponding circuit of terminal, i.e. transmitter circuit and signal circuit circuit.Specifically comprise the following steps:
Step S210: terminal applies forward voltage to the P3 section of headset plug and P4 section, obtains one first current value I1
Concrete, the processing module of terminal applies a forward voltage by codec to P3 section and P4 section, detects the first current value I1 in the loop that P3 section and P4 section and terminal respective lines form, obtains this first current value I1.
Step S220: terminal is again applied forward voltage to P3 section and P4 section, obtains one second current value I2 after once being switched P3 section and the transmitter circuit of P4 section and terminal and the annexation of signal circuit circuit by the second diverter switch
Concrete, the processing module of terminal sends one second control signal to the second diverter switch, and the second diverter switch switches according to this second control signal.The preferred triode switch of described second diverter switch, the P3 section of second diverter switch one end frames connecting with headphone plug and P4 section, the other end connects transmitter circuit and the signal circuit circuit of terminal, and the respective lines of P3 section and P4 section and terminal can be switched.When supposing that earphone inserts terminal, P3 section connects the transmitter circuit of terminal, and P4 section connects the signal circuit circuit of terminal; After second diverter switch switches, then the annexation of the two exchanges, and namely becomes the signal circuit circuit that P3 section connects terminal, and P4 section connects the transmitter circuit of terminal.After switching, the processing module of terminal applies a forward voltage by codec to P3 section and P4 section again, obtains one second current value I2.
Step S230: the size judging the first current value I1 and the second current value I2
If the first current value I1 is greater than the second current value I2, then enter step S240; If the first current value I1 is less than the second current value I2, then enter step S250.If the first current value I1 equals the second current value I2, then illustrate that earphone is three sections of earphones or other peripheral hardware.
Step S240: terminal switches back original annexation by the second diverter switch
When the first current value I1 is greater than the second current value I2, illustrate that original annexation is right, the processing module of terminal sends the second control signal to the second diverter switch again, second diverter switch switches again according to this second control signal, thus switches back original annexation, and namely P3 section connects the transmitter circuit of terminal, P4 section connects the signal circuit circuit of terminal, illustrate that P3 section is transmitter section, P4 section is signal circuit section, and the earphone of current insertion is Europe superscript earphone.
Step S250: the annexation that terminal keeps the second diverter switch current
When the first current value I is less than the second current value I2, illustrate that original annexation is wrong, and the annexation after switching is right, then keep the annexation that the second diverter switch is current, namely P3 section connects the signal circuit circuit of terminal, and P4 section connects the transmitter circuit of terminal, illustrates that P3 section is signal circuit section, P4 section is transmitter section, and the earphone of current insertion is American Standard earphone.
Thus, the earphone of various type of plug is identified, and has carried out adaptation according to recognition result, with the earphone of the various type of compatibility.
Next, then to the earphone of unlike signal type identify and compatibility.
Step S203: whether the earphone judging current insertion is digital signal earphone
As processing module finally judges that earphone is as digital signal earphone, then enter step S204; As processing module finally judges that earphone is as analog signal earphone, then enter step S205.
Step S204: processing module directly receives the audio signal that earphone sends
Terminal also has one first diverter switch, the preferred triode switch of this diverter switch, and its one end connects the second diverter switch, and the switchable connection handling module of the other end or codec, be sent to processing module or codec to make the audio signal of earphone.Second diverter switch acquiescence connection handling module, only just switch after receiving the control signal of processing module and be connected to codec, namely under default conditions, audio signal is directly sent to processing module by earphone.
When earphone is digital signal earphone, its audio signal sent is then digital signal, and processing module then directly receives the audio signal that earphone sends, and identifies and process this audio signal.
Step S205: control the first diverter switch disconnection and be connected with the acquiescence of processing module, then be connected to the codec of terminal
When earphone is analog signal earphone, its audio signal sent is analog signal, and processing module can not identify this analog signal.Therefore processing module sends the first control signal to the second diverter switch, and the second diverter switch disconnects according to this first control signal and being connected with the acquiescence of processing module, then is connected to codec.
Step S206: codec receives the audio signal that earphone sends, and carries out analog-to-digital conversion to this audio signal
Step S207: processing module receives the audio signal that codec sends
In certain embodiments, also first can carry out the identification of signal type, then carry out the identification of type of plug.
Thus, by identifying the type of plug of earphone and signal type, achieving the earphone of compatible different type of plug and signal type simultaneously, further increasing the compatibility of terminal, improve Consumer's Experience.
See Fig. 4, Fig. 5, earphone compatible device first embodiment of the present invention is proposed, described earphone compatible device can be applied to various terminal, it comprises processing module, switch module and codec, processing module and codec pass through transmitter section (Mic section) and the signal circuit section (ground section) of switch module frames connecting with headphone, to receive the audio signal of earphone, the L channel section of the direct frames connecting with headphone of codec and R channel section.
Processing module: for detecting whether the earphone of current insertion is digital signal earphone, if not, then send the first control signal to switch module.
Processing module can be the central processing unit of terminal.After processing module detects that earphone inserts the earphone jack of terminal, the signal type of Test earphone immediately, judges that the earphone of current insertion is digital signal earphone or analog signal earphone.
Because digital signal earphone is built-in with process chip, can automatic feedback one feedback signal when receiving pulse signal.Therefore, in specific implementation, processing module can send a pulse signal by codec to earphone, if (as about 20ms) receives the feedback signal of earphone feedback within a certain period of time, then judge that this earphone is as digital signal earphone, otherwise be analog signal earphone.When first time, pulse signal did not receive feedback signal, processing module can send the pulse signal of certain number of times (as 2 ~ 3 times) again to earphone, to ensure the accuracy judged.
When judging earphone as nonnumeric signal earphone, then sending the first control signal to switch module, switching annexation with control switch module.
Switch module: it comprises one first diverter switch, this first diverter switch acquiescence is connected to processing module, upon receiving the first control signal, then disconnects the connection with processing module, is connected to codec.
The preferred triode switch of first diverter switch, the transmitter section of its one end frames connecting with headphone plug, the switchable connection handling module of the other end or codec, be sent to processing module or codec to make the audio signal of earphone.First diverter switch acquiescence connection handling module, only just switch after receiving the control signal of processing module and be connected to codec, namely under default conditions, audio signal is directly sent to processing module by earphone.The schematic diagram of the first diverter switch as shown in Figure 5.
When earphone is digital signal earphone, its audio signal sent is then digital signal, and processing module then directly receives the audio signal that earphone sends, and identifies and process this audio signal.
When earphone is analog signal earphone, its audio signal sent is analog signal, and processing module can not identify this analog signal.Therefore the first diverter switch disconnects according to this control signal and being connected with the acquiescence of processing module, then is connected to codec, directly sends to codec to make the audio signal of earphone.When terminal extracted by earphone, the first diverter switch recovers Default Connected State automatically.
Codec: for after receiving the audio signal of earphone, analog-to-digital conversion is carried out to this audio signal, is converted to digital signal by audio signal from analog signal, then send processing module to.
Accordingly, judged by the signal type of processing module to earphone, according to judged result, diverter switch switching is connected to processing module or codec, directly receive the audio signal of earphone to make processing module or receive the audio signal after codec analog-to-digital conversion, make terminal can compatible digital Signal earphone and analog signal earphone, improve the compatibility of terminal, improve Consumer's Experience.
See Fig. 6, Fig. 7, propose earphone compatible device second embodiment of the present invention, the earphone compatible device of the present embodiment comprises processing module, switch module and codec, and the annexation of three is identical with the first embodiment.Wherein, switch module comprises the first diverter switch and the second diverter switch, and the second diverter switch is connected between the first diverter switch and earphone.
Processing module: for obtaining the type of plug information of the earphone of current insertion, and send the second control signal according to type of plug information to the second diverter switch; Whether the earphone detecting current insertion is digital signal earphone, if not, then sends the first control signal to the first diverter switch.
Switch module: comprise the first diverter switch and the second diverter switch, wherein the first diverter switch and the preferred triode switch of the second diverter switch.Second diverter switch one end frames connecting with headphone, the respective lines of other end frames connecting with headphone compatible apparatus and the second diverter switch, the switchable connection handling module of the second diverter switch or codec.First diverter switch acquiescence is connected to processing module, upon receiving the first control signal, then disconnects the connection with processing module, is connected to codec.Each section of headset plug, according to the second control signal, is connected on circuit corresponding to earphone compatible device by the second diverter switch.
The implementation of the earphone of the compatible unlike signal type of the present embodiment is identical with the first embodiment, and following emphasis describes the implementation of the earphone of compatible different type of plug.
Existing earphone mainly comprises three sections of earphones and four sections of earphones, wherein the plug portion of four sections of earphones comprises P1 ~ P4 totally 4 sections, be respectively L channel section, R channel section, transmitter (Mic) section and signal circuit () section, the difference that puts in order of each section of dissimilar earphone, three sections of earphones do not have transmitter section.
In specific implementation, can as prior art (as Chinese patent 201110241383.8), the magnitude of voltage of each section is obtained by processing module, the size of more each section of magnitude of voltage obtains the type of plug information of earphone, then produce corresponding second control signal according to the magnitude of voltage of each section, control the second diverter switch and each section of headset plug is connected on circuit corresponding to earphone compatible device.The L channel circuit of earphone compatible device, R channel circuit, transmitter circuit and signal circuit circuit is connected to respectively by the L channel section of headset plug, R channel section, transmitter section and signal circuit section.
In view of conventional earphone standard in the market mainly comprises Europe superscript and American Standard, the difference of two kinds of earphones is only the position reciprocity of transmitter section and signal circuit section, and L channel section is identical with R channel section.Namely the P1 section ~ P4 section of Europe superscript headset plug is respectively L channel section, R channel section, transmitter section and signal circuit section, and the P1 section ~ P4 section of American Standard headset plug is respectively L channel section, R channel section, signal circuit section and transmitter section.Therefore, the present embodiment preferably only identifies the P3 section of headset plug and P4 section, and then their is switched and be connected on the corresponding circuit of earphone compatible device.
That is: the P3 section of the second diverter switch frames connecting with headphone plug and P4 section, and switch the annexation of the transmitter circuit of earphone compatible device and the P3 section of signal circuit circuit and headset plug and P4 section, the now P1 section of the direct frames connecting with headphone plug of codec and P2 section; Processing module is used for before and after the second diverter switch switches, apply forward voltage by codec to P3 section and P4 section and obtain two current values, and controlling the second diverter switch by the size comparing two current values the P3 section of headset plug and P4 section are connected on circuit corresponding to earphone compatible device.The schematic diagram of the second diverter switch as shown in Figure 7.
Specific implementation is as follows:
Processing module applies a forward voltage by codec to P3 section and P4 section, obtains the first current value I1 in the loop that P3 section and P4 section and terminal respective lines form.
Processing module sends one second control signal to the second diverter switch, second diverter switch switches P3 section and the transmitter circuit of P4 section and terminal and the annexation of signal circuit circuit according to the second control signal, processing module applies forward voltage by codec to P3 section and P4 section immediately again, obtains one second current value I2.Now, when supposing that earphone inserts terminal, P3 section connects the transmitter circuit of terminal, and P4 section connects the signal circuit circuit of terminal; After second diverter switch switches, then the annexation of the two exchanges, and namely becomes the signal circuit circuit that P3 section connects terminal, and P4 section connects the transmitter circuit of terminal
Processing module judges the size of the first current value I1 and the second current value I2.If the first current value I1 is greater than the second current value I2, then illustrate that original annexation is right, processing module sends the second control signal to the second diverter switch again, second diverter switch switches again according to this second control signal, thus switches back original annexation, and namely P3 section connects the transmitter circuit of terminal, P4 section connects the signal circuit circuit of terminal, illustrate that P3 section is transmitter section, P4 section is signal circuit section, and the earphone of current insertion is Europe superscript earphone.If when the first current value I is less than the second current value I2, illustrate that original annexation is wrong, and the annexation after switching is right, then keep the annexation that the second diverter switch is current, namely P3 section connects the signal circuit circuit of terminal, and P4 section connects the transmitter circuit of terminal, illustrates that P3 section is signal circuit section, P4 section is transmitter section, and the earphone of current insertion is American Standard earphone.
The present embodiment is identical with the first embodiment by the implementation of the earphone of the compatible unlike signal type of the first diverter switch, does not repeat them here.
Accordingly, the earphone compatible device of the present embodiment, not only can identify the signal type of earphone, the type of plug of earphone can also be identified, achieve the earphone of compatible different type of plug and signal type simultaneously, further increase the compatibility of terminal, improve Consumer's Experience.
The present invention proposes a kind of mobile terminal simultaneously, it comprises an earphone compatible device, this earphone compatible device comprises processing module, switch module and codec, and described processing module and codec, by described switch module frames connecting with headphone, receive the audio signal of earphone.Processing module: for detecting whether the earphone of current insertion is digital signal earphone, if not, then send the first control signal to described switch module; Switch module: it comprises one first diverter switch, described first diverter switch acquiescence is connected to described processing module, when receiving described first control signal, then disconnects the connection with described processing module, is connected to described codec; Codec: for after receiving the audio signal of earphone, analog-to-digital conversion is carried out to this audio signal, then send described processing module to.Earphone compatible device described in the present embodiment is the earphone compatible device in the present invention involved by above-described embodiment, does not repeat them here.
Mobile terminal of the present invention, by judging the signal type of earphone, according to judged result, diverter switch switching is connected to processing module or codec, to make processing module directly receive the audio signal of earphone or receive audio signal after codec analog-to-digital conversion, make terminal can compatible digital Signal earphone and analog signal earphone.Further, the earphone of various type of plug can also be identified, finally achieve the earphone of compatible different type of plug and signal type simultaneously, improve the compatibility of terminal, improve Consumer's Experience.
One of ordinary skill in the art will appreciate that, realize the hardware that all or part of step in above-described embodiment method can control to be correlated with by program to complete, described program can be stored in a computer read/write memory medium, and described storage medium can be ROM/RAM, disk, CD etc.
Should be understood that; these are only the preferred embodiments of the present invention; can not therefore limit the scope of the claims of the present invention; every utilize specification of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.