Recent

Author Topic: Some more UOS  (Read 5715 times)

metis

  • Sr. Member
  • ****
  • Posts: 300
Some more UOS
« on: June 27, 2014, 05:55:16 pm »
Hi to all, who are interested in UOS by Fred vS,

in my Chat with Fred vS (see his Topic: "uos and uoslib version 1.0 is here") I discussed several
problems resp. "ToDo's" referring to his UOS (= United OpenLib of Sound).

If anyone wonders, why I go on with this project - Well, I love Portaudio.
Afaik it's the best OpenSource Audio I/O-Library, and together with ASIO it provides
the best Sound with lowest Latency.


All the following refers to loading SEVERAL Streams into ONE PlayerThread of ONE PlayerInstance.
Even Fred's UOS-MultiPlayer finally loads only ONE Stream per PlayerThread.

For the moment it's only done (and tested) on WinXP SP3, using Lazarus v1.2.2 + fpc v2.6.4.

The MainDifferences to the original UOS are:

- SEVERAL Streams can be Loaded-Paused/Unpaused-Stopped in ONE PlayerThread
- Loading Streams is gapless, means the previous Stream must NOT be stopped, before loading the next one
- Loading Streams at ANY Position (<-> UOS loads only at the Begin)
- I think, I fixed what Fred called "SyncProblems" - I'm not sure, 'cause Fred finally didn't specify this Problem
- Pause/Unpause EACH Stream (<-> UOS pauses the PlayerThread)
- the PositionSeek is done with less CodeLines
- Free the PlayerThread with "FreeOnTerminate=True" (<-> UOS uses additional OnTerminate-Procedure )


Currently working on 2 Problems:

All the following refers to "real" AudioTracks, where "real" means:
- LONG (1h and more)
- also with VARIABLE BitRates
(So not only Test-AudioTracks with constant BitRates and a Lenght of some Seconds or Minutes.)

1. Each Time a PositionSeek is done, the PlayerThread-Loop hangs for a while, until 'mpg123_seek()'
   has done his job. Thus a gap is heard in the other playing streams - not very nice !
   I havn't found a good&simple(!) solution yet - Maybe another Thread only for doing the Seek-Job would help ?

2. UOS is calculating wrong the Length&Position of quite a lot of mp3-Files, compressed with VBR (= Variable BitRate)


Any Ideas, how to do this...?

Unfortunately Fred has left this Forum, so I can't continue my chat with him.


metis (formerly altasam)
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

Fred vS

  • Hero Member
  • *****
  • Posts: 3480
    • StrumPract is the musicians best friend
Re: Some more UOS
« Reply #1 on: June 27, 2014, 09:01:50 pm »
Quote
Even Fred's UOS-MultiPlayer finally loads only ONE Stream per PlayerThread.

Yep, of course and it is the goal of the example...

If you want multi streams per PlayerThread, have you try the example :
/uos/examples/multiinput.lpi ?

This example loads 8 inputs... but i have try with 64 inputs without  problems with my old netbook...

And for pausing input: at creation of a new x-input into the player,
Code: [Select]
StreamIn[x].Data.Enabled is set to True.

While the player is playing, when you want to pause the x-input, just set
Code: [Select]
StreamIn[x].Data.Enabled := false.

To resume it, set it back to
Code: [Select]
StreamIn[x].Data.Enabled := true.
« Last Edit: June 29, 2014, 09:42:43 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: Some more UOS
« Reply #2 on: July 01, 2014, 05:18:17 pm »
Hi Fred,

glad to see You back in this Forum - Where have You been ? ;D

Quote
And for pausing input
"Stream.Enabled := True/False" is what I do, but this is only one tiny Point of my Topic. :)
(see: "The MainDifferences to the original UOS are")

Quote
have you try the example
Of course, I did - And I saw, that UOS loads ONE Stream per PlayerInstance, so per PlayerThread. :'(
(If I'm wrong, tell me, and - sorry)

So, let's try to get solved the real Problems, to build up a working Portaudio-MULTIChannel-AudioPlayer,
written in Lazarus, that is able to process SEVERAL In-/OutStreams in ONE PlayerThread, withOUT Gaps. ;)
( see: "Currently working on 2 Problems" )


Still, anyone interested... ? 8-)

metis
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

Fred vS

  • Hero Member
  • *****
  • Posts: 3480
    • StrumPract is the musicians best friend
Re: Some more UOS
« Reply #3 on: July 03, 2014, 12:48:20 pm »
Hello Metis.

Quote
And I saw, that UOS loads ONE Stream per PlayerInstance, so per PlayerThread. :'(
(If I'm wrong, tell me, and - sorry)

Hum, i do not understand what you want...
MultiInput.lpi example loads 8 different steams into one PlayerInstance...

Quote
glad to see You back in this Forum - Where have You been ? ;D

Im still on the way (im nomad) but all my pc stuffs (computer and backup-disks) were stolen... (i still do not have a other computer but i will find one ;-) ...).

Cheers...



I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018