Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera: pipewire-camera back-end detects no camera #9776

Open
1bsyl opened this issue May 13, 2024 · 3 comments
Open

Camera: pipewire-camera back-end detects no camera #9776

1bsyl opened this issue May 13, 2024 · 3 comments
Assignees
Milestone

Comments

@1bsyl
Copy link
Contributor

1bsyl commented May 13, 2024

on linux ubuntu-2404 + laptop, pipewire-camera backend gets initialized but see no camera. v4l2 actually sees 1 camera.

@madebr
Copy link
Contributor

madebr commented May 13, 2024

On Fedora 39, it looks like pipewire uses v4l2 behind the scenes:

$ SDL_CAMERA_DRIVER=v4l2 test/testcamera --trackmem
INFO:   - Camera #0:  HD WebCam: HD WebCam
$ SDL_CAMERA_DRIVER=pipewire test/testcamera --trackmem
INFO:   - Camera #0:  HD WebCam (V4L2)

The camera device name is a bit counter-intuitive here.

@1bsyl
Copy link
Contributor Author

1bsyl commented May 13, 2024

with pipe wire, I got

INFO: Saw 0 camera devices.
INFO: No cameras available?

not sure what to configure to get it working ...

@Green-Sky
Copy link
Contributor

check your config, in my config i have:

context.spa-libs = {
    #<factory-name regex> = <library-name>
    #
    # Used to find spa factory names. It maps an spa factory name
    # regular expression to a library name that should contain
    # that factory.
    #
    audio.convert.* = audioconvert/libspa-audioconvert
    avb.*           = avb/libspa-avb
    api.alsa.*      = alsa/libspa-alsa
    api.v4l2.*      = v4l2/libspa-v4l2
    api.libcamera.* = libcamera/libspa-libcamera
    api.bluez5.*    = bluez5/libspa-bluez5
    api.vulkan.*    = vulkan/libspa-vulkan
    api.jack.*      = jack/libspa-jack
    support.*       = support/libspa-support
    #videotestsrc   = videotestsrc/libspa-videotestsrc
    #audiotestsrc   = audiotestsrc/libspa-audiotestsrc
}

( run pw-config )

You can also run pw-dump and inspect the json to see all available devices (in case SDL does not pick up the video device)
example excerpt:

  {
    "id": 52,
    "type": "PipeWire:Interface:Node",
    "version": 3,
    "permissions": [ "r", "w", "x", "m" ],
    "info": {
      "max-input-ports": 0,
      "max-output-ports": 1,
      "change-mask": [ "input-ports", "output-ports", "state", "props", "params" ],
      "n-input-ports": 0,
      "n-output-ports": 1,
      "state": "suspended",
      "error": null,
      "props": {
        "api.libcamera.location": "front",
        "api.libcamera.path": "\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685",
        "client.id": 34,
        "clock.quantum-limit": 8192,
        "device.api": "libcamera",
        "device.description": "Chicony USB2.0 Camera: Chicony ",
        "device.id": 46,
        "device.name": "libcamera_device.\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685",
        "device.product.name": "Chicony USB2.0 Camera: Chicony ",
        "factory.id": 10,
        "factory.name": "api.libcamera.source",
        "media.class": "Video/Source",
        "media.role": "Camera",
        "node.description": "Built-in Front Camera",
        "node.driver": true,
        "node.name": "libcamera_input.__SB_.PCI0.GP18.XHC0.RHUB.PRT4-4_1.0-04f2_b685",
        "node.nick": "Chicony USB2.0 Camera  Chicony ",
        "node.pause-on-idle": false,
        "object.id": 52,
        "object.path": "libcamera:\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685",
        "object.serial": 55,
        "priority.session": 800
      },
      "params": {
        "PropInfo": [
          {
            "id": "device",
            "description": "The libcamera device",
            "type": "\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685"
          },
          {
            "id": "deviceName",
            "description": "The libcamera device name",
            "type": ""
          },
          {
            "id": "brightness",
            "description": "Brightness",
            "type": { "default": 0.000000, "min": -1.000000, "max": 1.000000 }
          },
          {
            "id": "contrast",
            "description": "Contrast",
            "type": { "default": 1.000000, "min": 0.500000, "max": 2.062500 }
          },
          {
            "id": "saturation",
            "description": "Saturation",
            "type": { "default": 1.000000, "min": 0.000000, "max": 3.125000 }
          }
        ],
        "Props": [
          {
            "device": "\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685",
            "deviceName": ""
          }
        ],
        "EnumFormat": [
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 640, "height": 480 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 160, "height": 120 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 176, "height": 144 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 320, "height": 240 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 352, "height": 288 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 640, "height": 360 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 640, "height": 480 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 1280, "height": 720 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 1280, "height": 720 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 640, "height": 480 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 160, "height": 120 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 176, "height": 144 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 320, "height": 240 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 352, "height": 288 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 640, "height": 360 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 640, "height": 480 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 1280, "height": 720 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 1280, "height": 720 }
          }
        ],
        "Format": [ ]
      }
    }
  },

@slouken slouken added this to the 3.2.0 milestone May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants