Hauppauge HD PVRの簡易キャプチャソフトの話を前にも書いたけど、その後もチマチマと直したりしている。マルチバッファリングの個々のバッファのサイズはどれくらいが適切か?とか、アダプティブに変える?とか悩んでたのだが、よく考えてみればUSBデバイスなのだから、MaxPacketSizeが決まっているはず(あほくさ)。
問題は、どうやってMaxPacketSizeを知るかだが、WindowsでChapter9テストとかやればいいのだろうか?と思ったらこの手のツールはlinuxにはちゃんとあるんですね。
lsusb -v での結果をみると、512でいいようだ。
ついでに、キャプチャのプロセスの優先度を自分で上げるように変更してみた。もちろんroot権限で実行する分には問題ないのだけれど、chmod +s とかで、権限を与えても一般ユーザーではうまくいかない…ナゼ?。要調査
%lsusb -v
(途中省略)
Bus 004 Device 050: ID 2040:4900 Hauppauge
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x2040 Hauppauge
idProduct 0x4900
bcdDevice 0.00
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 4mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
can't get device qualifier: Operation not permitted
can't get debug descriptor: Operation not permitted
cannot read device status, Operation not permitted (1)