VOGONS


First post, by elicia

User metadata
Rank Newbie
Rank
Newbie

Hi,

I tested this with :
* GUS driver 4.11 and 3.59
* on a windows platform and a linux platform
* on a sony laptop and a destop

The problem is that the output of PLAYMIDI.EXE is very noisy. It is like the sound is played by a vinyl disc and the noise I hear would be the consequence of scratches or dust on the surface of the disc...

I'm using dosbox 0.65. Everything is working fine (PCM sound is perfect) except this.

I tried to play with the "cycles" parameter, without luck. It does not seems to be a computing power issue. Maybe a saturation or timing issue...

Thanks for yous help.

My dosbox.conf :

[sdl]
# fullscreen -- Start dosbox directly in fullscreen.
# fulldouble -- Use double buffering in fullscreen.
# fullresolution -- What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
# windowresolution -- Scale the window to this size IF the output device supports hardware scaling.
# output -- What to use for output: surface,overlay,opengl,openglnb,ddraw.
# autolock -- Mouse will automatically lock, if you click on the screen.
# sensitiviy -- Mouse sensitivity.
# waitonerror -- Wait before closing the console if dosbox has an error.
# priority -- Priority levels for dosbox: lowest,lower,normal,higher,highest.
# Second entry behind the comma is for when dosbox is not focused/minimized.
# mapperfile -- File used to load/save the key/event mappings from.
# usescancodes -- Avoid usage of symkeys, might not work on all operating systems.

fullscreen=false
fulldouble=false
fullresolution=original
windowresolution=original
output=opengl
autolock=true
sensitivity=100
waitonerror=true
priority=highest,normal
mapperfile=mapper.txt
usescancodes=true

[dosbox]
# language -- Select another language file.
# memsize -- Amount of memory dosbox has in megabytes.
# machine -- The type of machine tries to emulate:hercules,cga,tandy,pcjr,vga.
# captures -- Directory where things like wave,midi,screenshot get captured.

language=
machine=vga
captures=capture
memsize=32

[render]
# frameskip -- How many frames dosbox skips before drawing one.
# aspect -- Do aspect correction, if your output method doesn't support scaling this can slow things down!.
# scaler -- Scaler used to enlarge/enhance low resolution modes.
# Supported are none,normal2x,normal3x,advmame2x,advmame3x,advinterp2x,advinterp3x,tv2x,tv3x,rgb2x,rgb3x,scan2x,scan3x.

frameskip=0
aspect=false
scaler=normal3x

[cpu]
# core -- CPU Core used in emulation: simple,normal,full,dynamic.
# cycles -- Amount of instructions dosbox tries to emulate each millisecond.
# Setting this higher than your machine can handle is bad!
# You can also let DOSBox guess the correct value by setting it to auto.
# Please note that this guessing feature is still experimental.
# cycleup -- Amount of cycles to increase/decrease with keycombo.
# cycledown Setting it lower than 100 will be a percentage.

core=normal
cycles=5000
cycleup=500
cycledown=20

[mixer]
# nosound -- Enable silent mode, sound is still emulated though.
# rate -- Mixer sample rate, setting any devices higher than this will
# probably lower their sound quality.
# blocksize -- Mixer block size, larger blocks might help sound stuttering
# but sound will also be more lagged.
# prebuffer -- How many milliseconds of data to keep on top of the blocksize.

nosound=false
rate=22050
blocksize=2048
prebuffer=10

[midi]
# mpu401 -- Type of MPU-401 to emulate: none, uart or intelligent.
# device -- Device that will receive the MIDI data from MPU-401.
# This can be default,alsa,oss,win32,coreaudio,none.
# config -- Special configuration options for the device. In Windows put
# the id of the device you want to use. See README for details.

mpu401=intelligent
device=alsa
config=128:0

[sblaster]
# sbtype -- Type of sblaster to emulate:none,sb1,sb2,sbpro1,sbpro2,sb16.
# sbbase,irq,dma,hdma -- The IO/IRQ/DMA/High DMA address of the soundblaster.
# mixer -- Allow the soundblaster mixer to modify the dosbox mixer.
# oplmode -- Type of OPL emulation: auto,cms,opl2,dualopl2,opl3.
# On auto the mode is determined by sblaster type.
# All OPL modes are 'Adlib', except for CMS.
# oplrate -- Sample rate of OPL music emulation.

sbtype=sb1
sbbase=220
irq=7
dma=1
hdma=5
mixer=true
oplmode=auto
oplrate=22050

[gus]
# gus -- Enable the Gravis Ultrasound emulation.
# gusbase,irq1,irq2,dma1,dma2 -- The IO/IRQ/DMA addresses of the
# Gravis Ultrasound. (Same IRQ's and DMA's are OK.)
# gusrate -- Sample rate of Ultrasound emulation.
# ultradir -- Path to Ultrasound directory. In this directory
# there should be a MIDI directory that contains
# the patch files for GUS playback. Patch sets used
# with Timidity should work fine.

gus=true
gusrate=22050
gusbase=240
irq1=5
irq2=5
dma1=3
dma2=3
ultradir=C:\ULTRASND

[speaker]
# pcspeaker -- Enable PC-Speaker emulation.
# pcrate -- Sample rate of the PC-Speaker sound generation.
# tandy -- Enable Tandy Sound System emulation (off,on,auto).
# For auto Tandysound emulation is present only if machine is set to tandy.
# tandyrate -- Sample rate of the Tandy 3-Voice generation.
# disney -- Enable Disney Sound Source emulation.

pcspeaker=true
pcrate=22050
tandy=auto
tandyrate=22050
disney=true

[bios]
# joysticktype -- Type of joystick to emulate: none, 2axis, 4axis,
# fcs (Thrustmaster) ,ch (CH Flightstick).
# none disables joystick emulation.
# 2axis is the default and supports two joysticks.

joysticktype=2axis

[serial]
# serial1-4 -- set type of device connected to com port.
# Can be disabled, dummy, modem, directserial.
# Additional parameters must be in the same line in the form of
# parameter:value. Parameters for all types are irq, startbps, bytesize,
# stopbits, parity (all optional).
# for directserial: realport (required).
# for modem: listenport (optional).
# Example: serial1=modem listenport:5000

serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled

[dos]
# xms -- Enable XMS support.
# ems -- Enable EMS support.
# umb -- Enable UMB support (false,true,max).

xms=true
ems=true
umb=true

[ipx]
# ipx -- Enable ipx over UDP/IP emulation.

ipx=false

[autoexec]
# Lines in this section will be run at startup.
mount c /mnt/usb/HD
c:
keyb fr
mount d /mnt/usb/CD -t cdrom

Reply 1 of 7, by dvwjr

User metadata
Rank Member
Rank
Member

The PlayMidi.exe is version 5.12 - it comes with the Gravis driver pack version 4.11 to which you referred in your post. Try the following at the DosBox v0.65 prompt:

PlayMidi.exe -u -verbose -video -8

Start with the use around 3,000 cycles with normal core in DosBox v0.65 - the "static" should go away because of the use of 8-bit patches instead of the desired 16-bit patches. Not the same audio quality but the 'static' is not present. The Gravis 4.11 driver set includes samples MIDI files - the one labeled GDVIB6.MID will demonstrate the 'static' with 16-bit patches and no 'static' with the forced use of 8-bit patches by PLAYMIDI.EXE with use of the "-8" command-line option.

The part of the GUS emulation problem appears to be with the current DosBox v0.65 GUS 16-bit DMA support implementation. Try this test: set the dosbox.conf GUS section with both DMA1 and DMA2 set to a 16-bit DMA selection of "5", as follows:

[gus] 
# gus -- Enable the Gravis Ultrasound emulation.
# gusbase,irq1,irq2,dma1,dma2 -- The IO/IRQ/DMA addresses of the
# Gravis Ultrasound. (Same IRQ's and DMA's are OK.)
# gusrate -- Sample rate of Ultrasound emulation.
# ultradir -- Path to Ultrasound directory. In this directory
# there should be a MIDI directory that contains
# the patch files for GUS playback. Patch sets used
# with Timidity should work fine.

gus=true
gusrate=22050
gusbase=240
irq1=5
irq2=5
dma1=5
dma2=5
ultradir=C:\ULTRASND

Now start up PLAYMIDI.EXE as above, choose the same example MIDI file GDVIB6.MID and you should have PLAYMIDI.EXE hang while loading the patches (instruments) using the 16-bit DMA channel "5". Now drop back to the 8-bit DMA channel "3" and repeat the experiment. Now you should be able to load and play the MIDI files without PLAYMIDI.EXE hanging. However, with either 8-bit or 16-bit DMA in DosBox v0.65 used for loading patches - you will still get 'static' with 16-bit patches, only 8-bit patches will provide noise-free sound with reduced fidelity...

There are still other probems with the very good GUS classic emulation built into DosBox v0.65 but that is another subject.

Hope this helps,

dvwjr

Reply 2 of 7, by elicia

User metadata
Rank Newbie
Rank
Newbie

Hi dvwjr,

Thanks for this quick and accurate feedback. I did your tests and everything went as you predicted, i.e. :

* With the -8 option, the noise disappears
* By selecting dma 5, playmidi hangs when loading the instruments.
BTW : if I try another song, there is no hang, but the song becomes pretty distorted.

So if I did correctly understand, the 16bits issue is a known problem and the only thing I have to do is to wait for a bug fix in an upcoming release ?

If I can help to test some patches, feel free to appeal to me.

Thanks again,
Elicia

Reply 3 of 7, by dvwjr

User metadata
Rank Member
Rank
Member

The 16-bit DMA problem in DosBox v0.65 is not the problem with 'noisy' patches under PLAYMIDI.EXE that is apparent. There are a few problems with the Gravis Ultrasound 'classic' emulation in DosBox v0.65 that are causing the problem(s). The '8-bit' forced patch loading gets rid of both the 'noise' and the higher fidelity.

No new Gravis 'patches' will probably ever be made - when the DosBox Gravis emulation code is fixed the problem will go away.

Nothing more for you now,

dvwjr

Reply 4 of 7, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Does Playmidi really use the GUS for outputting? Ie. does it sound the
same when the soundblaster emulation is disabled in dosbox?

If they do use the GUS, does anybody know if there's a playback mode
that can use signed/unsigned 16bit samples?

Reply 5 of 7, by dvwjr

User metadata
Rank Member
Rank
Member

Yes, the Gravis PLAYMIDI.EXE really uses only a GUS or the Dosbox v0.65 GUS emulation to play MIDI files. No GUS, No MIDI output.

The default mode of PLAYMIDI.EXE is to use 16-bit Ultrasound patches. You must force PLAYMIDI via the -8 command-line parameter to load and use 8-bit patches. The does not appear to be any way for PLAYMIDI.EXE to differentiate between 16-bit signed/unsigned patches.

Here is the Gravis Ultrasound Patch format.

Hope this helps,

dvwjr

Reply 6 of 7, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

> PLAYMIDI.EXE to differentiate between 16-bit signed/unsigned patches.

Yes, but maybe they use a different sign-setting than most other GUS
16bit stuff. I'm asking because i found the 16bit unsigned soundblaster16
modes to be not supported (some games, and cubic player use it).
And it results in much the same what was described in the posting here
(lound with static noise).
Implementing that mode for the sb16 emulation, it works fine, so i thought
something similar might be happening for the GUS. Just didn't find anything
about how they could specify such a mode.

Reply 7 of 7, by dvwjr

User metadata
Rank Member
Rank
Member

Looks like forum member Srecko who authored the GUS bug-fix has finally eliminated the 'static' noise in the Gravis Ultrasound 16-bit signed patches! Good work... 😁 Looks to be included in the next official release. Another bug quashed...

dvwjr