From: Bill F. <bil...@ca...> - 2001-09-07 09:38:21
|
On 09/06/2001, Derrik Pates wrote: > Subject: Playback on PPC - Video good, audio crap > > I'm now using Xine 0.5.2 (local built from Debian source packages). I've > so far come across 2 problems with it. First, if I don't specify an audio > output plugin to use ('oss' in this case), Xine gets hung up partway > through its startup process. Easy workaround, though - just add '-A oss' > to the Xine command line. The other problem is a bit larger, though - the > audio while playing back is very choppy and slightly delayed. I see a lot > of lines like: > > audio_out: inserting 2431 0-frames to fill a gap of 6839 pts > audio_out: inserting 2159 0-frames to fill a gap of 6075 pts > > in Xine's output during playback. I know it's not using realtime mode (the > dmasound_awacs driver doesn't support realtime mode apparently). However, > with 0.4.x versions of Xine, the audio sync, even using the soft-sync > method as the OSS output plugin is currently doing, was never this bad. > Anybody got any ideas? (This is running Debian sid, with 2.4.9-benh0 on an > iBook FireWire 366 with 128 MB of RAM and a 10 GB disk.) The xine audio_out plugins were restructured in 0.5.2, which broke the PPC and other non-realtime audio output. I just worked up a patch for xine 0.5.3 which corrects this (will also work with 0.5.2). I would also suggest making the same kind of change to audio_sun_out.c that I made to audio_oss_out.c, but since I don't have xine running on a Sun machine, I didn't do this. BTW, xine 0.5.3 does seem more stable than 0.5.2. I was able to hang 0.5.2 without too much trouble by seeking back and forth through a vob file, but 0.5.3 worked properly on all the seek attempts I tried. -Bill xine-lib-0.5.3-ppcaudio.patch: -------------------------------------------------------------------------------- diff -ur xine-lib-0.5.2.dist/src/audio_out/audio_oss_out.c xine-lib-0.5.2.mod/src/audio_out/audio_oss_out.c --- xine-lib-0.5.2.dist/src/audio_out/audio_oss_out.c Sat Sep 1 14:38:06 2001 +++ xine-lib-0.5.2.mod/src/audio_out/audio_oss_out.c Fri Sep 7 04:09:18 2001 @@ -92,6 +92,7 @@ #define GAP_TOLERANCE 5000 #define MAX_GAP 90000 +#define NOT_REAL_TIME -1 #ifdef CONFIG_DEVFS_FS #define DSP_TEMPLATE "/dev/sound/dsp%d" @@ -117,7 +118,6 @@ int audio_started; int audio_has_realtime; /* OSS driver supports real-time */ - int static_delay; /* estimated delay for non-realtime drivers */ } oss_driver_t; /* @@ -313,7 +313,7 @@ if (bytes_left<=0) /* buffer ran dry */ bytes_left = 0; } else { - bytes_left = this->static_delay; + return NOT_REAL_TIME; } @@ -560,8 +560,6 @@ this->output_sample_rate = 0; this->audio_fd = -1; - - this->static_delay = config->lookup_int (config, "oss_static_delay", 1000); this->ao_driver.get_capabilities = ao_oss_get_capabilities; this->ao_driver.get_property = ao_oss_get_property; diff -ur xine-lib-0.5.2.dist/src/xine-engine/audio_out.c xine-lib-0.5.2.mod/src/xine-engine/audio_out.c --- xine-lib-0.5.2.dist/src/xine-engine/audio_out.c Sun Sep 2 15:53:15 2001 +++ xine-lib-0.5.2.mod/src/xine-engine/audio_out.c Fri Sep 7 04:11:20 2001 @@ -257,13 +257,16 @@ * where, in the timeline is the "end" of the audio buffer at the moment? */ - buffer_vpts = this->metronom->get_current_time (this->metronom); - if (this->audio_started) delay = this->driver->delay(this->driver); else delay = 0; + if ((delay >=0) /* audio driver supports realtime */ + || !this->audio_started) { + + buffer_vpts = this->metronom->get_current_time (this->metronom); + /* External A52 decoder delay correction */ if (this->mode==AO_CAP_MODE_A52) delay+=10; @@ -295,6 +298,8 @@ "dropped\n", vpts, gap); } + } /* audio driver supports realtime */ + /* * resample and output frames */ |