A method for selecting and adapting HDMI resolution
By combining the Debian operating system and Xfce desktop management system with HPD level signals and EDID data, the problem of HDMI device resolution settings not being saved was solved, achieving adaptive matching and automatic recovery of manually set parameters, supporting hot-plug events, and without increasing hardware costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUSHI ZHITONG ELECTRONIC TECH (JINAN) CO LTD
- Filing Date
- 2023-10-13
- Publication Date
- 2026-06-16
Smart Images

Figure CN117636823B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of HDMI technology, and more specifically to an HDMI resolution selection and adaptation method. Background Technology
[0002] High Definition Multimedia Interface (HDMI) is an uncompressed, fully digital consumer electronics interface standard that integrates high-definition video and multi-channel audio onto a single digital interface for processing and transmission via a single cable. Today, HDMI has become the primary connection method for audio and video transmission in electronic products, widely used in high-density digital video disc players, cable / satellite set-top boxes, high-definition televisions, and other digital audiovisual equipment. It effectively improves the quality of digital images, eliminating the need for analog-to-digital conversion.
[0003] Currently, devices with HDMI display output functionality on the market connect to a monitor via an HDMI cable to output screen content. When the output device is connected to the monitor, the HDMI HPD pin is pulled up to 5V by the monitor. Upon detecting this pull-up, the device reads the monitor's EDID (Extended Display Identification Data) information, confirms the monitor's parameters, automatically matches the optimal recommended resolution, and begins outputting HDMI content. However, this process is automatic. If the resolution parameters are manually set in the operating system interface, unplugging or plugging in the HDMI cable, or restarting the device, the system will revert to the optimal recommended resolution, and the set resolution cannot be saved or restored. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and propose an HDMI resolution selection and adaptation method that can achieve both manual setting and adaptive matching of output resolution.
[0005] The technical solution adopted by this invention to solve its technical problem is:
[0006] An HDMI resolution selection and adaptation method includes:
[0007] Step 1: After powering on the device, first check if the resolution has been set;
[0008] If the resolution has been set before, check if the flag bit is 1. When the flag bit is 1, read the previously saved resolution parameter, set it, and output the resolution.
[0009] Step 2: Detect HPD level, and set resolution accordingly.
[0010] If no resolution has been set previously, the system will continue to detect the HPD level signal of the HDMI input source. When the HPD level signal changes from low to high, the system will read the EDID data information from the display screen. Then, it will continue to determine whether the output resolution has been set under the Debian desktop. If not, the optimal recommended resolution will be output. If the optimal resolution has been set as the output resolution, this resolution will be output, but the flag bit will still be set to 0. If a non-optimal resolution has been set as the output resolution, this resolution information will be saved and the flag bit will be set to 1, and then this resolution will be output.
[0011] Step 3: Continue monitoring HPD levels
[0012] The system detects whether the HPD level changes. If there is no change, the display will show normally. If there is a change, it indicates that the cable has been plugged in or unplugged or the device has restarted. The system then starts detecting the flag and continues to cycle through the process.
[0013] Furthermore, the device uses the Debian operating system, which employs the Xfce desktop management system, enabling the saving of resolution parameters set each time.
[0014] Furthermore, the Debian operating system uses a Linux kernel, and Linux uses the DRM (DirectRendering Manager) driver framework.
[0015] Furthermore, the device employs the extended configuration tool xrandr, which allows for setting the screen display size, orientation, mirroring, and other settings.
[0016] Technical effects of the present invention:
[0017] Compared with existing technologies, the HDMI resolution selection and adaptation method of the present invention first confirms whether the resolution has been set before by reading whether the flag bit is 1. If the resolution has not been set before, the HPD level signal of the HDMI input source needs to be detected. If the output resolution is the optimal resolution, the flag bit is set to 0; if the output resolution is not the optimal resolution, the flag bit is set to 1. The above method can not only support adaptive matching of the optimal resolution, but also save and automatically restore the manually set resolution. At the same time, the present invention does not require additional hardware costs, which is conducive to its widespread application. Attached Figure Description
[0018] Figure 1 This is a flowchart of the HDMI resolution selection and adaptation method of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0020] Example 1:
[0021] like Figure 1 As shown, this embodiment relates to an HDMI resolution selection and adaptation method implemented on the Debian operating system. The Debian operating system uses the Xfce desktop management system, which can save the resolution parameters set each time. The Debian operating system uses a Linux kernel, and Linux employs the DRM (Direct Rendering Manager) driver framework, which can manage display output, allocate buffers, process frame buffers, and detect and handle HDMI hot-plug events. When a hot-plug event occurs, the drm-hotplug.sh script file is executed, which can be used to obtain the HDMI hot-plug event. Linux uses xrandr as an extended configuration tool, which can set the screen display size, orientation, mirroring, etc. The resolution can be set using the xrandr command, for example, "xrandr --output HDMI1 --mode 1920x1080".
[0022] The HDMI resolution selection and adaptation method includes:
[0023] Step 1: After powering on the device, first check if the resolution has been set;
[0024] If the resolution has been set before, check if the flag bit is 1. When the flag bit is 1, read the previously saved resolution parameter, set it, and output the resolution.
[0025] Step 2: Detect HPD level, and set resolution accordingly.
[0026] If no resolution has been set previously, the system will continue to detect the HPD level signal of the HDMI input source. When the HPD level signal changes from low to high, the system will read the EDID data information from the display screen. Then, it will continue to determine whether the output resolution has been set under the Debian desktop. If not, the optimal recommended resolution will be output. If the optimal resolution has been set as the output resolution, this resolution will be output, but the flag bit will still be set to 0. If a non-optimal resolution has been set as the output resolution, this resolution information will be saved and the flag bit will be set to 1, and then this resolution will be output.
[0027] Step 3: Continue monitoring HPD levels
[0028] Each time the HDMI cable is plugged in or unplugged, or the device is restarted, the HPD level will go from low to high. Therefore, the system detects whether the HPD level changes. If there is no change, the monitor will display normally. If there is a change, it means that the cable has been plugged in or unplugged, or the device has been restarted. The system then starts detecting the flag and continues to cycle through the process.
[0029] Through the above-described method steps, this invention can both support adaptive matching of the optimal resolution and save and automatically restore the resolution set by the user. At the same time, this invention does not require additional hardware costs.
[0030] The above-described specific embodiments are merely specific examples of the present invention. The patent protection scope of the present invention includes, but is not limited to, the above-described specific embodiments. Any appropriate changes or modifications made by a person skilled in the art that conform to the claims of the present invention should fall within the patent protection scope of the present invention.
Claims
1. An HDMI resolution selection and adaptation method, characterized in that: Includes the following steps: After powering on the device, first check if the resolution has been set; If the resolution has been set before, check if the flag bit is 1. When the flag bit is 1, read the previously saved resolution parameter, set it, and output the resolution. Step 2: Detect HPD level, and set resolution accordingly. If no resolution has been set before, the system will continue to detect the HPD level signal of the HDMI input source. When the HPD level signal changes from low to high, the system will read the EDID data information from the display screen. Next, it checks whether the output resolution has been set in the Debian desktop. If not, the optimal recommended resolution will be output. If the optimal resolution is set as the output resolution, this resolution will be output, but the flag bit will still be set to 0. If a non-optimal resolution is set as the output resolution, this resolution information will be saved and the flag bit will be set to 1, and then this resolution will be output. Step 3: Continue monitoring HPD levels The system detects whether the HPD level changes. If there is no change, the display will show normally. If there is a change, it indicates that the cable has been plugged in or unplugged or the device has been restarted. The system then starts detecting the flag and continues to execute the loop. The method can both adaptively match the optimal resolution and save and automatically restore the resolution set manually.
2. The HDMI resolution selection and adaptation method according to claim 1, characterized in that: The device uses the Debian operating system, which employs the Xfce desktop management system.
3. The HDMI resolution selection and adaptation method according to claim 2, characterized in that: The Debian operating system uses the Linux kernel, and Linux uses the DRM driver framework.
4. The HDMI resolution selection and adaptation method according to claim 1, 2, or 3, characterized in that: The device uses the extended configuration tool xrandr.