MP3/MPlayer plugin 0.9.13 available

Message ID dco7j7$4sc$2@video.local.muempf.de
State New
Headers

Commit Message

Stefan Huelswitt Aug. 2, 2005, 4:39 p.m. UTC
  Hi,

appearently there are some problems with OSS replay. In some
cases VDR hangs for 5-6 seconds when skipping between songs.

I think I found a solution, but due to the great variety of OSS
drivers, this has to be tested with as much drivers as possible.
So if you're using OSS, please test the attached patch and report
any failure/weirdness.

Regards.
  

Comments

C.Y.M Aug. 2, 2005, 9:30 p.m. UTC | #1
Stefan Huelswitt wrote:
> diff -urN -X mp3-unstable/.exclude mp3-0.9.13/player-mp3.c mp3-unstable/player-mp3.c
> --- mp3-0.9.13/player-mp3.c	2005-07-30 14:33:50.000000000 +0200
> +++ mp3-unstable/player-mp3.c	2005-08-01 21:47:25.000000000 +0200

Thanks for this patch.  This seems to fix the libmad error I was getting on the
first frame of every mp3.

Previously, this is what I had in the logs every time I played an MP3:

mad: decode hdr error, frame=0 count=1: lost synchronization


But, now with this new patch (mp3-oss.diff) it looks like this:

mad: lost sync 03334449 00000000 ID3
mad: skipping over ID3 tag
mgr: bgr-scan -> run (150651)
mgr: background scan idle wakeup
mgr: background scan idle
mp3: heartbeat buffer=1048252 now=1015
mp3-ctrl: mode change detected


Best Regards,
C.
  
Martin Cap Aug. 3, 2005, 2:07 a.m. UTC | #2
Stefan Huelswitt wrote:
> Hi,
> 
> appearently there are some problems with OSS replay. In some
> cases VDR hangs for 5-6 seconds when skipping between songs.
> 
> I think I found a solution, but due to the great variety of OSS
> drivers, this has to be tested with as much drivers as possible.
> So if you're using OSS, please test the attached patch and report
> any failure/weirdness.
> 

Hi,

well, well. This is another "issue" I have with the plugin, no matter if 
I use 0.9.13 or 0.9.12.
I'll try the patch later this day.

---
Regards,
Martin Cap
  
Stefan Huelswitt Aug. 3, 2005, 4:12 p.m. UTC | #3
On 02 Aug 2005 "C.Y.M" <syphir@syphir.sytes.net> wrote:

> Previously, this is what I had in the logs every time I played an MP3:
> 
> mad: decode hdr error, frame=0 count=1: lost synchronization
> 
> 
> But, now with this new patch (mp3-oss.diff) it looks like this:
> 
> mad: lost sync 03334449 00000000 ID3
> mad: skipping over ID3 tag

This is not related to this patch (only changes OSS output).
Correctly skipping of the ID3 tag was introduced in the .13 release.

Regards.
  
Martin Cap Aug. 3, 2005, 4:27 p.m. UTC | #4
Stefan Huelswitt wrote:
> Hi,
> 
> appearently there are some problems with OSS replay. In some
> cases VDR hangs for 5-6 seconds when skipping between songs.
> 
> I think I found a solution, but due to the great variety of OSS
> drivers, this has to be tested with as much drivers as possible.
> So if you're using OSS, please test the attached patch and report
> any failure/weirdness.

Hi,

works great. VDR hanging for a few seconds is gone.

My driver is "cs461x" which comes with kernel 2.6.12.1 for a "Cirrus 
Logic CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator] (rev 01)".
  

Patch

diff -urN -X mp3-unstable/.exclude mp3-0.9.13/player-mp3.c mp3-unstable/player-mp3.c
--- mp3-0.9.13/player-mp3.c	2005-07-30 14:33:50.000000000 +0200
+++ mp3-unstable/player-mp3.c	2005-08-01 21:47:25.000000000 +0200
@@ -1391,7 +1391,7 @@ 
 void cOutputOss::Init(void)
 {
   if(fd<0) {
-    fd=open(dspdevice,O_WRONLY);
+    fd=open(dspdevice,O_WRONLY|O_NONBLOCK);
     if(fd>=0) poll.Add(fd,true);
     else esyslog("ERROR: Cannot open dsp device '%s': %s!",dspdevice,strerror(errno));
     }
@@ -1453,15 +1453,19 @@ 
 
 int cOutputOss::Output(const unsigned char *Data, int Len, bool SOF)
 {
-  int n=0;
-  if(SOF) {
-    struct FrameHeader *fh=(struct FrameHeader *)Data;
-    if(fh->samplerate!=outSr) Reset(fh->samplerate);
-    n=FHS;
-    Data+=n; Len-=n;
+  if(fd>=0) {
+    int n=0;
+    if(SOF) {
+      struct FrameHeader *fh=(struct FrameHeader *)Data;
+      if(fh->samplerate!=outSr) Reset(fh->samplerate);
+      n=FHS;
+      Data+=n; Len-=n;
+      }
+    int r=write(fd,Data,Len);
+    if(r<0 && !FATALERRNO) r=0;
+    if(r>=0) return n+r;
     }
-  int r=fd>=0 ? write(fd,Data,Len) : -1;
-  return (r>=0 ? r+n : -1);
+  return -1;
 }
 
 bool cOutputOss::Poll(void)