From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <1B8BCC41-0745-44E7-AD96-ABFF9A628CE8@sun.com> Date: Thu, 13 Aug 2009 13:00:46 -0400 Message-ID: <9ab217670908131000x16dc30a6s81cb7dd14b72c386@mail.gmail.com> From: "Devon H. O'Dell" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] audio standards -- too many to choose from Topicbox-Message-UUID: 47284dce-ead5-11e9-9d60-3106f5b1d025 2009/8/12 Tim Newsham : >>>> - What software exists for each of these formats? >> >> If you are asking about non Plan9 software I'd start with >> ffmpeg. >> >>>> - Which format is the most "popular"? >> >> I don't think I understand the question. > > Sorry, let me rephrase: > =A0- Of the different audio driver interface designs > =A0 =A0(audio(3), usb(4) and inferno usb(3)) which software > =A0 =A0(p9 and limbo) uses each? > =A0- Which of these interfaces is used the most? I don't know which is used the most, but I don't think the Plan 9 ones of them make particularly good sense to support multiple input formats to multiple output formats. sox was mentioned here recently, and is a great utility for doing the conversion. If we want a generic, reusable audio layer, to *me* the Inferno one is best with: audio audioctl It doesn't make sense to export files for volumes, codes, channels, and other settings to me. This is because (at least with HDA cards) you would end up with 5 bajillion files for controlling volume on each individual channel. You'd end up with another file for reading/writing codec settings. You'd end up with a file saying whether you preferred digital output or analog output. OSS relies heavily on ioctls for setting these things, but for good reason. In our case, a standardized set of strings for the ctl file seems best to me. If I want to change master volume, echo master 255.255 > /dev/audioctl. If I want to set digital out, echo output channel digital > /dev/audioctl. etc. A more spread out filesystem would make the ctl handler smaller, but would not reduce the amount of code needed to support mixers / codecs / channels / whatnot (In fact, you'd just have more code because you'd have to have functions for reading/writing those files). Also, then you just need to come up with strings -- you're just bit frobbing these things, and more complicated filesystem hierarchy doesn't help explain it any better. echo 255 > /dev/audio/mixer/channel/master/right; echo 255 > /dev/audio/mixer/channel/master/left; just seems obtuse, and, as I said, it's just adding more redundant code anyway. To then play sound, you would probably have a sox-like converter sitting on top of that (maybe even on top of /dev/audio?) that takes input of a certain format and does either minimal conversion (i.e. a card that supports XA ADPCM taking input from a playstation 2 sound file not having any conversion at all, WAV going to the proper byte-order PCM with the header stripped off, etc), or highest resolution audio available (e.g. 5.1 flac getting converted to whatever codec supports 5.1 audio). Thoughts? --dho