----------------------------------------------------------------------
I have been working on and off for sometime trying to get OPL3 FM
Synth (NOT the WaveTable Synth) to work under ALSA with a AOpen
(I'm fairly sure) Ymf744B Card. I have even gone as far as writing
some simple code to communicate directly with the /dev/dmfm
(/dev/sound/dmfm) device and thus at least verify that the OPL3 was
"reachable".

My basic setup is the default asound startup script, modified to
modprobe oss modules and snd-opl3-synth.  The kernel driver is the
latest CVS as of The End of August, and the sbiload is the latest
cvs version.  When I am trying to get the OPL3 FM Synth to work,
I use a simple script to run sbiload with the std and drum patches
as follows:

        /usr/bin/sbiload -p65:0 -v $1 --opl3 \
                         /usr/share/alsa/banks/opl3/drums.o3 \
                         /usr/share/alsa/banks/opl3/std.o3

Once the Patches are loaded, then I try to run pmidi and playmidi
to see if ALSA and OSS midi is now working.
        pmidi -p 65:0 W2Humans.mid
and
        playmidi [-r] W2Humans.mid
Both seem to "hang" for 3 minutes(the length of the clip) and
playmidi -r seems to indicate that indeed the player thinks
the midi file is playing.  No sound. :(

It seemed like the midi channel might be muted.  So I have double
checked to make sure all the mixer controls were turned on and up,
just in case.  I recall some previous post mentioning a synth, midi,
or a FM mixer control;  none of which I can manage to find, and the
ones I have found (master*,wave,pcm,external,cd,etc) are unmuted and
have been tested turned all the way up.

If anyone can help/share experiences it would be appreciated.
It seems that there is at least one person out there on this list
with a similar problem with the same card(first appearing in April),
and I was curious how far he had managed to get with the OPL3.

I have tried to include text/links of various pieces of information,
which might help in a diagnosis.  And a "Test" program for accessing
the direct FM device, in a last ditch attempt to make sure I could
talk to the OPL3 at least.  The error output I get is included.

Thanks

Philip Thiem

Loaded Modules
----------------------------------------------------------------------
snd-seq-midi
snd-seq-oss
snd-seq-midi-event
snd-pcm-oss
snd-mixer-oss
snd-opl3-synth
snd-seq-instr
snd-seq-midi-emul
snd-seq
snd-ainstr-fm
snd-ymfpci
snd-pcm
snd-mpu401-uart
snd-rawmidi
snd-opl3-lib
snd-hwdep
snd-seq-device
snd-timer
snd-ac97-codec
snd
soundcore

/etc/modutils.conf(relavent)
----------------------------------------------------------------------
#######################################
#ALSA Core
#######################################
# ALSA portion
alias char-major-116 snd
options snd snd_cards_limit=1 snd_device_mode=660 snd_device_gid=29
# OSS/Free portion
alias char-major-14 soundcore

#######################################
#ALSA Drivers
#######################################
# ALSA portion
alias snd-card-0 snd-ymfpci

# OSS/Free portion
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

pmidi -l gives
----------------------------------------------------------------------
 Port     Client name                       Port name
 64:0     External MIDI 0                   MIDI 0-0
 65:0     OPL3 FM synth                     OPL3 Port

/proc/pci and /proc/ioports output
----------------------------------------------------------------------
Bus  0, device   9, function  0:
  Multimedia audio controller: Yamaha Corporation YMF-744B [DS-1S Audio 
Controller] (rev 2).
        IRQ 5.
        Master Capable.  Latency=32.  Min Gnt=5.Max Lat=25.
        Non-prefetchable 32 bit memory at 0xdb000000 [0xdb007fff].
        I/O at 0xdc00 [0xdc3f].
        I/O at 0xe000 [0xe003].

dc00-dc3f : Yamaha Corporation YMF-744B [DS-1S Audio Controller]
dc00-dc01 : OPL2/3 (left)
dc02-dc03 : OPL2/3 (right)
dc20-dc21 : MPU401 UART
e000-e003 : Yamaha Corporation YMF-744B [DS-1S Audio Controller]
e400-e43f : 3Com Corporation 3c905 100BaseTX [Boomerang]
e400-e43f : 00:0a.0

/proc/asound/version
----------------------------------------------------------------------
Advanced Linux Sound Architecture Driver Version 0.9.0rc3.
Compiled on Sep  4 2002 for kernel 2.4.19-xfs with versioned symbols.

/prov/asound/seq/clients
----------------------------------------------------------------------
Client info
  cur  clients : 4
  peak clients : 5
  max  clients : 192

Client   0 : "System" [Kernel]
  Port   0 : "Timer" (Rwe-)
  Port   1 : "Announce" (R-e-)
    Connecting To: 63:0
Client  63 : "OSS sequencer" [Kernel]
  Port   0 : "Receiver" (-we-)
    Connected From: 0:1
Client  64 : "External MIDI 0" [Kernel]
  Port   0 : "MIDI 0-0" (RWeX)
Client  65 : "OPL3 FM synth" [Kernel]
  Port   0 : "OPL3 Port" (-We-)
  Port   1 : "OPL3 OSS Port" (-we-)

/proc/asound/oss/sndstat
----------------------------------------------------------------------
Sound Driver:3.8.1a-980706 (ALSA v0.9.0rc3 emulation code)
Kernel: Linux werg 2.4.19-xfs #10 Wed Sep 4 16:03:58 CDT 2002 i686
Config options: 0

Installed drivers:
Type 10: ALSA emulation

Card config:
Yamaha DS-XG PCI (YMF744) at 0xc8907000, irq 5

Audio devices:
0: YMFPCI (DUPLEX)

Synth devices:
0: OPL3 FM

Midi devices:
0: MPU-401 (UART)

Timers:
7: system timer

Mixers:
0: mixer00

/proc/asound/card0/oss_mixer
----------------------------------------------------------------------
VOLUME "Master" 0
BASS "" 0
TREBLE "" 0
SYNTH "" 0
PCM "PCM" 0
SPEAKER "PC Speaker" 0
LINE "Line" 0
MIC "Mic" 0
CD "CD" 0
IMIX "" 0
ALTPCM "" 0
RECLEV "" 0
IGAIN "Capture" 0
OGAIN "" 0
LINE1 "Aux" 0
LINE2 "" 0
LINE3 "" 0
DIGITAL1 "Digital" 0
DIGITAL2 "Digital" 1
DIGITAL3 "" 0
PHONEIN "Phone" 0
PHONEOUT "" 0
VIDEO "Video" 0
RADIO "" 0
MONITOR "" 0

alsamixersettings
----------------------------------------------------------------------
http://www.icequake.net/~witwerg/asound.state

DMFM Code(I'm not sure how "correct" this code is)
----------------------------------------------------------------------
const char soundfile[] = "/dev/dmfm";
int main() {
   int fmdev;

   fmdev = (soundfile, O_WRONLY);
   if (fmdev < 0) {
      perror("Opening Device");
      exit(1);
   }

   if (ioctl(fmdev, 0x20) == -1) {
      perror("Resetting Device");
   }

   if (ioctl(fmdev, 0x25, 0x01) == -1) {
      perror("To OPL3 mode Device");
   }

   close(fmdev);
   perror("Done");
}

perror then gives me the following errors
        Resetting Device: Invalid argument
        To OPL3 mode Device: Invalid argument



GPG Pub Key Archived at wwwkeys.us.pgp.net
Isn't it obvious lumberjacks love traffic lights?

Attachment: msg04675/pgp00000.pgp
Description: PGP signature

Reply via email to