Buffer overflow with OSS 4.0-1004

OSS specific BSD discussion (FreeBSD/NetBSD/OpenBSD)

Moderators: hannu, dev, kodachi, cesium

Buffer overflow with OSS 4.0-1004

Postby ksym » Tue Jul 17, 2007 5:19 pm

Hi,

Im using FreeBSD 6.2 with the newest 1004 build of OSS 4.0 ... it works well except when playing surround 5.1 sound. Every time I search forward/backward in the videostream, the sound starts "fragmenting" ...

Also dmesg reports the following warnings:
Code: Select all
osscore: Buffer 2 overfilled (-2400)
osscore: Buffer 3 overfilled (-2400)
osscore: Buffer 2 overfilled (-4800)
osscore: Buffer 2 overfilled (-2400)
osscore: Buffer 3 overfilled (-4800)
osscore: Buffer 3 overfilled (-2400)


The dmesg output may vary a bit (eg. buffer might be 1-3 and the digit after may be different).

The only way to counter this is to tap "pause" three times ... maybe this puts the audio stream in sync again?

The software I mainly use is Xine (although other software have the same problem), and it is the only process writing /dev/dsp5, so no vmix involved.

Sometimes the buffers overflow when playing music for many hours, even if the stream is stereo ...

ossinfo output:
Code: Select all
Version info: OSS 4.0 (build 1004/200707062313) (0x00040002)
Platform: FreeBSD/i386 6.2-RELEASE-p5 FreeBSD 6.2-RELEASE-p5 #0: Mon Jul 16 19:32:30 EEST 2007     luser@XXXXXX.XXX

Number of audio devices:        10
Number of audio engines:        10
Number of MIDI devices:         0
Number of mixer devices:        1


Device objects
0: sblive0 SB Audigy2
1: vmix0 OSS transparent virtual support

MIDI devices (/dev/midi*)

Mixer devices (/dev/mixer*)
0: SB Audigy2 (STAC9721) (Mixer 0 of device object 0)

Audio devices
/dev/oss/sblive0/pcm0   SB Audigy2 main  (device index 0)
/dev/oss/sblive0/pcm1   SB Audigy2 front out  (device index 1)
/dev/oss/sblive0/pcm2   SB Audigy2 side out  (device index 2)
/dev/oss/sblive0/pcm3   SB Audigy2 center/lfe out  (device index 3)
/dev/oss/sblive0/pcm4   SB Audigy2 raw S/PDIF (output only)  (device index 4)
/dev/oss/sblive0/pcm5   SB Audigy2 5.1 output device  (device index 5)
/dev/oss/vmix0/pcm0     SB Audigy2 main (VMIX0)  (device index 6)
/dev/oss/vmix0/pcm1     SB Audigy2 main (VMIX0)  (device index 7)
/dev/oss/vmix0/pcm2     SB Audigy2 main (VMIX0)  (device index 8)
/dev/oss/vmix0/pcm3     SB Audigy2 main (VMIX0)  (device index 9)


Anyways, are there any solutions for this?
ksym
 
Posts: 3
Joined: Tue Jul 17, 2007 5:00 pm

Postby hannu » Wed Jul 18, 2007 2:03 pm

There is no solution. SB audigy uses three different stereo engines for 5.1 playback. It is possible that they get out of sync if the application stops writing new data to the device. I don't think this problem can be fixed in the future. It can only be fixed by modifying xine to handle pause/resume in different way.
Hannu Savolainen (hannu@opensound.com)
hannu
Site Admin
 
Posts: 10
Joined: Fri Sep 12, 2003 6:28 am

Postby ksym » Wed Jul 18, 2007 6:07 pm

It is possible that they get out of sync if the application stops writing new data to the device. I don't think this problem can be fixed in the future. It can only be fixed by modifying xine to handle pause/resume in different way.


Is there any notice about this "feature" in the API documentation? If there is, then I could start bothering the Xine developers about this (since it would be their problem) ...
ksym
 
Posts: 3
Joined: Tue Jul 17, 2007 5:00 pm

Postby hannu » Wed Jul 18, 2007 7:16 pm

This is not an API issue but a problem related just with live/audigy devices.

The API documentation recommends to implement pause/resume by feeding silence to the device or by closing/reopening it.
Hannu Savolainen (hannu@opensound.com)
hannu
Site Admin
 
Posts: 10
Joined: Fri Sep 12, 2003 6:28 am


Return to BSD

Who is online

Users browsing this forum: No registered users and 1 guest