《更好的解释(数学篇)》——后序
LISP爱好者改编的歌曲……Eternal Flame

Ubuntu下关闭笔记本电脑的内置摄像头的一种方法

λ posted @ 2011年9月25日 19:37 in Mixture with tags tutorial ubuntu uvcvideo , 12519 阅读

先說明:我用的是Lenovo G450,用的是uvc攝像頭驅動


對於在網上論壇找不到合適的方法,以及Ubuntu隻有音頻設置軟件,我感到十分無奈。也許是大蝦們不想為那些對Linux沒有學習興趣的人費口水的關係吧,沒搜尋到一絲有見解的解決方案。不過算了,最終還是自己動腦解決了……

正所謂一切皆文件嘛,要解決攝像頭的問題,當然得找攝像頭的相關設備文件和驅動了。想想在Windows下是通過設備管理工具缷載攝像頭驅動的,那Linux下的驅動文件都是咋缷載的呢?通過查閱資料得知Linux下的驅動文件是以.ko為文件名後綴的,啟動系統後就會加載到內核模塊中去。於是知道該怎麼動手了,打開Terminal:

1.  lsmod | grep "video"  列出內核加載的模塊,發現了uvcvideo,遂GOOGLE之,得知其為攝像頭驅動的一種。其實另外還有videodevvideo,不過怎麼看也不像是攝像頭輸入直接相關的而像是平時看視頻用的。

2. 現在請關閉所有正在使用攝像頭的程序。

3.  sudo rmmod uvcvideo  缷載這個驅動。任務完成 :)

4. 下面是恢復的方法,同樣先關閉要使用攝像頭的程序。

5.  find /lib/modules/x.x.xx-xx-generic/kernel/drivers/ -name "uvcvideo.ko"  或者  locate uvcvideo.ko xx隻是代表一些數字),找到驅動文件所在地,實在不爽可以幹掉它,不過不保證筆記本或你本身會有什麼後遺症。

6.  sudo insmod /lib/modules/x.x.xx-xx-generic/kernel/drivers/media/video/uvc/uvcvideo.ko  根據第5步找到的完整路徑加載驅動。OK。

經由樓下的熱心觀眾的提示,以及時間與腦力的關係,以上的步驟3 、5 、6可由以下兩步代替 @_@ ,兼且行為更加徹底(會把videodev模塊也自動去掉,如果它暫時用不著):

 sudo modprobe -rv uvcvideo  缷載 uvcvideo 。

 sudo modprobe -v uvcvideo  自動搜尋 uvcvideo 驅動並裝載。

一個 modprobe 就完成了大部分操作,又方便記憶。(其實我還是覺得rmmodinsmod比較直觀,配合lsmod

 

不過,一重啟又還原了 -_-; ,那麼還應該找到 /etc/modprobe.d/blacklist.conf 文件,在裏面加入一行:

blacklist uvcvideo

就OK了。 


本網站無註明「轉載」的著作均由Jak Wings製作 CC BY-NC-SA 2.5
Creative Commons 保持署名-相同方式分享 2.5

Avatar_small
依云 说:
Sep 25, 2011 08:30:35 PM

后面那个可以直接用 modprobe 命令,它会按名称找到你要的模块。

Avatar_small
λ 说:
Sep 25, 2011 11:22:10 PM

Thanks,我再改一下~

Emma 说:
Jan 17, 2023 06:18:13 PM

It is relatively easy to turn off the built-in camera of a laptop under Ubuntu. There are a few different methods cbd products that can be used. One method is to use the "rmmod" command. This will remove the module associated with the camera, effectively turning it off. Another method is to use the "echo 0" command. This will disable the camera interface and turn off the power to the camera.

celebrity heights 说:
Jul 14, 2023 02:44:51 PM

Unlock the secrets of celebrity statures at celeb height wiki Pro: your premier destination for reliable and up-to-date heights!


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter