Trixie trouble

Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Trixie trouble

Henk Pragt
Hi forum,
my multi-channel sound mixer, based on UOS and running on a Raspberry Pi 5, was working great under Debian Bookworm, but the tracks get out of sync after updating to Debian Trixie. Grok says: "... a known and reported problem when upgrading to or installing Debian 13 "Trixie," particularly due to the shift from PulseAudio to PipeWire as the default audio server".
To start 20 tracks using uos_PlayNoFree now takes more than a second, causing bad sound.

Does anyone know a solution, or is there an UOS update to look out for?
Reply | Threaded
Open this post in threaded view
|

Re: Trixie trouble

fredvs
Administrator
This post was updated on .
Hello Henk Pragt and welcome to uos forum.

Hum, I did try some uos apps on Trixie and it seems ok but I did not try with lot of players working together.

Did you try using a other OUT device?

There is a uos demo, /uos/examples/deviceinfos, you can check the devices available.

Here picture of deviceinfos demo adapted for StrumPract project:



And then try to use a other device in your declaration, for example:

uos_AddIntoDevOut (player1,out-device-to-use,-1,-1,-1,-1,-1,-1);

You can also play with the latency value, maybe with pipewire a different value is better.
Reply | Threaded
Open this post in threaded view
|

Re: Trixie trouble

Henk Pragt
Hi Fred,
thanks for your reply.
I am still not very familiar with the internal workings of UOS, but was happy to get my mixer to work with such ease, so kudos for your work. I will look into deviceinfo demo to see if there a simple way to refer to the other output devices by name, so that updates to the OS will not change the index number. Is the latency just a start delay?

The basics of my simple app is below. I noticed that the values in the uos_inputindex and uos_outputindex always remain 0. Is that normal?
thx, Henk
----------------------------------------------------------
const noof_sounds = 20;
 
var filename : array[1..noof_sounds] of string;
    volume   : array[1..noof_sounds] of real;

var uos_inputindex   : array[0..sounds] of integer;   // sound system handles
    uos_outputindex  : array[0..sounds] of integer;

begin // on formactivate:
  // .. load filenames and volumes from disk

  uos_LoadLib('system', 'system', nil, nil, nil, nil, nil);

  for snd := 1 to noof_sounds do
  begin
    if uos_CreatePlayer(snd) then
    begin
      uos_inputindex[snd]  := uos_AddFromFile(snd, pchar(filename[snd]), -1, 2, 8192);
      uos_outputindex[snd] := uos_AddIntoDevOut(snd, -1, 0.08, uos_InputGetSampleRate(snd, uos_inputindex[snd]), uos_InputGetChannels(snd, uos_inputindex[snd]), 0, 8192, -1);
      uos_InputAddDSPVolume(snd, uos_inputindex[snd], vol[snd], vol[snd]); // set left and right volume
    end;
  end;

  // on button click:
  for snd := 1 to noof_sounds do uos_PlayNoFree(player);

Reply | Threaded
Open this post in threaded view
|

Re: Trixie trouble

fredvs
Administrator
Hello Henk Pragt

> Is the latency just a start delay?

See https://www.portaudio.com/docs/latency.html
"What is Latency?
Latency is basically longest time that you have to wait before you obtain a desired result. For digital audio output it is the time between making a sound in software and finally hearing it."

For example, with the Rpi 2 b, I get better sound using this:
  {$if defined(cpuarm) or defined(cpuaarch64)}
              // need a lower latency
              OutputIndex1 := uos_AddIntoDevOut(PlayerIndex1, -1, 0.3, -1, -1, -1, -1, -1) ;
       {$else}
              OutputIndex1 := uos_AddIntoDevOut(PlayerIndex1, -1, -1, -1, -1, -1, -1, -1);
       {$endif}

> I noticed that the values in the uos_inputindex and uos_outputindex always remain 0. Is that normal?

The input/output index is the index of the input/output in the array, you may have many different input/output.

If you only have one input, the index will be 0, the same for output.
So yes it is normal and the input/output were correctly added.

If you get -1 as result, there was a error when trying to add the input/output.