Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BasedOnStyle: Google
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 100

# pointers/references are aligned to the type
PointerAlignment: Left
# Include space after C-style cast
SpaceAfterCStyleCast: true
30 changes: 30 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint and Pre-commit Checks
permissions:
contents: read

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit
run: pre-commit run --all-files
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
exclude: ^uvcSupport/
repos:
# General pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-yaml
- id: check-json
- id: check-xml
- id: mixed-line-ending
args: ['--fix=lf']


- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format
52 changes: 26 additions & 26 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Copyright (c) 2018 Brookhaven Science Associates, as Operator
of Brookhaven National Laboratory

All Rights Reserved

Area detector USB Video Class (UVC) device driver implementation

Photon Sciences Division
Expand All @@ -16,41 +16,41 @@ EXCEPTIONS


OPEN SOURCE LICENSE
Redistribution and use in source and binary forms, with or without

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Software changes,
modifications, or derivative works, should be noted with comments and

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Software changes,
modifications, or derivative works, should be noted with comments and
the author and organization's name.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the names of Brookhaven Science Associates, Brookhaven National
Laboratory, or the Department of Energy nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
4. The software and the end-user documentation included with the

4. The software and the end-user documentation included with the
redistribution, if any, must include the following acknowledgment:
"This product includes software produced with the support of the

"This product includes software produced with the support of the
Brookhaven National Laboratory Photon Sciences division."

****************************************************************************

DISCLAIMER

THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND.
Neither the United States GOVERNMENT, nor the United States Department
of Energy, NOR Brookhaven National Laboratory, LLC, nor any of their employees, makes
any warranty, express or implied, or assumes any legal liability or
responsibility for the accuracy, completeness, or usefulness of any
information, data, apparatus, product, or process disclosed, or

Neither the United States GOVERNMENT, nor the United States Department
of Energy, NOR Brookhaven National Laboratory, LLC, nor any of their employees, makes
any warranty, express or implied, or assumes any legal liability or
responsibility for the accuracy, completeness, or usefulness of any
information, data, apparatus, product, or process disclosed, or
represents that its use would not infringe privately owned rights.
****************************************************************************

****************************************************************************
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An [EPICS](www.aps.anl.gov/epics) [areaDetector](https://github.com/areaDetector/areaDetector/blob/master/README.md) driver for communicating with USB Video Class (UVC) devices, including consumer webcams and some industrial cameras, using the open source [libuvc library](https://github.com/libuvc/libuvc).

The driver has been tested on 64 bit linux only, but it is possible that it will also work on windows and other architectures as well.
The driver has been tested on 64 bit linux only, but it is possible that it will also work on windows and other architectures as well.

It was tested with many devices, including the following:

Expand Down
12 changes: 6 additions & 6 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ADUVC RELEASES

Author: Jakub Wlodek
Author: Jakub Wlodek

ADUVC requires libusb, libuvc, epics-base, epics-modules, ADCore, and ADSupport. Further installation information can be found in the README file.

Expand Down Expand Up @@ -30,7 +30,7 @@ R1-7 (27-January-2023)
* Fixes
* Minor bug with continuous acquisition mode fixed
* Avoid "Auto Adjust" as default behavior


R1-6 (1-December-2020)
----
Expand Down Expand Up @@ -64,9 +64,9 @@ R1-4 (18-August-2020)
* Allow for helper utilities to compile with non-system installed libuvc

* Known Issues
* `libuvc` relies on `libusb-1.0`, not `libusb`.
* `libuvc` relies on `libusb-1.0`, not `libusb`.
* When camera is not connected, driver segmentation faults - should be handled more gracefully.


R1-3 (06-September-2019)
-----
Expand Down Expand Up @@ -113,7 +113,7 @@ R1-1 (28-January-2019)
* Updated documentation with params[in]/[out]
* Added LICENSE
* Code formatting cleaned up (removed all tab characters)


R1-0 (7-December-2018)
-----
Expand All @@ -131,7 +131,7 @@ R1-0 (7-December-2018)

R0-1 (Beta) (5-November-2018)
-----
* Key detector features implemented:
* Key detector features implemented:
* Image Acquisition supported and tested.
* Acquisition mode selection supported and tested
* Diagnostic information acquisition
Expand Down
2 changes: 1 addition & 1 deletion configure/CONFIG
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ include $(TOP)/configure/CONFIG_SITE
ifdef T_A
-include $(TOP)/configure/CONFIG_SITE.Common.$(T_A)
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
endif
endif
2 changes: 1 addition & 1 deletion configure/CONFIG_SITE
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ CHECK_RELEASE = YES
ifdef T_A
-include $(AREA_DETECTOR)/configure/CONFIG_SITE.Common.$(T_A)
-include $(AREA_DETECTOR)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
endif
endif
2 changes: 1 addition & 1 deletion configure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ include $(TOP)/configure/CONFIG
TARGETS = $(CONFIG_TARGETS)
CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS)))

include $(TOP)/configure/RULES
include $(TOP)/configure/RULES
2 changes: 1 addition & 1 deletion configure/RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

-include $(TOP)/../configure/RELEASE_LIBS_INCLUDE
-include $(TOP)/RELEASE.local
-include $(TOP)/configure/RELEASE.local
-include $(TOP)/configure/RELEASE.local
2 changes: 1 addition & 1 deletion configure/RULES
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
include $(CONFIG)/RULES

# Library should be rebuilt because LIBOBJS may have changed.
$(LIBNAME): ../Makefile
$(LIBNAME): ../Makefile
2 changes: 1 addition & 1 deletion configure/RULES.ioc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#RULES.ioc
include $(CONFIG)/RULES.ioc
include $(CONFIG)/RULES.ioc
2 changes: 1 addition & 1 deletion configure/RULES_DIRS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#RULES_DIRS
include $(CONFIG)/RULES_DIRS
include $(CONFIG)/RULES_DIRS
2 changes: 1 addition & 1 deletion configure/RULES_TOP
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#RULES_TOP
include $(CONFIG)/RULES_TOP
include $(CONFIG)/RULES_TOP
12 changes: 5 additions & 7 deletions docs/ADUVC/ADUVC.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ An EPICS driver for USB Video Class (UVC) devices
.. _libuvc: https://github.com/ktossell/libuvc
.. _ADUVC: https://github.com/epicsNSLS2-areaDetector/ADUVC
.. _areaDetector: https://github.com/areaDetector

Overview
--------

Expand Down Expand Up @@ -56,7 +56,7 @@ Issues with root ownership of UVC devices
-----------------------------------------

The USB camera device is typically owned by root, which prevents EPICS IOC from running as softioc user, and automatic startup using procServer. To grant access to USB camera device by other users, such as softioc, we wrote udev rules::

kgofron@xf17bm-ioc2:/etc/udev/rules.d$ more usb-cams.rules
# cam1 f007
SUBSYSTEM=="usb", ATTRS{idVendor}=="f007", OWNER="softioc", GROUP="softioc", MODE="0666", SYMLINK="cam1"
Expand Down Expand Up @@ -160,7 +160,7 @@ Release Notes
- Allow for helper utilities to compile with non-system installed libuvc

- Known Issues

- libuvc relies on libusb-1.0, not libusb.
- When camera is not connected, driver segmentation faults; should be handled more gracefully.

Expand Down Expand Up @@ -293,15 +293,13 @@ Known Issues and pull requests
------------------------------

- To submit an issue or a pull request for ADUVC, please do so at the source fork on `Github <https://github.com/epicsNSLS2-areaDetector/ADUVC>`__.
- Many low end vendors do not assign Serial Numbers (S/N), and such cameras must be started using Product Number instead.
- Many low end vendors do not assign Serial Numbers (S/N), and such cameras must be started using Product Number instead.
- Some vendors assign same S/N for the same model, and such multiples of such cameras do not work well when connected to same computer USB hub.
- USB cameras have to be accessed by root, and access by other users is enabled by modifying /etc/udev/rules.
- USB cameras have to be accessed by root, and access by other users is enabled by modifying /etc/udev/rules.

Important links
---------------

- libuvc_, is a cross-platform library for USB video devices.
- ADUVC_ driver on Github.
- areaDetector_ on Github.


32 changes: 16 additions & 16 deletions docs/ADUVC/lsusb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

kaz@kaz-VirtualBox:~/src/git/camera/pandac$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 80ee:0030 VirtualBox
Bus 001 Device 003: ID 80ee:0030 VirtualBox
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

kaz@kaz-VirtualBox:~/src/git/camera/pandac$ lsusb -s 001:003 -v

Bus 001 Device 003: ID 80ee:0030 VirtualBox
Bus 001 Device 003: ID 80ee:0030 VirtualBox
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
Expand All @@ -19,19 +19,19 @@
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 16
idVendor 0x80ee VirtualBox
idProduct 0x0030
idProduct 0x0030
bcdDevice 1.00
iManufacturer 1
iProduct 2
iSerial 3
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 487
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Expand All @@ -42,8 +42,8 @@
bInterfaceCount 2
bFunctionClass 14 Video
bFunctionSubClass 3 Video Interface Collection
bFunctionProtocol 0
iFunction 2
bFunctionProtocol 0
iFunction 2
Interface Descriptor:
bLength 9
bDescriptorType 4
Expand All @@ -52,8 +52,8 @@
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 1 Video Control
bInterfaceProtocol 0
iInterface 2
bInterfaceProtocol 0
iInterface 2
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
Expand All @@ -70,7 +70,7 @@
bTerminalID 1
wTerminalType 0x0201 Camera Sensor
bAssocTerminal 0
iTerminal 0
iTerminal 0
wObjectiveFocalLengthMin 0
wObjectiveFocalLengthMax 0
wOcularFocalLength 0
Expand All @@ -87,7 +87,7 @@
bControlSize 3
bmControls 0x00000001
Brightness
iProcessing 0
iProcessing 0
bmVideoStandards 0x 9
None
SECAM - 625/50
Expand All @@ -99,7 +99,7 @@
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 2
iTerminal 0
iTerminal 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
Expand All @@ -118,8 +118,8 @@
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
bInterfaceProtocol 0
iInterface 0
VideoStreaming Interface Descriptor:
bLength 14
bDescriptorType 36
Expand Down
Loading