Sound stuff: Looking for bidirectionnal audio!

Sound stuff: Looking for bidirectionnal audio!

Post by Hannu Savolain » Mon, 03 Apr 1995 05:00:00




>Hello, World!
>I am currently trying to find a way of playing audio and recording in
>simultaneously. A possible application could be a real time effect
>processor, or a direct to disk multi track recorder.

These tasks are difficult to implement without special hardware and/or
operating system constructions. The real time effect processing requires
that the recorded sample is played back almost immediately after being
recorded (otherwise there is some disturbing delay).

The problem with D2D is the disk I/O. Recording CD quality sound requires
that the file system+disk I/O code is able to store continuously 176k of
data to a file without pauses longer than 0.3 sec. On my system this is
not possible (DX4/100+IDE disks+ext2fs). It may work with SCSI disks
and/or using raw disk partitions (no fs on them). Doing recording and
playback at the same time makes things still worse.

Quote:>I looked the sound driver sources, and noticed that it is only designed
>to do one of these jobs at a time. I think that the major reason for this
>is that most of the cards have only 1 DMA channel.

This limitation is there since at the time I started writing the sound
driver there was just the SB which was not able to work in duplex mode.
However since full duplex is the most requested feature, it's propably
the time to start implementing it.

Quote:>> Do you think that an interrupt driven driver is a possible solution?
>> Would it be slow? (for a 44khz stereo and bidirectionnal transfert,
>would it take less than 5% cpu time on a pentium 60)

It's likely that it leaves about 5% of CPU free. Interrupt processing is just
too time consuming to be done 44100 at times/sec.

Quote:>I currently own a Sound Galaxy nx pro 16 sound card, which is a
>8 bits sound blaster compatible plus a Windows Sound System 16 bits
>device (ad1848). In the driver source (ad1848.c), I noticed that there
>is a mode with two DMA channels. Is it hardware compatible? Can it work?

The standard WSS interface doesn't support two DMA channels but some
cards may have a proprietary extension (SG NX Pro 16 is not one of them
AFAK). The ad1848.c is a generic driver that is intended to support all
AD1848/CS4248/CS4231 based cards such as WSS and GUS MAX. For this reason
there is preliminary support for dual DMA channel mode.

Hannu
--
-----------------------------
Hannu Savolainen

"Hackers don't use factory prebooted DOS."

 
 
 

Sound stuff: Looking for bidirectionnal audio!

Post by James Hightow » Tue, 04 Apr 1995 04:00:00


: The problem with D2D is the disk I/O. Recording CD quality sound requires
: that the file system+disk I/O code is able to store continuously 176k of
: data to a file without pauses longer than 0.3 sec. On my system this is
: not possible (DX4/100+IDE disks+ext2fs). It may work with SCSI disks
: and/or using raw disk partitions (no fs on them). Doing recording and
: playback at the same time makes things still worse.

No problem on my system, (Cyrix 486dx2/80, PCI ncr53c810 SCSI, Seagate
ST12400N Hawk II 2 gig disk, SB16 for in and GUS oldie for out,) I can even
play one 44.1k/16bit file while recording another, as long as the system
is doing _NOTHING ELSE_.

The hard part is trying to do useful work while also going back to the read
every 0.18 seconds. Today (Sunday) I'm going to try to implement a 128k
secondary buffer in dmabuf.c, which should allow 0.74 seconds between reads.
I implemented select last night, maybe the two together will allow me to get
something done.

: >I looked the sound driver sources, and noticed that it is only designed
: >to do one of these jobs at a time. I think that the major reason for this
: >is that most of the cards have only 1 DMA channel.
: This limitation is there since at the time I started writing the sound
: driver there was just the SB which was not able to work in duplex mode.
: However since full duplex is the most requested feature, it's propably
: the time to start implementing it.

Yay!

JJH
--
 I like to believe that people in the long run are going to do more to
promote peace than our governments.  Indeed, I think that people want
peace so much that one of these days governments had better get out of
the way and let them have it.
                -- Dwight D. Eisenhower

 
 
 

1. Sound stuff: Looking for bidirectionnal audio!


: >I am currently trying to find a way of playing audio and recording in
: >simultaneously. A possible application could be a real time effect
: >processor, or a direct to disk multi track recorder.

: I am attempting this sort of thing by using brute force- using two sound cards.
: I hav a GUS and a SB16, which can apparently be used at the same time.  
: Haven't had much success yet though, as using the GUS (alone or with the SB)
: only kind of works, and then usually causes a total system crash from which I
: have to do a reset.  (then run e2fsck from floppy- yuch!)

I'm doing 16 bit 44.1khz bidirectionnal with a gus and sb16 with no problems.

My config: (cat /dev/sndstat)

Note that the GUS is at 0x240, and the sb is at drq 5.
Are you sure you have the SB and GUS on different dma channels?
They default to the same.

Also, I had to read and write from the same program -- just pipeing
srec to splay was a loss.

JJH
--
"It runs like x, where x is something unsavory"
                -- Prof. Romas Aleliunas, CS 435

2. Booting Redhat linux 7.3 with Installation CD-ROM help

3. Looking for Digital Audio sound card

4. Interrupt handling with pipes with perl

5. ??: `cat sound.au >/dev/audio` Noisy After New Sound Card Installed??

6. Java Applets on Embeded Linux

7. bad sound quality for u-law sound (/dev/audio)

8. Vi Lovers Home Page renewed

9. need help on play sound files to /dev/{audio,sound}

10. Looking for good *sounding* sound card

11. Audio mixer for /dev/audio or USB audio?

12. Video, Audio & other stuff

13. Audio stuff...