Open
Conversation
I could not get pipeswitch to match some ports, and I was getting these errors in logs:
```
Nov 20 06:28:56 hostname pipeswitchd[21760]: 2025-11-20T06:28:56+09:00 - ERROR - channel not valid: UNK
```
It turned out the port of our application had `audio.channel` set to `UNK` for some reason:
```json
{
"id": 156,
"type": "PipeWire:Interface:Port",
"version": 3,
"permissions": [ "r", "x", "m" ],
"info": {
"direction": "output",
"change-mask": [ "props", "params" ],
"props": {
"audio.channel": "UNK",
"format.dsp": "32 bit float mono audio",
"node.id": 146,
"object.id": 156,
"object.path": "tonari-main-playback:output_3",
"object.serial": 1450,
"port.alias": "tonari-main-playback:output_4",
"port.direction": "out",
"port.group": "stream.0",
"port.id": 3,
"port.name": "output_4"
},
"params": {
"EnumFormat": [
{
"mediaType": "audio",
"mediaSubtype": "dsp",
"format": "F32P"
}
],
"Meta": [
{
"type": "Header",
"size": 32
}
],
"IO": [
{
"id": "Buffers",
"size": 8
},
{
"id": "AsyncBuffers",
"size": 8
}
],
"Format": [ ],
"Buffers": [ ],
"Latency": [
{
"direction": "Input",
"minQuantum": 0.000000,
"maxQuantum": 0.000000,
"minRate": 0,
"maxRate": 0,
"minNs": 0,
"maxNs": 0
},
{
"direction": "Output",
"minQuantum": 0.000000,
"maxQuantum": 0.000000,
"minRate": 0,
"maxRate": 0,
"minNs": 0,
"maxNs": 0
}
],
"Tag": [
]
}
}
}
```
Instead of returning Err, return Ok(None), which activates the fallback one level higher, which does the right thing.
Author
|
Actually I'm getting more errors now for different devices: Now I see there are many channels and spa methods to convert between their integer and string representations: https://pipewire.pages.freedesktop.org/pipewire-rs/libspa/index.html?search=spa_audio_channel But I don't think we need to deal with that: it should fine to represent them as Strings. I'll give it a try. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I could not get pipeswitch to match some ports, and I was getting these errors in logs:
It turned out the port of our application had
audio.channelset toUNKfor some reason:{ "id": 156, "type": "PipeWire:Interface:Port", "version": 3, "permissions": [ "r", "x", "m" ], "info": { "direction": "output", "change-mask": [ "props", "params" ], "props": { "audio.channel": "UNK", "format.dsp": "32 bit float mono audio", "node.id": 146, "object.id": 156, "object.path": "tonari-main-playback:output_3", "object.serial": 1450, "port.alias": "tonari-main-playback:output_4", "port.direction": "out", "port.group": "stream.0", "port.id": 3, "port.name": "output_4" }, "params": { "EnumFormat": [ { "mediaType": "audio", "mediaSubtype": "dsp", "format": "F32P" } ], "Meta": [ { "type": "Header", "size": 32 } ], "IO": [ { "id": "Buffers", "size": 8 }, { "id": "AsyncBuffers", "size": 8 } ], "Format": [ ], "Buffers": [ ], "Latency": [ { "direction": "Input", "minQuantum": 0.000000, "maxQuantum": 0.000000, "minRate": 0, "maxRate": 0, "minNs": 0, "maxNs": 0 }, { "direction": "Output", "minQuantum": 0.000000, "maxQuantum": 0.000000, "minRate": 0, "maxRate": 0, "minNs": 0, "maxNs": 0 } ], "Tag": [ ] } } }Instead of returning Err, return Ok(None), which activates the fallback one level higher, which does the right thing.
This fixes pipeswitch operation for our use-case. tonari internal reference: https://github.com/tonarino/portal/pull/5717#issuecomment-3554248816