Audio plug type detection

Systems and methods for audio plug type detection excursion are described. In some embodiments, a method may include: receiving an audio plug at an audio jack; grounding a sleeve terminal of the audio jack; applying an electrical current to a second ring terminal of the audio jack; and measuring a voltage between the second ring terminal and the sleeve terminal. In other embodiments an electronic circuit may include a controller and a memory coupled to the controller, the memory having program instructions stored thereon that, upon execution by the controller, cause the controller to: ground a sleeve terminal of an audio jack; apply an electrical current to a second ring terminal of the audio jack; and measure a voltage between the second ring terminal and the sleeve terminal.

TECHNICAL FIELD

This specification is directed, in general, to electronics, and, more specifically, to systems and methods for audio plug type detection.

BACKGROUND

In recent years, consumer electronic devices such as cell phones, portable media players, tablets, laptops, desktops, televisions, navigation systems, etc. have become ubiquitous. These devices often include an audio jack through which they receive and/or provide audio signals. Generally speaking, an audio jack is configured to receive an audio plug that is connected through electrical wires or cables to a stereo, receiver, speakers, headphones, etc.

Audio plugs can have any number of ring-shaped contacts, terminals, or poles along their lengths. A common type of audio plug is the TRS type, with “Tip,” “Ring,” and “Sleeve” terminals, in that order. Traditional TRS-type plugs carry the left channel (tip), right channel (ring), and ground (sleeve).

Another common type of audio plug is the TRRS type, with “Tip,” “first Ring,” “second Ring,” and “Sleeve” terminals, which may have different configurations: standard or Open Mobile Terminal Platform (OMTP). Contacts for a standard plug include the left channel (tip), right channel (first ring), ground (second ring), and microphone (sleeve). In an OMTP plug, the tip and first ring terminals also carry the left and right channels, respectively, but the second ring is a microphone contact and the sleeve terminal has the ground contact—i.e., the last two terminals are reversed relative to the standard plug.

Because a user may connect any type of audio plug to the same jack, detection circuitry has been developed to determine which type of audio plug is inserted.

Conventional plug detection is achieved by grounding the tip terminal, injecting a small electrical current first onto the second ring terminal (first detection), and then onto the sleeve terminal (second detection). A three-bit Analog-to-Digital (ADC) circuit measures the voltage on the second ring and sleeve terminals to convert the detected impedance to a digital value. If the impedance of the second ring is equal to the impedance of the sleeve terminal, the plug type is determined to be a 3-pole plug. Otherwise, if the impedance of the second ring is smaller than the sleeve impedance, the plug type is determined to be a 4-pole standard plug, and if the impedance of the second ring is greater than the sleeve impedance, the plug type is a 4-pole OMTP plug.

The inventors hereof have identified a number of problems with the aforementioned technique. For example, the dynamic range of the ADC needs to be wide enough to account for worst case headset resistance and worst case microphone resistance. Also, the Least-Significant-Bit (LSB) size needs to be small enough to account for minimum microphone resistance. For example, a 3-pole headset may be incorrectly detected as 4-pole if headset's resistance falls right at bin boundary of the ADC.

SUMMARY

Systems and methods for audio plug type detection are described. In an illustrative, non-limiting embodiment, a method may include receiving an audio plug at an audio jack; grounding a sleeve terminal of the audio jack; applying an electrical current to a second ring terminal of the audio jack; and measuring a voltage between the second ring terminal and the sleeve terminal. In many situations, the audio jack is of an unknown type. For example, the electrical current may be of the order of 1 μA.

The method may also include, in response to the magnitude of the voltage being approximately zero, determining that the audio plug is a 3-pole type. Additionally or alternatively, the method may include, in response to a magnitude of the voltage being greater than zero, determining that the audio plug is a 4-pole type. For example, the voltage may be of the order of 500 mV.

The method may further comprise grounding a tip terminal of the audio plug; applying another electrical current to the sleeve terminal and to the second ring terminal of the audio plug; measuring a first voltage between the sleeve terminal and the tip terminal; and measuring a second voltage between the second ring terminal and the tip terminal.

In some cases, applying the other electrical current may include concurrently applying the other current to the sleeve terminal and to the second ring terminal. The other electrical current may be of the order of 1 μA, and a difference between the first and second voltages may be of the order of 200 mV.

In response to a magnitude of the first voltage being greater than a magnitude of the second voltage, the method may include determining that the audio plug is a standard 4-pole audio plug. In response to a magnitude of the first voltage being smaller than a magnitude of the second voltage, the method may include determining that the audio plug is an Open Mobile Terminal Platform (OMTP) 4-pole audio plug.

In another illustrative, non-limiting embodiment an electronic circuit may include a controller; and a memory coupled to the controller, the memory having program instructions stored thereon that, upon execution by the controller, cause the controller to: ground a sleeve terminal of an audio jack; apply an electrical current to a second ring terminal of the audio jack; and measure a voltage between the second ring terminal and the sleeve terminal.

The program instructions, upon execution, may further cause the controller to, in response to the magnitude of the voltage being approximately zero, determine that the audio plug is a 3-pole type. Additionally or alternatively, the program instructions, upon execution, may further cause the controller to, in response to a magnitude of the voltage being greater than zero, determine that the audio plug is a 4-pole type. Additionally or alternatively, the program instructions, upon execution, may further cause the controller to ground a tip terminal of the audio plug; concurrently apply another electrical current to the sleeve terminal and to the second ring terminal of the audio plug; measure a first voltage between the sleeve terminal and the tip terminal; and measure a second voltage between the second ring terminal and the tip terminal.

The program instructions, upon execution, may further cause the controller to, in response to a magnitude of the first voltage being greater than a magnitude of the second voltage, determine that the audio plug is a standard 4-pole audio plug. Additionally or alternatively, the program instructions, upon execution, may further cause the controller to, in response to a magnitude of the first voltage being smaller than a magnitude of the second voltage, determine that the audio plug is an OMTP 4-pole audio plug.

In yet another illustrative, non-limiting embodiment, an audio device may include an audio jack configured to receive an audio plug of an unknown type; and an electronic circuit coupled to the audio jack, the electronic circuit configured to: ground a sleeve terminal of the audio jack; apply an electrical current to a second ring terminal of the audio jack; measure a voltage between the second ring terminal and the sleeve terminal; and at least one of: in response to the magnitude of the voltage being approximately zero, determine that the audio plug is a 3-pole type, or in response to a magnitude of the voltage being greater than zero, determine that the audio plug is a 4-pole type.

The electronic circuit may be further configured to: ground a tip terminal of the audio plug; concurrently apply another electrical current to the sleeve terminal and to the second ring terminal of the audio plug; measure a first voltage between the sleeve terminal and the tip terminal; measure a second voltage between the second ring terminal and the tip terminal; and at least one of: in response to a magnitude of the first voltage being greater than a magnitude of the second voltage, determine that the audio plug is a standard 4-pole audio plug, or in response to a magnitude of the first voltage being smaller than a magnitude of the second voltage, determine that the audio plug is an OMTP 4-pole audio plug.

DETAILED DESCRIPTION

The invention(s) now will be described more fully hereinafter with reference to the accompanying drawings. The invention(s) may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention(s) to a person of ordinary skill in the art. A person of ordinary skill in the art may be able to use the various embodiments of the invention(s).

In many implementations, some of the systems and methods disclosed herein may be incorporated into a wide range of audio-enabled electronic devices including, for example, computer systems, portable audio systems, consumer electronics, automotive systems, and professional audio equipment.

Examples of consumer electronics include television sets, A/V receivers, home theater or sound systems, set-top boxes, docking stations, soundbars, sound projectors, etc. Examples of portable audio systems include tablets, smartphones, media players, camcorders, etc. Examples of automotive audio systems include audio distribution, infotainment, in-seat entertainment, etc. Examples of professional audio systems include recording, live and installation sound, musical instruments, etc. It should be noted, however, that these examples are not limiting, but only demonstrative of the various types of systems which may incorporate the present embodiments, and that additional applications may be possible. More generally, these systems and methods may be incorporated into any device or system having one or more electronic audio parts or components.

Turning toFIG. 1, a diagram of an environment where certain systems and methods described herein may be implemented is depicted. As illustrated, one or more devices or systems such as, for example, automobile102, loudspeakers103, A/V receiver104, and/or audio recording equipment105(or any other audio-enabled device or system) may include printed circuit board (PCB)101having electronic circuit100mounted thereon. In some embodiments, electronic circuit100may include one or more analog, digital, and/or mixed signal integrated circuits (ICs) configured to perform loudspeaker protection against excessive excursion, as discussed in more detail below.

In one embodiment, electronic circuit100may include an electronic component package configured to be mounted onto PCB101using a suitable packaging technology such as Ball Grid Array (BGA) packaging, pin mount packaging, or the like. In some applications, PCB101may be mechanically mounted within or fastened onto the electronic device. In other implementations, however, PCB101may take a variety of forms and/or may include a plurality of other elements or components in addition to electronic circuit100. Moreover, in some embodiments, PCB101may not be used, and electronic circuit100may be integrated with other components of the electronic device without PCB101.

Examples of IC(s) include a System-On-Chip (SoC), an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), a processor, a microprocessor, a controller, a Microcontroller Unit (MCU), or the like. Additionally, IC(s) may include a memory circuit or device such as a Random Access Memory (RAM) device, a Static RAM (SRAM) device, a Magnetoresistive RAM (MRAM) device, a Nonvolatile RAM (NVRAM), and/or a Dynamic RAM (DRAM) device such as Synchronous DRAM (SDRAM), a Double Data Rate (DDR) RAM, an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable ROM (EEPROM), etc. IC(s) may also include one or more mixed-signal or analog circuits, such as, for example, Analog-to-Digital Converter (ADCs), Digital-to-Analog Converter (DACs), Phased Locked Loop (PLLs), oscillators, filters, amplifiers, etc.

As such, electronic circuit100may include a number of different portions, areas, or regions. These various portions may include one or more processing cores, cache memories, internal bus(es), timing units, controllers, analog sections, mechanical elements, etc.

Although the example ofFIG. 1shows electronic circuit100in monolithic form, it should be understood that, in alternative embodiments, various systems and methods described herein may be implemented with discrete components. For example, in some cases, one or more discrete capacitors, inductors, transformers, transistors, registers, logic gates, etc. may be physically located outside of electronic circuit100(e.g., elsewhere on PCB101).

FIG. 2is a block diagram of an example of audio plug type detection circuit200residing within electronic circuit100ofFIG. 1. As illustrated, detection circuit200includes input(s)/output(s)201, audio input/output jack202, audio processor203, and audio codec204. Components201,203, and204may be operably coupled to one another via Inter-IC Sound (I2S) bus205or other suitable bus. Also, in some devices, detection circuit200may be coupled to timing circuit206, processing cores207A-N, memory208, and/or input/output (I/O) interface(s)210via bus209. In some cases, components206-210may be a part of another device (e.g., a computer, etc.) that is hosting audio circuit200.

It should be noted that different bus standards may be used to facilitate communication between different ones of the aforementioned components and/or between detection circuit200and components206-210. Moreover, in some cases, one or more of these components may be directly coupled to each other or embedded within each other (e.g., audio processor203may include audio codec204). As such, it should be understood the particular configurations of audio circuit200and other components shown inFIG. 2are provided for illustration purposes only, and that other configurations are possible.

In operation, audio processor203may act either independently or under command of processor core(s)207A-N to control one or more of components201-204(e.g., via I2S205) in order to implement certain systems and methods for audio plug type detection. Audio codec204may implement one or more algorithms that compress and/or decompress audio data according to a given audio file format or streaming media audio format.

Processor core(s)207A-N may be any general-purpose or embedded processor(s) implementing any of a variety of Instruction Set Architectures (ISAs), such as the x86, RISC®, PowerPC®, ARM®, etc. In multi-processor systems, each of processor core(s)210A-N may commonly, but not necessarily, implement the same ISA.

Memory208may include for example, a RAM, a SRAM, MRAM, a NVRAM, such as “FLASH” memory, and/or a DRAM, such as SDRAM, a DDR RAM, an EPROM, an EEPROM, etc.

Bus209may be used to couple master and slave components together, for example, to share data or perform other data processing operations. In various embodiments, bus209may implement any suitable bus architecture, including, for instance, Advanced Microcontroller Bus Architecture® (AMBA®), CoreConnect™ Bus Architecture™ (CCBA™), etc. Additionally or alternatively, bus209may be absent and timing circuit206or memory208, for example, may be integrated into processor core(s)207A-N.

In some embodiments, input(s)/output(s)201may include, for example, ADCs, DACs, Phased Locked Loop (PLLs), oscillators, filters, amplifiers, etc. Particularly, input(s)/output(s)201may include one or more analog or digital input circuits configured to receive and/or preprocess, analog or digital audio signals (e.g., from a microphone, a line-in connection, an optical source, an S/PDIF line, etc.). In addition, input(s)/output(s)201may include one or more analog or digital output circuits configured to provide or output analog or digital audio signals to other devices, such as, for example, a loudspeaker, headphone, a line-out connection, an optical line, an S/PDIF line, etc.).

Audio jack202includes a cylindrical opening configured to receive an audio plug of one of a plurality of different types. Along the internal walls of the opening are four contacts211at positions corresponding to the tip (T), first Ring (R), second Ring (R), and sleeve (S) terminals of a TRRS audio plug, when one is inserted into the opening. Each of these four contacts211is electrically coupled to input(s)/output(s)201.

In various embodiments, modules or blocks shown inFIG. 2may represent processing circuitry, logic functions, and/or data structures. Although these modules are shown as distinct blocks, in other embodiments at least some of the operations performed by these modules may be combined in to fewer blocks. Conversely, any given one of the modules ofFIG. 2may be implemented such that its operations are divided among two or more logical blocks. Although shown with a particular configuration, in other embodiments these various modules or blocks may be rearranged according to other suitable embodiments.

FIG. 3are diagrams of examples of various audio plug types detectable according to some embodiments; and which show: TRS audio plug (3-pole)300A and corresponding contact diagram300B, TRRS audio plug (4-pole)301A, contact diagram301B for a standard TRRS audio plug, and contact diagram301C for an Open Mobile Terminal Platform (OMTP) TRRS audio plug.

TRS plug300A includes a Tip, Ring, and Sleeve contacts or terminals. Diagram300B shows that TRS plug300A carries the left audio channel at the Tip (L) and the right audio channel at the Ring (R), while the Sleeve terminal (G) is grounded. Also, a first impedance of approximately 16 to 1.5 kΩ between the Tip (L) and the Sleeve (G) represent a left speaker (e.g., of a headphone), and a second impedance of same value between the Ring (R) and the Sleeve (G) represent a right speaker.

TRRS plug301A includes a Tip, First Ring, Second Ring, and Sleeve contacts or terminals. Diagram301B shows that a standard TRRS plug carries the left audio channel at the Tip (L) and the right audio channel at the First Ring (R), the Second Ring (G) is grounded, and the Sleeve terminal (M) carries the microphone channel. A first impedance of approximately 16 to 1.5 kΩ between the First Ring (R) and the Second Ring (G) represents a right speaker and a second impedance of same value between the Tip (L) and the Second Ring (G) represent a left speaker. At third impedance of approximately 600 to 3 kΩ between the Second Ring (G) and the Sleeve (M) represent a microphone.

Still referring to TRRS plug301A, diagram301C shows that an OMTP TRRS plug also carries the left audio channel at the Tip (L) and the right audio channel at the First Ring (R), but the Second Ring (M) carries the microphone channel and the Sleeve terminal (G) is grounded. A first impedance of approximately 16 to 1.5 kΩ between the Tip (L) and the Sleeve (G) represents a left speaker and a second impedance of same value between the First Ring (R) and the Sleeve (G) represent a right speaker. At third impedance of approximately 600 to 3 kΩ between the Second Ring (M) and the Sleeve (G) represent a microphone.

FIG. 4is a flowchart of method400for audio plug type detection. In various embodiments, method400may be performed in two stages, illustrated inFIGS. 5 and 6, in order to detect, for example, which of plugs300B,301B, or301C is inserted into jack202ofFIG. 2.

A first stage of detection is performed by blocks401-405. At block401, method400grounds a sleeve terminal of the audio jack. At block402, method400applies an electrical current to a second ring terminal of the audio jack. At block403, method400measures a voltage between the second ring terminal and the sleeve terminal.

This first stage is illustrated atFIG. 5, where diagram500B shows contacts211positioned relative to a TRS plug configuration with a current flowing from the Second Ring of contacts211to the ground terminal of plug300B. Diagram501B shows contacts211positioned relative to a standard TRRS plug configuration with a current flowing from the Second Ring of contacts211to the Microphone terminal (M) of plug301B through the microphone impedance. And diagram501C shows contacts211positioned relative to an OMTP TRRS plug configuration with a current also flowing from the Second Ring of contacts211to the Ground terminal (G) of plug301C, also through the microphone impedance.

At block404, method400makes an evaluation as to the magnitude of the measured voltage. In response to the magnitude of the voltage being approximately zero, block405determines that the audio plug is a 3-pole type. Conversely, in response to a magnitude of the voltage being greater than zero, method400determines that the audio plug is a 4-pole type, and moves on to a second stage of detection. In some implementations, the electrical current applied to the second ring of the audio jack may be of the order of 1 μA. The measured voltage may be either zero (in the case of TRS plug configuration500B) or it may be of the order of 500 mV (in the case of a TRRS plug configuration501B or501C).

In sum, the result of the first detection stage is a determination of whether the previously unknown audio plug is a 3-pole TRS plug or a 4-pole TRRS plug.

In a second, subsequent stage, method400grounds a tip terminal of the audio plug at block406. At block407, method400concurrently applies another electrical current to the sleeve terminal and to the second ring terminal of the audio plug. At block408, method400measures a first voltage between the sleeve terminal and the tip terminal. At block409, method400measures a second voltage between the second ring terminal and the tip terminal.

The second stage is illustrated atFIG. 6, diagram601B shows contacts211positioned relative to a standard plug configuration with a first current flowing from the Sleeve of contacts211to the ground terminal of plug301B through the microphone impedance, and a second current flowing from the Second Ring of contacts211to the ground terminal of plug301B. Diagram601C shows contacts211positioned relative to an OMTP plug configuration with a first current flowing from the Sleeve of contacts211to the ground terminal of plug301C, and a second current flowing from the Second Ring of contacts211to the ground terminal of plug301C through the microphone impedance.

At block410, method400makes yet another evaluation. In response to a magnitude of the first voltage being greater than a magnitude of the second voltage, block411determines that the audio plug is a standard 4-pole audio plug. Conversely, in response to a magnitude of the first voltage being smaller than a magnitude of the second voltage, block412determines that the audio plug is an OMTP 4-pole audio plug.

In some embodiments, the first and second currents are the same—e.g., 1 μA—and difference between the first and second voltages is of the order of approximately 200 mV.

Accordingly, the result of the second detection stage is a determination of whether the 4-pole TRRS plug, assuming one has been detected in the first detection stage, is a standard type or an OMTP type.

It should be understood that the various operations described herein, particularly in connection withFIGS. 4-6, may be implemented by processing circuitry or other hardware components. The order in which each operation of a given method is performed may be changed, and various elements of the systems illustrated herein may be added, reordered, combined, omitted, modified, etc. It is intended that this disclosure embrace all such modifications and changes and, accordingly, the above description should be regarded in an illustrative rather than a restrictive sense.

A person of ordinary skill in the art will appreciate that the various circuits depicted above are merely illustrative and is not intended to limit the scope of the disclosure described herein. In particular, a device or system configured to perform audio power limiting based on thermal modeling may include any combination of electronic components that can perform the indicated operations. In addition, the operations performed by the illustrated components may, in some embodiments, be performed by fewer components or distributed across additional components. Similarly, in other embodiments, the operations of some of the illustrated components may not be provided and/or other additional operations may be available. Accordingly, systems and methods described herein may be implemented or executed with other circuit configurations.

It will be understood that various operations discussed herein may be executed simultaneously and/or sequentially. It will be further understood that each operation may be performed in any order and may be performed once or repetitiously.

Many modifications and other embodiments of the invention(s) will come to mind to one skilled in the art to which the invention(s) pertain having the benefit of the teachings presented in the foregoing descriptions, and the associated drawings. Therefore, it is to be understood that the invention(s) are not to be limited to the specific embodiments disclosed. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.