跳至主要内容

配置与学习树莓派config.txt配置文件

配置树莓派config.txt文件

windows pc下配置

  • 将SD卡通过读卡器连接到PC。
  • 打开config.txt文件,或新建这样一个文件。
  • 配置config.txt。
    • hdmi_force_hotplug=1 强制伪装成HDMI输出
    • hdmi_drive=2 当你选择通过HDMI显示输出时,需要选择2,如果是DVI输出,则该项为1
    • hdmi_group=2 设置HDMI类型,1为CEA,2为DMT
    • hdmi_mode=16 设置屏幕分辨率,见后文
    • config_hdmi_boost=4 设置HDMI接口信号强度,抗干扰
    • sdtv_mode=2 PAL制式
    • arm_freq=800 主频
  • 将SD卡重新插回树莓派并启动。

配置说明

概述

由于树莓派没有传统的BIOS,所以它的各种配置文件被存放在一个名为config.txt的文件中。
树莓派的config.txt会在内核初始化之前被GPU读取。

文件格式

默认的,该文件中任何配置都是通过#来注释的,如果需要配置对应项,则需要将行首的#删除。

配置项

内存

      disable_I2cache     : 禁止ARM访问GPU的二级缓存,相应的需要在内核中关闭二级缓存,默认为0
      gpu_mem     : GPU内存以M为单位,设置ARM和GPU之间的内存分配。ARM会获得剩余所有内存,最小设16,默认64
      gpu_mem_256     : 对于有256MB内存的树莓派的GPU设置,会覆盖gpu_mem,最大设192,默认不设置
      gpu_mem_512     : 对于有512MB内存的树莓派的GPU设置, 会覆盖gpu_mem,最大设448,默认不设置
      disable_pvt     : 禁止每500毫秒调整一次RAM的刷新率(RAM温度测量)

CAM - 动态内存分配

      cma_lwm     : 当GPU可用内存低于cma_lwm所设值,将向ARM请求一些内存
      cma_hwm     : 当GPU可用内存高于cma_hwm所设值,将向ARM释放一些内存
要启动CMA,下边的参数要添加到cmdline.txt文件中:
  1. coherent_pool=6M smsc95xx.turbo_mode=N

视频

sdtv_mode 为复合信号输出设置视频制式(默认为0)
sdtv_mode=0 NTSC,日本和美国主要用这个
sdtv_mode=1 日本版NTSC – 无基座
sdtv_mode=2 PAL,国内和欧洲主要用这个
sdtv_mode=3 巴西版PAL – 副载波为525/60而不是625/50
sdtv_aspect 为复合信号输出设置宽高比(默认为1)
sdtv_aspect=1 4:3
sdtv_aspect=2 14:9
sdtv_aspect=3 16:9
sdtv_disable_colourburst 禁止复合信号输出彩色副载波群. 图片会显示为单色, 但是可能会更清晰
sdtv_disable_colourburst=1 禁止输出彩色副载波群
hdmi_safe 使用"安全模式"的设置去尝试用HDMI最大兼容性启动. 这和下面的组合是一个意思: hdmi_force_hotplug=1, config_hdmi_boost=4, hdmi_group=2, hdmi_mode=4, disable_overscan=0
hdmi_safe=1
hdmi_ignore_edid 如果你的显示器是天朝产的垃圾货, 允许系统忽略EDID显示数据
hdmi_ignore_edid=0xa5000080
hdmi_edid_file 当设为1时, 将会从edid.dat文件中读取EDID数据,而不是从显示器.[1]
hdmi_edid_file=1
hdmi_force_edid_audio 伪装成支持所有音频格式播放, 即便报告不支持也允许通过DTS/AC3.
hdmi_force_edid_audio=1
hdmi_force_edid_3d 伪装成全部CEA模式都支持3D, 即便EDID并不支持.
hdmi_force_edid_3d=1
avoid_edid_fuzzy_match 禁止去模糊匹配EDID中描述的模式. 即便遮蔽错误, 也选用匹配分辨率和最接近帧率的标准模式.
avoid_edid_fuzzy_match=1
hdmi_ignore_cec_init 不发送初始化激活源消息. 避免在重启时使(启用CEC)TV结束待机并切换频道.
hdmi_ignore_cec_init=1
hdmi_ignore_cec 伪装成TV不支持CEC. 将不会支持任何CEC功能.
hdmi_ignore_cec=1
hdmi_force_hotplug 伪装成HDMI热插拔信号被检测到, 出现HDMI显示器被接入
hdmi_force_hotplug=1 即便没有检测到HDMI显示器也要使用HDMI模式
hdmi_ignore_hotplug 伪装成HDMI热插拔信号没有被检测到, 出现HDMI显示器未接入
hdmi_ignore_hotplug=1 即便检测到HDMI显示器也要使用混合模式
hdmi_pixel_encoding 强制像素编码模式. 默认情况下会使用EDID请求的模式, 所以不需要修改.
hdmi_pixel_encoding=0 default (limited for CEA, full for DMT)
hdmi_pixel_encoding=1 RGB limited (16-235)
hdmi_pixel_encoding=2 RGB full ( 0-255)
hdmi_pixel_encoding=3 YCbCr limited (16-235)
hdmi_pixel_encoding=4 YCbCr limited ( 0-255)
hdmi_drive 选择HDMI还是DVI模式
hdmi_drive=1 DVI模式 (没声音)
hdmi_drive=2 HDMI模式 (如果支持并已启用将有声音输出)
hdmi_group 设置HDMI类型
不指定组, 或者设为0, 将会使用EDID报告的首选组.
hdmi_group=1 CEA
hdmi_group=2 DMT
hdmi_mode 设置在CEA或DMT格式下的屏幕分辨率
当hdmi_group=1 (CEA)时,下列值有效
hdmi_mode=1 VGA
hdmi_mode=2 480p 60Hz
hdmi_mode=3 480p 60Hz H
hdmi_mode=4 720p 60Hz
hdmi_mode=5 1080i 60Hz
hdmi_mode=6 480i 60Hz
hdmi_mode=7 480i 60Hz H
hdmi_mode=8 240p 60Hz
hdmi_mode=9 240p 60Hz H
hdmi_mode=10 480i 60Hz 4x
hdmi_mode=11 480i 60Hz 4x H
hdmi_mode=12 240p 60Hz 4x
hdmi_mode=13 240p 60Hz 4x H
hdmi_mode=14 480p 60Hz 2x
hdmi_mode=15 480p 60Hz 2x H
hdmi_mode=16 1080p 60Hz
hdmi_mode=17 576p 50Hz
hdmi_mode=18 576p 50Hz H
hdmi_mode=19 720p 50Hz
hdmi_mode=20 1080i 50Hz
hdmi_mode=21 576i 50Hz
hdmi_mode=22 576i 50Hz H
hdmi_mode=23 288p 50Hz
hdmi_mode=24 288p 50Hz H
hdmi_mode=25 576i 50Hz 4x
hdmi_mode=26 576i 50Hz 4x H
hdmi_mode=27 288p 50Hz 4x
hdmi_mode=28 288p 50Hz 4x H
hdmi_mode=29 576p 50Hz 2x
hdmi_mode=30 576p 50Hz 2x H
hdmi_mode=31 1080p 50Hz
hdmi_mode=32 1080p 24Hz
hdmi_mode=33 1080p 25Hz
hdmi_mode=34 1080p 30Hz
hdmi_mode=35 480p 60Hz 4x
hdmi_mode=36 480p 60Hz 4xH
hdmi_mode=37 576p 50Hz 4x
hdmi_mode=38 576p 50Hz 4x H
hdmi_mode=39 1080i 50Hz reduced blanking
hdmi_mode=40 1080i 100Hz
hdmi_mode=41 720p 100Hz
hdmi_mode=42 576p 100Hz
hdmi_mode=43 576p 100Hz H
hdmi_mode=44 576i 100Hz
hdmi_mode=45 576i 100Hz H
hdmi_mode=46 1080i 120Hz
hdmi_mode=47 720p 120Hz
hdmi_mode=48 480p 120Hz
hdmi_mode=49 480p 120Hz H
hdmi_mode=50 480i 120Hz
hdmi_mode=51 480i 120Hz H
hdmi_mode=52 576p 200Hz
hdmi_mode=53 576p 200Hz H
hdmi_mode=54 576i 200Hz
hdmi_mode=55 576i 200Hz H
hdmi_mode=56 480p 240Hz
hdmi_mode=57 480p 240Hz H
hdmi_mode=58 480i 240Hz
hdmi_mode=59 480i 240Hz H
H表示16:9比例(正常是4:3).
2x表示双倍像素(即更高的像素时脉, 每个像素重复两次)
4x表示四倍像素(即更高的像素时脉, 每个像素重复四次)
当hdmi_group=2 (DMT)时,下列值有效
警告: 根据这篇帖子所述
像素时脉是有限制的, 最高支持的模式是1920x1200 @60Hz with reduced blanking.
hdmi_mode=1 640x350 85Hz
hdmi_mode=2 640x400 85Hz
hdmi_mode=3 720x400 85Hz
hdmi_mode=4 640x480 60Hz
hdmi_mode=5 640x480 72Hz
hdmi_mode=6 640x480 75Hz
hdmi_mode=7 640x480 85Hz
hdmi_mode=8 800x600 56Hz
hdmi_mode=9 800x600 60Hz
hdmi_mode=10 800x600 72Hz
hdmi_mode=11 800x600 75Hz
hdmi_mode=12 800x600 85Hz
hdmi_mode=13 800x600 120Hz
hdmi_mode=14 848x480 60Hz
hdmi_mode=15 1024x768 43Hz DO NOT USE
hdmi_mode=16 1024x768 60Hz
hdmi_mode=17 1024x768 70Hz
hdmi_mode=18 1024x768 75Hz
hdmi_mode=19 1024x768 85Hz
hdmi_mode=20 1024x768 120Hz
hdmi_mode=21 1152x864 75Hz
hdmi_mode=22 1280x768 reduced blanking
hdmi_mode=23 1280x768 60Hz
hdmi_mode=24 1280x768 75Hz
hdmi_mode=25 1280x768 85Hz
hdmi_mode=26 1280x768 120Hz reduced blanking
hdmi_mode=27 1280x800 reduced blanking
hdmi_mode=28 1280x800 60Hz
hdmi_mode=29 1280x800 75Hz
hdmi_mode=30 1280x800 85Hz
hdmi_mode=31 1280x800 120Hz reduced blanking
hdmi_mode=32 1280x960 60Hz
hdmi_mode=33 1280x960 85Hz
hdmi_mode=34 1280x960 120Hz reduced blanking
hdmi_mode=35 1280x1024 60Hz
hdmi_mode=36 1280x1024 75Hz
hdmi_mode=37 1280x1024 85Hz
hdmi_mode=38 1280x1024 120Hz reduced blanking
hdmi_mode=39 1360x768 60Hz
hdmi_mode=40 1360x768 120Hz reduced blanking
hdmi_mode=41 1400x1050 reduced blanking
hdmi_mode=42 1400x1050 60Hz
hdmi_mode=43 1400x1050 75Hz
hdmi_mode=44 1400x1050 85Hz
hdmi_mode=45 1400x1050 120Hz reduced blanking
hdmi_mode=46 1440x900 reduced blanking
hdmi_mode=47 1440x900 60Hz
hdmi_mode=48 1440x900 75Hz
hdmi_mode=49 1440x900 85Hz
hdmi_mode=50 1440x900 120Hz reduced blanking
hdmi_mode=51 1600x1200 60Hz
hdmi_mode=52 1600x1200 65Hz
hdmi_mode=53 1600x1200 70Hz
hdmi_mode=54 1600x1200 75Hz
hdmi_mode=55 1600x1200 85Hz
hdmi_mode=56 1600x1200 120Hz reduced blanking
hdmi_mode=57 1680x1050 reduced blanking
hdmi_mode=58 1680x1050 60Hz
hdmi_mode=59 1680x1050 75Hz
hdmi_mode=60 1680x1050 85Hz
hdmi_mode=61 1680x1050 120Hz reduced blanking
hdmi_mode=62 1792x1344 60Hz
hdmi_mode=63 1792x1344 75Hz
hdmi_mode=64 1792x1344 120Hz reduced blanking
hdmi_mode=65 1856x1392 60Hz
hdmi_mode=66 1856x1392 75Hz
hdmi_mode=67 1856x1392 120Hz reduced blanking
hdmi_mode=68 1920x1200 reduced blanking
hdmi_mode=69 1920x1200 60Hz
hdmi_mode=70 1920x1200 75Hz
hdmi_mode=71 1920x1200 85Hz
hdmi_mode=72 1920x1200 120Hz reduced blanking
hdmi_mode=73 1920x1440 60Hz
hdmi_mode=74 1920x1440 75Hz
hdmi_mode=75 1920x1440 120Hz reduced blanking
hdmi_mode=76 2560x1600 reduced blanking
hdmi_mode=77 2560x1600 60Hz
hdmi_mode=78 2560x1600 75Hz
hdmi_mode=79 2560x1600 85Hz
hdmi_mode=80 2560x1600 120Hz reduced blanking
hdmi_mode=81 1366x768 60Hz
hdmi_mode=82 1080p 60Hz
hdmi_mode=83 1600x900 reduced blanking
hdmi_mode=84 2048x1152 reduced blanking
hdmi_mode=85 720p 60Hz
hdmi_mode=86 1366x768 reduced blanking
overscan_left 左侧跳过像素数
overscan_right 右侧跳过像素数
overscan_top 顶部跳过像素数
overscan_bottom 底部跳过像素数
framebuffer_width 控制台framebuffer宽度, 以像素为单位. 默认是显示器宽度减去超出扫描.
framebuffer_height 控制台framebuffer高度, 以像素为单位. 默认是显示器高度减去超出扫描.
framebuffer_depth 控制台framebuffer深度, 以位为单位. 默认是16位. 8位也是有效的, 但是默认RGB调色板会导致屏幕不可读. 24位效果更好 ,但是2012年6月15号发现有显示混乱问题. 32位没有混乱问题, 但是需要设置framebuffer_ignore_alpha=1, 并在2012年6月15号发现颜色显示错误.
framebuffer_ignore_alpha 设为1将禁用alpha通道. 仅对32位有效.
test_mode 允许在启动时做声音与图像测试.
disable_overscan 设为1将禁用超出扫描.
config_hdmi_boost 设置HDMI接口的信号强度. 默认为0. 如果出现HDMI干扰问题可以试试设为4. 最大为7.
display_rotate 顺时针旋转屏幕显示 (默认为0) 或者翻转显示.
display_rotate=0 正常
display_rotate=1 90度
display_rotate=2 180度
display_rotate=3 270度
display_rotate=0x10000 水平翻转
display_rotate=0x20000 垂直翻转
注意: 旋转90度或者270度额外需要GPU内存, 所以在GPU只分配到16M的时候旋转会无效. 可能的原因:Crashes my RPI before Linux boots if set to "1" -- REW 20120913.

Popular posts from 产品随想的博客

Interview at the All Things Digital D5 Conference, Steve and Bill Gates spoke with journalists Kara Swisher and Walt Mossberg onstage in May 2007.

Kara Swisher: The first question I was interested in asking is what you think each has contributed to the computer and technology industry— starting with you, Steve, for Bill, and vice versa. Steve Jobs: Well, Bill built the first software company in the industry. And I think he built the first software company before anybody really in our industry knew what a software company was, except for these guys. And that was huge. That was really huge. And the business model that they ended up pursuing turned out to be the one that worked really well for the industry. I think the biggest thing was, Bill was really focused on software before almost anybody else had a clue that it was really the software that— KS: Was important? SJ: That’s what I see. I mean, a lot of other things you could say, but that’s the high-order bit. And I think building a company’s really hard, and it requires your greatest persuasive abilities to hire the best ...

Commencement Address at Stanford University--“Stay hungry. Stay foolish.”

I am honored to be with you today for your commencement from one of the finest universities in the world. Truth be told— I never graduated from college. This is the closest I’ve ever gotten to a college graduation. Today I want to tell you three stories from my life. That’s it. No big deal. Just three stories. The first story is about connecting the dots. I dropped out of Reed College after the first six months but then stayed around as a drop-in for another eighteen months or so before I really quit. So why did I drop out? It started before I was born. My biological mother was a young, unwed graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl. So my parents, who were on a waiting...

产品随想 | 周刊 第43期:历史上的今天

Products Huberman Lab   https://hubermanlab.com/ 一款聚焦于健康的播客 今日热榜   https://tophub.today/ 聚合展示,国内各热门榜单,对跟进热点非常有帮助,热点运营的好帮手 SketchyBar   https://github.com/FelixKratz/SketchyBar A highly customizable macOS status bar replacement Mac菜单栏定制 自定义程度很高,看作者展示的案例,暂时没想出这样的好处(不过应用本身的编辑,确实也没啥意义)生命在于折腾吧! Thanks-Mirror   https://github.com/eryajf/Thanks-Mirror 整理记录各个包管理器,系统镜像,以及常用软件的好用镜像,Thanks Mirror。 Musicn   https://github.com/zonemeen/musicn 一个下载高品质音乐的命令行工具,音乐来源: 咪咕 Planet Minecraft A creative Minecraft community fansite sharing maps, minecraft skins, resource packs, servers, mods, and more. 里面有很多动人的故事 可能是世界上最大的Minecraft社区,从2010年至今 The Uncensored Library   https://www.uncensoredlibrary.com/en blockworks   https://www.blockworks.uk/ "Distinctive maps for Minecraft that have educated players and risen to the level of art" 游戏也可以让人有更高的实现,而不仅仅是沉迷其中,国外游戏厂商比我们做的好太多 Minecraft_Memory_Bypass_GUI   https://github.com/xingchuanzhen/Minecraft_Memory_Bypass_GUI 绕过Minecraft...

巴菲特致股东信-1976年

 笔记: 为什么选择轻资产行业:当竞争疯狂时,不会强迫加入降价大战 最终选择了费雪的思想,选择能理解的优秀企业,以合理的价格买入并长期拥有 翻译: 雪球:https://xueqiu.com/6217262310/131440258 备份:https://archive.ph/XLK0S 原文: To the Stockholders of Berkshire Hathaway Inc, After two dismal years, operating results in 1976 improved significantly. Last year we said the degree of progress in insurance underwriting would determine whether our gain in earnings would be "moderate" or "major." As it turned out, earnings exceeded even the high end of our expectations. In large part, this was due to the outstanding efforts of Phil Liesche's managerial group at National Indemnity Company. In dollar terms, operating earnings came to $16,073,000, or $16.47 per share. While this is a record figure, we consider return on shareholders' equity to be a much more significant yardstick of economic performance. Here our result was 17.3%, moderately above our long-term average and even further above the average o...

巴菲特致股东信-1973年

 笔记: 在上一年度预测的今年竞争加剧导致利润下滑,真的发生了 翻译Link: 雪球:https://xueqiu.com/6217262310/131257618 备份:https://archive.ph/KIfdT 原文: To the Stockholders of Berkshire Hathaway Inc.: Our financial results for 1973 were satisfactory, with operating earnings of $11,930,592, producing a return of 17.4% on beginning stockholders' equity. Although operating earnings improved from $11.43 to $12.18 per share, earnings on equity decreased from the 19.8% of 1972. This decline occurred because the gain in earnings was not commensurate with the increase in shareholders' investment. We had forecast in last year's report that such a decline was likely. Unfortunately, our forecast proved to be correct. Our textile, banking, and most insurance operations had good years, but certain segments of the insurance business turned in poor results. Overall, our insurance business continues to be a most attractive area in which to employ capital. Management'...

巴菲特致股东信-1975年

 笔记: 华盛顿邮报已成为伯克希尔第一重仓股 翻译: 雪球:https://xueqiu.com/6217262310/131409324 备份:https://archive.ph/4hgK3 原文: To the Stockholders of Berkshire Hathaway Inc.: Last year, when discussing the prospects for 1975, we stated “the outlook for 1975 is not encouraging.” This forecast proved to be distressingly accurate. Our operating earnings for 1975 were $6,713,592, or $6.85 per share, producing a return on beginning shareholders ’ equity of 7.6%. This is the lowest return on equity experienced since 1967. Furthermore, as explained later in this letter, a large segment of these earnings resulted from Federal income tax refunds which will not be available to assist performance in 1976. On balance, however, current trends indicate a somewhat brighter 1976. Operations and prospects will be discussed in greater detail below, under specific industry titles. Our expectation is that significantly better results in textiles, earnings added from recent acquisitio...

Steve Jobs introduced the iPhone on January 9, 2007.

This is a day I’ve been looking forward to for two and a half years. Link Every once in a while, a revolutionary product comes along that changes everything. And Apple has been— well, first of all, one’s very fortunate if you get to work on just one of these in your career. Apple’s been very fortunate. It’s been able to introduce a few of these into the world. In 1984, we introduced the Macintosh. It didn’t just change Apple, it changed the whole computer industry. In 2001, we introduced the first iPod, and it didn’t just change the way we all listen to music, it changed the entire music industry. Well, today, we’re introducing three revolutionary products of this class. The first one is a widescreen iPod with touch controls. The second is a revolutionary mobile phone. And the third is a breakthrough internet communications device. So, three things: a widescreen iPod with touch controls; a revolutionary mobile phone; and a breakthrough internet communicat...

产品随想 | 周刊 第90期:史家之绝唱,无韵之离骚

Why AI Will Save the World   https://a16z.com/2023/06/06/ai-will-save-the-world/ Marc Andreessen的雄文,十分有說服力,邏輯清晰 辯證了現今AI監管拋出的5個可能的AI問題 讀的過程中,腦海裏浮現的都是編程隨想那篇文章 为什么马克思是错的?——全面批判马列主义的知名著作导读   https://program-think.blogspot.com/2018/09/Book-Review-The-Errors-of-Marxism-Leninism.html 兩者的思維鏈條、敘事方式,非常相似 人民聖殿教   https://zh.wikipedia.org/zh-hk/人民圣殿教?useskin=vector 瓊斯自稱是神的化身,幾千年前轉世為釋迦牟尼,創建了佛教;後來又轉世為耶穌基督,創建了基督教;之後短期化身轉世為巴孛,建立巴哈伊信仰;最後轉世為列寧,將社會主義發揚光大。 邪教徒聲稱自己轉世成了列寧,這說明了什麼? Apple Vision   https://stratechery.com/2023/apple-vision Omnivore   https://github.com/omnivore-app/omnivore Omnivore is a complete, open source read-it-later solution for people who like reading. How the YouTube Algorithm Works in 2023: The Complete Guide   https://blog.hootsuite.com/how-the-youtube-algorithm-works/#A_brief_history_of_the_YouTube_algorithm 外人眼中的YouTube推薦算法變遷 Histography   https://histography.io/ “Histography" is interactive timeline that spans across 14 billion years of history, f...

巴菲特致股东信-1974年

 笔记: 价格战企业的逻辑:需要降价获取销量--->需要降低成本--->怎么降?扩大规模以摊低成本--->提高固定资产投入--->净资产回报率会降低 翻译: 雪球:https://xueqiu.com/6217262310/131257947 备份:https://archive.ph/5CEP6 原文: To the Stockholders of Berkshire Hathaway Inc.: Operating results for 1974 overall were unsatisfactory due to the poor performance of our insurance business. In last year's annual report some decline in profitability was predicted but the extent of this decline, which accelerated during the year, was a surprise. Operating earnings for 1974 were $8,383,576, or $8.56 per share, for a return on beginning shareholders' equity of 10.3%. This is the lowest return on equity realized since 1970. Our textile division and our bank both performed very well, turning in improved results against the already good figures of 1973. However, insurance underwriting, which has been mentioned in the last several annual reports as running at levels of unsustainable profitability, turned dramatically worse...

Interview with Steve Jobs, WGBH, 1990

Interviewer: what is it about this machine? Why is this machine so interesting? Why has it been so influential? Jobs: Ah ahm, I'll give you my point of view on it. I remember reading a magazine article a long time ago ah when I was ah twelve years ago maybe, in I think it was Scientific American . I'm not sure. And the article ahm proposed to measure the efficiency of locomotion for ah lots of species on planet earth to see which species was the most efficient at getting from point A to point B. Ah and they measured the kilocalories that each one expended. So ah they ranked them all and I remember that ahm...ah the Condor, Condor was the most efficient at [CLEARS THROAT] getting from point A to point B. And humankind, the crown of creation came in with a rather unimpressive showing about a third of the way down...