Sound equipment starting method, equipment, medium and product based on SPDIF interface
Technical Field
The invention relates to the field of sound equipment, in particular to a sound equipment starting method, equipment, a medium and a product based on an SPDIF interface.
Background
The conventional sound equipment is required to be started up by a user through a start button or remote operation, and the SPDIF interface in the corresponding sound product only plays a role of transmitting a digital audio signal and is not used for starting up a detection signal, so that the starting up process of the conventional sound system is not intelligent and convenient enough, and the experience of the user is reduced.
Disclosure of Invention
In order to overcome the defects of the prior art, one of the purposes of the present invention is to provide a sound equipment startup method based on an SPDIF interface, which can solve the problems that the startup process of the existing sound system is not intelligent and convenient enough, and the experience of the user is reduced.
The second objective of the present invention is to provide an electronic device, which can solve the problems that the existing audio system is not intelligent and convenient enough in the starting process, and the experience of the user is reduced.
The invention also aims to provide a computer readable storage medium which can solve the problems that the starting process of the existing sound system is not intelligent and convenient enough, and the experience of a user is reduced.
The fourth purpose of the present invention is to provide a computer program product, which can solve the problems of insufficient intelligence and convenience in the starting process of the existing sound system, and reduced user experience.
One of the purposes of the invention is realized by adopting the following technical scheme:
the sound equipment starting method based on the SPDIF interface comprises the following steps that the sound equipment is provided with a main controller used for controlling the on and off of the sound equipment, a central processing unit and the SPDIF interface used for receiving digital audio signals, the central processing unit is connected with the main controller, a detection port is arranged in the central processing unit, and the detection port is connected with the SPDIF interface:
receiving an SPDIF signal, wherein the SPDIF signal input through an SPDIF interface is received by the central processing unit;
judging validity, judging whether the SPDIF signal is a valid signal or not by the central processing unit according to preset parameters, if so, executing a starting step, if not, judging that the SPDIF signal is an invalid signal, and returning to the step of receiving the SPDIF signal;
and a starting step, in which the central processing unit generates a starting instruction and sends the starting instruction to the main controller for starting the sound equipment.
Further, the detection port is an I/O port, the preset parameter is whether the SPDIF signal changes alternately within a preset time period, and the determining whether the SPDIF signal is an effective signal according to the preset parameter specifically includes: and judging whether the SPDIF signal is changed alternately in a preset time period, if so, taking the SPDIF signal as an effective signal, and if not, taking the SPDIF signal as an ineffective signal.
Further, the determining whether the SPDIF signal is changed alternately within the preset time period specifically includes: and judging whether the SPDIF signal has high and low level alternation in a preset time period.
Further, the detection port is a counter port, the preset parameter is that the number of times of pulse width change corresponding to the SPDIF signal within a first preset unit time reaches a preset change number threshold, and the determining whether the SPDIF signal is an effective signal according to the preset parameter specifically includes: receiving effective pulse width change times corresponding to the SPDIF signal and sent by a counter port, wherein the effective pulse width change times are the pulse width change times corresponding to the SPDIF signal in a first preset unit time, judging whether the effective pulse width change times reach a preset change time threshold value, if so, taking the SPDIF signal as an effective signal, and if not, taking the SPDIF signal as an invalid signal.
Further, the detection port is an interrupt port, the preset parameter is that the number of times that the central processing unit is interrupted by the SPDIF signal within a second preset unit time reaches a preset interrupt number threshold, and the determining whether the SPDIF signal is an effective signal according to the preset parameter specifically includes: recording the interruption times of interruption caused by the SPDIF signal input from an interruption port, judging whether the interruption times in a second preset unit time reaches a preset interruption time threshold value, if so, taking the SPDIF signal as an effective signal, and if not, taking the SPDIF signal as an invalid signal.
Further, the SPDIF signal may cause a cpu interrupt when it is at a low level or a falling edge.
Further, a power supply module which supplies power for the SPDIF interface and the central processing unit is arranged in the sound equipment.
The second purpose of the invention is realized by adopting the following technical scheme
An electronic device, comprising: a processor;
a memory; and a program, wherein the program is stored in the memory and configured to be executed by the processor, the program comprising instructions for executing the SPDIF interface-based audio device power-on method described in the present application.
The third purpose of the invention is realized by adopting the following technical scheme
A computer-readable storage medium having stored thereon a computer program for executing, by a processor, the SPDIF interface-based audio device power-on method described in the present application.
The fourth purpose of the invention is realized by adopting the following technical scheme
A computer program product comprising a computer program which, when executed by a processor, implements the SPDIF interface-based audio device booting method described in the present application.
Compared with the prior art, the invention has the beneficial effects that: the sound equipment starting method based on the SPDIF interface detects the effectiveness of the SPDIF signal input through the SPDIF interface as a starting detection signal, generates a starting instruction according to the detection result and sends the starting instruction to the main controller to be used for starting the sound equipment, achieves the effect of achieving automatic starting of the sound equipment by utilizing the SPDIF signal, enriches the functions of the sound equipment, enables the starting process of the sound equipment to become intelligent and convenient, and increases the use experience of users.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical solutions of the present invention more clearly understood and to implement them in accordance with the contents of the description, the following detailed description is given with reference to the preferred embodiments of the present invention and the accompanying drawings. The detailed description of the present invention is given in detail by the following examples and the accompanying drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart illustrating a method for starting up an audio device based on an SPDIF interface according to the present invention;
fig. 2 is a hardware architecture diagram of the audio device booting method based on the SPDIF interface according to the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and the detailed description, and it should be noted that any combination of the embodiments or technical features described below can be used to form a new embodiment without conflict.
As shown in fig. 2, in the audio device booting method based on the SPDIF interface in the present application, the audio device is provided with a main controller for controlling a power on/off operation, a central processing unit, and an SPDIF interface for receiving a digital audio signal, where the central processing unit is connected TO the main controller, the central processing unit is provided with a detection port, the detection port is connected TO the SPDIF interface, in this embodiment, the central processing unit is a single chip microcomputer, the detection port is an I/O port or a counter port or an interrupt port, and the count port is a count input TO port; the interrupt port is a TNT port, specifically, INT0 or INT1, and when a signal (low level or falling edge) is input to the INT0 or INT1 port, the program being executed can be temporarily stopped by the single chip microcomputer, and the pre-programmed and other programs are transferred to be executed, wherein NT0 and INT1 are called as external interrupt application input ends. The SPDIF interface is set as a coaxial interface or an optical fiber interface, the coaxial interface is specifically an RCA coaxial interface or a BNC coaxial interface, the optical fiber interface is a TOSLINK optical fiber interface, external equipment sends SPDIF signals (Digital audio signals transmitted by using an SPDIF protocol) through the SPDIF interface, the SPDIF is named as Sony/Philips Digital interface Format, and the SPDIF is a civil Digital audio interface protocol developed by cooperation of Sony and Philips company. In this embodiment, a power module for separately supplying power to the SPDIF interface and the central processing unit is provided in the audio device.
As shown in fig. 1, the method for starting up an audio device based on an SPDIF interface includes the following steps:
receiving an SPDIF signal, wherein the SPDIF signal input through an SPDIF interface is received by the central processing unit;
judging validity, judging whether the SPDIF signal is a valid signal or not by the central processing unit according to preset parameters, if so, executing a starting step, otherwise, judging that the SPDIF signal is an invalid signal, and returning to the step of receiving the SPDIF signal. In this step, according to the type of the detection port, the specific steps are as follows:
if the detection port is an I/O port, the preset parameter is whether the SPDIF signal changes alternately within a preset time period, and the determining whether the SPDIF signal is an effective signal according to the preset parameter specifically includes: judging whether the SPDIF signal has high and low level alternating change in a preset time period, if so, taking the SPDIF signal as an effective signal, and if not, taking the SPDIF signal as an invalid signal;
if the detection port is a counter port, the preset parameter is that the number of times of pulse width change corresponding to the SPDIF signal within a first preset unit time reaches a preset change number threshold, and the determining whether the SPDIF signal is an effective signal according to the preset parameter specifically includes: receiving effective pulse width change times corresponding to the SPDIF signal and sent by a counter port, wherein the effective pulse width change times are the pulse width change times corresponding to the SPDIF signal in a first preset unit time, judging whether the effective pulse width change times reach a preset change time threshold value, if so, taking the SPDIF signal as an effective signal, and if not, taking the SPDIF signal as an invalid signal;
if the detection port is an interrupt port, the preset parameter is that the number of times of interrupt of the central processing unit caused by the SPDIF signal in a second preset unit time reaches a preset interrupt number threshold, and the step of judging whether the SPDIF signal is an effective signal according to the preset parameter specifically comprises the steps of: recording the interruption times of interruption caused by the SPDIF signal input from an interruption port, judging whether the interruption times in a second preset unit time reaches a preset interruption time threshold value, if so, taking the SPDIF signal as an effective signal, and if not, taking the SPDIF signal as an invalid signal. In this embodiment, the SPDIF signal may cause an interrupt to the cpu when it is at a low level or a falling edge.
And a starting step, in which the central processing unit generates a starting instruction and sends the starting instruction to the main controller for starting the sound equipment.
The present invention also provides an electronic device comprising: a processor;
a memory; and a program, wherein the program is stored in the memory and configured to be executed by the processor, the program comprising instructions for executing the SPDIF interface-based audio device power-on method described in the present application.
The present invention also provides a computer-readable storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform the method for starting up an audio device based on an SPDIF interface described in this application.
The invention further provides a computer program product, which comprises a computer program, and the computer program realizes the startup method of the sound equipment based on the SPDIF interface in the application when being executed by the processor.
The sound equipment starting method based on the SPDIF interface detects the effectiveness of the SPDIF signal input through the SPDIF interface as a starting detection signal, generates a starting instruction according to the detection result and sends the starting instruction to the main controller to be used for starting the sound equipment, achieves the effect of achieving automatic starting of the sound equipment by utilizing the SPDIF signal, enriches the functions of the sound equipment, enables the starting process of the sound equipment to become intelligent and convenient, and increases the use experience of users.
The foregoing is merely a preferred embodiment of the invention and is not intended to limit the invention in any manner; those skilled in the art can readily practice the invention as shown and described in the drawings and detailed description herein; however, those skilled in the art should appreciate that they can readily use the disclosed conception and specific embodiments as a basis for designing or modifying other structures for carrying out the same purposes of the present invention without departing from the scope of the invention as defined by the appended claims; meanwhile, any changes, modifications, and evolutions of the equivalent changes of the above embodiments according to the actual techniques of the present invention are still within the protection scope of the technical solution of the present invention.