Linux API/usb2026. 11. 8. 23:16

gpt랑 대화하다가 검토중

uvc 카메라 두개를 하나의 root hub에 연결하면 대역폭 부족으로 하나가 인식이 안되는데

잘못된 보고를 하는 uvc 카메라의 경우(모든 장비가  bug-free가 아니니까 라고 표현)

이러한 것을 위해 드라이버 레벨에서 새롭게 대역폭을 계산해서 적용하도록 할 수 있는 옵션을 제공하나 보다.

다만 yuv 같은 경우처럼 고정된 크기라면 모를까  mjpeg 처럼 크기가 가변인건 안된다고 하는데

그럼.. h.264 cbr 의 경우는 ... 되는건가 싶었는데 압축 포맷이면 건너 뛴다고..

if (!(format->flags & UVC_FMT_FLAG_COMPRESSED) &&
    stream->dev->quirks & UVC_QUIRK_FIX_BANDWIDTH &&
    stream->intf->num_altsetting > 1) {

[링크 : https://github.com/torvalds/linux/blob/master/drivers/media/usb/uvc/uvc_video.c#L230]

 

나중에 한번 시도 할 만한 장비가 있으려나?

sudo modprobe -r uvcvideo
sudo modprobe uvcvideo quirks=0x80

 

What are quirks and how do I use them?
Not all UVC devices are bug-free. To be fair, most UVC devices are buggy, and some of them are so broken that they will not work with the uvcvideo driver out of the box. They should not have been labelled as UVC-compliant or even been sold, but the harm is done and we need to find a way to cope with it. That's why quirks have been introduced.

When a quasi-UVC device exhibits a UVC non-compliance (either because its developers have interpreted the UVC specification incorrectly, or because they forgot to implement parts of the specification that are not used by the Windows driver), the uvcvideo driver needs to handle that device in a special way. The driver tries to do detect those cases automatically, but needs to be explictly instructed on some cases. Each of those special cases is called a quirk and is identified by a flag.

UVC_QUIRK_FIX_BANDWIDTH 0x00000080 Try to estimate the bandwidth required for uncompressed streams instead on relying on the value reported by the camera. See FAQ 7 for more information.

[링크 : https://ideasonboard.org/uvc/faq/]

 

'Linux API > usb' 카테고리의 다른 글

usbfs / usb api  (0) 2012.02.04
/proc/bus/usb 의 내용이 없을 경우(There is no files /proc/bus/usb)  (0) 2009.06.08
usb 버스 정보 얻기  (0) 2009.06.08
Posted by 구차니
Linux API/usb2012. 2. 4. 18:24
심심(?)해서 USB 조이스틱 2개를 연결해서 본 목록

$ cat /proc/bus/usb/devices 
$ cat /sys/kernel/debug/usb/devices
에는 토폴로지 별로 상세하게 출력되고 

lsusb를 통해서도 볼수는 있는데
$ lsusb -d 12bd:a02f -v 식으로 하나의 장치만을 자세히 볼수도 있다.
$ lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 005: ID 0583:206f Padix Co., Ltd (Rockfire) 
Bus 003 Device 004: ID 12bd:a02f  
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


$ tree -a /dev/bus
/dev/bus
`-- usb
    |-- 001
    |   `-- 001
    |-- 002
    |   `-- 001
    |-- 003
    |   |-- 001
    |   |-- 004
    |   `-- 005
    |-- 004
    |   `-- 001
    `-- 005
        `-- 001

6 directories, 7 files 


















 
$ tree -a /proc/bus
/proc/bus
|-- input
|   |-- devices
|   `-- handlers
|-- pccard
|   `-- drivers
`-- pci
    |-- 00
    |   |-- 00.0
    |   |-- 02.0
    |   |-- 02.1
    |   |-- 1b.0
    |   |-- 1c.0
    |   |-- 1c.2
    |   |-- 1d.0
    |   |-- 1d.1
    |   |-- 1d.2
    |   |-- 1d.3
    |   |-- 1d.7
    |   |-- 1e.0
    |   |-- 1f.0
    |   |-- 1f.1
    |   |-- 1f.2
    |   `-- 1f.3
    |-- 02
    |   `-- 00.0
    |-- 06
    |   |-- 00.0
    |   |-- 00.2
    |   |-- 00.3
    |   |-- 00.4
    |   `-- 02.0
    `-- devices

6 directories, 26 files 
$ tree -a /sys/kernel/debug/usb/
/sys/kernel/debug/usb/
|-- devices
`-- usbmon
    |-- 0s
    |-- 0u
    |-- 1s
    |-- 1t
    |-- 1u
    |-- 2s
    |-- 2t
    |-- 2u
    |-- 3s
    |-- 3t
    |-- 3u
    |-- 4s
    |-- 4t
    |-- 4u
    |-- 5s
    |-- 5t
    `-- 5u

1 directory, 18 files 












 

$ tree -a /dev/input
/dev/input
|-- by-id
|   |-- usb-0583_USB_2-axis_8-button_gamepad-event-joystick -> ../event10
|   |-- usb-0583_USB_2-axis_8-button_gamepad-joystick -> ../js1
|   |-- usb-12bd_5-Axis_12-Button_with_POV-event-joystick -> ../event6
|   `-- usb-12bd_5-Axis_12-Button_with_POV-joystick -> ../js0
|-- by-path
|   |-- pci-0000:00:1d.1-usb-0:1:1.0-event-joystick -> ../event6
|   |-- pci-0000:00:1d.1-usb-0:1:1.0-joystick -> ../js0
|   |-- pci-0000:00:1d.1-usb-0:2:1.0-event-joystick -> ../event10
|   |-- pci-0000:00:1d.1-usb-0:2:1.0-joystick -> ../js1
|   |-- platform-i8042-serio-0-event-kbd -> ../event5
|   |-- platform-i8042-serio-2-event-mouse -> ../event8
|   `-- platform-i8042-serio-2-mouse -> ../mouse1
|-- event0
|-- event1
|-- event10
|-- event2
|-- event3
|-- event4
|-- event5
|-- event6
|-- event7
|-- event8
|-- event9
|-- js0
|-- js1
|-- mice
|-- mouse0
`-- mouse1

2 directories, 27 files 

아무튼, 개략적으로 USB 연결시 확인해야 할 경로는 위에 녀석들 뿐이려나?

[링크 : http://docs.blackfin.uclinux.org/kernel/generated/usb/index.html] << USB API
[링크 : http://www.linux-usb.org/USB-guide/book1.html]
Posted by 구차니
Linux API/usb2009. 6. 8. 20:27
증상 : USB hotplug 및 인식/사용에 아무런 이상없으나, /proc/bus/usb 에 아무런 파일 없음

mount -t usbfs usbfs /proc/bus/usb/
를 실행해주면 해결된다.

[링크 : http://www.linuxquestions.org/.../cannot-open-procbususbdevices-no-such-file-or-directory-378916/]


다른 링크에 의하면 ACPI 문제라던가, 커널 설정상의 문제가 있을 가능성이 있다고 한다.
[링크 : http://www.linuxquestions.org/.../mdk-10.2-no-usb-at-all-procbususbdevices-missing-326350/]

---
2012.02.04 추가

우분투에서 하니 usbfs로 마운트가 되지 않고 /proc/bus/usb 를 찾을 수 없다는 에러만 나타낸다.
그래서 mkdir로 생성해주려고 해도 배째는데, 아래와 같이 ln 으로 연결해주니 된다!!
대신 기존의 /proc/bus 는 통채로 사라지니 주의해야 한다.
차라리 /sys/kernel/debug/usb/devices 를 들어가서 보는게 나을지도 모르겠다.
$ sudo mount --bind /dev/bus /proc/bus
$ sudo ln -s /sys/kernel/debug/usb/devices /proc/bus/usb/devices   

[링크 : http://ubuntuforums.org/showthread.php?t=1648118 ] 



'Linux API > usb' 카테고리의 다른 글

uvc 카메라 대역폭 관련  (0) 2026.11.08
usbfs / usb api  (0) 2012.02.04
usb 버스 정보 얻기  (0) 2009.06.08
Posted by 구차니
Linux API/usb2009. 6. 8. 17:47
/proc/bus/usb/devices 를 읽으면 되는데
보기가 힘들다.


이걸 쉽게 보려면
usbtree 라는 perl 스크립트를 http://www.linux-usb.org/usb2.html 페이지에서 받아서 사용하면된다.

/: Bus 05.Port 1: Dev 1, Class=root_hub, Drv=ehci_hcd/8p, 480M
    |_ Port 1: Dev 7, If 0, Prod=ST3250310AS, Class=stor., Drv=usb-storage, 480M
    |_ Port 2: Dev 6, If 0, Prod=SKYMIRROR, Class=stor., Drv=usb-storage, 480M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Drv=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Drv=uhci_hcd/2p, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Drv=uhci_hcd/2p, 12M
    |_ Port 1: Dev 2, If 0, Prod=USB Optical Mouse, Class=HID, Drv=usbhid, 1.5M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Drv=uhci_hcd/2p, 12M

내용을 보니 그래도 버스 순서대로 출력이 되는 듯 하다.

'Linux API > usb' 카테고리의 다른 글

uvc 카메라 대역폭 관련  (0) 2026.11.08
usbfs / usb api  (0) 2012.02.04
/proc/bus/usb 의 내용이 없을 경우(There is no files /proc/bus/usb)  (0) 2009.06.08
Posted by 구차니