9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Devon H. O'Dell" <devon.odell@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] audio standards -- too many to choose from
Date: Thu, 13 Aug 2009 13:00:46 -0400	[thread overview]
Message-ID: <9ab217670908131000x16dc30a6s81cb7dd14b72c386@mail.gmail.com> (raw)
In-Reply-To: <Pine.BSI.4.64.0908121744570.20861@malasada.lava.net>

2009/8/12 Tim Newsham <newsham@lava.net>:
>>>> - 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:
>  - Of the different audio driver interface designs
>    (audio(3), usb(4) and inferno usb(3)) which software
>    (p9 and limbo) uses each?
>  - 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



  reply	other threads:[~2009-08-13 17:00 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12  1:08 Tim Newsham
2009-08-12  1:14 ` erik quanstrom
2009-08-12  1:31   ` Tim Newsham
2009-08-12  1:45     ` erik quanstrom
2009-08-12  2:07       ` Tim Newsham
2009-08-12  3:14         ` ron minnich
2009-08-12  3:24           ` erik quanstrom
2009-08-12  4:49             ` Charles Forsyth
2009-08-12  4:24           ` Russ Cox
2009-08-12  4:35             ` Charles Forsyth
2009-08-12 15:12               ` Russ Cox
2009-08-12  4:36             ` Roman Shaposhnik
2009-08-12 15:36               ` hiro
2009-08-14  2:45                 ` Roman V. Shaposhnik
2009-08-14 13:56                   ` hiro
2009-08-12  5:15             ` Tim Newsham
2009-08-12  5:39               ` Roman Shaposhnik
2009-08-12  8:28                 ` Tim Newsham
2009-08-12  9:30                   ` Steve Simon
2009-08-13  2:16                   ` Roman Shaposhnik
2009-08-13  3:17                     ` erik quanstrom
2009-08-13 22:48                     ` James Tomaschke
2009-08-13 22:52                       ` erik quanstrom
2009-08-13 23:19                         ` Christopher Nielsen
2009-08-13 23:47                         ` James Tomaschke
2009-08-14  0:00                           ` erik quanstrom
2009-08-14  1:13                             ` James Tomaschke
2009-08-14  1:41                               ` Anthony Sorace
2009-08-14  2:30                                 ` James Tomaschke
2009-08-14  1:42                               ` Devon H. O'Dell
2009-08-14  1:51                                 ` Devon H. O'Dell
2009-08-14  2:22                                 ` James Tomaschke
2009-08-14  3:16                                   ` Charles Forsyth
2009-08-14  3:42                                     ` James Tomaschke
2009-08-14  7:04                                       ` Charles Forsyth
2009-08-14 20:43                                         ` James Tomaschke
2009-08-15  9:26                                           ` Steve Simon
2009-08-14 13:16                                     ` matt
2009-08-14  4:51                                   ` Devon H. O'Dell
2009-08-14  5:01                                     ` Devon H. O'Dell
2009-08-14  5:56                                       ` James Tomaschke
2009-08-19  9:58                                         ` matt
2009-08-14  5:18                                     ` James Tomaschke
2009-08-14 14:39                                       ` Devon H. O'Dell
2009-08-14  9:16                                   ` Paul Donnelly
2009-08-14 13:47                                     ` hiro
2009-08-14 20:03                         ` Tim Newsham
2009-08-14 21:24                   ` sqweek
2009-08-14 21:54                     ` Skip Tavakkolian
2009-08-15 12:23                       ` hiro
2009-08-14 22:05                     ` Bakul Shah
2009-08-12  5:43               ` Anthony Sorace
2009-08-12  5:59                 ` Roman Shaposhnik
2009-08-12  6:11                   ` Roman Shaposhnik
2009-08-12 11:18                   ` erik quanstrom
2009-08-13  2:06                     ` Roman Shaposhnik
2009-08-12 22:11             ` James Tomaschke
2009-08-13  7:45             ` Skip Tavakkolian
2009-08-12  4:20         ` Roman Shaposhnik
2009-08-12  4:25           ` erik quanstrom
2009-08-12  4:50             ` Roman Shaposhnik
2009-08-12  5:10               ` Tim Newsham
2009-08-12  5:25                 ` Roman Shaposhnik
2009-08-12 15:42                 ` David Leimbach
2009-08-12  5:15               ` Anthony Sorace
2009-08-13  6:42               ` Skip Tavakkolian
2009-08-13 13:07                 ` erik quanstrom
2009-08-13 13:30                   ` Skip Tavakkolian
2009-08-13 13:31                   ` Devon H. O'Dell
2009-08-13 14:31                     ` Anthony Sorace
2009-08-13 14:41                       ` Devon H. O'Dell
2009-08-13 17:20                       ` hiro
2009-08-12 15:30             ` hiro
2009-08-12  5:54 ` Lawrence E. Bakst
2009-08-12  6:13   ` Roman Shaposhnik
2009-08-12 19:50 ` Tim Newsham
2009-08-12 20:57   ` Bakul Shah
2009-08-13  2:18   ` Roman Shaposhnik
2009-08-13  3:46     ` Tim Newsham
2009-08-13 17:00       ` Devon H. O'Dell [this message]
2009-08-13 19:13         ` Christopher Nielsen
2009-08-15  0:44 erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ab217670908131000x16dc30a6s81cb7dd14b72c386@mail.gmail.com \
    --to=devon.odell@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).