NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/51999 pulseaudio broken.



The following reply was made to PR kern/51999; it has been noted by GNATS.

From: Nathanial Sloss <nat%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/51999 pulseaudio broken.
Date: Thu, 23 Mar 2017 18:29:33 +1100

 Hi,
 
 I believe there is an in liboss inparticular GETISPACE.
 
 Acording to the OSS documentation get ispace should return the number of bytes 
 that can be read without blocking which would be equal to the record seek 
 value.  It currently returns how by how many bytes empty the record buffer is.
 
 With the attached patch I was able too get pulseaudio to work.  pacat had no 
 problems andms and the pach worked with other oss applications.
 
 --- ossaudio.c	2017-02-11 05:16:31.000000000 +1100
 +++ /home/test/ossaudio.c	2017-03-23 18:06:13.000000000 +1100
 @@ -411,11 +411,10 @@ audio_ioctl(int fd, unsigned long com, v
  			return retval;
  		setblocksize(fd, &tmpinfo);
  		bufinfo.fragsize = tmpinfo.blocksize;
 -		bufinfo.fragments = tmpinfo.hiwat - (tmpinfo.play.seek
 -		    + tmpinfo.blocksize - 1) / tmpinfo.blocksize;
 +		bufinfo.fragments = (tmpinfo.hiwat * tmpinfo.blocksize -
 +		    tmpinfo.play.seek) / tmpinfo.blocksize;
  		bufinfo.fragstotal = tmpinfo.hiwat;
 -		bufinfo.bytes = tmpinfo.hiwat * tmpinfo.blocksize
 -		    - tmpinfo.play.seek;
 +		bufinfo.bytes = bufinfo.fragments * tmpinfo.blocksize;
  		*(struct audio_buf_info *)argp = bufinfo;
  		break;
  	case SNDCTL_DSP_GETISPACE:
 @@ -424,11 +423,10 @@ audio_ioctl(int fd, unsigned long com, v
  			return retval;
  		setblocksize(fd, &tmpinfo);
  		bufinfo.fragsize = tmpinfo.blocksize;
 -		bufinfo.fragments = tmpinfo.hiwat - (tmpinfo.record.seek +
 -		    tmpinfo.blocksize - 1) / tmpinfo.blocksize;
 +		bufinfo.fragments = (tmpinfo.record.seek)
 +		    / tmpinfo.blocksize;
  		bufinfo.fragstotal = tmpinfo.hiwat;
 -		bufinfo.bytes = tmpinfo.hiwat * tmpinfo.blocksize
 -		    - tmpinfo.record.seek;
 +		bufinfo.bytes = tmpinfo.record.seek;
  		*(struct audio_buf_info *)argp = bufinfo;
  		break;
  	case SNDCTL_DSP_NONBLOCK:
 
 
 Best regards,
 
 Nat
 


Home | Main Index | Thread Index | Old Index