Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pipewire pipewire
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 405
    • Issues 405
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PipeWire
  • pipewirepipewire
  • Issues
  • #980

Closed
Open
Created Mar 27, 2021 by Andre Osku Schmidt@oskude

pw-dump output pipewire.sec.label is not always utf-8

i wanted to parse the output of pw-dump, but it seems the output is not valid utf-8:

 pw-dump -N | isutf8 -v
(standard input): line 578, char 33, byte 17439: Expecting bytes in the following ranges: 00..7F C2..F4.
65 6C 22 3A 20 22 D0 A1 BB EA FD 7F 22 2C 0A     | el": "......",.
                        ^^                       |         ^

and here some python test:

import subprocess
import json

#text = subprocess.run(["pw-dump", "-N"], capture_output=True, text=True).stdout
# above fails cause pw-dump output not valid utf-8?
text = subprocess.run(["pw-dump", "-N"], capture_output=True).stdout
data = json.loads(text)
print(data)

that errors out at the same point in input data:

 python3 test.py 
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    data = json.loads(text)
  File "/usr/lib/python3.9/json/__init__.py", line 341, in loads
    s = s.decode(detect_encoding(s), 'surrogatepass')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 17439: invalid start byte

if i pipe the output of pw-dump -N to a file, and look at it in my editor, some (all?) pipewire.sec.label entries look odd:

"pipewire.sec.label": "���",
"pipewire.sec.label": "\u0003"�:�!V,
"pipewire.sec.label": 0,
"pipewire.sec.label": "\b",
"pipewire.sec.label": "���",

fwiw, all above have these kind of parents:

    "id": <DIFFERENT>,
    "type": "PipeWire:Interface:Client",
    "version": 3,
    "permissions": [ "r", "w", "x", "m" ],
    "info": {
      "change-mask": [ "props" ],
      "props": {
        "pipewire.protocol": "protocol-native",
        "pipewire.sec.pid": <DIFFERENT>,
        "pipewire.sec.uid": 1000,
        "pipewire.sec.gid": 1000,

i searched a little in source and think it could have something to do with PW_KEY_SEC_LABEL and src/modules/module-protocol-native.c but i don't actually know what i'm reading.

i'm on archlinux with pipewire 0.3.24, and wonder if it's just my system...

Assignee
Assign to
Time tracking