Connection detection method, device, equipment and storage medium for audio playback device
By configuring a target communication mode between the controller of an electronic device and a voice chip, and using the pin level information of the voice chip to detect the connection status of the audio playback device, the problem of inability to detect in miniaturized electronic products is solved, and a fast and convenient connection status determination is achieved.
Patent Information
- Application Number
- CN202110548875.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-19
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-05-19
AI Technical Summary
In the prior art, due to size limitations, miniaturized electronic products cannot use external devices such as audio sockets to detect the connection of audio playback devices, making it difficult to determine the connection status.
By configuring the target communication mode on the communication pin between the controller of the electronic device and the voice chip, the connection status of the audio playback device can be determined by obtaining the level information. The connection status can be determined by using the pin level information of the voice chip, without the need for external detection equipment.
It enables quick and easy detection of the connection status of audio playback devices, and is applicable to electronic devices of different sizes, improving the applicability and convenience of the detection.
Smart Images

Figure CN113515257B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic chip pin control, and in particular to a connection detection method, device, equipment and storage medium for an audio playback device. Background Art
[0002] Currently, many electronic products are equipped with audio playback devices, such as speakers and horns. The wires of these audio playback devices are usually encapsulated in the packaging, and users cannot directly see their connection status. During the assembly process or after long-term use, the leads of the audio playback devices may fall off, causing the electronic products to fail to make any sound.
[0003] In order to effectively detect the connection status of an audio playback device, the prior art usually uses an external device such as an audio socket to connect to an electronic product to detect whether the electronic product is connected to the audio playback device; however, with the increasing number of miniaturized electronic products, some small electronic products cannot use external devices such as audio sockets for connection detection due to size limitations. Summary of the invention
[0004] The purpose of the present application is to provide a connection detection method, apparatus, device and storage medium for an audio playback device, which can determine the connection status of an audio playback device without the access of other external detection devices, thereby improving the speed and simplicity of the test.
[0005] The embodiment of the present application is implemented as follows:
[0006] In one aspect of an embodiment of the present application, a method for detecting an audio playback device is provided. The method is applied to a controller of an electronic device. The electronic device includes a controller, an audio playback device, and a voice chip. The voice chip is connected to the controller and the audio playback device, respectively. The method includes:
[0007] Sending a first configuration instruction to the voice chip, the first configuration instruction is used to instruct the voice chip to configure a connection pin on the voice chip to a target communication mode, wherein the connection pin is a pin connecting the voice chip and the audio playback device;
[0008] Get the level information of the connected pin of the voice chip;
[0009] The connection status of the audio playback device is determined according to the level information of the connection pin.
[0010] Optionally, the connecting pins include: a positive electrode lead pin and a negative electrode lead pin;
[0011] Get the level information of the connected pins of the voice chip, including:
[0012] Get the level information of the negative lead pin of the voice chip;
[0013] The connection status of the audio playback device is determined according to the level information of the connection pin, including:
[0014] If the level information of the negative lead pin is a high level, it is determined that the connection state of the audio playback device is a connected state.
[0015] Optionally, determining the connection state of the audio playback device according to the level information of the connection pin includes:
[0016] If the level information of the negative lead pin is a low level, it is determined that the connection state of the audio playback device is a disconnected state.
[0017] Optionally, after determining that the connection state of the audio playback device is a connected state, the method further includes:
[0018] A second configuration instruction is sent to the voice chip, where the second configuration instruction is used to instruct the voice chip to configure the connection pin on the voice chip to a speaker driving mode.
[0019] Optionally, after sending the first configuration instruction to the voice chip, the method further includes:
[0020] Get the configuration result of the connected pins, the configuration result includes: configuration success or configuration failure;
[0021] If the configuration result of the connection pin is configuration failure, the audio playback device is controlled to be disconnected from the negative lead pin, and the audio playback device is controlled to be connected to the spare pin of the voice chip, wherein the connection type of the spare pin is the same as the connection type of the connection pin;
[0022] Get the level information of the spare pin;
[0023] The connection state of the audio playback device is determined according to the level information of the spare pin.
[0024] Optionally, determining the connection state of the audio playback device according to the level information of the spare pin includes:
[0025] If the level information of the standby pin is a high level, it is determined that the connection state of the audio playback device is a connected state.
[0026] Optionally, after determining that the connection state of the audio playback device is a connected state, the method further includes:
[0027] Control the audio playback device to be disconnected from the standby pin, and control the audio playback device to be connected to the negative lead pin of the voice chip;
[0028] A second configuration instruction is sent to the voice chip, where the second configuration instruction is used to instruct the voice chip to configure the connection pin on the voice chip to a speaker driving mode.
[0029] Another aspect of the embodiment of the present application provides a detection device for an audio playback device, the device is applied to a controller of an electronic device, the electronic device includes a controller, an audio playback device and a voice chip, the voice chip is connected to the controller and the audio playback device respectively, the device includes: a configuration module, an acquisition module, and a determination module;
[0030] A configuration module, used for sending a first configuration instruction to the voice chip, wherein the first configuration instruction is used for instructing the voice chip to configure a connection pin on the voice chip to a target communication mode, wherein the connection pin is a pin connecting the voice chip and the audio playback device;
[0031] An acquisition module, used to obtain level information of the connection pin of the voice chip;
[0032] The determination module is used to determine the connection status of the audio playback device according to the level information of the connection pin.
[0033] Optionally, the connecting pin includes: a positive lead pin and a negative lead pin; an acquisition module, specifically used to obtain the level information of the negative lead pin of the voice chip; and a determination module, specifically used to determine that the connection state of the audio playback device is a connected state if the level information of the negative lead pin is a high level.
[0034] Optionally, the determination module is further configured to determine that the connection state of the audio playback device is a disconnected state if the level information of the negative lead pin is a low level.
[0035] Optionally, the configuration module is further used to send a second configuration instruction to the voice chip, where the second configuration instruction is used to instruct the voice chip to configure the connection pin on the voice chip to a speaker driving mode.
[0036] Optionally, the acquisition module is also used to obtain the configuration result of the connecting pin, and the configuration result includes: configuration success or configuration failure; if the configuration result of the connecting pin is configuration failure, control the audio playback device to disconnect from the negative lead pin, and control the audio playback device to connect to the spare pin of the voice chip, wherein the connection type of the spare pin is the same as the connection type of the connecting pin; obtain the level information of the spare pin; the determination module is also used to determine the connection status of the audio playback device according to the level information of the spare pin.
[0037] Optionally, the determination module is further configured to determine that the connection state of the audio playback device is a connected state if the level information of the standby pin is a high level.
[0038] Optionally, the configuration module is also used to control the audio playback device to be disconnected from the spare pin, and to control the audio playback device to be connected to the negative lead pin of the voice chip; and to send a second configuration instruction to the voice chip, wherein the second configuration instruction is used to instruct the voice chip to configure the connecting pin on the voice chip to a speaker drive mode.
[0039] Another aspect of an embodiment of the present application provides a computer device, including: a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the detection method of the above-mentioned audio playback device are implemented.
[0040] In another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for detecting an audio playback device are implemented.
[0041] The beneficial effects of the embodiments of the present application include:
[0042] In a connection detection method, device, equipment and storage medium for an audio playback device provided in an embodiment of the present application, a first configuration instruction can be sent to a voice chip, and the configuration instruction is used to instruct the voice chip to configure the connection pin on the voice chip to a target communication mode, wherein the connection pin is a pin connecting the voice chip and the audio playback device; obtain the level information of the connection pin of the voice chip; and determine the connection status of the audio playback device according to the level information of the connection pin. Among them, the connection pin is configured by a controller, so that the connection status of the audio playback device can be determined by the level information obtained by the connection pin, and no additional external device is required for corresponding detection, which correspondingly improves the speed of connection status detection. In addition, the method can be used for detection of electronic devices with different volumes, which can also improve the wide applicability of the detection and improve the speed and simplicity of the test. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A schematic diagram of a scenario of a detection method for an audio playback device provided in an embodiment of the present application;
[0045] Figure 2 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 1 ;
[0046] Figure 3 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 2 ;
[0047] Figure 4 Pin diagram of the voice chip provided in the embodiment of the present application Figure 1 ;
[0048] Figure 5 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 3 ;
[0049] Figure 6 Pin diagram of the voice chip provided in the embodiment of the present application Figure 2 ;
[0050] Figure 7 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 4 ;
[0051] Figure 8 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 5 ;
[0052] Fig. 9 A schematic diagram of the structure of a monitoring device for an audio playback device provided in an embodiment of the present application;
[0053] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0055] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0056] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0057] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0058] It should be noted that in the art, the method of obtaining the connection status of the audio playback device is usually to use a 3.5mm audio socket, and to identify whether the audio playback device is connected by using the on-off state of the contact spring of the audio socket after insertion. Therefore, an additional access detection circuit needs to be added. However, with the miniaturization of electronic products, the space of the current miniaturized audio playback device cannot prevent such an audio socket, which correspondingly leads to the inability to insert the contact spring of the audio socket. Therefore, it is difficult to achieve access detection for these small electronic products.
[0059] The following specifically explains the application scenarios of the detection method of the audio playback device provided in the embodiments of the present application.
[0060] Figure 1 For a scene diagram of the detection method of the audio playback device provided in the embodiment of the present application, please refer to Figure 1 The method is applied to a controller 110 of an electronic device, wherein the electronic device includes the controller 110, an audio playback device 130 and a voice chip 120, and the voice chip 120 is connected to the controller 110 and the audio playback device 130 respectively.
[0061] Optionally, the electronic device can be an electronic device such as a computer, a tablet computer, a mobile phone, or a dedicated audio device, which is not limited here. The controller 110 can be any type of controller such as a CPU (central processing unit) or an MCU (Microcontroller Unit), which can be selected according to the type of electronic device, which is not limited here. The voice chip 120 can be a Bluetooth voice chip or other types of chips that can perform signal conversion, which are used to convert analog electrical signals into digital electrical signals, thereby controlling the audio playback device 130 to perform corresponding work. The voice chip 120 can specifically be an audio processing chip (audio IC, Integrated Circuit Chip). The audio playback device 130 can specifically be a speaker, a horn, a loudspeaker and other equipment, which is used for broadcasting, amplification and other tasks. Taking a speaker as an example, it is mainly composed of an internal coil, and the internal resistance can usually be set to not exceed 1KΩ.
[0062] Optionally, the controller 110 can be two components separately provided with the voice chip 120, or can be a component integrated with the voice chip 120, and no specific limitation is made here. The illustrations of this application take the separate provision as an example. In actual production applications, the controller 110 and the voice chip 120 can also be provided as a whole to perform corresponding functions.
[0063] The executor of the detection method of the audio playback device provided in the embodiment of the present application may be the controller 110 in the electronic device. The specific implementation process of the detection method of the audio playback device provided in the embodiment of the present application is explained in detail below.
[0064] Figure 2 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 1 , please refer to Figure 2 , the method comprising:
[0065] S210: Send a first configuration instruction to the voice chip.
[0066] The first configuration instruction is used to instruct the voice chip to configure the communication pin on the voice chip to a target communication mode, wherein the communication pin is a pin connecting the voice chip and the audio playback device.
[0067] Optionally, the voice chip is provided with a plurality of pins, and two pins connected to the audio playback device among the plurality of pins are the above-mentioned connection pins, and the connection pins can be set with connection types, and based on different connection types, the voice chip can be set with different working modes. The connection pins can be specifically SPK pins (Loudspeakers pins, speaker pins).
[0068] Optionally, the first configuration instruction may be a preset instruction sent by the controller, and the preset working mode on the voice chip may be switched accordingly based on such preset instructions. After the voice chip receives the above-mentioned first configuration instruction, it may be switched to the target communication mode, and accordingly, the connection type of the communication pin of the voice chip may also be switched to the target communication mode. The target communication mode may be a preset communication mode, such as a general input and output mode, etc., which is not limited here.
[0069] S220: Obtaining level information of the connection pin of the voice chip.
[0070] Optionally, after switching to the target communication mode, the controller can collect and obtain the level information of the connected pin of the voice chip. In the target communication mode, the audio playback device is equivalent to a resistor element, and its level information will be different when the audio playback device is connected and when it is not connected.
[0071] S230: Determine the connection status of the audio playback device according to the level information of the connection pin.
[0072] Optionally, after the controller obtains the level information of the connection pin, it can make a judgment based on the level to determine the connection state of the current audio playback device to determine whether the audio playback device is normally connected.
[0073] In a connection detection method for an audio playback device provided in an embodiment of the present application, a first configuration instruction can be sent to a voice chip, the configuration instruction is used to instruct the voice chip to configure the connection pin on the voice chip to a target communication mode, wherein the connection pin is a pin connecting the voice chip and the audio playback device; obtain the level information of the connection pin of the voice chip; and determine the connection status of the audio playback device according to the level information of the connection pin. Among them, the connection pin is configured by a controller, so that the connection status of the audio playback device can be determined by the level information obtained by the connection pin, and no additional external device is required for corresponding detection, which correspondingly improves the speed of connection status detection. In addition, this method can be used for detection of electronic devices with different volumes, which can also improve the wide applicability of the detection and improve the speed and simplicity of the test.
[0074] Another specific implementation process of the method for detecting an audio playback device provided in an embodiment of the present application is explained in detail below.
[0075] Figure 3 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 2 , please refer to Figure 3 , the connection pins include: a positive lead pin and a negative lead pin; obtaining the level information of the connection pins of the voice chip, including:
[0076] S310: Obtaining level information of the negative lead pin of the voice chip.
[0077] Optionally, two connecting pins can usually be provided, one for providing voltage output and the other for receiving voltage access, thereby forming a closed loop, wherein the connecting pin providing voltage output can be the positive lead pin, and correspondingly, the connecting pin receiving voltage access can be the negative lead pin.
[0078] Optionally, the target communication mode may specifically be a GPIO mode (General-purpose input / output). In the GPIO mode, the positive lead pin is a high level output, and the negative lead pin is a weak pull-down input.
[0079] Optionally, the controller may obtain the level input by the negative lead pin by collecting the level.
[0080] The connection status of the audio playback device is determined according to the level information of the connection pin, including:
[0081] If the level information of the negative lead pin is a high level, S320: determine that the connection state of the audio playback device is a connected state.
[0082] Optionally, if the level information of the negative lead pin is high, it means that the weak pull-down input is pulled high by the high level output, that is, the high level of the positive lead pin is input into the negative lead pin, therefore, it can be determined that the connection state of the audio playback device is connected.
[0083] Optionally, determining the connection state of the audio playback device according to the level information of the connection pin includes:
[0084] If the level information of the negative lead pin is a low level, S330: determine that the connection state of the audio playback device is a disconnected state.
[0085] Optionally, if the level information of the negative lead pin is a low level, it means that the weak pull-down input is not pulled up by the high level output and still maintains the low level of the pull-down, that is, the high level of the positive lead pin is not input into the negative lead pin. Therefore, it can be determined that the connection state of the audio playback device is disconnected.
[0086] Optionally, after determining that the connection state of the audio playback device is a connected state, the method further includes: sending a second configuration instruction to the voice chip.
[0087] The second configuration instruction is used to instruct the voice chip to configure the connection pin on the voice chip to a speaker driving mode.
[0088] Optionally, the second configuration instruction is similar to the first configuration instruction, and both are preset instructions stored in the controller. After the voice chip receives the second configuration instruction, it can be switched to the speaker drive mode, and accordingly, the connection type of the connection pin of the voice chip can also be switched to the speaker drive mode. The speaker drive mode can be a mode in which a corresponding control signal is sent to the audio playback device through the connection pin, so that the audio playback device performs corresponding work. In the speaker drive mode, the audio playback device can be powered on normally and convert the electrical signal into an acoustic signal for external audio playback.
[0089] The pin structure of the voice chip provided in the embodiment of the present application is explained in detail below.
[0090] Figure 4 Pin diagram of the voice chip provided in the embodiment of the present application Figure 1 , please refer to Figure 4 The pins of the voice chip include: a positive lead pin 410 and a negative lead pin 420. The positive lead pin 410 and the negative lead pin 420 are both used to connect to an audio playback device.
[0091] Among them, in GPIO mode, the positive lead pin 410 provides a high level output, and the negative lead pin 420 is initially pulled down to a low level. When a high level signal is received, the negative lead pin 420 will be pulled up to a high level.
[0092] Another specific implementation process of the detection method of the audio playback device provided in the embodiment of the present application is explained in detail below.
[0093] Figure 5 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 3 , please refer to Figure 5 After sending the first configuration instruction to the voice chip, the method further includes:
[0094] S410: Obtain the configuration result of the connection pins.
[0095] The configuration result includes: configuration success or configuration failure.
[0096] Optionally, after receiving the first configuration instruction, the voice chip can perform a corresponding mode switch. If the switch is successful, the result of the successful switch can be sent to the controller as a configuration result of successful configuration. Correspondingly, if the switch fails, the result of the failed switch can be sent to the controller as a configuration result of failed configuration. The controller can receive such configuration results as the configuration results for the connecting pins.
[0097] S420: If the configuration result of the connection pin is configuration failure, the audio playback device is controlled to be disconnected from the negative lead pin, and the audio playback device is controlled to be connected to the spare pin of the voice chip.
[0098] The connection type of the spare pin is the same as the connection type of the connection pin.
[0099] Optionally, if the result obtained is that the connecting pin configuration fails, it can be determined that the connecting pin is not suitable for GPIO mode, and the connection between the audio playback device and the negative lead pin can be disconnected and connected to the spare pin of the voice chip instead, wherein the spare pin can be a pin in the voice chip that can be switched to GPIO mode. During the pin switching process, the switching can be achieved by a pin switching device preset in the electronic device. The pin switching device can switch the pin under the control of the controller, or it can be manually switched by the user, which is not limited here.
[0100] Optionally, after the switching is completed, an analog switch may be provided on the positive lead pin and the spare pin, and the electrical connection between the positive lead pin and the spare pin and the audio playback device may be achieved through the analog switch.
[0101] S430: Obtaining level information of the standby pin.
[0102] Optionally, after switching the connection pin, the level information of the standby pin may be obtained by adopting steps and methods similar to the aforementioned S220, which will not be described in detail here.
[0103] S440: Determine the connection status of the audio playback device according to the level information of the standby pin.
[0104] Optionally, after acquiring the level information of the standby pin, the controller may determine the connection state of the current audio playback device according to the level to determine whether the audio playback device is normally connected.
[0105] Another specific structure of the pins of the voice chip provided in the embodiment of the present application is explained in detail below.
[0106] Figure 6 Pin diagram of the voice chip provided in the embodiment of the present application Figure 2 , please refer to Figure 6 The pins of the voice chip also include: a spare pin 430. The spare pin 430 is not connected to any device in the speaker driving mode, and is connected to the audio playback device instead of the negative lead pin 420 in the GPIO mode.
[0107] Among them, in GPIO mode, the positive lead pin 410 provides a high level output, and the standby pin 430 is initially pulled down to a low level. When a high level signal is received, the standby pin 430 is pulled up to a high level.
[0108] Another specific implementation process of the method for detecting an audio playback device provided in an embodiment of the present application is explained in detail below.
[0109] Figure 7 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 4 , please refer to Figure 7 , determining the connection status of the audio playback device according to the level information of the spare pin, including:
[0110] If the level information of the standby pin is a high level, S510: determine that the connection state of the audio playback device is a connected state.
[0111] Optionally, if the level information of the spare pin is a high level, it means that the level of the spare pin is pulled up by the high level output of the positive lead pin, that is, the high level of the positive lead pin is input into the spare pin, therefore, it can be determined that the connection state of the audio playback device is a connected state.
[0112] Correspondingly, if the level information of the standby pin is a low level, S520: determine that the connection state of the audio playback device is a disconnected state.
[0113] Another specific implementation process of the detection method of the audio playback device provided in the embodiment of the present application is explained in detail below.
[0114] Figure 8 Schematic diagram of the process of the detection method of the audio playback device provided in the embodiment of the present application Figure 5 , please refer to Figure 8 After determining that the connection state of the audio playback device is a connected state, the method further includes:
[0115] S610: Control the audio playback device to be disconnected from the standby pin, and control the audio playback device to be connected to the negative lead pin of the voice chip.
[0116] Optionally, after determining that the connection state of the audio playback device is a connected state, the spare pin can be switched to the negative lead pin, that is, the audio playback device is controlled to be disconnected from the spare pin and connected to the negative lead pin of the voice chip. The specific process of switching the connection can be similar to the above, and can be achieved by a pin switching device preset in the electronic device. The pin switching device can switch the pin under the control of the controller, or it can be manually switched by the user, which is not limited here.
[0117] S620: Send a second configuration instruction to the voice chip, wherein the second configuration instruction is used to instruct the voice chip to configure the connection pin on the voice chip to a speaker driving mode.
[0118] The specific process of S620 has been explained above and will not be repeated here.
[0119] The following describes the apparatus, device, storage medium, etc. corresponding to the connection detection method for the audio playback device provided in the present application. The specific implementation process and technical effects are described above and will not be repeated below.
[0120] Fig. 9 For a structural diagram of the monitoring device for an audio playback device provided in an embodiment of the present application, please refer to Fig. 9 , the device includes: a configuration module 710, an acquisition module 720, and a determination module 730;
[0121] The configuration module 710 is used to send a first configuration instruction to the voice chip, where the first configuration instruction is used to instruct the voice chip to configure a connection pin on the voice chip to a target communication mode, wherein the connection pin is a pin connecting the voice chip and the audio playback device;
[0122] An acquisition module 720 is used to acquire level information of a connection pin of a voice chip;
[0123] The determination module 730 is used to determine the connection status of the audio playback device according to the level information of the connection pin.
[0124] Optionally, the connecting pin includes: a positive lead pin and a negative lead pin; an acquisition module 720, specifically used to obtain the level information of the negative lead pin of the voice chip; a determination module 730, specifically used to determine that the connection state of the audio playback device is a connected state if the level information of the negative lead pin is a high level.
[0125] Optionally, the determination module 730 is further configured to determine that the connection state of the audio playback device is a disconnected state if the level information of the negative lead pin is a low level.
[0126] Optionally, the configuration module 710 is further used to send a second configuration instruction to the voice chip, where the second configuration instruction is used to instruct the voice chip to configure the connection pin on the voice chip to a speaker driving mode.
[0127] Optionally, the acquisition module 720 is also used to obtain the configuration result of the connecting pin, and the configuration result includes: configuration success or configuration failure; if the configuration result of the connecting pin is configuration failure, control the audio playback device to disconnect from the negative lead pin, and control the audio playback device to connect to the spare pin of the voice chip, wherein the connection type of the spare pin is the same as the connection type of the connecting pin; obtain the level information of the spare pin; the determination module 730 is also used to determine the connection status of the audio playback device according to the level information of the spare pin.
[0128] Optionally, the determination module 730 is further configured to determine that the connection state of the audio playback device is a connected state if the level information of the standby pin is a high level.
[0129] Optionally, the configuration module 710 is also used to control the audio playback device to be disconnected from the spare pin, and to control the audio playback device to be connected to the negative lead pin of the voice chip; and to send a second configuration instruction to the voice chip, the second configuration instruction being used to instruct the voice chip to configure the connecting pin on the voice chip to a speaker drive mode.
[0130] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0131] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0132] Fig.10 For a schematic diagram of the structure of the computer device provided in the embodiment of the present application, please refer to Fig.10 , a computer device includes: a memory 810 and a processor 820, wherein the memory 810 stores a computer program that can be run on the processor 820, and when the processor 820 executes the computer program, the steps of the detection method of the above-mentioned audio playback device are implemented.
[0133] Optionally, the computer device may specifically be a controller in the aforementioned electronic device.
[0134] In another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for detecting an audio playback device are implemented.
[0135] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0136] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0137] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0138] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0139] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0140] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for detecting an audio playback device, characterized in that: The method is applied to a controller of an electronic device, wherein the electronic device includes the controller, an audio playback device, and a voice chip, wherein the voice chip is connected to the controller and the audio playback device respectively, and the method includes: Sending a first configuration instruction to the voice chip, wherein the first configuration instruction is used to instruct the voice chip to configure a communication pin on the voice chip to a target communication mode, wherein the communication pin is a pin connecting the voice chip and an audio playback device; Obtaining level information of the connection pin of the voice chip; Determining the connection status of the audio playback device according to the level information of the connection pin; The connecting pins include: a positive lead pin and a negative lead pin; The step of obtaining the level information of the connection pin of the voice chip includes: Acquiring level information of the negative lead pin of the voice chip; The step of determining the connection status of the audio playback device according to the level information of the connection pin includes: If the level information of the negative lead pin is a high level, it is determined that the connection state of the audio playback device is a connected state.
2. The method according to claim 1, characterized in that The step of determining the connection status of the audio playback device according to the level information of the connection pin includes: If the level information of the negative lead pin is a low level, it is determined that the connection state of the audio playback device is a disconnected state.
3. The method according to claim 1, characterized in that After determining that the connection state of the audio playback device is a connected state, the method further includes: A second configuration instruction is sent to the voice chip, where the second configuration instruction is used to instruct the voice chip to configure the communication pin on the voice chip to a speaker driving mode.
4. The method according to claim 1, characterized in that After sending the first configuration instruction to the voice chip, the method further includes: Obtaining a configuration result of the connection pin, wherein the configuration result includes: configuration success or configuration failure; If the configuration result of the connecting pin is configuration failure, the audio playback device is controlled to be disconnected from the negative lead pin, and the audio playback device is controlled to be connected to the spare pin of the voice chip, wherein the connection type of the spare pin is the same as the connection type of the connecting pin; Obtaining level information of the spare pin; The connection state of the audio playback device is determined according to the level information of the spare pin.
5. The method according to claim 4, characterized in that Determining the connection state of the audio playback device according to the level information of the standby pin includes: If the level information of the standby pin is a high level, it is determined that the connection state of the audio playback device is a connected state.
6. The method according to claim 5, characterized in that After determining that the connection state of the audio playback device is a connected state, the method further includes: Control the audio playback device to be disconnected from the standby pin, and control the audio playback device to be connected to the negative lead pin of the voice chip; A second configuration instruction is sent to the voice chip, where the second configuration instruction is used to instruct the voice chip to configure the communication pin on the voice chip to a speaker driving mode.
7. A detection device for an audio playback device, characterized in that: The device is applied to a controller of an electronic device, wherein the electronic device comprises the controller, an audio playback device and a voice chip, wherein the voice chip is connected to the controller and the audio playback device respectively, and the device comprises: a configuration module, an acquisition module and a determination module; The configuration module is used to send a first configuration instruction to the voice chip, wherein the first configuration instruction is used to instruct the voice chip to configure a connection pin on the voice chip to a target communication mode, wherein the connection pin is a pin connecting the voice chip and an audio playback device; The acquisition module is used to acquire the level information of the connection pin of the voice chip; The determination module is used to determine the connection status of the audio playback device according to the level information of the connection pin; The connecting pin includes: a positive lead pin and a negative lead pin; the acquiring module is specifically used to acquire the level information of the negative lead pin of the voice chip; the determining module is specifically used to determine that the connection state of the audio playback device is a connected state if the level information of the negative lead pin is a high level.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the method described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1 to 6.
