* Re: Hi, does someone use i810 onboard sound ?
@ 2003-10-04 21:31 Stas Sergeev
2003-10-05 1:00 ` Joël Bourquard
0 siblings, 1 reply; 10+ messages in thread
From: Stas Sergeev @ 2003-10-04 21:31 UTC (permalink / raw)
To: linux-msdos
Hello.
JoÌl Bourquard wrote:
> launch a DOS game or demo (Stunt Car Racer, Gobliiins, Cubic Team's
> Lasse Reinbong) the sound comes at the right moment but is awfully
> distorted.
That games are too old and are using
an obsolete method of sound output -
direct DAC access.
Try the newer games (the ones that are
using DMA) and see if they are better.
Or try the mp3 player dosamp.
If that works better, then you can try
to adjust the DIRECT_WRITE_FREQ constant
in linux_sound.h and tune it so that your
old games to work better (sorry, I forgot
to add an option for that, so it is necessary
to change that constant in the source file).
But if even the DMA-enabled games sounds
poor, then there might be something with
the driver. See sound-usage.txt for the
description of some driver-specific hacks
and try playing with the related options.
If that fails, try ALSA (if possible) as
it is known to be compatible with dosemu
in most cases by providing an excellent OSS
emulation layer.
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Hi, does someone use i810 onboard sound ?
@ 2003-10-04 22:11 Stas Sergeev
2003-10-05 0:28 ` Ryan Underwood
0 siblings, 1 reply; 10+ messages in thread
From: Stas Sergeev @ 2003-10-04 22:11 UTC (permalink / raw)
To: "Joыl Bourquard"; +Cc: linux-msdos
Hello.
JoÙl Bourquard wrote:
> I've tried DOSAmp and it works well with a stereo mp3, and double-speed
> with a mono mp3.
OK. I have to CC that message to
linux-msdos to let other people
know that is was not a bug (that's
why it is better if you CC your replies
to the ML yourself next time)
> Therefore:
> - I'll try to play with DIRECT_WRITE_FREQ and let you know about the
> outcome
Let the list know either please.
I'll then probably finally add an option
for that.
> - Is there an option to upsample mono to stereo (in DosEMU) ?
No, dosemu doesn't do any post-processing.
In future it probably will, or it will
use some sound server which will do the
post-processing or... right now there is
noone to work on that it seems.
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Hi, does someone use i810 onboard sound ?
@ 2003-10-04 23:06 Stas Sergeev
2003-10-05 14:08 ` Joël Bourquard
0 siblings, 1 reply; 10+ messages in thread
From: Stas Sergeev @ 2003-10-04 23:06 UTC (permalink / raw)
To: linux-msdos
[-- Attachment #1: Type: text/plain, Size: 606 bytes --]
Hello.
Joлl Bourquard wrote:
> Ok, I've played with the value of 6000 and tried various possibilities
> up to 120000, but the sound doesn't improve.
That's too much. 22050 is the maximum
reasonable value for that, but in
practice you'll in most cases need to
lower the freq from 6000, not raise it.
> There is something fishy, it seems. The sound is composed of a lot of
> little "clicks". When a high sampling value (~60000) is used, it sounds
> like the clicks become shorter.
Well, after all there might be a bug
somewhere. Try the attached patch and
see if it helps, then try tuning the
value again.
[-- Attachment #2: dirdac.diff --]
[-- Type: text/plain, Size: 1416 bytes --]
--- src/arch/linux/dosext/sound/linux_sound.c Sat Jul 5 23:14:10 2003
+++ src/arch/linux/dosext/sound/linux_sound.c Sun Oct 5 02:43:44 2003
@@ -261,6 +261,7 @@
static int sound_frag = 0x0200007;
static uint8_t buffer[BUF_LEN];
static size_t buffer_count = 0;
+ int result;
buffer[buffer_count] = value;
if (buffer_count < BUF_LEN - 1)
@@ -274,20 +275,25 @@
{
S_printf ("SB:[Linux] Initialising Direct DAC write (%u bits)\n", bits);
if (linux_sb_dma_is_empty() == DMA_HANDLER_OK) {
- bits_per_samp = bits;
+ result = 0;
if (ioctl (dsp_fd, SNDCTL_DSP_SAMPLESIZE, &bits)<0) {
S_printf ("SB:[Linux] Warning: ioctl() (SAMPLESIZE) failed: %s\n", strerror(errno));
- bits_per_samp = 0;
+ result = -1;
}
if (linux_set_OSS_fragsize(sound_frag) == DMA_HANDLER_NOT_OK) {
S_printf ("SB:[Linux] Warning: failed to change sound fragment size.\n");
- bits_per_samp = 0;
+ result = -1;
}
linux_sb_set_speed(DIRECT_WRITE_FREQ, 0, 0, 0);
/* reset DMA settings */
sample_rate = 0;
num_channels = 0;
oss_block_size = 0;
+ if (result == -1) {
+ bits_per_samp = 0;
+ return;
+ }
+ bits_per_samp = bits;
}
else {
S_printf("SB:[Linux] Sorry, can't change OSS settings now...\n");
^ permalink raw reply [flat|nested] 10+ messages in thread
* Hi, does someone use i810 onboard sound ?
@ 2003-10-04 23:58 Joël Bourquard
0 siblings, 0 replies; 10+ messages in thread
From: Joël Bourquard @ 2003-10-04 23:58 UTC (permalink / raw)
To: linux-msdos
Hi everyone,
This is my first message. I've installed Dosemu a few weeks ago and it
works great, except for the sound.
I have an i810 onboard sound chip, and OSS drivers (ie: /dev/dsp) work.
XMMS works, and cat file.raw > /dev/dsp works too.
I've set up the BLASTER environment variable in FreeDOS, and when I
launch a DOS game or demo (Stunt Car Racer, Gobliiins, Cubic Team's
Lasse Reinbong) the sound comes at the right moment but is awfully
distorted.
The only bug with by sound chip & drivers is, I think, a double-speed
playback with mono sounds (ie: a mono mp3 in XMMS). However, Dosemu
sounds much more distorted than that.
Is there a known solution for this, or did I miss something ?
PS: I have RedHat 9, Dosemu 1.1.99.1 and latest FreeDOS.
Thanks in advance
Regards,
Joël
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Hi, does someone use i810 onboard sound ?
2003-10-04 22:11 Hi, does someone use i810 onboard sound ? Stas Sergeev
@ 2003-10-05 0:28 ` Ryan Underwood
0 siblings, 0 replies; 10+ messages in thread
From: Ryan Underwood @ 2003-10-05 0:28 UTC (permalink / raw)
To: linux-msdos
Hi,
On Sun, Oct 05, 2003 at 02:11:03AM +0400, Stas Sergeev wrote:
>
> >- Is there an option to upsample mono to stereo (in DosEMU) ?
> No, dosemu doesn't do any post-processing.
> In future it probably will, or it will
> use some sound server which will do the
> post-processing or... right now there is
> noone to work on that it seems.
What is your opinion on JACK?
--
Ryan Underwood, <nemesis at icequake.net>, icq=10317253
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Hi, does someone use i810 onboard sound ?
2003-10-04 21:31 Stas Sergeev
@ 2003-10-05 1:00 ` Joël Bourquard
0 siblings, 0 replies; 10+ messages in thread
From: Joël Bourquard @ 2003-10-05 1:00 UTC (permalink / raw)
To: linux-msdos
Hi again Stas,
I should have replied to the list, sorry about that.
Ok, I've played with the value of 6000 and tried various possibilities
up to 120000, but the sound doesn't improve.
There is something fishy, it seems. The sound is composed of a lot of
little "clicks". When a high sampling value (~60000) is used, it sounds
like the clicks become shorter.
With dosamp a 44kHz stereo file sounds perfect.
I hope this helps
Regards,
Joël
On Sat, 2003-10-04 at 20:31, Stas Sergeev wrote:
> Hello.
>
> Joлl Bourquard wrote:
> > launch a DOS game or demo (Stunt Car Racer, Gobliiins, Cubic Team's
> > Lasse Reinbong) the sound comes at the right moment but is awfully
> > distorted.
> That games are too old and are using
> an obsolete method of sound output -
> direct DAC access.
> Try the newer games (the ones that are
> using DMA) and see if they are better.
> Or try the mp3 player dosamp.
> If that works better, then you can try
> to adjust the DIRECT_WRITE_FREQ constant
> in linux_sound.h and tune it so that your
> old games to work better (sorry, I forgot
> to add an option for that, so it is necessary
> to change that constant in the source file).
> But if even the DMA-enabled games sounds
> poor, then there might be something with
> the driver. See sound-usage.txt for the
> description of some driver-specific hacks
> and try playing with the related options.
> If that fails, try ALSA (if possible) as
> it is known to be compatible with dosemu
> in most cases by providing an excellent OSS
> emulation layer.
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Hi, does someone use i810 onboard sound ?
@ 2003-10-05 13:01 Stas Sergeev
2003-10-05 23:23 ` Joël Bourquard
0 siblings, 1 reply; 10+ messages in thread
From: Stas Sergeev @ 2003-10-05 13:01 UTC (permalink / raw)
To: linux-msdos
Hello.
JoÌl Bourquard wrote:
> I applied it, made a 'make clean' then tried various values between
> [100..22050], but unfortunately I heard no improvement from the new
> compiles.
Well, because you said your OSS driver
treats mono as stereo, I expected this
patch won't help you. But as it definitely
fixes the distortion for me (tested with
Goblins 1 and 2), I have commited it to
HEAD regardless.
> - Stunts: no sound in Soundblaster mode
IIRC Stunts uses an FM sound in SB mode,
which is not implemented yet.
You can set Stunts to MT-32 mode, which
is implemented and is supported by midid.
> About a workaround for the stereo issue, I didn't see it as
> "post-processing". Perhaps a simple option to prevent opening /dev/dsp
> in mono could be useful
Prevent and do what? Not opening at all?
You can just set $_sound=(off) for that.
To do that properly, dosemu or some
external software must convert the mono
sound stream to stereo, and preferrably
also resample it to 44100. Then your
problem as well as some other problems
will disappear.
> for people with buggy drivers (ie: i810) ?
For people with buggy drivers I wrote an
excellent test-case sound driver which can
be found here:
http://www.geocities.com/stssppnn/pcsp.html
It is intended to be 100% correct :)
Try it with dosemu and see if the patch
fixes the problem with that driver.
If yes - your driver is buggy and the ALSA
must be attempted instead. Btw, if you
know your OSS driver is buggy, why don't
you use ALSA? Is there a support for your
chip?
But if the sound is still distorted even with
the patched dosemu and that sound driver,
then we have to dig for another bug in dosemu.
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Hi, does someone use i810 onboard sound ?
2003-10-04 23:06 Stas Sergeev
@ 2003-10-05 14:08 ` Joël Bourquard
0 siblings, 0 replies; 10+ messages in thread
From: Joël Bourquard @ 2003-10-05 14:08 UTC (permalink / raw)
To: Stas Sergeev; +Cc: linux-msdos
Hi,
Thanks for the patch and the help !
I applied it, made a 'make clean' then tried various values between
[100..22050], but unfortunately I heard no improvement from the new
compiles.
Here's current status for all sound programs I have:
- Gobliiins (= Goblins 1): distorted
- Ween: distorted
- Stunts: no sound in Soundblaster mode
- Inca: double-speed, perhaps distorted
- dosamp: ok in stereo
About a workaround for the stereo issue, I didn't see it as
"post-processing". Perhaps a simple option to prevent opening /dev/dsp
in mono could be useful for people with buggy drivers (ie: i810) ?
Best Regards,
Joël
On Sat, 2003-10-04 at 22:06, Stas Sergeev wrote:
> Hello.
>
> Joлl Bourquard wrote:
> > Ok, I've played with the value of 6000 and tried various possibilities
> > up to 120000, but the sound doesn't improve.
> That's too much. 22050 is the maximum
> reasonable value for that, but in
> practice you'll in most cases need to
> lower the freq from 6000, not raise it.
>
> > There is something fishy, it seems. The sound is composed of a lot of
> > little "clicks". When a high sampling value (~60000) is used, it sounds
> > like the clicks become shorter.
> Well, after all there might be a bug
> somewhere. Try the attached patch and
> see if it helps, then try tuning the
> value again.
>
> ______________________________________________________________________
> --- src/arch/linux/dosext/sound/linux_sound.c Sat Jul 5 23:14:10 2003
> +++ src/arch/linux/dosext/sound/linux_sound.c Sun Oct 5 02:43:44 2003
> @@ -261,6 +261,7 @@
> static int sound_frag = 0x0200007;
> static uint8_t buffer[BUF_LEN];
> static size_t buffer_count = 0;
> + int result;
>
> buffer[buffer_count] = value;
> if (buffer_count < BUF_LEN - 1)
> @@ -274,20 +275,25 @@
> {
> S_printf ("SB:[Linux] Initialising Direct DAC write (%u bits)\n", bits);
> if (linux_sb_dma_is_empty() == DMA_HANDLER_OK) {
> - bits_per_samp = bits;
> + result = 0;
> if (ioctl (dsp_fd, SNDCTL_DSP_SAMPLESIZE, &bits)<0) {
> S_printf ("SB:[Linux] Warning: ioctl() (SAMPLESIZE) failed: %s\n", strerror(errno));
> - bits_per_samp = 0;
> + result = -1;
> }
> if (linux_set_OSS_fragsize(sound_frag) == DMA_HANDLER_NOT_OK) {
> S_printf ("SB:[Linux] Warning: failed to change sound fragment size.\n");
> - bits_per_samp = 0;
> + result = -1;
> }
> linux_sb_set_speed(DIRECT_WRITE_FREQ, 0, 0, 0);
> /* reset DMA settings */
> sample_rate = 0;
> num_channels = 0;
> oss_block_size = 0;
> + if (result == -1) {
> + bits_per_samp = 0;
> + return;
> + }
> + bits_per_samp = bits;
> }
> else {
> S_printf("SB:[Linux] Sorry, can't change OSS settings now...\n");
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Hi, does someone use i810 onboard sound ?
2003-10-05 13:01 Stas Sergeev
@ 2003-10-05 23:23 ` Joël Bourquard
0 siblings, 0 replies; 10+ messages in thread
From: Joël Bourquard @ 2003-10-05 23:23 UTC (permalink / raw)
To: Stas Sergeev; +Cc: linux-msdos
Hi Stas,
On Sun, 2003-10-05 at 12:01, Stas Sergeev wrote:
> IIRC Stunts uses an FM sound in SB mode,
> which is not implemented yet.
> You can set Stunts to MT-32 mode, which
> is implemented and is supported by midid.
You're correct, it is FM sound. Sorry.
> > About a workaround for the stereo issue, I didn't see it as
> > "post-processing". Perhaps a simple option to prevent opening /dev/dsp
> > in mono could be useful
> Prevent and do what? Not opening at all?
> You can just set $_sound=(off) for that.
> To do that properly, dosemu or some
> external software must convert the mono
> sound stream to stereo, and preferrably
> also resample it to 44100. Then your
> problem as well as some other problems
> will disappear.
I meant, to open in stereo while keeping the same sampling rate. Most
newer soundcards are 48000, but they (should) handle sampling rate
conversion in hardware.
> For people with buggy drivers I wrote an
> excellent test-case sound driver which can
> be found here:
> http://www.geocities.com/stssppnn/pcsp.html
> It is intended to be 100% correct :)
> Try it with dosemu and see if the patch
> fixes the problem with that driver.
> If yes - your driver is buggy and the ALSA
> must be attempted instead. Btw, if you
> know your OSS driver is buggy, why don't
> you use ALSA? Is there a support for your
> chip?
I thought my i810 driver was OSS, but it's already ALSA. My mistake.
I've tried your pc speaker driver, and wow it's impressive ! With this
driver the Goblins test was successful, after I did the following:
- applied your patch
- increased DIRECT_WRITE_FREQ to 11025.
If DIRECT_WRITE_FREQ is not changed, the games hangs after ~5 seconds
with plenty of "ERROR: SB: direct write buffer overflowed!" in the
console. I suggest you replace the default value with 11025 (should test
stability more carefully though).
Now for sure, my i810 driver sucks. Do you know if there is:
- an alternative ? (I'm using kernel 2.4.23)
- an incompatibility between it and DosEMU ?
- a place where I could report the problem to the i810 driver guys ?
Thanks for your help.. your DosEmu rocks !!
Best Regards,
Joël
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Hi, does someone use i810 onboard sound ?
@ 2003-10-06 18:48 Stas Sergeev
0 siblings, 0 replies; 10+ messages in thread
From: Stas Sergeev @ 2003-10-06 18:48 UTC (permalink / raw)
To: linux-msdos
[-- Attachment #1: Type: text/plain, Size: 2644 bytes --]
Hello.
Joлl Bourquard wrote:
> You're correct, it is FM sound. Sorry.
Have you tried my experimental OPL
implementation from www.dosemu.org/stas ?
It is not intended to work good, but
somehow it works for some people.
> I meant, to open in stereo while keeping the same sampling rate.
You probably mean to halve the sampling
rate, as the sample size becames twice
as large.
Well, not that I like such a solutions.
In general I don't like adding a driver-
specific hack at all. The next time someone
will come around and say that his driver
only supports 44100:)
But in general, what's the difference
between what you suggest and what actually
happens in your case now? Dosemu is trying to
set mono, the driver refuses and sets stereo
anyway, right? Then you lower the freq
manually... should work. But I guess dosemu
is unhappy that the driver ignored the
request, so it keeps trying to re-initialize
it, hence the distortion.
Try the attached patch (above the previous
one) - it will (hopefully) just ignore the
failure letting you to tune the freq.
> If DIRECT_WRITE_FREQ is not changed, the games hangs after ~5 seconds
> with plenty of "ERROR: SB: direct write buffer overflowed!" in the
> console.
It is not intended to hang, but it probably
becames horribly slowed down because dosemu
it writing that error message thousands of
times per second. I'll fix that (later) to
print only one message per an overflow.
This error is actually harmless, it only
means that some bytes are being skipped from
the sound stream, reducing the sound quality.
> I suggest you replace the default value with 11025
That doesn't work properly for me neither
with Goblins nor with some other games.
Making it a run-time option will help much
better.
> Now for sure, my i810 driver sucks. Do you know if there is:
> - an alternative ? (I'm using kernel 2.4.23)
You said it is ALSA. ALSA is not included in
2.4.any kernels. Either you used a standalone
ALSA modules or you are using an OSS driver.
> - an incompatibility between it and DosEMU ?
Dosemu needs all the OSS functionality present
and working accordingly to an OSS (sparse) docs.
Otherwise expect troubles.
> - a place where I could report the problem to the i810 driver guys ?
For the OSS drivers that should be
linux-kernel@vger.kernel.org (I don't think
they'll care about an i810 though), for ALSA -
see their site www.alsa-project.org.
But you should mention your xmms problems
there as mentioning dosemu problems anywhere
is a sure way to get the bug report ignored:)
Dosemu is known to be incompatible with
everything in this world and most people simply
don't care about it any more.
[-- Attachment #2: linux_sound.diff --]
[-- Type: text/plain, Size: 509 bytes --]
--- linux_sound.c Sun Oct 5 16:37:44 2003
+++ linux_sound.c Mon Oct 6 22:14:37 2003
@@ -278,7 +278,7 @@
result = 0;
if (ioctl (dsp_fd, SNDCTL_DSP_SAMPLESIZE, &bits)<0) {
S_printf ("SB:[Linux] Warning: ioctl() (SAMPLESIZE) failed: %s\n", strerror(errno));
- result = -1;
+// result = -1;
}
if (linux_set_OSS_fragsize(sound_frag) == DMA_HANDLER_NOT_OK) {
S_printf ("SB:[Linux] Warning: failed to change sound fragment size.\n");
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2003-10-06 18:48 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-04 22:11 Hi, does someone use i810 onboard sound ? Stas Sergeev
2003-10-05 0:28 ` Ryan Underwood
-- strict thread matches above, loose matches on Subject: below --
2003-10-06 18:48 Stas Sergeev
2003-10-05 13:01 Stas Sergeev
2003-10-05 23:23 ` Joël Bourquard
2003-10-04 23:58 Joël Bourquard
2003-10-04 23:06 Stas Sergeev
2003-10-05 14:08 ` Joël Bourquard
2003-10-04 21:31 Stas Sergeev
2003-10-05 1:00 ` Joël Bourquard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox