l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2006 Jan 27 17:02

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] update on the audio CD problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] update on the audio CD problem

On Fri 27 Jan 06,  2:27 PM, Micah J. Cowan <micah@cowan.name> said:
> On Fri, Jan 27, 2006 at 04:54:14PM -0500, Peter Jay Salzman wrote:
> > On Fri 27 Jan 06,  1:17 PM, Micah J. Cowan <micah@cowan.name> said:
> > > On Fri, Jan 27, 2006 at 04:05:23PM -0500, Peter Jay Salzman wrote:
> > > > On Fri 27 Jan 06, 12:50 PM, Bill Kendrick <nbs@sonic.net> said:
> > > > > On Fri, Jan 27, 2006 at 05:06:09AM -0500, Peter Jay Salzman wrote:
> > > > > > Digital extraction is where the cd is read, and the signal gets pumped
> > > > > > through the ATA port to your speakers.  This is more efficient from the
> > > > > > CPU's standpoint.
> > > > > 
> > > > > Woah, I would think this is way LESS efficient.
> > > > 
> > > > No.  The CPU is involved in many read-copy operations when the signal passes
> > > > through the sound card.
> > > > 
> > > > AFAIK, the north and south bridge use DMA during digital extraction.
> > > 
> > > Pete, I'm pretty sure that the CPU isn't even /involved/ with analog
> > > mode. It's analog. There is no read/copy. There's nothing to read/copy.
> >  
> > sure there is.
> > 
> > data needs to be copied from kernel space to user space.  that _definitely_
> > requires the CPU.  that's why the whole "zero-copy user-space access" was
> > such a big deal.
> Kernel space? What the heck are you talking about?
> There is a direct analog connection from the CD drive to the sound card.
> It doesn't ever even touch the mother board. The signal sure as hell
> isn't routed out through the soundcard to the motherboard, and then back
> into the soundcard. No kernel, user, or any other sort of space is
> involved.  It's an analog signal, which isn't even representable in
> kernel or user space unless you convert it to digital, which kind of
> defeats the purpose.

1. read() is performed on a block file device to obtain sound data.
2. write() is performed to write the data to the sound char device file.

it looks like this:

   read(drive_fd, buffer, size);
   write(sound_fd, buffer, size);

the kernel performs these system calls in kernel mode on behalf of the
application.  the data is read into kernel space, and recopied into
userspace no fewer than 4 times.

additionally, there are user/kernel context switches, and that also takes up
effort and time.

if you don't understand me, or don't believe me, i'll do the google search
and post a link that explains this.

with digital audio extraction, DMA can be used to copy data directly from
the drive into userland memory.  this is the whole point of DMA transer.


ps- i'm not sure how you can claim that "no kernel, user, or any other space
is involved" when we're talking about I/O to hardware device files.  doesn't
that seem a bit silly to you?  after all, the kernel's main function is to
interface with hardware and manage memory.
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.