Opened 12 years ago

Last modified 3 years ago

#215 assigned defect

pmixWrite() failed if a buffer size is too small

Reported by: KO Myung-Hun Owned by: martini
Priority: highest Milestone: MMPM/2 Compatibility
Component: UNIAUD16 Version: 1.9.26
Severity: blocker Keywords:
Cc:

Description

Hi/2.

As a subject, pmixWrite() failed if a buffer size is too small.

For examples, a buffer size is 2048 bytes, it returns an error code, 5613, which means "Insufficient Buffer".

Change History (17)

comment:1 Changed 12 years ago by abwillis

Could you try the uniaud32.sys on netlabs? I am curious if that is the problem that VPC is having considering it uses small buffer sizes. The uniaud32.sys just has a change backed out that allows VPC to work. If it also works for your situation then it may give an idea what is happening. I am using it here so that VPC has sound but it does exhibit problems with Z! and I have been told with PM123 (though I am not sure I have seen problems with PM123 myself - may have and forgotten too). ftp://ftp.netlabs.org/incoming/uniaud32-19226-vpc.zip

comment:2 Changed 12 years ago by KO Myung-Hun

That's it.

It works with a small buffer size.

What's the change ?

comment:3 Changed 12 years ago by abwillis

Sorry, I was trying to watch this but missed your update anyhow: the diff is in: ticket #146

comment:4 Changed 12 years ago by abwillis

I see that you had found it and also had some patches for uniaud apis? Do those changes then allow uniaud.dll to work?

comment:5 Changed 12 years ago by KO Myung-Hun

Yes, at least in my box.

comment:6 Changed 12 years ago by KO Myung-Hun

See ticket #191.

comment:7 Changed 12 years ago by abwillis

For some reason your driver gives me a Trap 8 on my system... I applied your uniaud diff to my tree and that build works fine. I am running the acpi build... which build do you have for download? Also, this information shows that it is due to the buffer so I found that the buffer diff can be pared down some:

Index: sound.c
===================================================================
--- sound.c	(revision 563)
+++ sound.c	(working copy)
@@ -975,6 +975,7 @@
 						   pHwParams->ulNumChannels, 0);
 	_snd_pcm_hw_param_set(&params, SNDRV_PCM_HW_PARAM_RATE,
 						   pHwParams->ulSampleRate, 0);
+#if 0
 	_snd_pcm_hw_param_set(&params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
 						   periodsize, 0);
 	_snd_pcm_hw_param_set(&params, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
@@ -985,6 +986,7 @@
 						   periodsize*nrperiods, 0);
 	_snd_pcm_hw_param_set(&params, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
 						   periodbytes*nrperiods, 0);
+#endif
 
 
 	dprintf(("HWP: SR rate %ld, BPS %ld, CH %ld, PRSZ %lx, periods %lx",

The first section of the older diff did not have to be if'd out.

Last edited 12 years ago by abwillis (previous) (diff)

comment:8 Changed 12 years ago by KO Myung-Hun

It's a non-ACPI-W4 build.

comment:9 Changed 12 years ago by David McKenna

I'm also getting a Trap 8.... any way I could try out a corrected ACPI version?

comment:10 Changed 12 years ago by abwillis

Here is a better workaround... it works with VPC and does better with mplayer here:

Index: sound.c
===================================================================
--- sound.c	(revision 563)
+++ sound.c	(working copy)
@@ -975,6 +975,7 @@
 						   pHwParams->ulNumChannels, 0);
 	_snd_pcm_hw_param_set(&params, SNDRV_PCM_HW_PARAM_RATE,
 						   pHwParams->ulSampleRate, 0);
+if (periodsize > 6 * minperiodsize) {
 	_snd_pcm_hw_param_set(&params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
 						   periodsize, 0);
 	_snd_pcm_hw_param_set(&params, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
@@ -985,6 +986,7 @@
 						   periodsize*nrperiods, 0);
 	_snd_pcm_hw_param_set(&params, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
 						   periodbytes*nrperiods, 0);
+}
 
 
 	dprintf(("HWP: SR rate %ld, BPS %ld, CH %ld, PRSZ %lx, periods %lx",

comment:11 Changed 12 years ago by abwillis

In case anyone is interested but missed seeing it, I uploaded a build with this change to netlabs incoming, it is an acpi build... uniaud32-vpc.zip

comment:12 Changed 12 years ago by KO Myung-Hun

Unfortunately, it does not help a small buffer problem regardless of any audio cards in VirtualBox?.

comment:13 Changed 12 years ago by abwillis

It works with VirtualPC here but VirtualBox? does not have the sound support built into the OS/2 port. The VirtualBox? Port would need to be updated to support sound.

comment:14 Changed 3 years ago by martini

Hi KO Myung-Hun

I'm giving a hand with some ticket house keeping.

Can you please report if you still have the same issue with:

Regards

comment:15 Changed 3 years ago by martini

Owner: set to martini
Status: newassigned

comment:16 Changed 3 years ago by KO Myung-Hun

Ok, this seems to be fixed by setting the minimum buffer size.

However, unfortunately, it's not possible to use a small buffer such 2048 bytes(512 samples * 16 bits audio * stereo) for very short latency and very fast response in games and so on.

comment:17 Changed 3 years ago by KO Myung-Hun

Sorry, I've tested incorrectly.

Setting the minimum buffer size was a feature of kai.

This problem has not been fixed, yet.

You can test like this:

set KAI_MINSAMPLES=512 && kaidemo any-16bits-streo-audio.wav

Sound card is Intel HD audio in VirtualBox? v6.1.16.

Note: See TracTickets for help on using tickets.