Terminal device and audio data processing method
By designing two headphone sockets and corresponding control logic in the terminal device, the problem that existing equipment can only support one headphone pin type is solved, and compatibility with 4- and 3-segment headphones is achieved, improving the usability of headphone products.
Patent Information
- Application Number
- PCT/CN2024/126000
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-07
- Filing Date
- 2024-10-21
- Publication Date
- 2025-06-12
AI Technical Summary
Existing terminal devices can only support one type of headphone pin, which leads to insufficient utility in headphone products and cannot be compatible with 4- and 3-segment headphones at the same time.
Design a terminal device, including two headphone sockets, logic switches, audio codec chips and master control chips. Through the main control chip, the microphone pins of each earphone socket can be independently connected to the audio codec chip, achieving compatibility with different types of earphones.
It achieves simultaneous compatibility of 4- and 3-segment headphones, improves the usability of headphone products, and ensures that the functions of different types of headphones work normally.
Smart Images

Figure CN2024126000_12062025_PF_FP_ABST
Abstract
Description
Terminal device and audio data processing method
[0001] Cross-references
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on December 7, 2023, with application number 202311682834.0 and invention name “A terminal device and method for processing audio data”. The entire contents of the application are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of terminal audio technology, and in particular to a terminal device and a method for processing audio data. Background Art
[0004] A headphone jack is a physical headphone connector that's widely used on various electronic devices. Currently, most devices on the market only have one headphone jack. Two headphones are connected to the headphone jack via a one-to-two adapter cable to achieve parallel signal connection, allowing simultaneous operation.
[0005] Headphones are further divided into those with microphones and those without. Headphones with microphones have four pins, while those without have three. Existing terminal devices can only support headphones with one pin type through a single headphone jack, which limits the versatility of headphone products.
[0006] Summary of the Invention
[0007] The purpose of this application is to provide a terminal device and an audio data processing method.
[0008] In a first aspect, a terminal device is provided, comprising: a first headphone jack, a second headphone jack, a logic switch, an audio codec chip and a main control chip; the channel pin of the first headphone jack and the channel pin of the second headphone jack are connected in parallel to the audio output end of the audio codec chip; wherein the main control chip is used for: when a headphone with a microphone is inserted into the first headphone jack, based on a first microphone enable instruction initiated for the first headphone jack, controlling the logic switch so that the microphone pin of the first headphone jack is connected to the audio input end of the audio codec chip; and / or, when a headphone with a microphone is inserted into the second headphone jack, based on a second microphone enable instruction initiated for the second headphone jack, controlling the logic switch so that the microphone pin of the second headphone jack is connected to the audio input end.
[0009] According to a second aspect, a method for processing audio data is provided, comprising: when it is determined based on the plug-in and unplugging detection results corresponding to a first headphone socket and a second headphone socket that devices are both plugged into the first headphone socket and the second headphone socket, reading actual channel impedance for comparison with a preset theoretical impedance of a mono headphone to determine whether the devices plugged into the first headphone socket and the second headphone socket include headphones; when it is determined that the devices plugged into the first headphone socket and the second headphone socket include headphones, and when it is determined based on the plug-in and unplugging detection results corresponding to the first headphone socket and the second headphone socket that devices are changed from being both plugged into the first headphone socket and the second headphone socket to being plugged into only one of the first headphone socket and the second headphone socket, re-reading actual channel impedance for comparison with a preset theoretical impedance of a mono headphone to determine the type of the device plugged into the one of the devices; when it is determined that the type of the device plugged into the one of the devices is a headphone, performing signal gain on the audio data outputted from the audio output terminal; wherein the magnitude of the signal gain is determined based on the ratio between the actual channel impedance previously read and the actual channel impedance re-read.
[0010] According to a third aspect, a method for processing audio data is provided, comprising: when it is determined based on the plug-in and unplug-out detection results corresponding to a first headphone socket and a second headphone socket that only one of the first headphone socket and the second headphone socket has a device plugged in, reading the left channel impedance or the right channel impedance for comparison with a preset theoretical impedance of a mono headphone to determine the type of the plugged-in device; when it is determined that the type of the plugged-in device is a headphone, and when it is determined based on the plug-in and unplug-out detection results corresponding to the first headphone socket and the second headphone socket that the first headphone socket and the second headphone socket have changed from one of the first headphone socket and the second headphone socket having a device plugged in to both of the first headphone socket and the second headphone socket having devices plugged in, re-reading the left channel impedance or the right channel impedance for comparison with a preset theoretical impedance of a mono headphone to determine whether the devices plugged into the first headphone socket and the second headphone socket are both headsphones; when it is determined that the types of the devices plugged into the first headphone socket and the second headphone socket are both headsphones, performing signal reduction on the audio data outputted from the audio output end; wherein the magnitude of the signal reduction is determined based on the ratio between the actual channel impedance previously read and the actual channel impedance re-read. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0012] FIG1 is a schematic diagram of the first structure of a terminal device according to an embodiment of the present application.
[0013] FIG2 is a second structural diagram of a terminal device according to an embodiment of the present application.
[0014] FIG3 is a schematic diagram of a third structure of a terminal device according to an embodiment of the present application.
[0015] FIG4 is a first schematic diagram of a terminal device in an embodiment of the present application performing device detection on a headset to control a microphone function.
[0016] FIG5 is a second schematic diagram of a terminal device in an embodiment of the present application performing device detection on a headset to control a microphone function.
[0017] FIG6 is a schematic diagram of a first working logic of the signal amplifier according to an embodiment of the present application.
[0018] FIG7 is a schematic diagram of a flow chart of the signal booster according to an embodiment of the present application in the first scenario.
[0019] FIG8 is a schematic diagram of a second working logic of the signal amplifier according to an embodiment of the present application.
[0020] FIG9 is a schematic diagram of a flow chart of a signal amplifier according to an embodiment of the present application in a first scenario.
[0021] FIG10 is a schematic diagram of a terminal device according to an embodiment of the present application controlling a headset microphone in a call scenario.
[0022] FIG11 is a flow chart of a method for processing audio data according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] As mentioned above, most of the terminal devices currently on the market are only equipped with one headphone jack and support one type of headphone pin, resulting in insufficient versatility of headphone products.
[0024] For example, if a terminal device is equipped with a headphone jack that supports 3-way headphones, and a user plugs a 4-way headphone (with a microphone) and a 3-way headphone (without a microphone) into the headphone jack, the microphone on the 4-way headphone will not work, and there may even be false detection of a long press on the 4-way headphone button. In addition, the power corresponding to the 3-way and 4-way headphones is inconsistent when connected in parallel, resulting in different sound effects, which in turn affects the user experience.
[0025] In response to the above problems, this application at least aims to propose a terminal device solution that can be compatible with and support both 4-segment headphones and 3-segment headphones, which can improve the versatility of the terminal device for headphone products.
[0026] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this specification.
[0027] 1 is a schematic diagram of the structure of the terminal device, which may include: a first headphone jack 110 , a second headphone jack 120 , a logic switch 130 , an audio codec chip 140 , and a main control chip 150 .
[0028] The audio channel pin of the first headphone socket 110 and the audio channel pin of the second headphone socket 120 are connected in parallel to the audio output end of the audio codec chip 140 .
[0029] The main control chip 150 can be used to: when a headphone with a microphone is inserted into the first headphone jack 110, based on a first microphone activation instruction initiated for the first headphone jack 110, control the logic switch 130 to connect the microphone pin of the first headphone jack 110 to the audio input end of the audio codec chip 140; in addition, when a headphone with a microphone is inserted into the second headphone jack 120, based on a second microphone activation instruction initiated for the second headphone jack 120, control the logic switch 130 to connect the microphone pin of the second headphone jack 120 to the audio input end.
[0030] It should be noted that the first microphone activation instruction and the second microphone activation instruction may be issued by the user.
[0031] As an example, the display screen (built-in or external) of the terminal device in this embodiment displays an interactive interface capable of controlling an external device plugged into the first headphone jack 110 or the second headphone jack 120. This interactive interface may be a user interface (UI) of related software that includes audio playback / control functions (e.g., mute, volume increase / decrease, etc.). The user can operate on the interactive interface to control whether the microphone of the headphone corresponding to the first headphone jack 110 or the second headphone jack 120 needs to be activated based on the microphone usage requirements.
[0032] For example, when the microphone of the earphone corresponding to the first earphone socket 110 is started, a first microphone enabling instruction may be generated to control the logic switch 130 so that the microphone pin of the first earphone socket 110 is connected to the audio input terminal; and when the microphone of the earphone corresponding to the second earphone socket 120 is started, a second microphone enabling instruction may be generated to control the logic switch 130 so that the microphone pin of the second earphone socket 120 is connected to the audio input terminal.
[0033] Compared to conventional solutions, the terminal device of this embodiment is equipped with two headphone jacks, namely a first headphone jack and a second headphone jack. The audio channel pins of the first headphone jack and the second headphone jack are connected in parallel to the audio output of the audio codec chip. This ensures that when headphones are connected to the first headphone jack and / or the second headphone jack, the headphones can receive audio data provided by the audio codec chip, thereby achieving normal audio playback.
[0034] In some exemplary embodiments, the main control chip can separately control the on-off connection between the microphone pin of the first headphone jack and the audio output end of the audio codec chip, as well as the on-off connection between the microphone pin of the first headphone jack and the audio output end of the audio codec chip through a logic switch, thereby ensuring that the microphone of the headset can transmit audio data to the audio codec chip through the headphone jack into which it is inserted when needed, so as to achieve normal audio recording.
[0035] To sum up, based on the terminal device of this embodiment, the first headphone socket and the second headphone socket can independently insert different types of headphones, such as headphones with microphones or headphones without microphones or other types of headphones, and the functions of both types of headphones can work normally, thereby improving the versatility of the headphone product.
[0036] Figure 2 is a schematic diagram of the structure of the terminal device for the audio channel of this embodiment. The audio channels of the terminal device can be divided into a left channel and a right channel. Here, the audio data output by the audio output terminal in the left channel is defined as HPH_L, and the audio data output by the right channel is defined as HPH_R.
[0037] Wherein: the left channel pin of the first headphone socket and the left channel pin of the second headphone socket are connected in parallel to the audio output end corresponding to the left channel of the audio decoder chip, and can receive the HPH_L signal at the same time.
[0038] The right channel pin of the first headphone socket and the right channel pin of the second headphone socket are connected in parallel to the audio output end corresponding to the right channel of the audio decoder chip, and can receive the HPH_R signal at the same time.
[0039] In addition, a signal amplifier may be provided on the audio decoder chip, which can be used to perform signal gain or signal reduction on HPH_L and HPH_R.
[0040] Figure 3 is a schematic diagram of the circuit structure of the terminal device of this embodiment. The terminal device may include: a first plug-in detector provided on the audio codec chip and a second plug-in detector implemented by the main control chip based on a reserved port.
[0041] The plug detection pin of the first headphone socket is connected to the first plug detector on the audio codec chip. The first plug detector can detect the plug of the first headphone socket according to the high and low level changes of the Headset_int1 signal in the circuit it is connected to.
[0042] Similarly, the plug detection pin of the second headphone jack is connected to the second plug detector of the main control chip. The second plug detector can perform plug detection on the second headphone jack according to the high and low level changes of the Headset_int2 signal in its connected circuit.
[0043] In addition, the terminal device may further include: a device detector provided on the audio codec chip.
[0044] The main control chip can, when it is determined that a device is plugged into the first headphone socket based on the plug-in detection result corresponding to the first headphone socket (i.e., the result of the plug-in detection operation performed by the first plug-in detector), control the logic switch to connect the microphone pin of the first headphone socket to the device detector to complete the device detection; and, when it is determined that a device is plugged into the second headphone socket based on the plug-in detection result corresponding to the second headphone socket (i.e., the result of the plug-in detection operation performed by the second plug-in detector), control the logic switch to connect the microphone pin of the second headphone socket to the device detector to complete the device detection. The device detection mentioned here refers to the identification of different types of connected devices, such as headphones with microphones, headphones without microphones, selfie sticks, extension cables, etc.
[0045] The following is a detailed introduction to the control of the main control chip in combination with the specific circuit structure of the logic switch.
[0046] 3 , the logic switch of this embodiment may include: a first switch S1 , a second switch S2 , a third switch S3 , and a fourth switch S4 .
[0047] Among them: S1 and S2 are arranged on the circuit between the microphone pin of the first headphone jack and the device detector; in addition, S2 is also arranged on the circuit between the microphone pin of the first headphone jack and the audio output end, and on the circuit between the microphone pin of the first headphone jack and the microphone (MIC) power supply of the audio codec chip.
[0048] S4 and S3 are arranged on the circuit between the microphone pin of the second headphone jack and the device detector; in addition, S4 is also arranged on the circuit between the microphone pin of the second headphone jack and the audio output end, and on the circuit between the microphone pin of the second headphone jack and the MIC power supply of the audio codec chip.
[0049] Correspondingly, the main control chip implements switch control of S1-S4 through its reserved ports and can achieve the following functions:
[0050] 1. Equipment detection and control
[0051] 1) If, based on the plug-in / unplug detection result corresponding to the first headphone jack, it is determined that a device is plugged into the first headphone jack, S1 and S2 are controlled to close, and S3 is controlled to open. At this point, the microphone of the first headphone jack is connected to the MIC power supply Vmic_bias via pull-up resistors R1 and R2, and the microphone pin of the first headphone jack is connected to the device detector to complete device detection. However, if S3 is open, the microphone pin of the second headphone jack is not connected to the device detector.
[0052] 2) If, based on the plug-in / unplug test result corresponding to the second headphone jack, it is determined that a device is plugged into the second headphone jack, S3 and S4 are controlled to close, and S1 is controlled to open. At this point, the microphone of the second headphone jack is connected to the MIC power supply Vmic_bias via pull-up resistors R1 and R2, and the microphone pin of the second headphone jack is connected to the device detector to complete device detection. However, the microphone pin of the first headphone jack is not connected to the device detector when S1 is open.
[0053] 2. Microphone Enable Control
[0054] 1) When a device detection result corresponding to the first headphone jack indicates that no headphones with microphones are connected to the first headphone jack, or when a first microphone disable instruction initiated for the first headphone jack is received, controlling S1 and S2 to be disconnected to block the microphone pin of the first headphone jack from being connected to the audio output terminal;
[0055] 2) When the device detection result corresponding to the second headphone jack indicates that no headphones with microphones are connected to the second headphone jack, or when a second microphone disable instruction initiated for the second headphone jack is received, S3 and S4 are controlled to be disconnected to block the microphone pin of the second headphone jack from being connected to the audio output end.
[0056] Based on the above logic switch design, when a single headphone is in use, after detecting the insertion of a headphone via Headset_int1 or Headset_int2, the microphone power supply Vmic_bias is powered on and switches S1S2 or S3S4 are closed. Headmic_in_det is used to determine the headphone type: a 3-way, 4-way, selfie stick, or extension cable. When headphones are plugged into both jacks, switches S1 / S2 or S3 / S4 are controlled to close in the order in which the headphones were plugged in, respectively, to detect the type of the two headphones. If one of the headphones is a 3-way headphone, the corresponding switch is controlled to open. If both headphones are 3-way headphones, all four switches are opened. If both headphones are 4-way headphones, all four switches are closed, powering both headphone microphones and enabling key detection for both 4-way headphones. At this time, resistors R3 and R4 act to isolate the MIC signals of the two headphones.
[0057] Figure 4 shows the circuit control diagram for inserting a second headphone after a three-segment headphone has already been inserted. When the second headphone is inserted, the corresponding switch (S1 / S2 or S3 / S4) for the first headphone is opened, and the corresponding switch (S1 / S2 or S3 / S4) for the second headphone is closed, initiating device detection for the second headphone. If the second headphone is determined to be a three-segment headphone, the corresponding switch (S1S2 or S3S4) for the second headphone is opened; if the second headphone is determined to be a four-segment headphone, the corresponding switch (S1S2 or S3S4) for the second headphone remains closed.
[0058] Figure 5 illustrates the detection control flow for inserting a second earphone after a four-band headphone has already been inserted. When the second earphone is inserted, the corresponding switch (S1 or S3) for the first earphone is opened, and the corresponding switch (S1 / S2 or S3 / S4) for the second earphone is closed, initiating device detection for the second earphone. If the second earphone is determined to be a three-band headphone, the corresponding switch (S1S2 or S3S4) for the second earphone is opened; if the second earphone is determined to be a four-band headphone, the corresponding switch (S1S2 or S3S4) for the second earphone remains closed.
[0059] In addition, as shown in FIG3 , the audio decoder chip may also be provided with a mixer. The mixer is used to, when the microphone pin of the first headphone jack and the microphone pin of the second headphone jack are simultaneously connected to the audio input terminal, synthesize the audio data collected by the microphone pin corresponding to the first headphone jack and the audio data collected by the microphone pin corresponding to the second headphone jack, and output the synthesized audio data to the audio input terminal, thereby simultaneously recording two headphones with microphones.
[0060] In addition, as shown in FIG2 , the audio decoder chip may also be provided with a signal amplifier. The signal amplifier is used to perform signal gain or signal loss on the audio data output by the audio output terminal to ensure that when different headphones are connected to the first headphone jack and the second headphone jack, or when the connection is changed, power compensation is achieved to avoid a large volume difference between the two headphones.
[0061] The signal amplifier of this embodiment can determine the changes in the headphone type and number of headphones through headphone impedance detection, and automatically call the signal gain parameters of a single headphone or two headphones, thereby bringing a better experience to the user.
[0062] The following is a detailed introduction to the adjustment of signal gain parameters by the signal amplifier.
[0063] FIG6 is a schematic diagram of the working logic of the signal booster according to this embodiment, which is applied to the scenario where a single headphone is inserted into a dual headphone is inserted into the device, and may include:
[0064] Step S602: When only one of the first headphone socket and the second headphone socket is plugged into a device, read the left channel impedance or the right channel impedance to compare with a preset theoretical impedance of a mono headphone to determine the type of the plugged in device.
[0065] Among them, this embodiment can determine that there are devices inserted into the first headphone socket and the second headphone socket for transmission and reception based on the plug-in and unplugging detection operations corresponding to the first headphone socket and the second headphone socket, which will not be repeated later.
[0066] Step S604: When it is determined that the type of the inserted device is a headphone, and when the first headphone jack and the second headphone jack are both inserted with devices instead of one of them being inserted with a device, the left channel impedance or the right channel impedance is re-read to compare with the preset theoretical impedance of a mono headphone to determine whether the types of the devices inserted into the first headphone jack and the second headphone jack are both headphones.
[0067] Step S606, when it is determined that the types of the devices correspondingly inserted into the first earphone socket and the second earphone socket are both earphones, perform signal gain on the audio data output by the audio output end; wherein, the amplitude of the signal gain is determined based on the ratio between the actually read channel impedance and the newly read channel impedance.
[0068] As an exemplary introduction, taking the change from single-device insertion to dual-device insertion as an example, as shown in FIG. 7:
[0069] In the case of single-device insertion, first read the impedances R_HPH1 of the left and right channels. If R_HPH1 < R_REF1 is satisfied, it indicates that the currently connected device is an earphone, and at this time the signal booster uses the default signal gain parameters; if R_HPH1 < R_REF1 is not satisfied, it indicates that the currently connected device may be a selfie stick or an extension cable. Among them, R_REF1 is the discrimination threshold between the selfie stick or extension cable and the impedance of a normal earphone, such as a large impedance value of 10kohm or 20Kohm.
[0070] In the case of a second device being inserted, at this time read the impedances R_HPH2 of the left and right channels again. When the first device is an earphone, determine the signal gain amplitude gain = 20lg(R_HPH1 / R_HPH2) to complete the signal gain according to gain; if the first device is a selfie stick or a long cable and R_HPH2 < R_REF1 is satisfied, it indicates that the second device is also an earphone, and at this time the signal booster uses the default signal gain parameters; if the first device is a selfie stick or a long cable and R_HPH2 < R_REF1 is not satisfied, and the inserted second device is also a selfie stick or an extension cable, the signal booster does not need to work at this time.
[0071] In addition, FIG. 8 is another schematic diagram of the working logic of the signal booster, which is applied to the scenario of changing from dual-earphone insertion to single-earphone insertion, and may include:
[0072] Step S802, when devices are inserted into both the first earphone socket and the second earphone socket, read the actual channel impedance to compare with the theoretically set impedance of a mono earphone to determine whether the types of the devices correspondingly inserted into the first earphone socket and the second earphone socket include earphones.
[0073] Step S804, when it is determined that the types of the devices correspondingly inserted into the first earphone socket and the second earphone socket include earphones, and the first earphone socket and the second earphone socket change from both having devices inserted to only one of them having a device inserted, re-read the actual channel impedance to compare with the theoretically set impedance of a mono earphone to determine the type of the device correspondingly inserted into the one of them.
[0074] Step S806, when it is determined that the type of the device corresponding to the inserted one is a headset, reduce the signal gain of the audio data output from the audio output terminal; wherein, the reduction amplitude of the signal gain is determined based on the ratio between the previously read actual channel impedance and the newly read actual channel impedance.
[0075] As an exemplary introduction, taking the change from dual-device insertion to single-device insertion as an example, refer to FIG. 9 as shown:
[0076] In the case of dual-device insertion, first read the left and right channel impedances R_HPH2 once. If R_HPH2 < R_REF1, it means that at least one of the two devices is a headset, and at this time the signal booster uses the default signal gain parameters; if R_HPH2 < R_REF1 is not satisfied, it means that both headset devices are selfie sticks or extension cords.
[0077] Next, if one device is unplugged, read the left and right channel impedances R_HPH1. If R_HPH1 < R_REF1, it means that the remaining device is a headset, and determine the reduction amplitude of the signal gain gain = 20lg(R_HPH1 / R_REF1) to adjust the signal gain according to the effect of gain; if R_HPH1 < R_REF1 is not satisfied, it means that the remaining device is a selfie stick or extension cord, and at this time the signal booster does not need to work.
[0078] In summary, when the signal booster in this embodiment changes from a single headset to dual headsets or from dual headsets to a single headset, it can automatically switch the appropriate signal gain parameters of the audio data, avoiding sudden changes in the headset sound and causing a poor user experience.
[0079] FIG. 10 is a schematic diagram of the control of the microphones of dual headset devices during a call on a terminal device.
[0080] If the used headsets are all three-segment headsets, that is, there is no microphone on the headset, the main microphone on the terminal is used at this time. If one of the headsets is a four-segment headset, the microphone on the four-segment headset is used by default.
[0081] If both headsets are four-segment headsets, the microphones on both headsets can be used. By default, both microphones work, and the mixer mixes the two audio channels. In addition, it is also possible to select to mute one of the headset microphones on the mute button of the call UI interface, and at this time the mixer only outputs the audio of one microphone.
[0082] The above is the introduction of the terminal device in this embodiment. It should be understood that since the traditional solution only configures one headset socket for the terminal device, the audio encoder chip usually only configures one plug-in detector and one device detector.
[0083] The terminal device of this embodiment can continue to use the existing audio encoder chip. That is, the audio encoder chip's built-in plug-in detector is used as the first plug-in detector, and the second plug-in detector is implemented by the main control chip through a reserved port. In addition, under the control of the main control chip's logic switch, the first and second headphone jacks can be connected to the device detector in a time-sharing manner to complete their respective device detection. The entire solution does not require any hardware changes to the audio encoder chip, and costs are controlled.
[0084] In addition, another embodiment of the present application further provides a method for processing audio data. FIG11 is a flow chart of the method for processing audio data, including:
[0085] Step S1102: When it is determined that a headset with a microphone is plugged into the first headset socket, a first microphone activation instruction is generated to control the microphone pin of the first headset socket to connect to the audio input end of the audio codec chip of the terminal device.
[0086] Step S1104: When it is determined that a headset with a microphone is plugged into the second headset socket, a second microphone activation instruction is generated to control the microphone pin of the second headset socket to connect to the audio input end of the audio codec chip of the terminal device.
[0087] It should be understood that the terminal device shown in FIG1 can serve as the execution subject of the audio data processing method of this embodiment, so the audio data processing method of this embodiment can also implement the steps shown in FIG6 and / or FIG8.
[0088] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Thus, this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0089] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0090] The above are merely examples of the present invention and are not intended to limit this specification. For those skilled in the art, various modifications and variations of this specification are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification shall be included within the scope of the claims of this specification. In addition, all other embodiments obtained by those of ordinary skill in the art without creative effort shall fall within the scope of protection of this document.
Claims
1. A terminal device, wherein: include: A first headphone socket, a second headphone socket, a logic switch, an audio codec chip and a main control chip; the channel pin of the first headphone socket and the channel pin of the second headphone socket are connected in parallel to the audio output end of the audio codec chip; Wherein, the main control chip is used for: When a headset with a microphone is inserted into the first headset socket, based on a first microphone activation instruction initiated for the first headset socket, controlling the logic switch to connect the microphone pin of the first headset socket to the audio input end of the audio codec chip; and / or, In the case where a headset with a microphone is inserted into the second headphone socket, based on a second microphone enabling instruction initiated for the second headphone socket, the logic switch is controlled to enable the microphone pin of the second headphone socket to be connected to the audio input terminal.
2. The terminal device according to claim 1, wherein: Also includes: A mixer provided on the audio codec chip; Wherein, the mixer is used for: When the microphone pin of the first headphone socket and the microphone pin of the second headphone socket are simultaneously connected to the audio input end, the audio data collected by the microphone pin corresponding to the first headphone socket and the audio data collected by the microphone pin corresponding to the second headphone socket are synthesized and output to the audio input end.
3. The terminal device according to claim 1, wherein: Also includes: Display screen; Among them, the display screen displays an interactive interface that can control the external device plugged into the first headphone socket or the second headphone socket, and the interactive interface is used to generate the first microphone activation instruction and / or the second microphone activation instruction based on user operation.
4. The terminal device according to claim 1, wherein: Also includes: A device detector disposed on the audio codec chip; Wherein, the main control chip is also used for: When it is determined that a device is plugged into the first headphone socket according to the plug-in and unplug-out detection operation corresponding to the first headphone socket, the logic switch is controlled to connect the microphone pin of the first headphone socket to the device detector to complete the device detection, and the device detection result corresponding to the first headphone socket is used to indicate whether a headphone with a microphone is plugged into the first headphone socket; and / or, When it is determined according to the plug-in and unplug-out detection operation corresponding to the second headphone socket that a device is plugged into the second headphone socket, the logic switch is controlled to connect the microphone pin of the second headphone socket to the The device detector is input to complete device detection, and the device detection result corresponding to the second headphone socket is used to indicate whether a headphone with a microphone is inserted into the second headphone socket.
5. The terminal device according to claim 4, wherein: The logic switch includes a first switch, a second switch, a third switch and a fourth switch; Among them, the first switch and the second switch are arranged on the circuit between the microphone pin of the first headphone socket and the device detector, and the second switch is arranged on the circuit between the microphone pin of the first headphone socket and the audio output end; the fourth switch and the third switch are arranged on the circuit between the microphone pin of the second headphone socket and the device detector, and the fourth switch is arranged on the circuit between the microphone pin of the second headphone socket and the audio output end.
6. The terminal device according to claim 5, wherein: The control chip is also used for: When it is determined that a device is plugged into the first headphone socket according to the plug-in and unplug-out detection operation corresponding to the first headphone socket, the first switch and the second switch are controlled to be closed, and the third switch is controlled to be opened, so that the microphone pin of the first headphone socket is connected to the device detector to complete the device detection; and / or, When it is determined that a device is plugged into the second headphone socket according to the plug-in and unplug-out detection operation corresponding to the second headphone socket, the third switch and the fourth switch are controlled to be closed, and the first switch is controlled to be opened, so that the microphone pin of the second headphone socket is connected to the device detector to complete the device detection.
7. The terminal device according to claim 5, wherein: The control chip is also used for: When the device detection result corresponding to the first headphone socket indicates that the first headphone socket is not connected to a headphone with a microphone, or when a first microphone disabling instruction initiated for the first headphone socket is received, controlling the first switch and the second switch to be disconnected to block the microphone pin of the first headphone socket from being connected to the audio output end; and / or When the device detection result corresponding to the second headphone socket indicates that the second headphone socket is not connected to headphones with microphones, or when a second microphone disabling instruction initiated for the second headphone socket is received, the third switch and the fourth switch are controlled to be disconnected to block the microphone pin of the second headphone socket from being connected to the audio output end.
8. The terminal device according to any one of claims 4 to 7, wherein: Also includes: A signal amplifier provided on the audio codec chip; The signal amplifier is used for: When it is determined that only one of the first headphone socket and the second headphone socket has a device plugged in according to the plugging and unplugging detection operations corresponding to the first headphone socket and the second headphone socket, reading the impedance of the left channel or the right channel to compare with a preset theoretical impedance of a mono headphone to determine the type of the plugged in device; After determining that the type of the inserted device is a headphone, determining, according to the new plug-in and unplug-out detection operations corresponding to the first headphone socket and the second headphone socket, that the first headphone socket and the second headphone socket are both plugged with devices instead of one of them being plugged with a device being plugged in, re-reading the left channel impedance or the right channel impedance to compare with a preset theoretical impedance of a mono headphone, and determining whether the types of the devices plugged into the first headphone socket and the second headphone socket are both headsphones; When it is determined that the types of devices inserted into the first headphone socket and the second headphone socket are both headphones, signal gain is performed on the audio data output by the audio output end; wherein the amplitude of the signal gain is determined based on the ratio between the actual channel impedance previously read and the actual channel impedance re-read.
9. The terminal device according to claim 8, in, Wherein, the signal amplifier is also used for: When it is determined that devices are plugged into both the first headphone socket and the second headphone socket according to the plugging and unplugging detection operations corresponding to the first headphone socket and the second headphone socket, an actual channel impedance is read to compare with a preset theoretical impedance of a mono headphone to determine types of devices plugged into the first headphone socket and the second headphone socket; After determining that the types of devices corresponding to the first headphone socket and the second headphone socket include headphones, determining that the first headphone socket and the second headphone socket are changed from both being plugged with devices to only one of them being plugged with a device according to new plug-in and plug-out detection operations corresponding to the first headphone socket and the second headphone socket, re-reading the actual channel impedance to compare with the preset theoretical impedance of the mono headphone to determine the type of the device corresponding to the one of them; When it is determined that the type of device inserted into one of the devices is headphones, the signal gain of the audio data output from the audio output terminal is reduced; wherein the extent of the reduction in the signal gain is determined based on the ratio between the actual channel impedance previously read and the actual channel impedance re-read.
10. A method for processing audio data, applied to a terminal device comprising a first headphone socket and a second headphone socket, wherein: include: When it is determined that a headset with a microphone is inserted into the first headset socket, a first microphone start instruction is generated to control the microphone pin of the first headset socket to be connected to the audio input end of the audio codec chip of the terminal device; and / or, When it is determined that a headset with a microphone is inserted into the second headset socket, a second microphone start instruction is generated to control the microphone pin of the second headset socket to connect to the audio input end of the audio codec chip of the terminal device.
11. The method according to claim 10, wherein: Also includes: When only one of the first headphone socket and the second headphone socket is plugged with a device, reading the impedance of the left channel or the right channel to compare with a preset theoretical impedance of a mono headphone to determine the type of the plugged in device; When it is determined that the type of the inserted device is a headset, and the first headset socket and the second headset socket are changed from one of which is plugged with a device to both of which are plugged with devices, re-read the left channel impedance or the right channel impedance to compare with a preset theoretical impedance of a mono headset, to determine whether the types of the devices plugged into the first headset socket and the second headset socket are both headsets; When it is determined that the types of devices inserted into the first headphone socket and the second headphone socket are both headphones, signal gain is performed on the audio data output by the audio output end; wherein the amplitude of the signal gain is determined based on the ratio between the actual channel impedance previously read and the actual channel impedance re-read.
12. The method according to claim 10, wherein: Also includes: When devices are both plugged into the first headphone socket and the second headphone socket, the actual channel impedance is read to compare with the preset theoretical impedance of the mono headphone to determine whether the types of devices plugged into the first headphone socket and the second headphone socket include headphones; When it is determined that the types of devices corresponding to the first headphone socket and the second headphone socket include headphones, and the first headphone socket and the second headphone socket are changed from both being plugged with devices to only one of them being plugged with a device, re-reading the actual channel impedance to compare it with the preset theoretical impedance of the mono headphone to determine the type of the device corresponding to the one of them; When it is determined that the type of device inserted into one of the devices is headphones, the signal gain of the audio data output from the audio output terminal is reduced; wherein the extent of the signal gain reduction is determined based on the ratio between the actual channel impedance previously read and the actual channel impedance re-read.
Citation Information
Patent Citations
Audio play device and volume control method for same
CN102855905A
Device for receiving and transmitting audio signals
CN106331945A
Method and device for audio output
CN106358125A
Audio signal output method for terminal and terminal
CN107277667A
Terminal having plural audio signal output ports and audio signal output method thereof
US20130185639A1