pipewire: module-roc-sink: explicity specify sender packet encoding

roc-toolkit commit 03d29eb97211ca87593566998c5087590c1bae38 [0]
("Add sample_format() and pcm_format() to SampleSpec") made
a change in how the packet encoding is determined. Specifically:

  This commit introduces small breaking change in C API:
  when we search for packet_encoding compatible with
  frame_encoding, we now take into account format too.

  It means that if you use ROC_FORMAT_PCM_FLOAT32 in frame_encoding,
  ROC_PACKET_ENCODING_AVP_L16_STEREO will not be selected automatically
  anymore, and you need to specify it manually via packet_encoding.

This causes module-roc-sink to fail to set up the ROC sender:

  roc_api: bad configuration: failed to select packet_encoding matching frame_encoding, set roc_sender_config.packet_encoding manually

So specify `ROC_PACKET_ENCODING_AVP_L16_STEREO` explicitly
as the packet encoding. This seems to work with roc-toolkit 0.3,
so the required version is not changed.

Fixes #4070

[0]: 03d29eb972
This commit is contained in:
Barnabás Pőcze 2024-06-20 03:00:41 +02:00 committed by Wim Taymans
parent ea7e0e9152
commit 6acfb53884

View file

@ -264,6 +264,7 @@ static int roc_sink_setup(struct module_roc_sink_data *data)
sender_config.frame_encoding.rate = data->rate;
sender_config.frame_encoding.channels = ROC_CHANNEL_LAYOUT_STEREO;
sender_config.frame_encoding.format = ROC_FORMAT_PCM_FLOAT32;
sender_config.packet_encoding = ROC_PACKET_ENCODING_AVP_L16_STEREO;
sender_config.fec_encoding = data->fec_code;
info.rate = data->rate;