Linux Pipewire backend does not switch samplerate
#16
With a bit of luck, remove this entry: https://github.com/xbmc/xbmc/blob/master...re.cpp#L59 - the rest should then default to 32 bit Int.
Forget about the exclusive change above.

Btw. just for you to understand what this does:

Music File -> Kodi -> Float-Planar -> Kodi -> SN32 Integer -> Pipewire.

So you put an additional conversion from planar float to 32 bit Integer, while Pipewire would perfectly understand float input and kodi only would interleave the planes.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#17
I left a comment in your bugreport and kindly asked what PW wants us to do and gave reasoning why kodi behaves like it behaves.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#18
Saw that, thank you.

I ripped out the 32 bit float formats from AESinkPipewire.cpp to satisfy my curiosity. Removing only this line resulted in the AESink not being initialized, though, so had to purge all references. Doing this resulted in...

exactly the same behaviour as with the float format still in place.

S   ID  QUANT   RATE    WAIT    BUSY   W/Q   B/Q  ERR FORMAT           NAME
R   41    512  48000 571.7us  22.7us  0.05  0.00    0    S32LE 2 48000 alsa_output.usb-miniDSP_miniDSP_Flex-00.analog-stereo
R   51    735  44100 125.5us 334.1us  0.01  0.03    0    S32LE 2 44100  + Kodi

Yes, I've put the default rate to 48000 to stop you from frowning.
Reply
#19
Frowning ;-).

Great - that's a bit of a surprise to me. Let's see what upstream says in the report.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#20
Additional idea:

Here: https://github.com/xbmc/xbmc/blob/master...e.cpp#L418 try to add

  std:Confusedtring 1bySampleRate =
      StringUtils::Format("{}/{}", "1", format.m_sampleRate);
SPA_DICT_ITEM_INIT(PW_KEY_NODE_RATE, 1bySampleRate.c_str());

Works now?
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#21
diff --git a/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp b/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp
index bc5e3d3f96..0fb3149a57 100644
--- a/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp
@@ -410,12 +410,15 @@ bool CAESinkPipewire::Initialize(AEAudioFormat& format, std::string& device)
   std::string fraction =
       StringUtils::Format("{}/{}", frames / DEFAULT_LATENCY_DIVIDER, format.m_sampleRate);
 
+  std::string srate = StringUtils::Format("{}/{}", 1, format.m_sampleRate);
+
   std::array<spa_dict_item, 5> items = {
       SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_TYPE, "Audio"),
       SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_CATEGORY, "Playback"),
       SPA_DICT_ITEM_INIT(PW_KEY_APP_NAME, CCompileInfo::GetAppName()),
       SPA_DICT_ITEM_INIT(PW_KEY_NODE_NAME, CCompileInfo::GetAppName()),
-      SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, fraction.c_str())};
+      SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, fraction.c_str()),
+      SPA_DICT_ITEM_INIT(PW_KEY_NODE_RATE, srate.c_str())};
 
   auto properties = SPA_DICT_INIT(items.data(), items.size());
   m_stream->UpdateProperties(&properties);
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#22
Here, you can cherry-pick the patch: https://github.com/xbmc/xbmc/pull/24363
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#23
Closed the report upon testing your proposed diff, with one minor change added.
Reply
#24
Awesome. Thanks for making our pipewire sink ready for primetime in upcoming v21.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
Pipewire backend does not switch samplerate0