xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Linux shell standard input bugs All In One

Linux shell standard input bugs All In One

errors ❌

warning: file '<standard input>', around line 110: table wider than line width

$ man vcgencmd > vcgencmd.md
warning: file '<standard input>', around line 110: table wider than line width

image

$ man vcgencmd | xclip -o > vcgencmd.md
Error: Can't open display: (null)
warning: file '<standard input>', around line 110:
  table wider than line width

image

$ man vcgencmd | xclip -i | xclip -o > vcgencmd.md
Error: Can't open display: :0.0
Error: Can't open display: :0.0
warning: file '<standard input>', around line 110:
  table wider than line width


groff / troff

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258105#c2

solutions

vcgencmd & xclip

# 设置 $DISPLAY 环境变量 ✅
$ export DISPLAY=:0.0

$ echo $DISPLAY

image

# 正确的用法 ✅ (先复制,后粘贴)
# 使用多次 pipe 管道操作 🚀
$ man vcgencmd | xclip -i | xclip -o > vcgencmd.md

https://www.cnblogs.com/xgqfrms/p/17318422.html

demos

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

vcgencmd

$ vcgencmd version
Jan  5 2023 10:48:31 
Copyright (c) 2012 Broadcom
version 8ba17717fbcedd4c3b6d4bce7e50c7af4155cba9 (clean) (release) (start)
pi@rpi3b:~/Desktop $ 

image

https://www.raspberrypi.com/documentation/computers/configuration.html#changing-the-default-pin-configuration

$ vcgencmd commands
commands="commands, set_logging, bootloader_config, bootloader_version, cache_flush, codec_enabled, get_mem, get_rsts, measure_clock, measure_temp, measure_volts, get_hvs_asserts, get_config, get_throttled, pmicrd, pmicwr, read_ring_osc, version, otp_dump, set_vll_dir, set_backlight, get_lcd_info, arbiter, test_result, get_camera, enable_clock, scaling_kernel, scaling_sharpness, hdmi_ntsc_freqs, hdmi_adjust_clock, hdmi_status_show, hvs_update_fields, pwm_speedup, force_audio, hdmi_stream_channels, hdmi_channel_map, display_power, memtest, dispmanx_list, schmoo, render_bar, disk_notify, inuse_notify, sus_suspend, sus_status, sus_is_enabled, sus_stop_test_thread, egl_platform_switch, mem_validate, mem_oom, mem_reloc_stats, hdmi_cvt, hdmi_timings, readmr, file, vcos, ap_output_control, ap_output_post_processing, vchi_test_init, vchi_test_exit, pm_set_policy, pm_get_status, pm_show_stats, pm_start_logging, pm_stop_logging, vctest_memmap, vctest_start, vctest_stop, vctest_set, vctest_get"
pi@raspberrypi:~ $ 

http://elinux.org/RPI_vcgencmd_usage

$ man vcgencmd > ./man-docs/vcgencmd.md
pi@rpi3b:~/Desktop $ cat ./man-docs/vcgencmd.md
VCGENCMD(1)                                  General Commands Manual                                 VCGENCMD(1)

NAME
       vcgencmd - query the VideoCore for information

SYNOPSIS
       vcgencmd [-t] command [params]

       vcgencmd -h
       vcgencmd --help

DESCRIPTION
       vcgencmd  is  a command line utility that can get various pieces of information from the VideoCore GPU on
       the Raspberry Pi.

OPTIONS
       -t     Time how long the command takes to complete

       -h, --help
              Show this information

COMMANDS
       To get a list of all the commands that vcgencmd supports, type vcgencmd commands.  Some of the more  use‐
       ful commands are described below.

       vcos sub-command
              The vcos command has a number of sub-commands:

              version
                     Displays the build date and version of the firmware on the VideoCore.

              log status
                     Displays the error log status of the various VideoCore software areas.

       version
              Displays the build date and version of the firmware on the VideoCore.

       get_camera
              Displays  the  enabled  and detected state of the official camera. 1 means yes, 0 means no. Whilst
              all firmware (except cutdown versions) will support the camera, this support needs to  be  enabled
              by using the start_x boot option [BOOT].

       get_throttled
              Returns  the  throttled state of the system. This is a bit pattern - a bit being set indicates the
              following meanings:

              Bit   Meaning
              ────  ────────────────────────────────────
               0    Under-voltage detected
               1    Arm frequency capped
               2    Currently throttled
               3    Soft temperature limit active
              16    Under-voltage has occurred
              17    Arm frequency capping has occurred
              18    Throttling has occurred
              19    Soft temperature limit has occurred

              A value of zero indicates that none of the above conditions is true.

              To find if one of these bits has been set, convert the value returned to binary, then number  each
              bit along the top. You can then see which bits are set. For example:

              0x50000 = 0101 0000 0000 0000 0000

              Adding the bit numbers along the top we get:

              19   18   17   16   15   14   13   12   11   10   9   8   7   6   5   4   3   2   1
               0    1    0    1    0    0    0    0    0    0   0   0   0   0   0   0   0   0   0

              From  this  we  can  see  that  bits 18 and 16 are set, indicating that the Pi has previously been
              throttled due to under-voltage, but is not currently throttled for any reason.

       measure_temp
              Returns the temperature of the SoC as measured by the on-board temperature sensor.

       measure_clock clock
              This returns the current frequency of the specified clock. The options are:

              Clock   Description
              ──────  ────────────────────────────────
              arm     ARM cores
              core    VC4 scaler cores
              h264    H.264 block
              isp     Image Signal Processor
              v3d     3D block
              uart    UART
              pwm     PWM block (analog audio output)
              emmc    SD card interface
              pixel   Pixel valve
              vec     Analog video encoder
              hdmi    HDMI
              dpi     Display Peripheral Interface

              For example, vcgencmd measure_clock arm.

       measure_volts block
              Displays the current voltages used by the specific block.

              Block     Description
              ────────  ─────────────────
              core      VC4 core voltage
              sdram_c
              sdram_i
              sdram_p

       otp_dump
              Displays the content of the One Time Programmable (OTP) memory, which is part of  the  SoC.  These
              are 32 bit values, indexed from 8 to 64. See the raspi-otp(7) for more details.

       get_mem type
              Reports  on  the  amount of memory allocated to the ARM cores with vcgencmd get_mem arm or the VC4
              with vcgencmd get_mem gpu.

              Note: On a Raspberry Pi 4 with greater than 1GB of RAM, the arm option is inaccurate.  This is be‐
              cause the GPU firmware which implements this command is only aware of the first gigabyte of RAM on
              the system, so the arm setting will always return 1GB minus the gpu memory value. To get an  accu‐
              rate  report  of the amount of ARM memory, use one of the standard Linux commands, such as free or
              cat /proc/meminfo.

       codec_enabled type
              Reports whether the specified CODEC type is enabled. Possible options for  type  are  AGIF,  FLAC,
              H263, H264, MJPA, MJPB, MJPG, MPG2, MPG4, MVC0, PCM, THRA, VORB, VP6, VP8, WMV9, WVC1.

              MPG2, WMV9, and WVC1 currently require a paid for licence (see the [FAQ] for more info), except on
              the Pi4, where these hardware codecs are disabled in preference to software  decoding,  which  re‐
              quires  no  licence. Note that because the H265 hardware block on the Raspberry Pi4 is not part of
              the VideoCore GPU, its status is not accessed via this command.

       get_config type|name
              This returns all the configuration items of the specified type that have been set  in  config.txt,
              or a single configuration item. Possible values for type parameter are int, str, or simply use the
              name of the configuration item.

       get_lcd_info
              Displays the resolution and colour depth of any attached display.

       mem_oom
              Displays statistics on any Out Of Memory events occuring in the VC4 memory space.

       mem_reloc_stats
              Displays statistics from the relocatable memory allocator on the VC4.

       read_ring_osc
              Returns the curent speed voltage and temperature of the ring oscillator.

       hdmi_timings
              Displays the current HDMI settings timings. See [VIDEO] for details of the values returned.

       dispmanx_list
              Dump a list of all dispmanx items currently being displayed.

       display_power 0|1|-1
       display_power 0|1|-1 display
              Show current display power state, or set the display power state.  vcgencmd display_power  0  will
              turn  off  power  to the current display.  vcgencmd display_power 1 will turn on power to the dis‐
              play. If no parameter is set, this will display the current power state. The final parameter is an
              optional  display ID, as returned by tvservice -l or from the table below, which allows a specific
              display to be turned on or off.

              vcgencmd display_power 0 7 will turn off power to display ID 7, which is HDMI 1 on a Raspberry  Pi
              4.

              Display         ID
              ──────────────  ───
              Main LCD        0
              Secondary LCD   1
              HDMI 0          2
              Composite       3
              HDMI 1          7

              To determine if a specific display ID is on or off, use -1 as the first parameter.

              vcgencmd  display_power  -1 7 will return 0 if display ID 7 is off, 1 if display ID 7 is on, or -1
              if display ID 7 is in an unknown state, for example undetected.

EXIT STATUS
       0      Command completed successfully

       -1     Problem with VHCI

       -2     VideoCore returned an error

SEE ALSO
       [DOCS] https://www.raspberrypi.org/documentation/computers/os.html#vcgencmd

                                                                                                     VCGENCMD(1)
pi@rpi3b:~/Desktop $ 

refs

https://www.cnblogs.com/xgqfrms/tag/xclip/



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-05-31 12:15  xgqfrms  阅读(14)  评论(1编辑  收藏  举报