An audio channel automatic switching circuit, method, device and storage medium are disclosed
By using an automatic audio channel switching circuit, which utilizes PMOS transistors and a control chip to identify the insertion or removal of speakers and microphones, automatic switching between USB sound cards and HDMI audio channels is achieved. This solves the problems of inconvenient switching and difficult identification in existing technologies, and improves efficiency and flexibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technology cannot achieve automatic switching of audio channels, resulting in the inability of USB sound cards and HDMI audio channels to switch automatically. In addition, USB sound cards have problems such as startup delay and inability to recognize speakers and microphones.
An automatic audio channel switching circuit is adopted, including an audio output terminal and an input terminal. Automatic switching is achieved through a PMOS transistor and a control chip. The level change of the PMOS transistor is used to identify the insertion or removal of the speaker and microphone, and the control chip automatically switches the audio channel according to the status information.
It enables automatic switching between USB sound card and HDMI audio channel, avoiding the hassle of manual switching, improving efficiency, and can flexibly identify speakers and microphones, solving startup delay and recognition problems.
Smart Images

Figure CN116233690B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of audio channel switching technology, and particularly relates to a circuit, method, device and storage medium for realizing automatic audio channel switching. Background Technology
[0002] In typical OPS (Open Pluggable Specification) computer environments, on the one hand, USB sound cards have higher priority. This means that even when no external devices are plugged in, the USB sound card remains the first priority channel, taking precedence over the HDMI audio channel. Furthermore, USB sound cards and HDMI audio cannot be used simultaneously. If HDMI audio is needed, it's generally necessary to manually switch to the HDMI audio channel, a process many users don't know how to do, often wasting considerable time and impacting efficiency. On the other hand, if using a USB sound card requires connecting external audio devices such as speakers and microphones, the USB sound card suffers from startup delays when external devices are connected, and the system cannot independently identify whether the external audio device is a speaker or a microphone, making it inflexible. Summary of the Invention
[0003] The purpose of this invention is to provide a circuit, method, apparatus, and storage medium for automatically switching audio channels, aiming to solve the problems that the prior art cannot provide a circuit for automatically switching audio channels, resulting in the inability to automatically switch between USB sound card input and HDMI audio channels, as well as the startup delay when using a USB sound card and the inability to individually identify speakers and microphones.
[0004] On one hand, the present invention provides a circuit for automatically switching audio channels, including an audio output terminal and an audio input terminal for connecting to a USB sound card. The circuit also includes a first PMOS transistor, a second PMOS transistor, a third PMOS transistor, and a fourth PMOS transistor, as well as a first VCC terminal, a first GND terminal, a second VCC terminal, and a second GND terminal. The gate of the first PMOS transistor is connected to the audio output terminal, the drain of the first PMOS transistor is connected to the gate of the second PMOS transistor and a first resistor, the other end of the first resistor is connected to the first VCC terminal, and the source of the first PMOS transistor is connected to the first GND terminal. The drain of the second PMOS transistor is connected to the control chip and the second resistor, respectively. The other end of the second resistor is connected to the first VCC terminal, and the source of the second PMOS transistor is connected to the first GND terminal. The gate of the third PMOS transistor is connected to the audio input terminal. The drain of the third PMOS transistor is connected to the gate of the fourth PMOS transistor and the third resistor, respectively. The other end of the third resistor is connected to the second VCC terminal, and the source of the third PMOS transistor is connected to the second GND terminal. The drain of the fourth PMOS transistor is connected to the control chip and the fourth resistor, respectively. The other end of the fourth resistor is connected to the second VCC terminal, and the source of the fourth PMOS transistor is connected to the second GND terminal.
[0005] Preferably, a body diode is provided between the drain and source of the first PMOS transistor, the second PMOS transistor, the third PMOS transistor, and the fourth PMOS transistor.
[0006] Preferably, the control chip has at least two GPIO pins, one of which is connected to the drain of the second PMOS transistor, and the other of which is connected to the drain of the fourth PMOS transistor.
[0007] Preferably, both the audio output and audio input interfaces are equipped with sensing pins, so that the audio output and audio input do not need to be connected to the USB sound card through the sensing pins.
[0008] Preferably, the audio output terminal is a speaker output terminal, and the audio input terminal is a microphone input terminal.
[0009] Preferably, the control chip is a PCH chip.
[0010] On the other hand, the present invention also provides a method for automatically switching audio channels, employing the circuit described in any of the above claims, the method comprising the following steps:
[0011] S1: The audio output terminal and / or audio input terminal feed back status information to the control chip;
[0012] S2: The control chip acquires status information and determines whether an external audio device is plugged into the USB sound card based on the status information;
[0013] S3: If no external audio device is plugged in, switch the audio channel to the HDMI channel; otherwise, switch the audio channel to the USB sound card channel.
[0014] Preferably, the USB sound card is equipped with an ID code, and the status information includes the ID code information.
[0015] On the other hand, the present invention also provides an automatic audio channel switching device, which includes the circuit described in any of the above claims. The device includes a 3.5mm audio interface, and both the audio output terminal and the audio input terminal are connected to a USB sound card through the 3.5mm audio interface.
[0016] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described above.
[0017] The beneficial effects of this invention are as follows: Unlike existing technologies, the automatic audio channel switching circuit of this invention includes an audio output terminal and an audio input terminal, both of which are connected to a USB sound card. The circuits connected to the audio output terminal and the audio input terminal are respectively equipped with dual P-channel MOSFETs. Unplugging or plugging a speaker and / or microphone into the USB sound card will cause a change in the level of the corresponding connected circuit, which makes it easy for the control chip to determine whether a speaker and / or microphone is plugged into the USB sound card. It can realize automatic switching between the USB sound card and HDMI audio channels. When no speaker and / or microphone is plugged into the USB sound card, HDMI is the priority channel, and no manual switching is required from the user. The switching is fast. When a speaker or microphone is plugged into the USB sound card, the control chip can recognize it accordingly, making it flexible to use. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of an audio channel automatic switching circuit provided in an embodiment of the present invention;
[0019] Figure 2 This is a flowchart illustrating the implementation of an automatic audio channel switching method according to an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0021] The specific implementation of the present invention will be described in detail below with reference to specific embodiments:
[0022] Example 1:
[0023] like Figure 1 As shown in the figure, an automatic audio channel switching circuit provided in Embodiment 1 of the present invention includes an audio output terminal 1 and an audio input terminal 2, which are used to connect to a USB sound card. It also includes a first PMOS transistor 3, a second PMOS transistor 4, a third PMOS transistor 5, and a fourth PMOS transistor 6, as well as a first VCC terminal, a first GND terminal, a second VCC terminal, and a second GND terminal. The gate of the first PMOS transistor 3 is connected to the audio output terminal 1, the drain of the first PMOS transistor 3 is connected to the gate of the second PMOS transistor 4 and a first resistor 7, the other end of the first resistor 7 is connected to the first VCC terminal, and the source of the first PMOS transistor 3 is connected to the first GND terminal. The drain of the second PMOS transistor 4 is connected to the control chip 20 and the second resistor 8, respectively. The other end of the second resistor 8 is connected to the first VCC terminal. The source of the second PMOS transistor 4 is connected to the first GND terminal. The gate of the third PMOS transistor 5 is connected to the audio input terminal 2. The drain of the third PMOS transistor 5 is connected to the gate of the fourth PMOS transistor 6 and the third resistor 9, respectively. The other end of the third resistor 9 is connected to the second VCC terminal. The source of the third PMOS transistor 5 is connected to the second GND terminal. The drain of the fourth PMOS transistor 6 is connected to the control chip 20 and the fourth resistor 10, respectively. The other end of the fourth resistor 10 is connected to the second VCC terminal. The source of the fourth PMOS transistor 6 is connected to the second GND terminal.
[0024] Specifically, such as Figure 1 As shown, the first PMOS transistor 3 and the second PMOS transistor 4 form a dual P-channel MOS transistor Q5, and the third PMOS transistor 5 and the fourth PMOS transistor 6 form a dual P-channel MOS transistor Q8. When the audio output terminal 1 and the audio input terminal 2 detect the insertion of a USB sound card external device, there will be a change in the level state. Through the two flips and isolations of the two dual P-channel MOS transistors Q5 and Q8, the input is given to the control chip 20. Q5 and Q8 mainly play the role of level isolation to prevent the level from burning out the control chip 20. The model of Q5 and Q8 is 2N7002-D-SOT363.
[0025] Specifically, in this embodiment, the control chip 20 is a PCH (Southbridge) chip. The PCH chip has at least two GPIO pins. One of the GPIO pins is connected to the drain of the second PMOS transistor 4, and the other GPIO pin is connected to the drain of the fourth PMOS transistor 6. The status information detected by the audio output terminal 1 and / or the audio input terminal 2 (the status information includes whether an external audio device is inserted into the USB sound card) is fed back to the PCH (Southbridge) chip through the GPIO pin. The PCH (Southbridge) chip then determines whether an external audio device is inserted into the USB sound card based on the obtained status information, and then performs audio channel switching: if no external audio device is inserted, the audio channel is switched to the HDMI channel; otherwise, the audio channel is switched to the USB sound card channel.
[0026] Specifically, in this embodiment, the audio output terminal 1 is a speaker output terminal, and the audio input terminal 2 is a microphone input terminal. Commonly used USB sound cards are equipped with speaker jacks and microphone jacks. Both the audio output terminal 1 and the audio input terminal 2 are connected to the USB sound card through a 3.5mm audio interface. When in use, the speaker and / or microphone can be directly inserted into the corresponding jacks. The speaker electrical signal is connected to the audio output terminal 1, and the microphone electrical signal is connected to the audio input terminal 2.
[0027] Specifically, in this embodiment, both the audio output terminal 1 and the audio input terminal 2 are provided with sensing pins. The audio output terminal 1 and the audio input terminal 2 are electrically connected to the control chip 20 through the sensing pins, thereby realizing the electrical connection between the control chip 20 and the speaker and / or microphone.
[0028] Furthermore, such as Figure 1As shown in the diagram, in this embodiment, a body diode is disposed between the drain and source of each of the first PMOS transistor 3, the second PMOS transistor 4, the third PMOS transistor 5, and the fourth PMOS transistor 6. Specifically, an integrated diode is disposed between the drain and source of the first PMOS transistor 3, with the anode of the body diode and the source of the first PMOS transistor 3 both connected to the first GND terminal, and the cathode of the body diode connected to the drain of the first PMOS transistor 3; an integrated diode is disposed between the drain and source of the second PMOS transistor 4, with the anode of the body diode and the source of the second PMOS transistor 4 connected to the first GND terminal. The source of each PMOS transistor 4 is connected to the first GND terminal, and the cathode of the body diode is connected to the drain of the second PMOS transistor 4. An integrated diode is disposed between the drain and source of the third PMOS transistor 5. The anode of the body diode and the source of the third PMOS transistor 5 are both connected to the second GND terminal, and the cathode of the body diode is connected to the drain of the third PMOS transistor 5. An integrated diode is disposed between the drain and source of the fourth PMOS transistor 6. The anode of the body diode and the source of the fourth PMOS transistor 6 are both connected to the second GND terminal, and the cathode of the body diode is connected to the drain of the fourth PMOS transistor 6.
[0029] Furthermore, such as Figure 1 As shown, the resistance of the first resistor R287 is 8.2K, the resistance of the second resistor R141 is 8.2K, the resistance of the third resistor R312 is 8.2K, and the resistance of the fourth resistor R307 is 8.2K.
[0030] Typically, playback devices have HDMI and USB sound card channels. The following example demonstrates an automatic audio channel switching circuit used in practical applications. Its working principle is as follows: When a speaker and / or microphone is plugged into the USB sound card, the speaker and / or microphone are electrically connected to the control chip 20 via audio output terminal 1 and / or audio input terminal 2, respectively. The circuits connected to audio output terminal 1 and / or audio input terminal 2 are at a low level, and the status information of audio output terminal 1 and / or audio input terminal 2 changes from "no device inserted" to "device inserted." Subsequently, audio output terminal 1 and / or audio input terminal 2 feeds back the detected status information to the control chip 20. The control chip 20 controls the audio channel to switch to the USB sound card channel. Conversely, when the speaker and / or microphone are unplugged from the USB sound card or are never plugged into the USB sound card, the circuit connected to the audio output terminal 1 and / or audio input terminal 2 is at a high level, and the status information of the audio output terminal 1 and / or audio input terminal 2 changes from "device inserted" to "no device inserted", or remains "no device inserted". Then, the audio output terminal 1 and / or audio input terminal 2 feeds back the detected status information to the control chip 20, and the control chip 20 controls the audio channel to switch to the HDMI channel.
[0031] Example 2:
[0032] like Figure 2 As shown, Embodiment 2 of the present invention provides a method for automatically switching audio channels, using the circuit described in Embodiment 1 above. The method includes the following steps:
[0033] S1: The audio output terminal and / or audio input terminal feed back status information to the control chip;
[0034] S2: The control chip acquires status information and determines whether an external audio device is plugged into the USB sound card based on the status information;
[0035] S3: If no external audio device is plugged in, switch the audio channel to the HDMI channel; otherwise, switch the audio channel to the USB sound card channel.
[0036] In practical applications, in step S1, both the audio output terminal 1 and the audio input terminal 2 are connected to the USB sound card via a 3.5mm audio interface. The external audio devices include a speaker and a microphone. The speaker is electrically connected to the audio output terminal 1, and the microphone is electrically connected to the audio input terminal 2. When the speaker and / or microphone are plugged into or not plugged into the USB sound card, the circuit states connected to the audio output terminal 1 and the audio input terminal 2 are different. Therefore, after the audio output terminal 1 and the audio input terminal 2 feed back the status information to the control chip 20, the control chip 20 can switch the audio channels of the USB sound card and HDMI according to the acquired status information.
[0037] Specifically, the control chip 20 in this embodiment is a PCH (Southbridge) chip.
[0038] In step S2, when the speaker and / or microphone are plugged into the USB sound card, the speaker and / or microphone are also electrically connected to the audio output terminal 1 and / or audio input terminal 2 through the 3.5mm audio interface. The circuit connected to the audio output terminal 1 and / or audio input terminal 2 is at a low level, and the status information of the audio output terminal 1 and / or audio input terminal 2 changes from "no device inserted" to "device inserted".
[0039] In step S2, when the speaker and / or microphone are unplugged from the USB sound card or are never plugged into the USB sound card, the circuit connected to the audio output terminal 1 and / or audio input terminal 2 is at a high level, and the status information of the audio output terminal 1 and / or audio input terminal 2 changes from "device inserted" to "no device inserted", or is always "no device inserted".
[0040] In step S3, if an external audio device is inserted, the control chip 20 switches the audio channel to the USB sound card channel according to the "device inserted" status information; otherwise, if no external audio device is inserted, the control chip 20 switches the audio channel to the HDMI channel according to the "no device inserted" status information.
[0041] The USB sound card in this embodiment is also equipped with an ID code. The status information includes the ID code information. The control chip 20 can determine the information of the connected USB sound card from the acquired status information, which is convenient for identifying and verifying different connected USB sound cards. It is applicable to a variety of USB sound card models and has a wide range of applications.
[0042] Example 3:
[0043] In Embodiment 3 of the present invention, an automatic audio channel switching device is provided, comprising the circuit described in Embodiment 1. The device includes a 3.5mm audio interface, and both the audio output and input terminals are connected to a USB sound card via the 3.5mm audio interface. It is used to implement the steps in the automatic audio channel switching method described in Embodiment 2 above, for example... Figure 2 Steps S1 to S3 are shown in the diagram.
[0044] In practical applications, the circuit described in Embodiment 1 is mounted on a development circuit board, which is also mounted in the device provided in Embodiment 3. The device further includes a 3.5mm audio interface, and the audio output and audio input terminals in Embodiment 1 are both connected to the USB sound card via the 3.5mm audio interface.
[0045] In use, the audio output terminal 1 and audio input terminal 2 can first sense whether an external audio device is plugged into the USB sound card. Based on the insertion status of the audio output terminal 1 and audio input terminal 2, they obtain status information. The audio output terminal 1 and audio input terminal 2 then feed the status information back to the control chip 20. The control chip 20 can switch the audio channels of the USB sound card and HDMI according to the obtained status information. The external audio devices include a speaker and a microphone. The speaker is electrically connected to the audio output terminal 1, and the microphone is electrically connected to the audio input terminal 2.
[0046] Example 4:
[0047] In Embodiment 4 of the present invention, a computer-readable storage medium is provided, which stores a computer program. When executed by a processor, the computer program implements the steps of the method for automatically switching audio channels described in Embodiment 1, for example... Figure 2 Steps S1 to S3 are shown in the diagram.
[0048] First, both the audio output terminal 1 and the audio input terminal 2 are connected to the USB sound card via a 3.5mm audio interface. The external audio devices include a speaker and a microphone. The speaker is electrically connected to the audio output terminal 1, and the microphone is electrically connected to the audio input terminal 2. When the speaker and / or microphone are plugged into or not plugged into the USB sound card, the circuit levels connected to the audio output terminal 1 and the audio input terminal 2 are different. Then, after the audio output terminal 1 and the audio input terminal 2 feed back the status information to the control chip 20, the control chip 20 can switch the audio channels of the USB sound card and HDMI according to the acquired status information.
[0049] When a speaker and / or microphone is plugged into the USB sound card, the speaker and / or microphone are also electrically connected to audio output terminal 1 and / or audio input terminal 2 via a 3.5mm audio interface. The circuit connected to audio output terminal 1 and / or audio input terminal 2 is at a low level, and the status information of audio output terminal 1 and / or audio input terminal 2 changes from "no device inserted" to "device inserted". Then, the control chip 20 switches the audio channel to the USB sound card channel according to the "device inserted" status information.
[0050] When the speaker and / or microphone are unplugged from the USB sound card or are never plugged into the USB sound card, the circuit connected to the audio output terminal 1 and / or audio input terminal 2 is at a high level, and the status information of the audio output terminal 1 and / or audio input terminal 2 changes from "device inserted" to "no device inserted", or remains "no device inserted". Then, the control chip 20 switches the audio channel to the HDMI channel according to the "no device inserted" status information.
[0051] The computer-readable storage medium of Embodiment 3 of the present invention may include any entity or device capable of carrying computer program code, a recording medium, such as ROM / RAM, disk, optical disk, flash memory, etc.
[0052] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A circuit for automatically switching audio channels, comprising an audio output terminal and an audio input terminal, wherein the audio output terminal and the audio input terminal are used to connect to a USB sound card, characterized in that: It also includes a first PMOS transistor, a second PMOS transistor, a third PMOS transistor, and a fourth PMOS transistor, as well as a first VCC terminal, a first GND terminal, a second VCC terminal, and a second GND terminal; the gate of the first PMOS transistor is connected to the audio output terminal, the drain of the first PMOS transistor is connected to the gate of the second PMOS transistor and a first resistor, the other end of the first resistor is connected to the first VCC terminal, the source of the first PMOS transistor is connected to the first GND terminal, the drain of the second PMOS transistor is connected to the control chip and a second resistor, the other end of the second resistor is connected to the first VCC terminal, and the source of the second PMOS transistor is connected to the first GND terminal; the gate of the third PMOS transistor is connected to the audio input terminal, and the drain of the third PMOS transistor is connected to the first PMOS transistor, the second PMOS transistor, the third PMOS transistor, the fourth PMOS transistor, the fifth PMOS transistor, the sixth PMOS transistor, the seventh PMOS transistor, the eighth PMOS transistor, the ninth PMOS transistor, the eleventh ... The gate of the fourth PMOS transistor is connected to the third resistor, the other end of which is connected to the second VCC terminal. The source of the third PMOS transistor is connected to the second GND terminal. The drain of the fourth PMOS transistor is connected to the control chip and the fourth resistor, the other end of which is connected to the second VCC terminal. The source of the fourth PMOS transistor is connected to the second GND terminal. The first and second PMOS transistors form a dual P-channel MOS transistor Q5, and the third and fourth PMOS transistors form a dual P-channel MOS transistor Q8. When the audio output and audio input terminals detect the insertion of a USB sound card external device, there will be a change in the level state. Through the two flips and isolation of the two dual P-channel MOS transistors Q5 and Q8, the signal is input to the control chip.
2. The automatic audio channel switching circuit as described in claim 1, characterized in that: A body diode is provided between the drain and source of the first PMOS transistor, the second PMOS transistor, the third PMOS transistor, and the fourth PMOS transistor.
3. The automatic audio channel switching circuit as described in claim 2, characterized in that: The control chip has at least two GPIO pins, one of which is connected to the drain of the second PMOS transistor, and the other of which is connected to the drain of the fourth PMOS transistor.
4. The automatic audio channel switching circuit as described in claim 1, characterized in that: Both the audio output and audio input interfaces are equipped with sensing pins, so the audio output and audio input do not need to be connected to the USB sound card through the sensing pins.
5. The automatic audio channel switching circuit as described in claim 1, characterized in that: The audio output terminal is a speaker output terminal, and the audio input terminal is a microphone input terminal.
6. The automatic audio channel switching circuit as described in any one of claims 1 to 5, characterized in that: The control chip is a PCH chip.
7. A method for automatically switching audio channels, employing the circuit described in any one of claims 1-6, characterized in that: The method includes the following steps: S1: The audio output terminal and / or audio input terminal feed back status information to the control chip; S2: The control chip acquires status information and determines whether an external audio device is plugged into the USB sound card based on the status information; S3: If no external audio device is plugged in, switch the audio channel to the HDMI channel; otherwise, switch the audio channel to the USB sound card channel.
8. The method for automatically switching audio channels as described in claim 7, characterized in that: The USB sound card is configured with an ID code, and the status information includes the ID code information.
9. A device for automatically switching audio channels, comprising the circuit as described in any one of claims 1-6, characterized in that: The device includes a 3.5mm audio interface, and both the audio output and audio input terminals are connected to a USB sound card via the 3.5mm audio interface.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 7 and 8.
Citation Information
Patent Citations
Function switching circuit and gateway type set top box
CN105208438A
Serial port compatible with multiple bottom layer control ports
CN113836064A
Audio processing device, karaoke circuit board and multifunctional television all-in-one machine system
CN211908972U
Interface selector
JP2001296939A