ogg123 hangs hacking the same audiopacket

Hello Forum
Maybe someone knows where I can find help on this error in ogg123, ver: 1.1.1 from 11.3 (11.4 also fails)?

I use ogg123 to output ogg-encoded streams to an audio-device (alsa). It can be URL-streams from Icecast-server or just ogg-music from my network-disk.

It could something like:

> ogg123 /home/my/Music/* ; Playing my ogg-ripped CD from an end to default audio-device

I have also tried option like:
> ogg123 -q … ; avoid output to terminal
> ogg123 -q -d alsa … ; output to device=alsa

In all cases so fare ogg123 stops playing after 3-6 hours, and it is hackking on the same sound-packet. Maybe advancing 1-2 new packets each 3-5 seconds :frowning:

Does anybody known, where I can report this error? Maybe mail-list to Vorbis?

Jan

Hi again

I can add that the output buffer was empty (0%), when the error occur, and CPU was 0,0 %. When playing CPU was around 0,3%.

Maybe it is because of network broke? But does anybody know if ogg123 or another player can reestablise the stream?

Jan

Another question:
I want to try to use VLC from the command line. Will VLC try to reconnect to the input stream, if it’s broken ?

How will the command to VLC for playing an music ogg-file over an nfs-file system be?

Something like:
> vlc …/Music/*.ogg

Jan

Don’t use vlc myself, but mplayer works in exactly that manner from the command line. Never had problems with it, use it all the time, but I don’t really push it very hard I just play music off my hard drive with it. It works like a console application, been meaning to set up a server type situation for it so I could control it over my wifi network using my phone, but never got around to it.

Thanks Malcolm
I will give mplayer a try also. I am trying to make a “stable” audio link over the Internet (not stable), where I can stream an ogg-stream from an Icecast server and to an audio client, exam ogg123. Analog audio output from jacks shall feed an FM-transmitter on a local radiostation.

I want to run an endless shell command file, something like:

repeat forever {
ogg123 <url-to-icecast-server>
sleep 15 ; second
}

Problem is that ogg123 hangs when Internet breaks, and I have also tried vlc now, which also has problem when the link breaks.

I think in the “best solution” the audio client should try itself to reestablishe tcp-connection a couple of time with an interval in between. When not able to do it, the audion client shall terminate. The sleep command shall wait about 10-60 seconds, and the give the audio client a new try.

If the audio client hangs - as ogg123 does - and never terminate, then the endless loop is not running.

Jan

ok, think I got it.

Problem is that ogg123 hangs when Internet breaks, and I have also tried vlc now, which also has problem when the link breaks.

I think in the “best solution” the audio client should try itself to reestablishe tcp-connection a couple of time with an interval in between. When not able to do it, the audion client shall terminate. The sleep command shall wait about 10-60 seconds, and the give the audio client a new try.

If the audio client hangs - as ogg123 does - and never terminate, then the endless loop is not running.

Yeah, I see. You basically need an audio player that will quit when it’s not getting audio data through the tcp connection. Not sure that there is one. Not super savvy with networking, but it’s not really a trivial feature, since looking at a tcp connection from the client side, there’s no obvious way to tell that it’s broken–the packets are guaranteed to come through in order, but they’re not guaranteed to come at any given time.

The way I see it, you either find an audio player that will timeout on a lack of audio data, which I agree simplest, and then the loop you have set up will work fine, or you don’t. If you don’t, you either have to set up a program to monitor the packets as they come into the audio player, or one to monitor the audio that comes out of it. If either of these things dies, you kill everything and start over.

If it came down to it I would try a python script to monitor the connection, not exactly sure how to monitor the data going out. For the python script you set up a dummy server, connect the dummy to the real audio server, connect audio player to the dummy’s write socket, then poll() (select() is an alternative) the incoming tcp stream with a timeout on it. If it times out, you kill everything and start over, if you get a packet in time you write it to the socket attached to the audio player and poll the socket again.

Hopefully there is an audio player that lets you set up a time out on a tcp stream, but otherwise it wouldn’t be impossible with a little scripting. Nothing special about python either, but that is what I would use.

Hi Malcolm

Thanks again! You have a good understanding of the problem. I am helping a pal with this installation, and he has found a solution, which seems to function so fare in practice on the Internet in Denmark.

He says, that ogg123 in the Ubuntu distro can work with up to 15 sec of breaks in the tcp-stream without stopping. More than 15 sec ogg123 terminate (not hacking forever in audio). If its terminate, then the loop restart ogg123.

As an extra safety the Ubuntu-client PC restarts automatic each night at 04 a’clock :slight_smile:

Your idea of monitoring the tcp-stream seems right to my knowledge, but I am not able to do that scripting in python :frowning:

Jan

Ok, glad that works.

Hi again

To end the story, I can add, that our experimentation shows that mplayer perform better that ogg123, when the tcp-stream with audio-packets stops.

mplayer terminate consequence every time, where as ogg123 can hang sometime (also on the Ubuntu distro). So thanks for the proposal of mplayer :slight_smile:

Jan