PDA

View Full Version : Alien BBC Garbled Sound



neilcoburn
2005-06-03, 07:41
I have searched both the mailing lists and the forum, and this has been
raised before but to my knowledge not resolved.

When playing live BBC streams on AlienBBC, after a while (10-20 minutes)
the sound becomes garbled - it sounds like 2 streams are being played a
fraction out of time which each other. This doesn't happen when playing
archive/Listen Again programmes. Incidentally, the live stream is also
noticeably quieter (and muffled) than the Listen Again streams.

Has anyone found a solution to this?

I'm running Alien BBC v0.97, Slimserver v6.1 from about 3 weeks ago on
Windows XP, and playing on both an SB1 and SB2.

Neil Sleightholm
2005-06-03, 09:26
I'm afraid this hasn't been resolved. I believe it is an mplayer issue but haven't had time to try and debug the problem.

Neil

Olaf
2005-07-20, 14:07
Neil Sleightholm <Neil.Sleightholm.1q26vz@...> writes:

>
>
> I'm afraid this hasn't been resolved. I believe it is an mplayer issue
> but haven't had time to try and debug the problem.
>
> Neil
>
Just to add to the chorus: I have the same issue. This problem is new on
6.0.2/0.97 - did not occur with previous version. I needed to upgrade when
SB2 came along - now I cannot listen to BBC anymore. May I encourage you to
research this with some haste ;|

Neil Sleightholm
2005-07-20, 14:26
That is interesting, what version where you using before? I don't believe this is an AlienBBC problem, I am sure it is a problem with mplayer and we don't control that. I have posted a bug report on the mplayer forum and although someone else had the problem no could offer a solution.

Neil

Yannzola
2005-07-20, 14:26
Which version of mplayer are you all running? The latest version (pre7) did =not= work on my PC. However, (pre6) appears to work just fine.

y.

Neil Sleightholm
2005-07-20, 14:29
Even more interesting! I get the problem with pre6 and pre7.

Olaf
2005-07-20, 15:50
Neil Sleightholm <Neil.Sleightholm.1shm3z@...> writes:

>
>
> That is interesting, what version where you using before? I don't
> believe this is an AlienBBC problem, I am sure it is a problem with
> mplayer and we don't control that. I have posted a bug report on the
> mplayer forum and although someone else had the problem no could offer
> a solution.
>
> Neil
>
Looking thru my archive, it seems I last used SlimServer_5_4_x_v2005-02-12 and
0.93; I did not touch mplayer when upgrading. I should therefore still be
running pre6.

JJP
2005-07-20, 23:32
Same problem here - XP, SB2s running 15/07/05 nightly, mplayer pre7, alienBBC 0.98.

Garbling sometimes happens within 2-3 minutes of fast-forwarding the stream which makes BBC unusable. I now have a sore ear due to complaints from "other household squeezebox user(s)".

It's annoying (makes me angry!) that the BBC still insists on using realplayer for audio when they do appear to have adopted a windows media format for some video. I pay my licence fee for them to force me to install some bloated spyware realplayer trash.
/rant

Patience............

Triode
2005-07-21, 01:02
JJP,

Not sure you meant "fast forwarding" - just to clarify, Alien doesn't support fast forwarding within one stream.

However if you do get the corruption problem pressing Fwd (as long as you have a playlist of one item) should restart the current stream.

As for the cause of this - yes definately mplayer, I suspect they don't support dynamic rate adaption properly.

Neil Sleightholm
2005-07-21, 11:11
If anyone with this problem has time you could try running mplayer directly to confirm this is the same problem. The following command line will play the live Radio4 stream:
mplayer -vo null -cache 128
rtsp://rmlivev8.bbc.net.uk/farm/*/ev7/live24/radio4/live/r4_dsat_g2.ra

I find this this will run for anything from a few seconds to hours but eventually the output will be garbled. I think Triode's comment about "dynamic rate adaption" is probably true because I find this is worse for popular times of the day (Chris Moyles on R1 and the Archers on R4).

If there is anyone out there that knows how mplayer works or can debug it please feel free to jump in....

Neil

JJP
2005-07-21, 22:45
JJP,

Not sure you meant "fast forwarding" - just to clarify, Alien doesn't support fast forwarding within one stream.

Triode - sorry - I meant pressing FWD as a de-garble tactic..

Mark.Bennett
2005-07-24, 14:18
On Thu, 2005-07-21 at 11:11 -0700, Neil Sleightholm wrote:
> If anyone with this problem has time you could try running mplayer
> directly to confirm this is the same problem. The following command
> line will play the live Radio4 stream:
> mplayer -vo null -cache 128
> rtsp://rmlivev8.bbc.net.uk/farm/*/ev7/live24/radio4/live/r4_dsat_g2.ra
>
> I find this this will run for anything from a few seconds to hours but
> eventually the output will be garbled. I think Triode's comment about
> "dynamic rate adaption" is probably true because I find this is worse
> for popular times of the day (Chris Moyles on R1 and the Archers on
> R4).
>
> If there is anyone out there that knows how mplayer works or can debug
> it please feel free to jump in....

I've been meaning to try this for a while so, inspired by your post,
I tried this tonight. After just over 20 minutes the stream became
garbled exactly as I get when listening over Slimserver/Squeezebox.

I then killed and started Mplayer again to unscramble the audio.
According to the headers reported by Mplayer, the bit rates are
the same between the two runs. In both cases:

Opening audio decoder: [realaud] RealAudio decoder
opening shared obj '/usr/lib/win32/cook.so.6.0'
Audio codec: [11] 44 Kbps Stereo Music
Audio bitrate: 44.100 kbit/s (5513 bps)
AUDIO: 22050 Hz, 2 ch, 16 bit (0x10), ratio: 5513->88200 (44.1 kbit)
Selected audio codec: [racook] afm:realaud (RealAudio COOK)

So, unless it was a bit rate change that lasted no more than a
minute, Mplayer is incorrectly reporting the bitrates, or I'm
incorrectly reading the Mplayer messages, it doesn't look like
a dynamic bit-rate change to me.

However, it does confirm it to be an Mplayer problem, and
nothing to do with AlienBBC/Slim Devices/Squeezebox.

This is using:

MPlayer 1.0pre6-3.3.3 (C) 2000-2004 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 9)
Detected cache-line size is 64 bytes
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1

On:

Linux Eagle 2.6.10-1.771_FC2smp #1 SMP Mon Mar 28 01:10:51 EST 2005 i686
i686 i386 GNU/Linux

--
"The biggest problem encountered while trying to design a system that
was completely foolproof, was, that people tended to underestimate the
ingenuity of complete fools." (Douglas Adams)

Neil Sleightholm
2005-07-24, 14:36
Mark, thanks for confirming this. I think (but I'm only guessing) that the primary bit rate is what is displayed but realaudio support dynamically changing the rate on the fly.

I am looking into trying to debug this but at present I'm not getting much help from the mplayer community.

Neil

Olaf
2005-08-04, 12:27
Neil Sleightholm <Neil.Sleightholm.1sp18o@...> writes:
> I am looking into trying to debug this but at present I'm not getting
> much help from the mplayer community.

Neil, have you had any success in debugging this problem?

Neil Sleightholm
2005-08-04, 13:23
I have reported on the mplayer developers forum and someone appears to have had some sucess reproducing it but still no fix yet.

Neil

Scooter
2005-08-28, 08:46
It's annoying (makes me angry!) that the BBC still insists on using realplayer for audio when they do appear to have adopted a windows media format for some video. I pay my licence fee for them to force me to install some bloated spyware realplayer trash.
/rant


I agree. The BBC have recently started trialing the same idea with video - with "The Mighty Boosh". However, I can't get it to work, and the reason, as I put in my feedback form to them is the 3 letters of media playback doom - R, A and M. The self styled "Real" media player is nothing but an advertising platform, that almost never works properly or reliably.

It occurs to me that they may have chosen this format to prevent the stream being saved. This is, in my opinion, at best misguided, and probably a little bit stupid, as the BBC *broadcast* this content free to air in digital form. I can save all the video and audio I want by plucking the stream "out of the air" with a digital TV card. In a far superior format too - episodes of Top Gear for example, in the original digital broadcast format are 1.7GB!

I reaslise they have to protect their markets overseas, but Realplayer is not the answer. I would have thought the potential revenues for distributing shows over the 'net would justify some R&D into their own solution.

Anyway - that's my rant for the day :p I can confirm the exact same smyptoms - almost like the individual chunks are beingplayed in reverse. Works fine on the archived audio.

Olaf
2005-09-08, 14:50
Neil Sleightholm <Neil.Sleightholm.1t9b3n@...> writes:

> I have reported on the mplayer developers forum and someone appears to
> have had some sucess reproducing it but still no fix yet.

Neil, could you post link to the thread in the mplayer forum? I am more than
a little hacked off that I still cannot listen to the BBC. Thanks - ovr.

Neil Sleightholm
2005-09-08, 17:46
Here you go http://thread.gmane.org/gmane.comp.video.mplayer.user/37755

Olaf
2005-09-12, 23:20
Neil Sleightholm <Neil.Sleightholm.1t9b3n@...> writes:

> I have reported on the mplayer developers forum and someone appears to
> have had some sucess reproducing it but still no fix yet.

Neil, could you leave URL to thread in mplayer community? I am a little
frustrated that I still cannot listen to the BBC. Thanks.

Dan Goodinson
2005-09-12, 23:49
I can't find any earlier emails in this thread :( Can you describe the
sound you get, as I occasionally get something with might be similar.

For me, I quite often get something that sounds a bit like SB (or SS)
has gone "out of sync" with the radio. It's almost like I'm getting 2
streams at once, and they are out of sync by around a second. If I
power off SB with the remote then power it back, the problem goes away.
It can happen after as little as 2 minutes, but tends to happen after
I've been listening for a couple of hours.

SS runs on Win2k Pro, Celeron 1.4GHz, 512MB. The 'system' harddrive
where SS is installed has around 12GB free space. I'm using SS 6.0.x
and SB1 firmware rev39.

-----Original Message-----
From: discuss-bounces (AT) lists (DOT) slimdevices.com
[mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf Of Olaf
Sent: 13 September 2005 07:21
To: discuss (AT) lists (DOT) slimdevices.com
Subject: Re: [slim] Re: Alien BBC Garbled Sound


Neil Sleightholm <Neil.Sleightholm.1t9b3n@...> writes:

> I have reported on the mplayer developers forum and someone appears to

> have had some sucess reproducing it but still no fix yet.

Neil, could you leave URL to thread in mplayer community? I am a little

frustrated that I still cannot listen to the BBC. Thanks.

Neil Sleightholm
2005-09-13, 11:34
Neil, could you leave URL to thread in mplayer community?Olaf, if you check back through this thread you should see a link. Neil

Neil Sleightholm
2005-09-13, 11:37
Can you describe the sound you get, as I occasionally get something with might be similar.Dan, your description sounds like the same problem - I think it sounds like 2 streams running slightly out of sync. I find it only happens on the live streams.

Neil

Olaf
2005-09-14, 13:05
Neil Sleightholm <Neil.Sleightholm.1vb8ob@...> writes:

>
>
> Olaf Wrote:
> > Neil, could you leave URL to thread in mplayer community?Olaf, if you
check back through this thread you
> should see a link. Neil
>


Apols, Neil, for duplicate entry but for reasons I do not understand GMANE
took 4 (!) days over posting the original message. I thought it had been lost
in transit and reposted...

bilko2
2005-09-14, 13:21
I have the same problem.
The "choppy" output sounds like it's all there but it's being broken up into ~0.3 sec chunks which then come out in the wrong order.

Neil Sleightholm
2005-09-22, 09:53
The following quote is from the mplayer list, hopefully we might get a solution to this problem soon.

I think I know what is causing the garbled audio problem. The realaudio server is dropping packets but only indicates it by jumps in the Data packet timestamps and setting the KeyFrame bit in the Flags. If you look at the timestamps of the Real data Packet Headers (using ethereal) you will see that whereas normally the delat is aout 116 - occassionally there are deltas of about 232 or 348. At the same time, the keyframe flag which is normally set once every 32 packet, is set at the right point to restart the striping. The striping mechanism is explained in a doc in the Mplayer directory.

The Realaudio stream has the audio striped across multiple packets and so if Mplayer doesn't detect the missing packets it starts putting the audio stream back toegther in the wrng order.

As implemented RTS just takes each packet and buffers the data and ignore the timestamp and key frame data. What needs to be done is when a gap is detected, some packets needs to be inserted to make up the loss.

I am trying to code up a solution but I think I am on the right track.

Neil Sleightholm
2005-09-23, 09:36
Another update:


I've had a look at the ethereal output and I agree, it seems to be the BBC servers dropping the odd packet. I hear that the BBC have one the biggest RealServer farms going, so maybe it's not surprising we havn't seen it from other servers.

If there's anything I can do to help (testing, coding (never touched mplayer) etc), let me know.

Patrick Dixon
2005-09-23, 10:36
Sounds promising!

Neil Sleightholm
2005-09-27, 07:43
Good news. A fix for this was posted to the mplayer list today. I have compiled a Windows version and have been using it today without any problems. We will have to wait for an official mplayer release but if you want to compile it yourself here is the change.

I think have a fix for this problem. I have tested it with all the BBC live real streams and it seems to work. I haven't tested to see if it interferes with other Real streams. A few times Mplayer has stopped, I don't know if this is as a result of my fix or just the network. My tests were run on SuSe 9.3 and I will be building a Windows version as soon as I setup a compile environment.

The messages in the fix will be gewnerated with -v 1 so that you can see if packet loss was detected. I fill in the gaps with the previous packet which result in a short burst of choppy audio. If you get a burst of errors, then you will hear a longer burst of choppy audio but the stream usually settles down. I can live with this but I can suggest a better solution if somebody wants to do the work.

My changes are to one file libmpdemux/demux_real.c. A diff file is included below. I made the changed to a recent release but demux_real.c hasn't changed much in months so the changes will work back to other versions.

The cut & paste may have messed some lines but I hope you use it.




*** demux_real.c 2005-09-26 15:53:26.000000000 +0100
--- demux_real.c.orig 2005-09-25 23:47:44.000000000 +0100
*************** typedef struct {
*** 92,105 ****
int a_bitrate; ///< Audio bitrate
int v_bitrate; ///< Video bitrate
int stream_switch; ///< Flag used to switch audio/video demuxing
-
- /* Variables to fix missing buffer in stream audio */
- int live_stream; // Flag to indicate that it is a live audio only stream
- int ms_per_packet; // millisec per pack - used to detect if a packet is missed
- int ms_per_block; // millsec per block (usually made up 16 packets)
- int ms_per_packet_safety; // Since timing is not precise - a safety margin is needed - guess about 20% of packet time.
-
-
} real_priv_t;

/* originally from FFmpeg */
--- 92,97 ----
*************** got_audio:
*** 695,721 ****
priv->audio_need_keyframe = 0;
}else
dp->pts = (priv->a_pts==timestamp) ? 0 : (timestamp/1000.0f);
- /*************************/
-
- if ( (priv->live_stream == 1) && (((sh_audio_t*)ds->sh)->format == mmioFOURCC('c','o','o','k')) ){ // Not sure if missingpacket happen the same way for other formats
-
- demux_packet_t *dp1;
- if (((timestamp - priv->a_pts) > priv->ms_per_packet_safety)&& ((timestamp - priv->a_pts) < priv->ms_per_block))
- mp_msg(MSGT_DEMUX,MSGL_V, "Packet timestamp gap Actual %7d msec Expected %7d Flags %02X\n", timestamp-priv->a_pts,priv->ms_per_packet,dp->flags);
- if (((timestamp - priv->a_pts) < priv->ms_per_packet))
- mp_msg(MSGT_DEMUX,MSGL_V, "Packet timestamp gap too short Actual %7d msec Expected %7d Flags %02X\n", timestamp-priv->a_pts,priv->ms_per_packet,dp->flags);
-
- while( ((timestamp - priv->a_pts) > priv->ms_per_packet_safety) && (timestamp - priv->a_pts) < priv->ms_per_block) {
- dp1 = new_demux_packet(len);
- memcpy(dp1->buffer,dp->buffer,len);
- priv->a_pts=priv->a_pts + priv->ms_per_packet;
- dp1->pos = demuxer->filepos;
- dp1->flags = 0;
- ds_add_packet(ds, dp1);
- }
- }
- /**************************/
-
priv->a_pts=timestamp;
dp->pos = demuxer->filepos;
dp->flags = (flags & 0x2) ? 0x10 : 0;
--- 687,692 ----
*************** static demuxer_t* demux_open_real(demuxe
*** 1158,1169 ****

if (!strncmp(mimet,"audio/",6)) {
if (strstr(mimet,"x-pn-realaudio") || strstr(mimet,"x-pn-multirate-realaudio")) {
-
- if (strstr(mimet,"x-pn-multirate-realaudio-live" )) {
- priv->live_stream = 1;
- } else
- priv->live_stream = 0;
-
// skip unknown shit - FIXME: find a better/cleaner way!
len=codec_data_size;
tmp = stream_read_dword(demuxer->stream);
--- 1130,1135 ----
*************** static demuxer_t* demux_open_real(demuxe
*** 1392,1406 ****
((short*)(sh->wf+1))[4]=codecdata_length;
// stream_read(demuxer->stream, ((char*)(sh->wf+1))+6, 24); // extras
stream_read(demuxer->stream, ((char*)(sh->wf+1))+10, codecdata_length); // extras
- priv->ms_per_packet = (long) ((coded_frame_size*8*1000L)/(sh->wf->nAvgBytesPerSec)); // I think variable should be avgbits/sec
- priv->ms_per_packet_safety = priv->ms_per_packet + (priv->ms_per_packet/5) ; // Add 20% for the safety margin
- priv->ms_per_block = priv->ms_per_packet * sub_packet_h;
- priv->ms_per_packet--; // Empircally - round down to suit observed actual gaps
- if (priv->live_stream == 1){
- mp_msg(MSGT_DEMUX,MSGL_V,"Live stream: Subpacksize %d sub packet h %d Flavour %d coded frame size %d codecdatalength %d avg byte/sec %d channels %d\n",sub_packet_size,sub_packet_h,flavor,coded_frame_s ize,codecdata_length, sh->wf->nAvgBytesPerSec, sh->channels);
- mp_msg(MSGT_DEMUX,MSGL_V,"Live stream: Expected range ms/packet %d to %d ms per block %d\n",priv->ms_per_packet,priv->ms_per_packet_safety, priv->ms_per_block);
- }
-
break;
case MKTAG('r', 'a', 'a', 'c'):
case MKTAG('r', 'a', 'c', 'p'):
--- 1358,1363 ----

bglad
2005-09-27, 07:59
great news neil, thanks for pushing this

Patrick Dixon
2005-09-27, 15:18
great news neil, thanks for pushing this
Thanks from me too.

David Brittain
2005-09-28, 00:20
Thanks also from me. It worked for me too.

Attached is a patch against the latest mplayer CVS, this should apply
more cleanly.

Dave

Patrick Dixon wrote:
> bglad Wrote:
>
>> great news neil, thanks for pushing this
>>
> Thanks from me too.
>
>
>


Index: demux_real.c
================================================== =================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_real.c,v
retrieving revision 1.73
diff -u -r1.73 demux_real.c
--- demux_real.c 2 Sep 2005 08:32:32 -0000 1.73
+++ demux_real.c 28 Sep 2005 07:17:10 -0000
@@ -92,6 +92,13 @@
int a_bitrate; ///< Audio bitrate
int v_bitrate; ///< Video bitrate
int stream_switch; ///< Flag used to switch audio/video demuxing
+/******************************/
+ /* Variables to fix missing buffer in stream audio */
+ int live_stream; // Flag to indicate that it is a live audio only stream
+ int ms_per_packet; // millisec per pack - used to detect if a packet is missed
+ int ms_per_block; // millsec per block (usually made up 16 packets)
+ int ms_per_packet_safety; // Since timing is not precise - a safety margin is needed - guess about 20% of packet time.
+/********************************/
} real_priv_t;

/* originally from FFmpeg */
@@ -687,6 +694,25 @@
priv->audio_need_keyframe = 0;
}else
dp->pts = (priv->a_pts==timestamp) ? 0 : (timestamp/1000.0f);
+/********************************/
+ if ( (priv->live_stream == 1) && (((sh_audio_t*)ds->sh)->format == mmioFOURCC('c','o','o','k')) ){
+ // Not sure if missingpacket happen the same way for other formats
+ demux_packet_t *dp1;
+ if (((timestamp - priv->a_pts) > priv->ms_per_packet_safety)&& ((timestamp - priv->a_pts) < priv->ms_per_block))
+ mp_msg(MSGT_DEMUX,MSGL_V, "Packet timestamp gap Actual %7d msec Expected %7d Flags %02X\n", timestamp-priv->a_pts,priv->ms_per_packet,dp->flags);
+ if (((timestamp - priv->a_pts) < priv->ms_per_packet))
+ mp_msg(MSGT_DEMUX,MSGL_V, "Packet timestamp gap too short Actual %7d msec Expected %7d Flags %02X\n", timestamp-priv->a_pts,priv->ms_per_packet,dp->flags);
+
+ while( ((timestamp - priv->a_pts) > priv->ms_per_packet_safety) && (timestamp - priv->a_pts) < priv->ms_per_block) {
+ dp1 = new_demux_packet(len);
+ memcpy(dp1->buffer,dp->buffer,len);
+ priv->a_pts=priv->a_pts + priv->ms_per_packet;
+ dp1->pos = demuxer->filepos;
+ dp1->flags = 0;
+ ds_add_packet(ds, dp1);
+ }
+ }
+/********************************************/
priv->a_pts=timestamp;
dp->pos = demuxer->filepos;
dp->flags = (flags & 0x2) ? 0x10 : 0;
@@ -1130,6 +1156,12 @@

if (!strncmp(mimet,"audio/",6)) {
if (strstr(mimet,"x-pn-realaudio") || strstr(mimet,"x-pn-multirate-realaudio")) {
+/****************************/
+ if (strstr(mimet,"x-pn-multirate-realaudio-live" )) {
+ priv->live_stream = 1;
+ } else
+ priv->live_stream = 0;
+/***************************/
// skip unknown shit - FIXME: find a better/cleaner way!
len=codec_data_size;
tmp = stream_read_dword(demuxer->stream);
@@ -1358,6 +1390,16 @@
((short*)(sh->wf+1))[4]=codecdata_length;
// stream_read(demuxer->stream, ((char*)(sh->wf+1))+6, 24); // extras
stream_read(demuxer->stream, ((char*)(sh->wf+1))+10, codecdata_length); // extras
+/********************************/
+ priv->ms_per_packet = (long) ((coded_frame_size*8*1000L)/(sh->wf->nAvgBytesPerSec)); // I think variable should be avgbits/sec
+ priv->ms_per_packet_safety = priv->ms_per_packet + (priv->ms_per_packet/5) ; // Add 20% for the safety margin
+ priv->ms_per_block = priv->ms_per_packet * sub_packet_h;
+ priv->ms_per_packet--; // Empircally - round down to suit observed actual gaps
+ if (priv->live_stream == 1){
+ mp_msg(MSGT_DEMUX,MSGL_V,"Live stream: Subpacksize %d sub packet h %d Flavour %d coded frame size %d codecdatalength %d avg byte/sec %d channels %d\n",sub_packet_size,sub_packet_h,flavor,coded_frame_s ize,codecdata_length, sh->wf->nAvgBytesPerSec, sh->channels);
+ mp_msg(MSGT_DEMUX,MSGL_V,"Live stream: Expected range ms/packet %d to %d ms per block %d\n",priv->ms_per_packet,priv->ms_per_packet_safety, priv->ms_per_block);
+ }
+/**************************************/
break;
case MKTAG('r', 'a', 'a', 'c'):
case MKTAG('r', 'a', 'c', 'p'):

cbemoore
2005-09-28, 09:10
I'm not sure how to go about compiling from CVS. Can anyone give me some basic instructions, or send me a precompiled Windows executable?

It looks like the MPlayer Windows executables are only produced every few months, so we could be waiting a while before we can download it from the MPlayer website?

Cheers
Chris

David Brittain
2005-09-28, 10:37
Sorry, I'm running Linux.

From what I know building for Windows is not simple:

http://mplayerhq.hu/MPlayer/releases/win32/contrib/MPlayer-MinGW-Howto.txt

Dave

cbemoore wrote:
> I'm not sure how to go about compiling from CVS. Can anyone give me some
> basic instructions, or send me a precompiled Windows executable?
>
> It looks like the MPlayer Windows executables are only produced every
> few months, so we could be waiting a while before we can download it
> from the MPlayer website?
>
> Cheers
> Chris
>
>
>

mcknej01
2005-09-29, 01:57
Is there a "Dummy's" guide to applying this fix. I'm running FC3 Linux, have downloaded the latest mplayer cvs, but am completely lost in applying the fix.

Do I just cut and paste the changes (e.g. overwrite the entire) debian_real.c file, or should it be inserted somewhere?

If this fix works I'm sure that there will be MANY happy BBC / Squeezebox listeners (including my wife).

Thanks for getting the problem resolved this far.

David Brittain
2005-09-29, 13:15
Change directory to libmpdemux/
Save the patch file attached to my message above to this directory
run 'patch < mplayer_patch.diff'
change to the root mplayer directory and rebuild

Dave

mcknej01 wrote:
> Is there a "Dummy's" guide to applying this fix. I'm running FC3 Linux,
> have downloaded the latest mplayer cvs, but am completely lost in
> applying the fix.
>
> Do I just cut and paste the changes (e.g. overwrite the entire)
> debian_real.c file, or should it be inserted somewhere?
>
> If this fix works I'm sure that there will be MANY happy BBC /
> Squeezebox listeners (including my wife).
>
> Thanks for getting the problem resolved this far.
>
>
>

Neil Sleightholm
2005-09-29, 14:58
If anyone wants to apply this patch I would recommend doing it to the 1.0pre7 version rather than the latest one in CVS. With the latest one I found that mono streams played and double speed unless I used the "-af channel=2" option and also that streams wouldn't end they just kept repeating the last few seconds.

Neil

jonathanbarber
2005-09-30, 01:46
Installed AlienBBC (with some difficulty!) a couple of months back and love it but gutted that I can't listen to the live feeds. Unfortunately this patch looks a bit complicated for me to enact in my windows set up. Hopefully a simpler solution will not be long....


Thanks for everyone's help on this

J

lordypieman
2005-09-30, 03:01
I to am a Windows (2kSP4) Slimserver/Squeezebox user with the same AlienBBC problem and looking for the same solution. I'm also not sure I'm up to recompiling from the C sourcecode.

If anyone gets a Windows version compiled could they post a link to it here for us to road-test and report back?

Cheers,
Martin.

Win 2k SP4
Slim v6.2
AlienBBC
Squeezebox

markcaines
2005-09-30, 05:31
...and if anyone has got it working for Mac OS X, I would also really appreciate some more guidance.

Mark

Neil Sleightholm
2005-09-30, 09:15
For Windows keep an eye on this site http://oss.netfarm.it/mplayer-win32.php. He regularly posts new Windows versions for the CVS source. I have been told that this patch will be included in CVS this weekend.

Neil

jbm
2005-09-30, 09:25
Everybody wants a pony.

http://www.mnftiu.cc/mnftiu.cc/images/gywo.andapony.gif

danco
2005-09-30, 12:57
On 30/9/05 at 05:31 -0700, markcaines wrote
>...and if anyone has got it working for Mac OS X, I would also really
>appreciate some more guidance.
>
>Mark

can't help with listen luve, but it works fine with listen again.
browse the threads if you nrrf info

--
Daniel Cohen

markcaines
2005-10-01, 02:19
Dan - I'm in the same position - everything works apart the live streams. Guess I'll have to be patient.

Mark

tygar
2005-10-02, 14:06
It would be great if the AlienBBC web page could be updated with this information! (Thanks in advance)

Neil Sleightholm
2005-10-03, 09:52
It would be great if the AlienBBC web page could be updated with this information!Done. I have included a link back to this thread and will update the information when I know more.

Neil

Neil Sleightholm
2005-10-04, 02:48
Here is a new version of the mplayer patch for anyone that is interested:

Index: demux_real.c
================================================== =================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_real.c,v
retrieving revision 1.72
diff -u -r1.72 demux_real.c
--- demux_real.c 5 Aug 2005 19:57:46 -0000 1.72
+++ demux_real.c 3 Oct 2005 06:59:31 -0000
@@ -92,6 +92,13 @@
int a_bitrate; ///< Audio bitrate
int v_bitrate; ///< Video bitrate
int stream_switch; ///< Flag used to switch audio/video demuxing
+
+ /* Variables to fix missing buffer in stream audio */
+ int live_stream; // Flag to indicate that it is a suitable live audio only stream
+ int ms_per_packet; // estimated millisec per packet
+ int ms_per_block; // estimated millisec per block which is a multiple of packets defined by stream parameters
+ int ms_per_packet_safety; // estimated millisec per packet with a margin
+ char *previous_pkt,*previous_pkt2; // Copy of previous packet
} real_priv_t;

/* originally from FFmpeg */
@@ -687,6 +694,41 @@
priv->audio_need_keyframe = 0;
}else
dp->pts = (priv->a_pts==timestamp) ? 0 : (timestamp/1000.0f);
+/*
+ * Only use this method of packet loss detection & fix for live audio streams of cook V5 decoder - typically from BBC live streams
+ */
+ if ( (priv->live_stream == 1) && (((sh_audio_t *)ds->sh)->format == mmioFOURCC('c','o','o','k')) ){
+ demux_packet_t *dp1;
+ int toggle =0;
+
+ if (((timestamp - priv->a_pts) > priv->ms_per_packet_safety) && ((timestamp - priv->a_pts) < priv->ms_per_block))
+ mp_msg(MSGT_DEMUX,MSGL_V, "Packets lost: timestamp gap Actual %d msec Expected %d Flags %02X\n", timestamp-priv->a_pts, priv->ms_per_packet,dp->flags);
+ if ((timestamp - priv->a_pts) < (priv->ms_per_packet-2)) // This is a diagnostic msg - allow a margin of 2 based on observations of streams to reduce "noise"
+ mp_msg(MSGT_DEMUX,MSGL_V, "Packet timestamp gap too short Actual %d msec Expected %d Flags %02X\n", timestamp-priv->a_pts, priv->ms_per_packet,dp->flags);
+
+/* Detected some packets dropped by server by gap in the timestamp. This loops fills in the missing packets with copies of previous packets
+ * as an empty buffer would be heard as a click. Packets are striped but also alternate - so previous packet is not the packet closest in time.
+ */
+ if ((timestamp - priv->a_pts) < priv->ms_per_block) // Only insert buffer if it is not a whole block missing
+ while( ((timestamp - priv->a_pts) > priv->ms_per_packet_safety) ) {
+ dp1 = new_demux_packet(len);
+ if (toggle == 1) { // This chooses which previous packet to pick that is closest in time to the missing packet
+ memcpy(dp1->buffer,priv->previous_pkt,len);
+ toggle = 0;
+ }
+ else { // When there is more than one missing packet toggle chooses which previous packet is most suitable.
+ memcpy(dp1->buffer,priv->previous_pkt2,len);
+ toggle = 1;
+ }
+ priv->a_pts=priv->a_pts + priv->ms_per_packet;
+ dp1->pos = demuxer->filepos;
+ dp1->flags = 0;
+ ds_add_packet(ds, dp1);
+ }
+ memcpy(priv->previous_pkt2,priv->previous_pkt,len); // Ensure that the last two good packets are kept to use to replace missing packets
+ memcpy(priv->previous_pkt,dp->buffer,len);
+ }
+
priv->a_pts=timestamp;
dp->pos = demuxer->filepos;
dp->flags = (flags & 0x2) ? 0x10 : 0;
@@ -1358,6 +1400,28 @@
((short*)(sh->wf+1))[4]=codecdata_length;
// stream_read(demuxer->stream, ((char*)(sh->wf+1))+6, 24); // extras
stream_read(demuxer->stream, ((char*)(sh->wf+1))+10, codecdata_length); // extras
+/*
+ * Initialise variables used for packet loss detection in live audio streams using cook V5
+ * Although in case "cook" Test for cook format because 'sipr' & 'atrc' fall through into cook
+ */
+ if ( (sh->format == MKTAG('c', 'o', 'o', 'k')) && (version == 5) && strstr(mimet,"x-pn-multirate-realaudio-live")) {
+ priv->live_stream = 1;
+ priv->ms_per_packet = (long) ( (coded_frame_size*8*1000L)/(sh->wf->nAvgBytesPerSec)); // Variable name nAvgBitsPerSec would be more appropriate
+ priv->ms_per_packet_safety = priv->ms_per_packet + (priv->ms_per_packet/5) ; // Add 20% for the safety margin as packet timing based on AvgBitsPerSec is not accurate
+ priv->ms_per_block = priv->ms_per_packet * sub_packet_h;
+
+ mp_msg(MSGT_DEMUX,MSGL_V,"Live stream: Subpacksize %d sub packet h %d Flavour %d coded frame size %d codecdatalength %d avg byte/sec %d channels %d\n",sub_packet_size,sub_packet_h,flavor,coded_frame_s ize,codecdata_length, sh->wf->nAvgBytesPerSec, sh->channels);
+ mp_msg(MSGT_DEMUX,MSGL_V,"Live stream: Expected range ms/packet %d to %d ms per block %d\n",priv->ms_per_packet,priv->ms_per_packet_safety, priv->ms_per_block);
+
+ priv->previous_pkt = malloc(coded_frame_size);
+ priv->previous_pkt2 = malloc(coded_frame_size);
+ if (!priv->previous_pkt || !priv->previous_pkt2){
+ mp_msg(MSGT_DEMUX,MSGL_V,"Couldn't allocate memory to a packet buffer\n");
+ memset(priv->previous_pkt, 0, coded_frame_size);
+ memset(priv->previous_pkt2, 0, coded_frame_size);
+
+ }
+ }
break;
case MKTAG('r', 'a', 'a', 'c'):
case MKTAG('r', 'a', 'c', 'p'):
@@ -1742,6 +1806,10 @@
for(i=0; i<MAX_STREAMS; i++)
if(priv->index_table[i])
free(priv->index_table[i]);
+ if(priv->previous_pkt)
+ free(priv->previous_pkt);
+ if(priv->previous_pkt2)
+ free(priv->previous_pkt2);
free(priv);
}

Note: I couldn't get the patch to automatically patch the file so I had to manualy patch it. I applied it to v1.73 of demux_real.c.

I have been running this on Windows this morning and it seems to be better than the previous one as the glitches are a lot less noticable.

Neil

gingerneil
2005-10-04, 03:46
any chance you could post the binary ?

Neil Sleightholm
2005-10-04, 05:11
any chance you could post the binary ?I am looking in to the possibility of this but when it was investigated before there were copyright issues.

Neil

Neil Sleightholm
2005-10-04, 09:38
Here is a new version of the mplayer patch for anyone that is interestedI would be interested in anyone else's results with this new patch. It worked for me for most of the day for me but then started going wrong.

Neil

Neil Sleightholm
2005-10-07, 09:26
This has just been pointed out to me:
http://mplayerhq.hu/DOCS/HTML/en/mplayer-binary.html
E.2. Binary distribution
MPlayer previously contained source from the OpenDivX project, which disallows binary redistribution. This code has been removed in version 0.90-pre1 and the remaining file divx_vbr.c that is derived from OpenDivX sources has been put under the GPL by its authors as of version 0.90pre9. You are now welcome to create binary packages as you see fit.

Another impediment to binary redistribution was compiletime optimizations for CPU architecture. MPlayer now supports runtime CPU detection (pass the --enable-runtime-cpudetection to configure). It is disabled by default because it implies a small speed sacrifice, but it is now possible to create binaries that run on different members of the Intel compatible CPU family.So, as I read that there is not a problem with redistributing my compile of mplayer. Does anyone else read this in the same way?

I will try to release the Windows version in the next few days, if some else can compile for Unix and the Mac I will add that to the AlienBBC site. I should point out that this will be an 'alpha' only and I will not support it.

Neil

Mike Anderson
2005-10-07, 11:14
I too am a clueless Windows user looking for a compiled and patched version. If anyone could email it to me or post a link, that would be much appreciated.

Thanks,
Mike
mikeand1@comcast.net

Neil Sleightholm
2005-10-08, 01:06
I have made may Windows release avaiable for download, see: http://forums.slimdevices.com/showthread.php?p=56344#post56344

Neil

Mike Anderson
2005-10-08, 10:12
excellent, thanks - I'll run it for a while and let you know how it works.

Mike Anderson
2005-10-08, 10:22
It's still happening (in fact it kicked in sooner than usual, after abour 3-4 minutes).

Other than putting the new mplayer.exe in the proper slimserver directory and restarting slimserver, is there something else I have to do?

neilcoburn
2005-10-09, 00:14
It doesn't work for me - it just locks up the Squeezebox and I have to do a power cycle to get it running again.

maxwl
2005-10-09, 04:21
It appears to have worked for me, another clueless windows user. I have had live radio 3 and radio 4 playing for about 1 hour each and they seem ok. Obviously more testing will be useful.

However another related problem. I hope someone can help.
With live radio 2 all I get is the following audio at the start.. "You're listening to BBC Radio 2 live online at www.bbcradio.co.uk/radio2"

and then nothing. just silence.

The other BBC live stations seem fine.

Any ideas?

Thanks in advance
Max
Ireland

trevtu
2005-10-09, 05:24
If you are having a problem getting the new mplayer to work try this:-

Stop Slimserver
rename your existing mplayer
extract the new mplayer to ?:\Program Files\SlimServer\server\Bin\MSWin32-x86-multi-thread
REBOOT your PC

Try a live stream.

This worked for me after a failed first attempt. I had been listening to Alien BBC before installing the mplayer update and I think that in that case the reboot ensures a clean start.

Trevor.

MrStan
2005-10-09, 05:26
This appears to have been added to the BBC Radio player recently as well, but only for Radio 2.

The AlienBBC Plugin appears to be playing:-
rtsp://rmv8.bbc.net.uk/radio2/r2online_id.rm which now only gives the announcement.

It should be playing:-
rtsp://rmlivev8.bbc.net.uk/farm/*/ev7/live24/radio2/live/r2_dsat_g2.ra as long as the BBC doesn't change it.

lordypieman
2005-10-09, 06:05
I've replaced my MPlayer.exe with the alpha version from the link provided here in the forum and the performance is (so far) faultless. I'll run it for a few days and report back after a longer trial.

I have the same problem as Maxwl with Radio 2. It plays only the introduction, and keeps repeating it. It is also played at (I'm guessing) double speed with gaps between each repetition.
Radio Five Live plays at double speed too, which gaps every couple of seconds. Radios 1,3,4,6,7 all work fine.

Anyone got a fix for th problem with radio 2 and 5?

Lordypieman

Piii 833MHz, 256Mb RAM
Windows 2kSP4
SlimServer 6.2
AlienBBC 0.98

neilcoburn
2005-10-09, 06:30
It's now working for me, after a PC re-boot.

Bill Burns
2005-10-09, 07:55
lordypieman wrote:

> I have the same problem as Maxwl with Radio 2. It plays only the
> introduction, and keeps repeating it. It is also played at (I'm
> guessing) double speed with gaps between each repetition.

I had the same thing on some feeds; the double-speed fix for
slimserver-convert.conf shown on Neil's page took care of it:
http://www.x2systems.com/alienbbc/mplayer.html

--
Bill Burns
Long Island NY USA
mailto:billb (AT) ftldesign (DOT) com

Triode
2005-10-09, 08:48
Re Radio2.

Just to say we are aware of this and are working on a solution for the next version of Alien - it's due to the radio 2 metafile
including two streams - the ident one and then the real stream. By default Alien only plays the first one.

For the moment, if you are happy editing perl files, try:

edit Plugins/Alien/RTSP.pm

change the line:
my $multistream;

to:
my $multistream = 1;

> However another related problem. I hope someone can help.
> With live radio 2 all I get is the following audio at the start..
> "You're listening to BBC Radio 2 live online at
> www.bbcradio.co.uk/radio2"
>

maxwl
2005-10-09, 09:16
Triode

That seems to have fixed it. Thanks for your help.
Radio 2 is back and no garbled sound (hopefully!).

maxwl

Neil Sleightholm
2005-10-09, 11:28
It plays only the introduction, and keeps repeating it. It is also played at (I'm guessing) double speed with gaps between each repetition.Re the double speed, see http://www.x2systems.com/alienbbc/mplayer.html "Known Problems".

Neil

netim3
2005-10-09, 11:37
I'm a bit of a newbie but am happy to try & compile a mac version. Can you send me the inputs & I'll have a go?

Neil Sleightholm
2005-10-09, 14:27
I'm a bit of a newbie but am happy to try & compile a mac version. Can you send me the inputs & I'll have a go?It is not quite as simple as that. If you refer to the mplayer site you may be able to find the information on how to compile a Mac version.

Andrew L. Weekes
2005-10-09, 15:27
Thanks Neil for making the alpha release available, for someone like me, who last compiled a program in 1980-something, it's a huge help ;)

It seems to be working a dream at present - I can't begin to tell you how much I appreciate the efforts you and everyone else has put in to getting this bug fixed.

Cheers,

Andy.

netim3
2005-10-09, 15:30
OK, as I said, I'm a real newbie. Tell me if I'm headed in the right direction....

I changed you ./configure options to enable for macos
I installed gcc 3.3 and make3.8 on the Mac
I downloaded the mplayer-1.0pre7try2 package and unpacked it.

I tried to run the ./configure but got the following error messages. Any tips on how to proceed appreciated.

./configure --prefix=/usr --language=all --disable-mencoder --disable-jpeg --disable-gif --disable-tga --disable-liblzo --disable-tv --disable-dvb --disable-vidix --disable-sdl --disable-pnm --disable-xvid --disable-toolame --disable-mad --disable-png --disable-win32 --enable-md5sum --enable-gl --disable-menu --enable-macosx --enable-live --with-livelibdir=/home/mplayer/live --enable-real --enable-qtx --enable-static="-mconsole" --enable-runtime-cpudetection --with-codecsdir=codecs
Detected operating system: Darwin
Detected host architecture: ppc
Checking for cc version ... 4.0.0, bad
Checking for gcc version ... 4.0.0, bad
Checking for gcc-3.4 version ... not found
Checking for gcc-3.3 version ... 3.3, ok
Checking for host cc ... gcc-3.3
Checking for CPU type ... 7450 altivec
Checking for GCC & CPU optimization abilities ... 7450
Checking for assembler support of -pipe option ... no
Checking for GCC altivec support ... none
Checking for mplayer binary name ... mplayer
Checking for extra headers ... none
Checking for extra libs ... none
Checking for -lposix ... no
Checking for -lm ... no
Checking for i18n ... no
Checking for iconv ... no
Checking for langinfo ... no
Checking for language ... using en (man pages: cs de en es fr hu it pl sv)
Checking for enable sighandler ... yes
Checking for runtime cpudetection ... no
Checking for restrict keyword ... none
Checking for __builtin_expect ... no
Checking for kstat ... no
Checking for posix4 ... no
Checking for lrintf ... no
Checking for nanosleep ... no
Checking for socklib ... no
Checking for inet_pton() ... no (=> i'll try inet_aton next)
Checking for inet_aton() ... no (=> network support disabled)
Checking for inttypes.h (required) ... no
Checking for bitypes.h (inttypes.h predecessor) ...
Error: Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/en/faq.html).

Check "configure.log" if you do not understand why it failed.

Neil Sleightholm
2005-10-10, 11:16
OK, as I said, I'm a real newbie. Tell me if I'm headed in the right direction....You are in the right direction but I think you need to install a lot of other bits first. The instructions for Windows are: http://www2.mplayerhq.hu/MPlayer/releases/win32/contrib/MPlayer-MinGW-Howto.txt if that helps. You may be able to find something similar for the Mac. It took me a whole weekend to get it to compile!

Neil

neilcoburn
2005-10-11, 00:33
I'm still having trouble using Neil's fixed Mplayer in Windows. The SB just freezes, usually showing 'connecting' on screen, sometimes getting past that to 'now playing [programme]' but then freezing with no audio. I then have to power cycle the Squeezebox. I've tried rebooting after updating mplayer, and tried downloading the zip file again and doing the whole process again. Any thoughts?

bpa
2005-10-11, 02:50
Open a Windows C prompt windows. Change dir to the where Mplayer is installed. Try the following command.

mplayer -verbose 1 -vo null -cache 128 -af volume=4:sc,resample=44100:0:1 -playlist http://www.bbc.co.uk/radio4/realplayer/media/fmg2.rpm

If it starts up and you hear audio then Mplayer is OK and the problem lies with the Slimserver/SB not Mplayer. You could try without the "-verbose 1" flag on the first run as this will reduce messages.

If Mplayer does not play - look at the messages - it generate lots of messages some of which indicate files/codecs not found some of these are normal so don't jump to conclusions. At worst post a copy of the log.

Bryan

jonathanbarber
2005-10-11, 10:26
Firstly wanted to say a huge thank you for fixing this problem which has until now taken the shine off my Squuezebox.

I still have the problem on Radio 2 plays introduction and then silence. I can't edit perl, would this be fixed by downloading the latest night version of Squuzebox software?

Thanks

J

Triode
2005-10-11, 10:31
No - it will with the next version of Alien though....

> I still have the problem on Radio 2 plays introduction and then
> silence. I can't edit perl, would this be fixed by downloading the
> latest night version of Squuzebox software?
>

MKS
2005-10-14, 02:10
Firstly wanted to say a huge thank you for fixing this problem which has until now taken the shine off my Squuezebox.

I still have the problem on Radio 2 plays introduction and then silence. I can't edit perl, would this be fixed by downloading the latest night version of Squuzebox software?

Thanks

J
Sorry - I know I'm a noob around here, but I think I fixed this problem easily using Triode's advice in an earlier thread about AlienBBC and Radio2 (search on Radio2).

2) for the radio2 live only playing the ident problem, edit Plugins/Alien/RTSP.pm to set $multistream = 1. I.e replace:
"my $multistream;" with "my $multistream = 1;"
You can edit this file easily from Windoze Explorer by selecting Open, and then choose Wordpad or Notepad from the list of possible applications. You don't need Perl. Search for "Multistream" within the document and you'll quickly find the appropriate bit to change.

Oh - by the way, I'm absolutely amazed at what all of this software can do (Squeezebox, Slimserver, Softsqueeze, AlienBBC, Slimscrobbler, LastFM plugins etc.) You're all amazingly lovely, talented, helpful people... ;-) I'm looking forward to watching less crap television and listening to more good radio and music... (SB2 arrives within the next week...)

Triode
2005-10-14, 10:52
Better still - try the new version of AlienBBC if you are using server version 6.2:

http://forums.slimdevices.com/showthread.php?p=57539#post57539

> Sorry - I know I'm a noob around here, but I think I fixed this problem
> easily using Triode's advice in an earlier thread about AlienBBC and
> Radio2 (search on Radio2).
> Triode Wrote:
>> 2) for the radio2 live only playing the ident problem, edit
>> Plugins/Alien/RTSP.pm to set $multistream = 1. I.e replace:
>> "my $multistream;" with "my $multistream = 1;"
> You can edit this file easily from Windoze Explorer by selecting Open,
> and then choose Wordpad or Notepad from the list of possible
> applications. You don't need Perl. Search for "Multistream" within
> the document and you'll quickly find the appropriate bit to change.

jonathanbarber
2005-10-17, 16:09
Hi

I did infact try both fixes, changing the file through notepad and then reloading alienbbc (deleted two files covert & custom in Slimserver and plugin folder) extracted new Alien BBc within Slimserver 6.2.

Both these brought the same result that Radio 2 plays introduction and then cuts to silent before going to time/date screensaver. Any ideas?

Thanks

J

Neil Sleightholm
2005-10-18, 09:42
Hi

I did infact try both fixes, changing the file through notepad and then reloading alienbbc (deleted two files covert & custom in Slimserver and plugin folder) extracted new Alien BBc within Slimserver 6.2.

Both these brought the same result that Radio 2 plays introduction and then cuts to silent before going to time/date screensaver. Any ideas?

Thanks

JCould you post a trace of the output when you play Radio 2. If you are using AlienBBC 0.99 it shouldn't play the ident at all.

Neil

jonathanbarber
2005-10-18, 11:39
Neil

I can set up the correct CMD window and slimserver directory, how do I then post the output for Radio 2. Sorry to be so ignorant!

J

Neil Sleightholm
2005-10-18, 12:14
If you run "slim.exe --d_plugins --d_parse --d_remotestream" from the command line you should see a load of trace. Then once it is running try to play Radio 2 and collect the output by copying from the window.

Neil

Olaf
2005-10-22, 16:09
<neil.coburn@...> writes:

>
> I have searched both the mailing lists and the forum, and this has been
> raised before but to my knowledge not resolved.
>
> When playing live BBC streams on AlienBBC, after a while (10-20 minutes)
> the sound becomes garbled - it sounds like 2 streams are being played a
> fraction out of time which each other. This doesn't happen when playing
> archive/Listen Again programmes. Incidentally, the live stream is also
> noticeably quieter (and muffled) than the Listen Again streams.
>
> Has anyone found a solution to this?
>
> I'm running Alien BBC v0.97, Slimserver v6.1 from about 3 weeks ago on
> Windows XP, and playing on both an SB1 and SB2.
>

Well done, Neil !! I just downloaded your latest mplayer concoction (w/o
kill) and eventually managed to get it going once I realized I had to re-
arrange comments in slimserver-convert.conf. Radio3's been playing for the
past 3 hours w/o problems. Eureka!

Hangtight
2005-10-27, 06:56
Hi,

I'm new to the forum and have been following this thread with interest as my wife is very keen to listen to Radio 4 again on the grown up speakers! I have just tried moving to Slimserver 6.2, alien 0.99 and the suggested mplayer fix (w/o kill) but I'm still getting the garbled output within a couple of minutes of selecting a BBC stream. Am I missing something? Any help much appreciated (if only so I don't have to go and dig my old tuner out of the loft!)

Thanks in advance.

bpa
2005-10-27, 10:02
I'm having problems tracing this last "garbled" issues. I've been running Mplayer for the last week for 4 hours at a time at the peak early time (5:30-9:30) on R4 and have not experienced it.

Can you give me a summary of when the problem occurs for you, how long do you have to listen and how frequent ?

How does the garbled audio sound to you ?

Can you give details of the Mplayer you are using. Cut and paste the banner line which gives version no. etc. and also file size.

CardinalFang
2005-10-27, 14:16
Any chance of someone building a Mac executable? Pretty please? I still have the garbled sound and it is definitely the dropped/out-of-sync packets issue.

It's really annoying, especially if you have someone in the house who is dedicated to the Archers and gets very stroppy when the sound gets mangled just when there's a dramatic incident involving sausages and sheep dip (it's a tale of country folk in the UK in case people in the colonies were wondering :-))

Paul

Hangtight
2005-10-28, 02:11
Hi bpa,

The mplayer version is 'mplayer dev-CVS-051004-17:18-3.4.2 for Windows' from the link somewhere in previous posts. Slimserver is 6.2 from 26-10-05 and alienbbc 0.99 from the same date. The audio connects and plays fine but starts to garble in as little as 30 seconds. The effect is of very short bursts of audio played in the wrong order with occasional short gaps. This degrades further until it sounds like two garbled streams superimposed over each other. A friend of mine thinks it sounds great and wants to sample it for a track. My wife on the other hand thinks that she should just be able to turn it on and listen to the Archers. For the sake of peace and harmony, I'm with the wife on this one!

bpa
2005-10-28, 02:20
That version of Mplayer didn't handle all the garbled problems

http://www.x2systems.com/AlienBBC/mplayer051015.zip

Try this version - this is the one I'm still testing to find the last (hopefully) issue- people still seem to get garbled audio but it is far less frequent

Hangtight
2005-10-28, 06:44
Thanks, This version of mplayer is a definite improvement, but still got garbled output after about 30 minutes. Seems to restart the stream ok without any immediate problems as before. I'll keep listening and see if the problem exhibits any sort of pattern.

bpa
2005-10-28, 06:51
The newer version dealt with gaps of audio of typically 2-6 seconds. So when there is a gap Mplayer can only fill in the gap with silence or old samples - that is probably what you are hearing.

I'm very interested if the stream becomes garbled, stays garbled and doesn't return to normal within 20 seconds.

Hangtight
2005-10-28, 07:04
After I'd replaced the mplayer.exe with your suggested version ( followed by a reboot) the stream ran for 30 minutes, garbled and then stayed garbled, (isn't garbled a weird word when you say it often enough?)with no signs of recovery. Restarted OK and is still fine after a further 30 minutes. Got to pop out for a while now, but I'll let you know if it's still behaving when I get back in.

Thanks for your time.

bpa
2005-10-28, 07:44
The fact that it stayed garbled is enough. I just can't get it to happen on my connections even though I've run it for hours. Main difference is I don't have a Squeezebox - that may be key.
Thanks

Neil Sleightholm
2005-10-28, 09:59
Could you try using mplayer directly. This should play Radio 4:
mplayer -vo null -cache 128 -af volume=4:sc,resample=44100:0:1 -playlist http://www.bbc.co.uk/radio4/realplayer/media/fmg2.rpm

This should eliminate AlienBBC/SlimServer.

Neil

Hangtight
2005-10-28, 10:05
I take it I need to open a cmd window and put the above string in?

Neil Sleightholm
2005-10-28, 10:49
Yes and change to the location of mplayer (probably C:\Program Files\SlimServer\Server\Bin\MSWin32-x86-multi-thread).

Neil

Hangtight
2005-10-28, 14:40
Seems to play fine at start up. I haven't had to play in DOS since I was at school! What I didn't do was check the output from the Squeezebox before I ran mplayer direct. Would calling up mplayer from cmd have frozen the hardware end of things if it was already being used by the Squeezebox? I just checked the unit and it's just sitting there with a static level displayed on the VU meters.

Hangtight
2005-10-28, 14:43
Just skipped like a stuck record for a few seconds after 8 minutes, but recovered.

Hangtight
2005-10-28, 15:18
Weird. Moving the scroll bar on the cmd window will make the stream skip and repeat until you stop playing around with it.

bpa
2005-10-28, 16:51
Mplayer in a cmd window is prone to be affected by all sorts of things mainly scroll bar but something in my screen powersave makes it freeze. So unless you can leave the PC alone, you can't really trust the test.

Hangtight
2005-10-29, 00:34
Left it running last night undisturbed, but stream had stopped when I checked it this morning. Unfortunately the window got closed before I could note down any reports. From what I can remember the stream had played for about 6.5hrs before it stopped which would put the stop at about 5am BST. Does the stream stop and restart at the start of a new days programming? In the mean time I'll just keep testing.

Thanks

Neil Sleightholm
2005-10-29, 03:26
Mplayer in a cmd window is prone to be affected by all sorts of things mainly scroll bar but something in my screen powersave makes it freeze. So unless you can leave the PC alone, you can't really trust the test.This is odd, I don't see anything like this. I do all my mplayer testing in a cmd window on XP without any problems. Do you specify the "-vc null" and "-vo null" options?

Neil

bpa
2005-10-29, 03:58
Neil,

It was late when I wrote the last message. I meant when I run slim.exe in a CMD window and I have "-verbose 1" in the slimserver-convert.conf file.

It runs with the nice time counter rolling over. If you mess with the scroll bar, mplayer seems to stop I presume it can't output to the window and so audio stream processing also stop - it is mainly a simple one thread program.

Whenever I do long tests with Windows - I used to come back to the system and find it frozen. I blamed on powersave but now I think there is something else as I have disabled them all (I think). The datastream to BBC is stopped with regular TCP acks but the TCP window not moving - this means Mplayer has a full output buffer or problem with output to display - not sure which or why ? But I don't think looking at these problems will help sort the garble issue so I'll stick to Linux.

The file you used to build the latest version of Mplayer was the file I posted unchanged ? You didn't have to make any changes to make it work ? My current version of demux-real has had many debug changes so I want to go back to the beginning.

Hangtight
2005-10-29, 04:08
I've had mplayer running in a cmd window for about 3 hours this morning with 5 instances of block gaps with inserted silence and 8 instances of lost packets with gaps between 350ms & 1200ms. Has recovered every time and still running fine. I've not changed anything in the .conf file. I'm just using the control string you posted earlier.

Neil Sleightholm
2005-10-29, 04:15
The file you used to build the latest version of Mplayer was the file I posted unchanged ? You didn't have to make any changes to make it work ? My current version of demux-real has had many debug changes so I want to go back to the beginning.I haven't made any changes to the files you posted but I think I have lost track of which one is in which build. I have attached the three versions I have in my build folder. If you could tell me which one matches your baseline I can rebuild mplayer and post only 1 version for download if that would help. Note: I always build mplayer with the latest CVS copy, would it be better to base the changes on 1.0pre7?

Neil

bpa
2005-10-29, 06:58
The file demux_real.c matches my baseline. Also the behaviour and messages output indicate that your latest Mplayer build used it - so there is no need for a rebuild.

Rather than keep updating my CVS build - I have stayed with a mid Sept build and then later re-test with latest CVS and pre7. I don't believe there is anything to be gained by going back to pre7.

I have a number of test files built from ethereal logs so I can test base functionality on different versions. The real time stream from the BBC has packets arriving at different rates and that can't be simulated easily but our current problem is "garbled" audio which can only happen if not enough or too many packets are passed to the codec - timing of packets doesn't matter as the code processes packets sequentially with no regard to whether a file or a live stream supplied it.

I now have a Softsqueeze running on my Linux box and Slim 6.1.2 running on Windows with no problems.

Hangtight
2005-10-29, 08:55
Just came home to find a long list of missing package messages in the cmd window and a locked up PC. Not sure what happened and when, but I can't remember the last time my machine fell over, so I'm tentatively pointing the finger at mplayer/ rm. Is there anything else I can do or configuration I can run that will help you all get to the bottom of the problem?

bpa
2005-10-29, 09:28
I'm pretty sure it was Mplayer - I think it is associated with screen saver and/or power save for the monitor ?

I don't think it is worth testing this config. as other problems are ocurring which just distract. What may be more interesting is to change slimserver-convert.conf so that Mplayer produces messages - from "really-quiet" to "verbose 1" and keep run slim from the CMD window. This may still have cmd window problems but it will let us see the "packets lost" which I think is still key.

Just for the record what is the "power" of your system
Processor ?
Windows version ?
memory ?

Hangtight
2005-10-29, 12:04
AMD 64 3200+, 1GB PC3200 ram, XP Pro SP2. No power save or screen saver enabled.

bpa
2005-10-29, 16:20
With Softqueeze (Linux) playing r4 on Slimserver 6.1.2 on XP, I've had two cases where connections just dropped and restarted. After the first I rant ethereal on Linux. After 3h40m (43Mbytes) of trace - same thing.

Trace shows slimserver on port 9000 (i.e. the port of the Get Stream.mp3) closes the connection to Softsqueeze - this cause Mplayer to stop but slimserver restarts it.
Why would slimserver decided to close connection yet restart the stream ? Is there a timer or counter running ?

This is another red herring but very strange slimserver behaviour.

Before the restart of the stream, lots of lost packets - even after a 19969msec gap the stream continued as normal.

My machine is comparable - P4 3.4, 1Gb, XP PRO sp2 so that excludes that possibility.

Neil Sleightholm
2005-10-30, 01:02
I think the restarting is to do with the socketwrapper code. This listens for output from mplayer and sends it the slim code, if output stops the code restarts mplayer. This is required on Windows to overcome problems with piping data. The source of this is available in SVN if you want to take a look. This code was changed specifically from AlienBBC, it may be that there is something odd going on. You can get debug info from this by changing slimserver-convert.conf, replace #PIPE# with #DEBUGPIPE#.

Mplayer download: would it be a good idea to remove the 'mplayer with kill code' from the downloads page?

Neil

bpa
2005-10-30, 01:32
I may have a peek at the socketwrapper code but it is a side issue to the garbled audio. I was initially worried that the restart was caused by Mplayer but from the trace it doesn't look likely so I don't think it is associated with garbled audio just indicative of gaps in the audio stream.

Re the "kill code" mplayer - remove it - it was a mistake - I think some people may have installed it by accident if the mouse wasn't quite over the latest version.

Triode
2005-10-30, 03:24
>
> I think the restarting is to do with the socketwrapper code. This
> listens for output from mplayer and sends it the slim code, if output
> stops the code restarts mplayer. This is required on Windows to
> overcome problems with piping data. The source of this is available in
> SVN if you want to take a look. This code was changed specifically from
> AlienBBC, it may be that there is something odd going on. You can get
> debug info from this by changing slimserver-convert.conf, replace
> #PIPE# with #DEBUGPIPE#.
>
NB if you have #DEBUGPIPE# enabled socketwrapper kills the stream if it stalls for 10 seconds, otherwise it is a minute (from
memory)

bpa
2005-10-30, 06:06
I enabled DEBUGPIPE - no message about pipe being stalled just "Killing MoveData thread".

Restart occurred about 3:25 after start of stream. Yesterday it was about 3:40hrs. I have 2 ethereal traces so I'll try to see if the times are closer but it looks too coincidental. I'll look into this a bit more but I still think it is peripheral to the garbled audio.

Triode
2005-10-30, 06:18
Shall we take this discussion to the plugin list as it sounds like it will carry on for a while...

Socketwrapper source is here: http://svn.slimdevices.com/trunk/tools/socketwrapper/

If you don't see the stalled message, then it sounds like a process in the pipeline ended.

>
> I enabled DEBUGPIPE - no message about pipe being stalled just "Killing
> MoveData thread".
>
> Restart occurred about 3:25 after start of stream. Yesterday it was
> about 3:40hrs. I have 2 ethereal traces so I'll try to see if the
> times are closer but it looks too coincidental. I'll look into this a
> bit more but I still think it is peripheral to the garbled audio.

bpa
2005-11-06, 05:16
I have posted a new patch and Windows .exe for Mplayer in this thread which hopefully solves this final garbled audio.
.
http://forums.slimdevices.com/showthread.php?t=16917&page=9