Linux ç flashplayer ã§ä»»æã® capture ããã¤ã¹ããé²é³ããã«ã¯ï¼
Linux ã§ä½¿ç¨ã§ããè¯ã Webcam ã¨ã㦠Qcam Pro 9000 ãè³¼å ¥ãã¾ããï¼ããã§ï¼ç§ãèªå® ustreamer ã«å度仲éå ¥ãã§ãããã¨æã£ã¦ãã¾ããï¼ããããªããï¼äººçã¯ã¨ã¦ãå³ãããã®ã§ãï¼luvcview ã§æ åã¯åãã¦ããï¼arecord ã§é³å£°ãåãã¦ããã®ã§å¤§ä¸å¤«ã ã¨æãããï¼flashplayer ãè²ã ã¨ããããã¦ããã¦ãã¾ãï¼ãªãã¨ï¼flashplayer ã®ææ°ç (9.0.115) ã§ã¯ï¼ãããªå ¥å㯠V4L1ï¼é³å£°å ¥å㯠ALSA ã®ããã©ã«ãããã¤ã¹ã«åºå®ããã¦ãã¾ããï¼uvcvideo 㯠V4L2 ãªã®ã§ãã®ã¾ã¾ã§ã¯ã«ã¡ã©ããã®æ åã flash ãåãè¾¼ãã¾ãããï¼USB Audio ã¯ããã©ã«ãããã¤ã¹ã§ã¯ãªãã®ã§é³å£°ãåãè¾¼ãã¾ãã ï¼ï¼
ããããã¨èª¿ã¹ã¦ããã¨ããï¼Screencast4Linux ã¨ããããã¸ã§ã¯ããçºè¦ãã¾ããï¼ãã®ããã¸ã§ã¯ãã¯ï¼Linux ã§ã¹ã¯ãªã¼ã³ãã£ã¹ãããããï¼V4L ã®ä»®æ³ããã¤ã¹ãä½ã£ã¦ãã¾ãï¼ç´ æ´ããã§ãï¼ãã® Screencast4Linux 㨠luvcvideo ãçµã¿åãããã°ï¼ManyCam ã¿ãããªäºãã§ãã¡ãããã§ããï¼ã¨ã¦ãé¢ç½ãããªã®ã§ï¼æ©é RTM ã«ãScreencast4Linux + luvcview ãä½ããã£ã¦ããã¿ã¹ã¯ãä½æãã¦ããã¾ããï¼ã¾ã ã¿ã¹ã¯ãä½ã£ãã ããªã®ã§è§£æ±ºãã¦ã¯ãã¾ããã ï¼ï¼
次ã«é³å£°ã§ãï¼ããã¤ãã¡ã¨åä»ãªãã§ãï¼ã§ãï¼ã¨ã¦ãç´ ç´ãªæ¹æ³ã§è§£æ±ºã§ãã¾ããï¼
ã¾ãç°å¢æ¡ä»¶ã«ã¤ãã¦æ´çãã¾ãï¼ç§ã®è¨ç®æ©ç°å¢ã«ã¯ãªã³ãã¼ãã®ãµã¦ã³ãããã¤ã¹ã¨ã㦠HDA Intel ãããã¾ãï¼ããã«å ãã¦ï¼æ°ãã« Qcam Pro 9000 ãæã£ã¦ãããã¤ã¯ã USB Audio ã¨ãã¦èªèããã¾ããï¼ALSA ããè¦ãã¨ï¼CARD0 ã HDA Intelï¼CARD1 ã USB Audio ã«ãªã£ã¦ãã¦ï¼CARD0 㯠playback 㨠capture ã®ä¸¡ PCM ããã¤ã¹ãããï¼CARD1 ã«ã¯ capture PCM ããã¤ã¹ãããªãç¶æ ã§ãï¼
flashplayer ã Linux Microphone ã¨ãã¦ã©ã® capture ããã¤ã¹ãèªèãã¦ããã®ãæåã¯ä¸æã§ããï¼ããã§ï¼strings libflashplayer.so ããã£ã¦ã¿ãã¨ããï¼ãplug:hw0,0ãã¨ããæååãåãè¾¼ã¾ãã¦ããäºãåããã¾ããï¼ããããï¼Linux Microphone ã plug:hw0,0 ãæãã¦ãããã¨ãæ¨æ¸¬ã§ãã¾ãï¼ãããå®éã«ã¯éã£ã¦ãã¦ï¼å¾è¿°ã®ããã« Linux Microphone 㯠ALSA ã®ããã©ã«ã capture ããã¤ã¹ã§ãããã¨ãåãã£ã¦ãã¾ãï¼ï¼ããã§ï¼CARD0 㨠CARD1 ãå ¥ãæ¿ãã¦ãããã¨ç»çãã¾ããï¼
è¤æ°ã®ãµã¦ã³ãããã¤ã¹ãåå¨ããã¨ãï¼ALSA ããè¦ãå ´åã®ã«ã¼ãçªå·ãã©ã®ããã«å²ãå½ã¦ãããã®ã§ããããï¼ç¹ã«è¨å®ãã¦ããªããã°ï¼ããã¤ã¹ãã©ã¤ãããã¼ãããé çªã«çªå·ãå²ãå½ã¦ããã¾ã[MultipleCards - ALSA wiki]ï¼ããã§ã¯ãªãï¼ç¹å®ã®ããã¤ã¹ãç¹å®ã®çªå·ã¸å²ãå½ã¦ãã«ã¯ï¼ã¢ã¸ã¥ã¼ã«ã®ã¨ã¤ãªã¢ã¹ãè¨å®ãã¾ãï¼ä¾ãã°ï¼ç§ã®ç°å¢ã§ CARD0 ã« USB Audioï¼CARD1 ã« HDA Intel ãå²ãå½ã¦ãã«ã¯æ¬¡ã®ããã« /etc/modprobe.d/sound ãæ¸ãæãã¾ã*1ï¼
# Logicool Qcam Pro 9000 alias sound-slot-0 snd-card-0 alias snd-card-0 snd-usb-audio options snd-usb-audio index=0 vid=0x46d pid=0x990 # HDA Intel alias sound-slot-1 snd-card-1 alias sound-service-1-0 snd-mixer-oss alias sound-service-1-1 snd-seq-oss alias sound-service-1-3 snd-pcm-oss alias sound-service-1-8 snd-seq-oss alias sound-service-1-12 snd-pcm-osshree alias snd-card-1 snd-hda-intel options snd-hda-intel index=1
ãã®ãããªè¨å®ãè¡ãï¼ãµã¦ã³ãé¢é£ã®ããã¤ã¹ããã¹ã¦ rmmod ãï¼ããä¸åº¦ modprobe ãããã¨ã§ï¼CARD0 ã USB Audio ã«ãªãï¼CARD1 ã HDA Intel ã«ãªãã¾ãï¼
ãã®ç¶æ ã§ï¼flashplayer ããã¡ã㨠Qcam Pro 9000 ã®ãã¤ã¯ããé³ãæ¾ã£ã¦ããããã©ãã確ãããã®ã§ããï¼ããããªãã¤ãºãé²é³ãããã ãã§ä¸æãè¡ãã¾ããã§ããï¼ããã ãã§ãªãï¼CARD0 ã« playback PCM ããã¤ã¹ãåå¨ããªãããï¼ãã¡ãã¡ CARD1 ãåºåå ã¨ãã¦æå®ããªããã°é³ãé³´ããªããªã£ã¦ãã¾ã£ãã®ã§ã ï¼ï¼ ãã®ç¶æ ã¯ã¨ã¦ãä¸ä¾¿ãªã®ã§ï¼æ¬¡ã®ãã㪠~/.asoundrc ãæ¸ãã¦ï¼ããã©ã«ãããã¤ã¹ã dmixer ã«ãã¾ããï¼
pcm.!default { type plug slave.pcm "dmixer" } pcm.dmixer { type dmix ipc_key 838861 ipc_key_add_uid true slave { pcm "hw:1,0" period_size 1024 buffer_size 8192 rate 48000 periods 0 period_time 0 } bindings { 0 0 1 1 } }
ãããã¦ï¼åºåå ãç¹ã«æå®ããã¨ãåæã« CARD1 ããåºåãã¦ãããããã«ãªãã¾ããï¼ã¨ãããï¼ãã®è¨å®ããã¦ä»¥éã¯ï¼flashplayer ã¯é³ãå ¨ãæ¾ããªããªã£ã¦ãã¾ãã¾ãã ï¼ï¼ ãªããã®ãããªç¾è±¡ãèµ·ãã£ãã®ãèãã¦ã¿ã¾ãããï¼çç±ã¯ä¸ã¤ããæãå½ããã¾ããï¼ããã¯ï¼ããã©ã«ãã® PCM ããã¤ã¹ã dmixer ã«åºå®ããã¦ãããã¨ã§ãï¼dmixer ã¯åçå°ç¨ã®ãã©ã°ã¤ã³ã§ãããï¼é²é³ã§ä½¿ããããããªãã®ã§ãï¼
è²ã 調ã¹ãã¨ããï¼dmixer ã®é²é³çã¨ãè¨ãã dsnoop ã¨ãããã©ã°ã¤ã³ã®åå¨ã¨ï¼playback 㨠capture ãå¥åã§æå®å¯è½ãª asym ãã©ã°ã¤ã³ã®åå¨ãç¥ããã¨ãã§ãã¾ããï¼dsnoop ãç¨ã㦠USB Audio ããé²é³ããä»®æ³ããã¤ã¹ãä½ãï¼ããã©ã«ãããã¤ã¹ã§ã¯ playback ã®å ´åã« dmix ãï¼capture ã«å¯¾ãã¦ã¯ dsnoop ãæå®ãã¦ãããã°è¯ãã®ã ã¨æããã¾ãï¼ããã§ï¼æ¬¡ã®ããã« ~/.asoundrc ãæ¸ãæãã¾ããï¼
pcm.!default { type asym playback.pcm { type plug slave.pcm "dmixer" } capture.pcm { type plug slave.pcm "dsnooped" } } pcm.dmixer { type dmix ipc_key 838861 ipc_key_add_uid true slave { pcm "hw:1,0" period_size 1024 buffer_size 8192 rate 48000 periods 0 period_time 0 } bindings { 0 0 1 1 } } pcm.dsnooped { type dsnoop ipc_key 5150 ipc_key_add_uid true slave { pcm "hw:0,0" channels 1 period_size 1024 buffer_size 8192 rate 4800 periods 0 period_time 0 } }
ãã®è¨å®ã®ä¸ã§ arecord ãå®è¡ããã¨ï¼ããã¤ã¹ãæå®ããã¨ã Qcam Pro 9000 ã®ãã¤ã¯ããé³ãæ¾ã£ã¦ããã¾ããï¼ãã㦠aplay ã§ã¯ãã¡ãã¨ãªã³ãã¼ãããã¤ã¹ããé³ãé³´ã£ã¦ãã¾ãï¼ç´ æ´ããã§ãï¼flashplayer ã§è©¦ãã¦ã¿ãã¨ããï¼ustream 㧠Qcam Pro 9000 ã®ãã¤ã¯ãç¨ãã¦é²é³ãããã¨ãã§ãã¾ããï¼ï¼ï¼
ããã¾ã§æ¥ã¦ï¼æåã«è¨å®ãã CARD0 㨠CARD1 ã®é çªãå ¥ãæ¿ããè¨å®ã¯å¿ è¦ç¡ããã¨ã«æ°ã¥ãã¾ããï¼ãªã³ãã¼ãããã¤ã¹ã CARD1 ã§ï¼USB Audio ã CARD0 ã¨ããç¶æ ã¯ãªãã ãæ°æã¡ãæªãã§ãï¼ãããã£ã¦æ¬¡ã®ããã« /etc/modprobe.d/sound ãæ¸ãæãã¾ããï¼
# HDA Intel alias sound-slot-0 snd-card-0 alias sound-service-0-0 snd-mixer-oss alias sound-service-0-1 snd-seq-oss alias sound-service-0-3 snd-pcm-oss alias sound-service-0-8 snd-seq-oss alias sound-service-0-12 snd-pcm-osshree alias snd-card-0 snd-hda-intel options snd-hda-intel index=0 # Logicool Qcam Pro 9000 alias sound-slot-1 snd-card-1 alias snd-card-1 snd-usb-audio options snd-usb-audio index=1 id=QCAM-200S vid=0x46d pid=0x990
æå¾ã®è¡ã® options ã«ãid=QCAM-200Sãã¨ããå¼æ°ãå¢ããã¾ããï¼ãããæå®ããã¨ï¼ä»è¿ Ux46dx900 ã ã£ãã«ã¼ãåã QCAM-200S ã«å¤ããã¾ãï¼ãã®æ¹ãåãããããã§ãããï¼ãã®å¤æ´ã«ä¼´ã£ã¦ï¼~/.asoundrc ã次ã®ããã«æ¸ãå¤ããã¾ãï¼
pcm.!default { type asym playback.pcm { type plug slave.pcm "dmixer" } capture.pcm { type plug slave.pcm "dsnooped" } } pcm.dmixer { type dmix ipc_key 838861 ipc_key_add_uid true slave { pcm "hw:0,0" period_size 1024 buffer_size 8192 rate 48000 periods 0 period_time 0 } bindings { 0 0 1 1 } } pcm.dsnooped { type dsnoop ipc_key 5150 ipc_key_add_uid true slave { pcm "hw:1,0" channels 2 period_size 1024 buffer_size 8192 rate 4800 periods 0 period_time 0 } }
ãããã¦ãã§ããï¼flashplayer ã§ä»»æã® capture ããã¤ã¹ããé²é³ã§ããããã«ãªãã¾ããï¼ãããï¼ãã®ã¾ã¾ã§ã¯ï¼é²é³å ãå¤æ´ãããå ´åã«ï¼ãã¡ãã¡ ~/.asoundrc ãæ¸ãæã㦠firefox ãåèµ·åããªããã°ãªãã¾ãã ï¼ï¼ ããã解決ããã«ã¯ï¼è¤æ°ã® capture ããã¤ã¹ãã¾ã¨ããä¸ã¤ã®ä»®æ³ããã¤ã¹ãä½æã§ããã°è¯ãã¯ãã§ãï¼ãã®æ¹æ³ã«ã¤ãã¦ã¯ï¼ã¾ãã®æ©ä¼ã«èª¿ã¹ã¦ã¿ããã¨æãã¾ãï¼