public inbox for linux-msdos@vger.kernel.org
 help / color / mirror / Atom feed
* trouble with dosemu and alsa oss emulation (and a fix for alsa)
@ 2003-09-06 20:09 Vedran Rodic
  2003-09-06 21:56 ` Ryan Underwood
  2003-09-08  7:14 ` Jaroslav Kysela
  0 siblings, 2 replies; 4+ messages in thread
From: Vedran Rodic @ 2003-09-06 20:09 UTC (permalink / raw)
  To: alsa-devel; +Cc: linux-msdos

Hi. 

I'm having trouble with latest ALSA and oss emulation. I'm using dosemu to
play some DOS games and I've noticed that sound in DOS apps stops playing 
after short time (depending on the app). 


I'm regulary updating both alsa and dosemu, I suspected dosemu first, since
I had no problems whatsoever with alsa oss emulation. 

It turned out that this was not dosemu problem, but alsa oss emulation problem.
I've tracked it down to a change in  alsa-kernel/core/oss/pcm_oss.c. 
The change is here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/alsa/alsa-kernel/core/oss/pcm_oss.c.diff?r1=1.40&r2=1.41

I'm currently using the latest pcm_oss.c but without this patch and it
works great again. 

I think that dosemu code - src/arch/linux/dosext/sound/linux_sound.c is
correct. 

Anyway, here's a couple of lines from dosemu sound log, starting arround 
where IOCTL error appears:

SB:[Linux] Get Free Fragments (16, 0)
SB:[Linux] Get Free Fragments (16, 0)
SB: Read 0x7f from DSP Write Buffer Status Register
SB: Going to write 128 bytes
SB:[Linux] Get Free Fragments (16, 0)
SB:[Linux] Get Free Fragments (16, 0)
SB: DSP command 0xd0 accepted
SB: Pausing DMA transfer, 256 bytes left
SB: Read 0x7e from DSP Write Buffer Status Register
SB: DSP command 0xd4 accepted
SB: Going to write 128 bytes
SB:[Linux] Get Free Fragments IOCTL error (Broken pipe)
SB:[Linux] Get Free Fragments IOCTL error (Broken pipe)
SB: Going to write 128 bytes
SB:[Linux] Get Free Fragments IOCTL error (Broken pipe)
SB:[Linux] Get Free Fragments IOCTL error (Broken pipe)
SB: Going to write 128 bytes


Vedran


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: trouble with dosemu and alsa oss emulation (and a fix for alsa)
  2003-09-06 20:09 trouble with dosemu and alsa oss emulation (and a fix for alsa) Vedran Rodic
@ 2003-09-06 21:56 ` Ryan Underwood
  2003-09-08  7:14 ` Jaroslav Kysela
  1 sibling, 0 replies; 4+ messages in thread
From: Ryan Underwood @ 2003-09-06 21:56 UTC (permalink / raw)
  To: alsa-devel, linux-msdos


Hi,

On Sat, Sep 06, 2003 at 10:09:43PM +0200, Vedran Rodic wrote:
> Hi. 
> 
> I'm having trouble with latest ALSA and oss emulation. I'm using dosemu to
> play some DOS games and I've noticed that sound in DOS apps stops playing 
> after short time (depending on the app). 
> 
> 
> I'm regulary updating both alsa and dosemu, I suspected dosemu first, since
> I had no problems whatsoever with alsa oss emulation. 
> 
> It turned out that this was not dosemu problem, but alsa oss emulation problem.
> I've tracked it down to a change in  alsa-kernel/core/oss/pcm_oss.c. 
> The change is here:
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/alsa/alsa-kernel/core/oss/pcm_oss.c.diff?r1=1.40&r2=1.41
> 
> I'm currently using the latest pcm_oss.c but without this patch and it
> works great again. 
> 
> I think that dosemu code - src/arch/linux/dosext/sound/linux_sound.c is
> correct. 

Yeah, I know I tried dosemu with the ALSA OSS emulation before, and it
worked mostly correct (surprisingly enough!).  I'm glad you spotted this
regression, it might have gone overlooked for some time otherwise.

DOSEMU really needs the native ALSA sound output... one of these days ;)

-- 
Ryan Underwood, <nemesis at icequake.net>, icq=10317253

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: trouble with dosemu and alsa oss emulation (and a fix for alsa)
  2003-09-06 20:09 trouble with dosemu and alsa oss emulation (and a fix for alsa) Vedran Rodic
  2003-09-06 21:56 ` Ryan Underwood
@ 2003-09-08  7:14 ` Jaroslav Kysela
  2003-09-08 14:45   ` [Alsa-devel] " Vedran Rodic
  1 sibling, 1 reply; 4+ messages in thread
From: Jaroslav Kysela @ 2003-09-08  7:14 UTC (permalink / raw)
  To: Vedran Rodic; +Cc: alsa-devel, linux-msdos

On Sat, 6 Sep 2003, Vedran Rodic wrote:

> Hi.
>
> I'm having trouble with latest ALSA and oss emulation. I'm using dosemu to
> play some DOS games and I've noticed that sound in DOS apps stops playing
> after short time (depending on the app).
>
>
> I'm regulary updating both alsa and dosemu, I suspected dosemu first, since
> I had no problems whatsoever with alsa oss emulation.
>
> It turned out that this was not dosemu problem, but alsa oss emulation problem.
> I've tracked it down to a change in  alsa-kernel/core/oss/pcm_oss.c.
> The change is here:
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/alsa/alsa-kernel/core/oss/pcm_oss.c.diff?r1=1.40&r2=1.41

Please, try patch bellow.

					Jaroslav


Index: pcm_oss.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/oss/pcm_oss.c,v
retrieving revision 1.47
diff -u -r1.47 pcm_oss.c
--- pcm_oss.c	3 Sep 2003 13:43:41 -0000	1.47
+++ pcm_oss.c	8 Sep 2003 07:12:58 -0000
@@ -1394,6 +1394,10 @@
 	}
 	if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &delay);
+		if (err == -EPIPE || err == -ESTRPIPE) {
+			err = 0;
+			delay = 0;
+		}
 	} else {
 		err = snd_pcm_oss_capture_position_fixup(substream, &delay);
 	}
@@ -1454,7 +1458,12 @@
 	} else {
 		if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
 			err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &avail);
-			avail = runtime->buffer_size - avail;
+			if (err == -EPIPE || err == -ESTRPIPE) {
+				avail = runtime->buffer_size;
+				err = 0;
+			} else {
+				avail = runtime->buffer_size - avail;
+			}
 		} else {
 			err = snd_pcm_oss_capture_position_fixup(substream, &avail);
 		}

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Alsa-devel] trouble with dosemu and alsa oss emulation (and a fix for alsa)
  2003-09-08  7:14 ` Jaroslav Kysela
@ 2003-09-08 14:45   ` Vedran Rodic
  0 siblings, 0 replies; 4+ messages in thread
From: Vedran Rodic @ 2003-09-08 14:45 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, linux-msdos

On Mon, Sep 08, 2003 at 09:14:40AM +0200, Jaroslav Kysela wrote:
> On Sat, 6 Sep 2003, Vedran Rodic wrote:
> 
> > Hi.
> >
> > I'm having trouble with latest ALSA and oss emulation. I'm using dosemu to
> > play some DOS games and I've noticed that sound in DOS apps stops playing
> > after short time (depending on the app).
> >
> >
> > I'm regulary updating both alsa and dosemu, I suspected dosemu first, since
> > I had no problems whatsoever with alsa oss emulation.
> >
> > It turned out that this was not dosemu problem, but alsa oss emulation problem.
> > I've tracked it down to a change in  alsa-kernel/core/oss/pcm_oss.c.
> > The change is here:
> > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/alsa/alsa-kernel/core/oss/pcm_oss.c.diff?r1=1.40&r2=1.41
> 
> Please, try patch bellow.

It solved the problem. Thanks

Vedran

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-08 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-06 20:09 trouble with dosemu and alsa oss emulation (and a fix for alsa) Vedran Rodic
2003-09-06 21:56 ` Ryan Underwood
2003-09-08  7:14 ` Jaroslav Kysela
2003-09-08 14:45   ` [Alsa-devel] " Vedran Rodic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox