LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   ALSA and an old fashioned sound board on kernel 2.6. (https://www.linuxquestions.org/questions/slackware-14/alsa-and-an-old-fashioned-sound-board-on-kernel-2-6-a-903249/)

stf92 09-15-2011 06:41 PM

ALSA and an old fashioned sound board on kernel 2.6.
 
kernel 2.6.21.5, Slackware 12.0
package alsa-driver-1.0.23

Hi:
The first question I think should be: does ALSA support OSS. I'll assume the answer is yes. Still better: I'll begin by the end: I want to have linux support for an OPL3-SA3 sound board (chipset YMF719-S). I have made it work on linux 2.2.16, but have now quite forgotten the details, even the basics. There I had OSS pure, no ALSA, to begin with. And I went throu a series of complicated steps, but finally succeeded. To the facts:

Question #2: is OSS support compiled into the kernel, in my system, or are the modules inserted during boot time, or neither one nor the other? That is, how do I know.

Fact #1: The Yamaha OPL3-SA3 is for the ISA bus, but the machine I intend to install it in has ISA slots.

Fact #2: I do 'insmod soundcore' and get file not found. Locate gives
Code:

/lib/modules/2.6.21.5/kernel/sound/soundcore.ko
/lib/modules/2.6.21.5-smp/kernel/sound/soundcore.ko
/home/semoi/ALSA/alsa-driver-1.0.23/utils/patches/soundcore.2.4.patch
/home/semoi/ALSA/alsa-driver-1.0.23/utils/patches/soundcore.2.4.20.patch

Question #3: what are the *.ko?

Unfortunately, the documentation for OPL3 is all in .../Documentation/sound/oss and is dated 2001, when ALSA did not existed in Linux. One of the many drawbacks of having kernel 2.6.x.x instead of 2.4.x.

In .../Documentation/sound/oss I have, besides Introduction, files OPL3 and OPL3-SA2. OPL3 simply says this: "A pure OPL3 card is nice and easy to configure. Simply do 'insmod opl3 io=0x388'". Doing it, I get No such file or directory.

OPL3-SA2 seems written by a different person. It's lengthy and refers to driver opl3sa2.o. To make it short, 'locate -i opl3' gives:
Code:

/lib/modules/2.6.21.5/kernel/sound/isa/snd-opl3sa2.ko
/lib/modules/2.6.21.5/kernel/sound/drivers/opl3
/lib/modules/2.6.21.5/kernel/sound/drivers/opl3/snd-opl3-synth.ko
/lib/modules/2.6.21.5/kernel/sound/drivers/opl3/snd-opl3-lib.ko
/lib/modules/2.6.21.5-smp/kernel/sound/isa/snd-opl3sa2.ko
/lib/modules/2.6.21.5-smp/kernel/sound/drivers/opl3
/lib/modules/2.6.21.5-smp/kernel/sound/drivers/opl3/snd-opl3-synth.ko
/lib/modules/2.6.21.5-smp/kernel/sound/drivers/opl3/snd-opl3-lib.ko

/usr/include/sound/opl3.h
/usr/src/linux-2.6.21.5/sound/oss/opl3sa2.c
/usr/src/linux-2.6.21.5/sound/oss/opl3.c
/usr/src/linux-2.6.21.5/sound/oss/opl3.h
/usr/src/linux-2.6.21.5/sound/oss/opl3_hw.h
/usr/src/linux-2.6.21.5/sound/isa/opl3sa2.c
/usr/src/linux-2.6.21.5/sound/drivers/opl3
/usr/src/linux-2.6.21.5/sound/drivers/opl3/opl3_oss.c
/usr/src/linux-2.6.21.5/sound/drivers/opl3/Makefile
/usr/src/linux-2.6.21.5/sound/drivers/opl3/opl3_seq.c
/usr/src/linux-2.6.21.5/sound/drivers/opl3/opl3_midi.c
/usr/src/linux-2.6.21.5/sound/drivers/opl3/opl3_lib.c
/usr/src/linux-2.6.21.5/sound/drivers/opl3/opl3_drums.c
/usr/src/linux-2.6.21.5/sound/drivers/opl3/opl3_voice.h
/usr/src/linux-2.6.21.5/sound/drivers/opl3/opl3_synth.c
/usr/src/linux-2.6.21.5/Documentation/sound/oss/OPL3
/usr/src/linux-2.6.21.5/Documentation/sound/oss/OPL3-SA2
/usr/src/linux-2.6.21.5/include/sound/opl3.h
/usr/src/linux-2.6.21.5/include/config/snd/opl3
/usr/src/linux-2.6.21.5/include/config/snd/opl3/lib.h
/usr/src/linux-2.6.21.5/include/config/snd/opl3sa2.h

As you can see, opl3sa2 has not been compiled.

Question #4: if in the old machine (ISA bus) I install linux 2.4.x, wouldn't it be much less work, as it has no knowledge of ALSA?

I would like to put some conclusion of mine here, some guess, but I'm completely at a loss. I've found a file which documents all I had done in linux 2.2.16, but is not written in English. Otherwise, I would attach it, if only aiming at showing I can also solve my problems. However, it all boilt down to this, I think:
Code:


#!/bin/bash
# scriptcito escrito por E.S.
# FILE NAME: soundon.sh

SB_CTRL=0x370
SB_WSS=0x530
SB_MPU=0x330
SB_IRQ=5
SB_DMA=1
SB_DMA2=0
SB_ADLIB=0x388

echo Starting sound.
/sbin/insmod soundcore
/sbin/insmod soundlow
/sbin/insmod sound
# Los tres precedentes en ese mismo orden.
echo Starting OPL3-SAx...
/sbin/insmod mpu401
/sbin/insmod ad1848
/sbin/insmod opl3sa2 io=$SB_CTRL mss_io=$SB_WSS mpu_io=$SB_MPU irq=$SB_IRQ \
  dma=$SB_DMA dma2=$SB_DMA2
/sbin/insmod opl3 io=$SB_ADLIB
# Fin de archivo

EDIT:
Code:

semoi@darkstar:~/STORE1/soft/linux$ lsmod|grep oss
snd_seq_oss            32896  0
snd_seq_midi_event    10112  1 snd_seq_oss
snd_seq                50640  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss            42784  0
snd_mixer_oss          18048  1 snd_pcm_oss
snd_pcm                72068  3 snd_pcm_oss,snd_trident,snd_ac97_codec
snd_seq_device        10508  5 snd_seq_dummy,snd_seq_oss,snd_seq,snd_trident,snd_rawmidi
snd                    47204  13 snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_trident,snd_ac97_codec,snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device
semoi@darkstar:~/STORE1/soft/linux$


allend 09-16-2011 01:46 AM

Quote:

/lib/modules/2.6.21.5-smp/kernel/sound/isa/snd-opl3sa2.ko
This is the already compiled kernel module (for the -smp kernel) that supports the soundcard.
Based on values from your script, executing, as root, 'modprobe snd-opl3sa2 io=0x370 mss_io=0x530 mpu_io=0x330 irq=5 dma=1 dma2=0' should activate the soundcard. To have this happen at boot, add the line to the rc.modules file in /etc/rc.d (you may find there is already a line for this that needs to be uncommented and appropriate options added).

I have not used one, but it is my understanding that if you want to use MIDI with the OPL3 chip, then you need to supply a library of voices and code to synthesise these.
I think these files are related to that
Quote:

/lib/modules/2.6.21.5-smp/kernel/sound/drivers/opl3/snd-opl3-synth.ko
/lib/modules/2.6.21.5-smp/kernel/sound/drivers/opl3/snd-opl3-lib.ko
Once you have the card configured, ALSA should handle it.

stf92 09-16-2011 08:22 AM

Thanks for your kind reply. I cannot test now because haven't yet installed slack 12.0 in the target machine. MIDI is not a problem, as far as I can use the mpu. Have a good weekend.

ReaperX7 09-18-2011 09:24 AM

ALSA should be able to detect the YMF719-S from the "alsaconf" tool. If it doesn't auto-detect it have it check for Legacy devices, and it should either detect it then or give you a menu of modules to select from.

"snd-opl3sa2" "SHOULD" load by default after setup along with "snd-opl3-lib", but you can always run "lsmod" and see what modules are loaded for the sound card, and see if you may have to manually edit to load anything from "rc.modules" as previously stated at boot time, but usually the 2.6.xx kernel is fairly good at auto-detecting & loading modules for hardware even it is fairly old. The "snd-opl3-synth" module may have to be loaded by hand though through the local startup script like "rc.local". I'm unsure if using the MPU-401 port still requires loading this module as I've really never used the MPU-401 port.

Oh... and to answer question 3:

".ko" is the extension for 2.6.xx or later kernel modules, where as the 2.4.xx and earlier used ".o" extensions.

Best of luck getting the card working though.

As for question 4:

It doesn't really matter if you use OSS or ALSA anymore as ALSA should now support the majority of all known soundcards and chipsets. OSS may actually support less in cases unless you go with the commercial grade OSSv4 driver from 4Front, but even then, don't get your hopes too high.

stf92 09-18-2011 10:37 PM

Hi:

and thanks for your post. My primary interest in installing slack in the old machine was making OPL3 work. For that, I hesitated between 12.0 and an older version. I finally opted for 9.1 because ALSA had been introduced between 2.5.4 and 2.5.5, as I learned. So , and I apologize, I have 9.1 with its kernel 2.4.22 in that machine. But, surprisingly, the OS boots with ALSA support.

Code:

$ amixer -c 0 sset PCM,0 100%,100% unmute  nocap
amixer: Mixer attach hw:0 error: No such device.
$

In slack 12.0 the command is accepted. But I'm now reading ALSA-configuration.txt in slack 9.1. I hope I understand what happens.

EDIT: "But, surprisingly, the OS boots with ALSA support". This is a bit ambiguous. What is true is that kernel 2.4.22 (slack 9.1) has no ALSA support compiled in. And another thing. I just ran alsaconf, as ReaperX7 suggested, and that did it. Thanks.


All times are GMT -5. The time now is 02:51 AM.