AddFromURL does not support ogg streams

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

Re: AddFromURL does not support ogg streams

fredvs
Administrator
Hello, yes it should be possible, you are welcome to try it!
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

trustfm
ok i download the latest version of uos and opus works but
every now and then i get

Access violation.

Press OK to ignore and risk data corruption.
Press Abort to kill the program.
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
This post was updated on .
Ha, strange, here with the uos demo SimpleWebPlayer, http://s1.knixx.fm:5347/dein_webradio_vbr.opus is playing OK.
With the last commit of my project swp, it is playing for hours a opus radio.

But for Windows, even Win 32, I fail to make opus play.
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
This post was updated on .
Huh, ok, I just get the error with the uos demo simplewebplayer compiled with Lazarus GTK2.

If I may, I know very well that problem and it is why I switched to MSEgui.
That crash is from GTK, not uos, I did some years ago debug this with other fpc developers, it appears random and nobody understood why.  It appears also with long animation.

The solution is (like I did for my audio LCL project) to use Qt widgetset, with this it is much safer (or, for all related with audio, the best is MSEgui).

Try to build the uos simplewebplayer with Qt widgetset, you will see no more random crash.

When I said in my previous post that I was listening for hours the opus radio, it was with last commit of swp that uses MSEgui widgetset.

That said, if you want to debug the error using GTK2 widget, good luck and courage to find it.

[EDIT] After thinking the guilty was the timer, no it is not the timer, it is the mysterious GTK2 bug.
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
This post was updated on .
Here in attachment the compiled version of last swp with opus stream for Linux 64.
Maybe you can try the opus streams to check if you have still the error.
SimpleWebPlayer_linux64.zip

Also in menu setting you may import your m3u to test your radios.
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
This post was updated on .
Re-hello.

OK, I jumped back to LCL/GTK2 and finally I think what is the problem:

Like I suspected, it is the fpc timer that fails while synchronization:

The debugger point to, in fpc customtimer.pas:

procedure TCustomTimer.DoOnTimer;
begin
  if Assigned(FOnTimer) then
    FOnTimer(Self);  // here the random crash
end;

Note too that only mp3 can deal with "live" icy, like give the name of song playing or image tag of what is playing.
For acc and opus, some url give few icy tags when catching the header at http.head(), like name of the radio, audio format, ... but icy "live" is not provided for aac or opus/ogg streams, it is a only mp3 feature.

And if  you see in the uos simplewebplayer a timer is called to check if icy was updated with synchronize().

I will update the uos demo code to check "live" icy only for mp3.

So my conclusion: the synchro is not always ok for GTK2 and I dont see solution.
Of course if you have a idea, please share it.
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
This post was updated on .
Hello.

OK, fixed uos simplewebplayer demo in last commit.

[EDIT] In last commit of uos, added all icy tags for the demo.

And it should be more GTK2 friendly.

Please, if you have time and courage, could you test if it is ok with GTK2 on your system?

Note that the GTK2 bug is still there and could reappear randomly when a synchro is called (like in the looproc).
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

trustfm
This post was updated on .
Sorry for the late response . i will test everything tomorrow . I will make a new post that might be interested
For the GTK2 i avoid using TTimers that update the main form i make a thread and use the Synchronize function to update the main form . I will look everything tomorrow . I posted a new recorder with mp3 support. uos and uos_flat are modded in that example . You can do anything with the new code i do not need any nomination feel free to change/keep anything  
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

trustfm
The problem persists with opus even with icy disabled ...
Tested the latests
https://github.com/fredvs/uos/tree/main 2025-04-17

In1Index := uos_AddFromURL(PlayerIndex1, PChar(edit4.Text), -1, samformat, sizebuff, audioformat, false);  
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
What problem persists?  The random crash?

Even with the binary of swp of my previous post?
SimpleWebPlayer_linux64.zip

Did you try to compile the uos demo using Qt widgetset vs GTK2 with Lazarus/CodeTyphon?

In th case libqt5pas is not installed on your system:

$ sudo apt install libqt5pas-dev
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
Did you try to run it via the debugger, it should give you infos about the crash.

Here I dont get crash with uos simpleplayer demo, even compiled with GTK2, so I cannot help.
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

trustfm
Hello
i have run with the debugger

length (StreamOut[x].Data.Buffer) = 16384
for x3 := 0 to high (StreamIn[x2].Data.Buffer) do
high (StreamIn[x2].Data.Buffer) = 1919
StreamOut[x].Data.Buffer -------
for x3 := 0 to high (StreamIn[x2].Data.Buffer) done
copy buffer-in into buffer-out
 if (length (Plugin) > 0) then
Convert Input format into Output
Finally give buffer to output
Give to output device
length (StreamOut[x].Data.Buffer) =16384
OUTPUT DATA into portaudio------------------------------
give to output device 1
End give to output device 2
Before LoopEndProc ------------------------------
Before if (nofree = true) and (status = 0)-----
Before until status = 0;----
Before for x := 0 to high (StreamIn)
Before StreamIn[x].Data.Seekable = True
DSPin BeforeBufProc 1
DSPin BeforeBufProc 2
===> Before op_read_x.
Seek outframes = 960
OUTPUT DATA AFTER1 ------------------------------
 StreamIn[x].Data.outframes = 1920
Check if internet is stopped.
StreamIn[x].Data.status = 1
Getting the level before DSP procedure
DSPin AfterBuffProcBefore
DSPin AfterBuffProcAfter
The synchro main loop procedurebefore
Getting the level after DSP procedure
End level after DSP procedure
Seeking if StreamIn is terminated
status = 1
Give Buffer to Output
Buffer[x2] := cfloat (0.0)
length (StreamIn[x2].Data.Buffer) = 1920
length (StreamOut[x].Data.Buffer) = 16384
for x3 := 0 to high (StreamIn[x2].Data.Buffer) do
high (StreamIn[x2].Data.Buffer) = 1919
StreamOut[x].Data.Buffer -------
for x3 := 0 to high (StreamIn[x2].Data.Buffer) done
copy buffer-in into buffer-out
 if (length (Plugin) > 0) then
Convert Input format into Output
Finally give buffer to output
Give to output device
length (StreamOut[x].Data.Buffer) =16384
OUTPUT DATA into portaudio------------------------------
give to output device 1
End give to output device 2
Before LoopEndProc ------------------------------
Before if (nofree = true) and (status = 0)-----
Before until status = 0;----
Before for x := 0 to high (StreamIn)
Before StreamIn[x].Data.Seekable = True
DSPin BeforeBufProc 1
DSPin BeforeBufProc 2
===> Before op_read_x.
Seek outframes = 960
OUTPUT DATA AFTER1 ------------------------------
 StreamIn[x].Data.outframes = 1920
Check if internet is stopped.
StreamIn[x].Data.status = 1
Getting the level before DSP procedure
DSPin AfterBuffProcBefore
DSPin AfterBuffProcAfter
The synchro main loop procedurebefore
Getting the level after DSP procedure
End level after DSP procedure
Seeking if StreamIn is terminated
status = 1
Give Buffer to Output
Buffer[x2] := cfloat (0.0)
length (StreamIn[x2].Data.Buffer) = 1920
length (StreamOut[x].Data.Buffer) = 16384
for x3 := 0 to high (StreamIn[x2].Data.Buffer) do
high (StreamIn[x2].Data.Buffer) = 1919
StreamOut[x].Data.Buffer -------
for x3 := 0 to high (StreamIn[x2].Data.Buffer) done
copy buffer-in into buffer-out
 if (length (Plugin) > 0) then
Convert Input format into Output
Finally give buffer to output
Give to output device
length (StreamOut[x].Data.Buffer) =16384
OUTPUT DATA into portaudio------------------------------
give to output device 1
End give to output device 2
Before LoopEndProc ------------------------------
Before if (nofree = true) and (status = 0)-----
Before until status = 0;----

no evidence of crash here i get this pop up error


The SimpleWebPlayer_linux64.zip works ... i will try qt instead of gtk2
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
This post was updated on .
Ok, I was talking to run it with the debugger but not with -duos_debug, only with the debugger.

And yes, I see that you dont believe me but this is the GTK2 bug, if you click on OK, you will see there is no crash.

Maybe with the debugger if you have chance, it will give you some infos but not always.

And, sorry to repeat me, if you compile it choosing Qt widgetset there will be no error random message.
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
My old DJ project was using Bass library and GTK2, and I get also that problem, so it was not the audio library the guilty.  And after switch to Qt, no more problems.

But, when using Qt widget, you have to oblige users to install libqt5pas-dev and I dont like this.
(It is why I love MSEgui who is dependencies free, but this is a other story.)
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

trustfm
This post was updated on .
Ok i have added
 sudo apt install libqt5pas-dev
i cannot compile
qt5object.inc(43,0) Error: linker: undefined reference to `QGuiApplication_setFallbackSessionManagementEnabled'

I have tried gtk3 same issue .
i have to investigate more
Luckly this does not happens at beatflow player ...

Later ok i have to recompile the IDE with qt5 ...

Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
Hum, I dont use Lazarus/CodeTyphon for a long time ago...

Ask it to my friend Sternas (and  to him), sure CodeTyphon has the solution.

> Luckly this does not happens at beatflow player ...

Hum, random is random,...
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
Hello.

Here the SimpleWebPlayer demo from uos example compiled with Qt.
I used Lazarus for this from fpcupdeluxe.
SimpleWebPlayer_uos_demo.zip
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

trustfm
that did not run... even placing at the demo folder ... do not worry this has to do with my system here ...
Thank you
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

fredvs
Administrator
In last commit, fixed web stream of opus files on Windows 10/11.
At the moment only for Win32, I was not able to compile libopusfile.dll 64 bit.
Reply | Threaded
Open this post in threaded view
|

Re: AddFromURL does not support ogg streams

trustfm
EXCELLENT NEWS !
Thank you !

I am setting up a prealpha versions of beatflow player for now i am in bugfixing mode and do not add new features . I will update the forum once the site is up.
12345