From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QQGeM-0000Oj-SP for garchives@archives.gentoo.org; Sat, 28 May 2011 10:21:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BBA8C1C03B; Sat, 28 May 2011 10:20:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 834661C03B for ; Sat, 28 May 2011 10:20:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 03BF11B4033 for ; Sat, 28 May 2011 10:20:15 +0000 (UTC) X-Virus-Scanned: by amavisd-new using ClamAV at gentoo.org X-Spam-Score: -4.864 X-Spam-Level: X-Spam-Status: No, score=-4.864 required=5.5 tests=[AWL=1.735, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1soi3MKoIGXM for ; Sat, 28 May 2011 10:20:08 +0000 (UTC) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by smtp.gentoo.org (Postfix) with ESMTP id 07BDC1B4011 for ; Sat, 28 May 2011 10:20:06 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QQGck-0004iR-IZ for gentoo-user@gentoo.org; Sat, 28 May 2011 12:20:02 +0200 Received: from athedsl-376180.home.otenet.gr ([79.131.21.114]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 28 May 2011 12:20:02 +0200 Received: from realnc by athedsl-376180.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 28 May 2011 12:20:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: Nikos Chantziaras Subject: [gentoo-user] Re: OT: What does the data stream to a sound card look like? Date: Sat, 28 May 2011 13:19:58 +0300 Organization: Lucas Barks Message-ID: References: <20110528095044.GA3946@acm.acm> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: athedsl-376180.home.otenet.gr User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110524 Thunderbird/3.1.10 In-Reply-To: <20110528095044.GA3946@acm.acm> X-Archives-Salt: X-Archives-Hash: fe7a624f8927135f8490c8b2dde0e371 On 05/28/2011 12:50 PM, Alan Mackenzie wrote: > Hi, Gentoo. > > It occurred to me the other day that I am clueless about how a sound > card works. How do the data get into it? Does the sound card use an > interrupt to ask for more data? The data is placed in RAM. The card reads it from there using a DMA operation. You can read about it here: http://en.wikipedia.org/wiki/Direct_memory_access > What form do the data take? It's raw data, and its form depends on what the card is expecting. What the card is expecting is programmable by the card's driver. > Say I feed an mp3 through the card. Does > the Athlon do the decompression, or does the sound card do it? The MP3 is decoded by your CPU (by software like libmad, xine, gstreamer, etc.) The decoded data is send to the driver, the driver applies any needed conversions to it (according to what the card expects), and then places it in RAM so the card can get it by means of DMA. > Last of all, is there a command line program which can play a CD by > feeding its data into the sound card? Today this works the same playing any other audio. The fact that audio in this case comes from a CD doesn't matter. An application reads the audio from the CD, sends it to the driver, and from there it gets to the sound card.