How to set device output format?
On a target system with HDMI audio there are two output formats supported (s32le and s16le). Pipewire always seems to use s32le. How can i set/enforce s16le output? There is no sound output with s32le so i want to test s16le.
I've tested this on my local system with loopback device:
$ pw-cli e 49 EnumFormat
Object: size 240, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Id 1 (Spa:Enum:MediaType:audio)
Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Id 1 (Spa:Enum:MediaSubtype:raw)
Prop: key Spa:Pod:Object:Param:Format:Audio:format (65537), flags 00000000
Choice: type Spa:Enum:Choice:Enum, flags 00000000 44 4
Id 267 (Spa:Enum:AudioFormat:S32LE)
Id 267 (Spa:Enum:AudioFormat:S32LE)
Id 268 (Spa:Enum:AudioFormat:S32BE)
Id 263 (Spa:Enum:AudioFormat:S24_32LE)
Id 271 (Spa:Enum:AudioFormat:S24LE)
Id 259 (Spa:Enum:AudioFormat:S16LE)
Id 260 (Spa:Enum:AudioFormat:S16BE)
Prop: key Spa:Pod:Object:Param:Format:Audio:rate (65539), flags 00000000
Choice: type Spa:Enum:Choice:Range, flags 00000000 28 4
Int 48000
Int 8000
Int 192000
Prop: key Spa:Pod:Object:Param:Format:Audio:channels (65540), flags 00000000
Choice: type Spa:Enum:Choice:None, flags 00000000 20 4
Int 2
Prop: key Spa:Pod:Object:Param:Format:Audio:position (65541), flags 00000000
Array: child.size 4, child.type Spa:Id
Id 3 (Spa:Enum:AudioChannel:FL)
Id 4 (Spa:Enum:AudioChannel:FR)
These are some commands i've tested. They don't work (pw-cli e 49 4
still shows S32LE). I do not really have a clue though how it should be done. Any help appreciated.
$ pactl set-sink-formats 49 'pcm, format = "[ S16LE ]"'
Failure: Not supported
$ pw-cli set-param 49 4 { format: "S16LE" }
Object: size 32, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:Format (4)
Prop: key Spa:Pod:Object:Param:Format:Audio:format (65537), flags 00000000
Id 259 (Spa:Enum:AudioFormat:S16LE)