Dan wrote:

> 1. unmute PCM, Master and Line groups by AMIXER, set appropriate sound
> 2. on the console_1 run 'mikmod' with music in modular
> etc...

I see you need some basics about sound under Linux.

First thing: there are "output chanels" and "input chanels". You can
record from input chanels and play thought output ones. You cannot
usually record from output chanels.

In your case, you are trying to use the PCM/Wave chanel (used by mikmod
to play the mods) for both playing (by mikmod) and recording. (by dd)
This is normally not possible. (and this is general. This applies to OSS,
ALSA, ESD...)

Second thing: dd is a utility designed to copy blocs of data, without any
knowledge about what the data is and not allowing any ioctl command to be
performed to "setup" the data. This makes it a pretty unsuitable tool for
audio. You should better use arecord, which is a program specifically
designed to record audio. You can specify the format, the sampling rate,
the number of chanels, the recording source, etc...

Another possibility, since I see you have sox, is using sox for recording
too. Sox normally supports a "format" called "ossdsp". Assuming you have
oss emulation properly configured, you can use this format to convert the
file /dev/dsp into a wav file with something like this:

sox -t ossdsp -r 44100 -c 2 -sw /dev/dsp -t wav verynicemusic.wav

Or, if you have a fast machine (i've done it on a P-2 266 machine), even
this:

sox -t ossdsp -r 44100 -c 2 -sw /dev/dsp -t wav - | lame -b 192 -h -
verynicemusic.mp3

This "converts" the recorded audio to wav format "on the fly" and passes
the data to lame via it's standar input. This data is compressed in
realtime and written to disk directly in mp3 format. This, of course,
requires much more CPU than the other option, since data NEEDS to be
compressed at realtime.

Note that, when you use programs designed for OSS, you probably lose some
functionality that would be available in an equivalent Alsa program.

Third thing: all this explanation should be unnecessary, since you don't
really need to perform this recording. It's a pretty dumb thing if you
think it twice: you are telling mikmod to mix the chanels in the mod file
into ONE pcm data channel, then play it throught the soundcard (this is:
converting to analog), after this, you want to record it (this is:
converting analog data back to digital PCM data). If mikmod generates pcm
data... why not take it directly?

I don't know about mikmod. I just know it's a software mixing mod player.
But I know that most programs of this kind have some sort of option to
write audio data directly to disk (normally in WAV or raw format),
instead of outputing it to the soundcard. This is the first thing you
should try.

Fourth thing: in the case mikmod does not have any option suitable to
this, Alsa provides some files in the proc filesystem which can be used
to catch the pcm data mikmod is generating. Those files are:

/proc/asound/dev/pcmC0D0p
/proc/asound/dev/pcmC0D0c

C0 and D0 parts are the card number and the device number. Usually the
first sound card is card 0 (C0) and it only has one device, usually being
0 too. (D0) "p" stands for Playback and "c" for Capture. If you read from
/proc/asound/dev/pcmC0D0p, you'll be intercepting whatever mikmod is
sending to the card. The only problem here is that you have to guess the
format. But this is normally not a big problem.

Note that I remember those files being in a different location in alsa
0.5.x (now I'm using 0.9.0beta6), I don't know if those files are in the
same place in your computer. They should be somewhere in /proc/asound.
That's all I can tell you.

I hope this helps a little bit.  ;)


_______________________________________________
Alsa-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to