Stéphane Letz wrote:
>
> Ok. Now testing with O_EXCL and SNDCTL_DSP_COOKEDMODE works, bit I see  
> some strange of the device. The overruns/underrun detection code based  
> on SNDCTL_DSP_GETERROR does not see underrun anymore although the  
> sound get weird with high CPU load (Writing another buffer in the out  
> device solve the "weird sound" problem...). The same overruns/underrun  
> detection code was working when opening the /dev/dsp0 device (that  
> uses vmix AFAIK)
>
> This occurs on OpenSolaris with internal HDAudio using published OSS  
> 4.0. Are tey know problems with this card with OSS 4.0 ?
>   
I don't think this is caused by problems with any particular card. 
Underruns/overruns will happen if the CPU load gets too high (more than 
80-90%). In this situation the application is not able to process audio 
data as fast as it should. It's often possible to decrease the problem 
by using higher priority (see man sched_setscheduler).

It is just necessary to write enough silent data to the output device 
before starting the read/write loop. It is normal that the other 
processes running in the computer occasionally delay the audio process 
by few milliseconds. If there is not enough data in the playback buffer 
then this delay will cause an underrun. In addition recorded data will 
get accumulated in the recording device during the delay. This will 
sooner or later cause recording overruns if the application doesn't 
handle this properly. Simple read/write loop (without any 
usleep/whatever calls) will recover from this situation automatically.

Best regards,

Hannu
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel

Reply via email to