約 1,060,679 件
https://w.atwiki.jp/audi80/pages/4.html
ニュース @wikiのwikiモードでは #news(興味のある単語) と入力することで、あるキーワードに関連するニュース一覧を表示することができます 詳しくはこちらをご覧ください。 =>http //atwiki.jp/guide/17_174_ja.html たとえば、#news(wiki)と入力すると以下のように表示されます。 【グランサガ】リセマラ当たりランキング - グランサガ攻略wiki - Gamerch(ゲーマチ) Among Us攻略Wiki【アマングアス・アモングアス】 - Gamerch(ゲーマチ) 【ひなこい】最強ひな写ランキング - ひなこい攻略Wiki - Gamerch(ゲーマチ) マニュアル作成に便利な「画像編集」機能を提供開始! - ナレッジ共有・社内wikiツール「NotePM」 - ヨコハマ経済新聞 【Apex Legends】ヴァルキリーの能力と評価【エーペックス】 - Gamerch(ゲーマチ) モンハンライズ攻略Wiki|MHRise - AppMedia(アップメディア) 【ウインドボーイズ】リセマラ当たりランキング(最新版) - ウインドボーイズ攻略Wiki - Gamerch(ゲーマチ) ポケモンBDSP(ダイパリメイク)攻略wiki - AppMedia(アップメディア) 【テイルズオブルミナリア】リセマラ当たりランキング - TOルミナリア攻略Wiki - Gamerch(ゲーマチ) SlackからWikiへ!シームレスな文章作成・共有が可能な「GROWIBot」リリース - アットプレス(プレスリリース) 【ウマ娘】チャンピオンズミーティングの攻略まとめ - Gamerch(ゲーマチ) 【ウマ娘】ナリタブライアンの育成論|URAシナリオ - Gamerch(ゲーマチ) 【ウマ娘】ヒシアケボノの育成論|URAシナリオ - Gamerch(ゲーマチ) 【ウマ娘】フジキセキの育成論|URAシナリオ - Gamerch(ゲーマチ) ドラゴンクエストけしケシ攻略Wiki - Gamerch(ゲーマチ) サモンズボード攻略wiki - GameWith 【スタオケ】カード一覧【金色のコルダスターライトオーケストラ】 - Gamerch(ゲーマチ) 【ブレフロレゾナ】リセマラ当たりランキング【ブレイブフロンティアレゾナ】 - ブレフロR攻略Wiki - Gamerch(ゲーマチ) 【ポケモンユナイト】サーナイトの評価と性能詳細【UNITE】 - Gamerch(ゲーマチ) 【ガーディアンテイルズ】ギルドレイド戦(秘密の研究所)の攻略とおすすめキャラ【ガデテル】 - Gamerch(ゲーマチ) 仲村トオル、共演者は事前に“Wiki調べ” - 沖縄タイムス 【ENDER LILIES】攻略チャートと全体マップ【エンダーリリィズ】 - Gamerch(ゲーマチ) 【ウマ娘】あんしん笹針師の選択肢はどれを選ぶべき? - Gamerch(ゲーマチ) 【ポケモンユナイト】アップデート情報・キャラ調整まとめ - ポケモンユナイト攻略Wiki - Gamerch(ゲーマチ) 【Apex】シーズン11の新要素と最新情報まとめ【エーペックス】 - Gamerch(ゲーマチ) ロストジャッジメント攻略Wiki - Gamerch(ゲーマチ) 【Among us】新マップThe Airship(エアシップ)の解説【アモングアス】 - Gamerch(ゲーマチ) ハーネスについて小児科医の立場から考える(坂本昌彦) - 個人 - Yahoo!ニュース - Yahoo!ニュース ゼルダ無双攻略Wiki|厄災の黙示録 - AppMedia(アップメディア) ウマ娘攻略Wiki - AppMedia(アップメディア) ゲトメア(ゲートオブナイトメア)攻略Wiki - Gamerch(ゲーマチ) 【白夜極光】リセマラ当たりランキング - 白夜 極光 wiki - Gamerch(ゲーマチ) お蔵入りとなった幻の『スーパーマリオ』 オランダの博物館でプレイ可能?(リアルサウンド) - Yahoo!ニュース - Yahoo!ニュース ナレッジ共有・社内wikiツール「NotePM」が「ITreview Best Software in Japan 2021」のTOP50に選出 - PR TIMES 真女神転生5攻略Wiki|メガテン5 - AppMedia(アップメディア) 【B4B】近接ビルドデッキにおすすめのカード【back4blood】 - Gamerch(ゲーマチ) ポケモンスナップ攻略wiki - AppMedia(アップメディア) 富野由悠季「ブレンパワード」作り直したい!ファンを前に意欲(シネマトゥデイ) - Yahoo!ニュース - Yahoo!ニュース 【ウマ娘】査定効率から見た取るべきスキルとおすすめキャラ【プリティーダービー】 - Gamerch(ゲーマチ) 【スマブラSP】カズヤの評価とコンボ【スマブラスペシャル】 - Gamerch(ゲーマチ) ナレッジ共有・社内wiki「NotePM」が「ITreview Grid Award 2021 Fall」で、チームコラボレーションとマニュアル作成部門において「Leader」を5期連続でW受賞! - PR TIMES メモ・ドキュメント・wiki・プロジェクト管理などオールインワンのワークスペース「Notion」が日本語ベータ版提供開始 - TechCrunch Japan 【ギアジェネ】リセマラ当たりランキング【コードギアス】 - ギアジェネ攻略Wiki - Gamerch(ゲーマチ) モンスターファーム2(MF2)攻略wiki|アプリ・Switch移植版 - AppMedia(アップメディア) 【ブラサジ】最強キャラTierランキング【ブラックサージナイト】 - Gamerch(ゲーマチ) 【パワプロ】鬼滅の刃コラボ情報まとめ - Gamerch(ゲーマチ) 【SPAJAM2021】第3回予選大会は「クイズ!WIKIにゃんず!」を開発したチーム「かよちゃんず」が最優秀賞! | gamebiz - SocialGameInfo 検索結果における「ナレッジパネル」の役割とは・・・ウィキメディア財団とDuckDuckGoの共同調査 - Media Innovation ナレッジ共有・社内wikiツール「NotePM」が「BOXIL SaaS AWARD 2021 Autumn」にて「コラボレーション部門」を受賞! - PR TIMES 【ポケモンユナイト】カメックスの評価と立ち回り【UNITE】 - Gamerch(ゲーマチ) Wikipediaが「中国人編集者の身の安全を守るため」に一部の編集者アカウントをBANに - GIGAZINE 【ドッカンバトル】3.5億ダウンロードキャンペーン最新情報 - ドッカンバトル攻略Wiki - Gamerch(ゲーマチ) BTS(防弾少年団)のV、8月のWikipedia閲覧数が韓国アーティストで1位!グループでは4ヶ月連続トップ - Kstyle 【イース6オンライン】リセマラ当たりランキング|召喚ガチャの開放条件は? - Gamerch(ゲーマチ) BacklogからNotePMへwiki情報を自動API連携する「Backlog to NotePM」をSaaStainerに掲載開始 - PR TIMES ライザのアトリエ2攻略Wiki - AppMedia(アップメディア) 真女神転生3リマスター攻略Wiki|メガテン3 - AppMedia(アップメディア) タスクも文書もWikiもデータベースもまとめて管理できる「Notion」とは? - ASCII.jp ナレッジ共有・社内wikiツール「NotePM」が、見るだけ専用ユーザー『無料』の新プランを発表! - PR TIMES 【かのぱず】リセマラ当たりランキング【彼女お借りします】 - Gamerch(ゲーマチ) 【乃木フラ】リセマラの必要はある?【乃木坂的フラクタル】 - Gamerch(ゲーマチ) メトロイド ドレッド攻略Wiki - Gamerch(ゲーマチ) 【パワプロ】生放送まとめ|パワフェス2021 - パワプロ攻略Wiki - Gamerch(ゲーマチ) ルーンファクトリー5攻略wiki|ルンファク5 - AppMedia(アップメディア) シャーマンキングふんばりクロニクル攻略Wiki - Gamerch(ゲーマチ) 簡単操作で自分専用Wikiを構築できるMarkdownエディタ「Obsidian」のモバイル版を使ってみた - GIGAZINE ディーサイドトロイメライ攻略Wiki - Gamerch(ゲーマチ) 情報マネジメントツール「Huddler」がwiki機能を刷新 - PR TIMES シェアエコ配送アプリ「DIAq(ダイヤク)」のアンカーアプリで、高層ビル・商業施設の入館方法などお役立ち情報をまとめた「DIAqwiki」を公開 - アットプレス(プレスリリース) 異常熱波のカナダで49.6度、いま北米で起きていること(森さやか) - 個人 - Yahoo!ニュース - Yahoo!ニュース 【ツイステ】マスターシェフの攻略~辛味のふるさと~【料理イベント】 - Gamerch(ゲーマチ) 【ラグナロクオリジン】リセマラは不要?おすすめ職業は?【ラグオリ】 - Gamerch(ゲーマチ) 白夜極光攻略wiki - AppMedia(アップメディア) 【バイオミュータント】2.02アプデ|アップデート1.4情報 - バイオミュータント攻略Wiki - Gamerch(ゲーマチ) ニーアレプリカントリメイク攻略wiki|ver.1.22 - AppMedia(アップメディア) 【ウマ娘】ゴルシウィークはいつから?キャンペーン情報まとめ - Gamerch(ゲーマチ) シーズン66 - 【超速GP】ミニ四駆 超速グランプリ攻略まとめwiki - 電撃オンライン 乃木坂的フラクタル攻略Wiki - Gamerch(ゲーマチ) 「こんなことになるとは…」13年前のエイプリルフールについた“嘘”がネットで… ある男の告白(BuzzFeed Japan) - Yahoo!ニュース - Yahoo!ニュース 【ウマ娘】DMM版のデータ連携のやり方とメリット【プリティーダービー】 - Gamerch(ゲーマチ) 整理不要の情報共有ツール(社内Wiki)「Nerve」シードラウンドで総額約3500万円の資金調達を実施 - PR TIMES Nerve - 整理不要の情報共有ツール(社内Wiki) ローンチカスタマー募集開始のお知らせ - PR TIMES パニシンググレイレイヴン(パニグレ)攻略wiki - Gamerch(ゲーマチ) 稲作アクションRPG『天穂のサクナヒメ』における「農林水産省攻略wiki説」は本当なのか? - AUTOMATON スタスマ攻略Wiki【スタースマッシュ】 - Gamerch(ゲーマチ) 無料とは思えない多機能っぷりなWikiインフラ「Wiki.js」レビュー、自前でホスト&外部サービスと連携可能 - GIGAZINE Microsoft Teamsの基本と活用(24) TeamsのWikiを使う - マイナビニュース 『ゲーミングお嬢様』での提起が話題に “企業系wiki”に横たわる問題点とは - リアルサウンド 「エイリアンのたまご」,自動周回機能と公式wikiが登場 - 4Gamer.net 【リゼロス】Re ゼロから始める異世界生活 Lost in Memories攻略まとめwiki - 電撃オンライン 【世界初!】モノの背景を全方位で執筆できるVintage Wiki「VOV」を正式リリース - PR TIMES 足もとのベストアンサーを“編集”! Wikiペディキュア! - ビューティ特集 | SPUR - SPUR.JP パワプロ2021/2020攻略Wiki - Gamerch(ゲーマチ) ヌーラボ、「Backlog」の絵文字入力の補完機能やWiki編集の自動マージ機能を改善 - CodeZine(コードジン) ヌーラボ、プロジェクト管理ツール「Backlog」の絵文字入力の補完機能・Wiki編集の自動マージ機能を修正改善 - PR TIMES アサルトリリィ Last Bullet 攻略Wiki【ラスバレ】 - Gamerch(ゲーマチ) SHOW BY ROCK!! Fes A Live攻略wiki - Gamerch(ゲーマチ) Backlog、Wikiにファイル添付が容易にできる機能をリリース -- グローバルバーの視認性改善なども実施 - PR TIMES GK川島、パンチング失点でWiki書き換え炎上 「セネガル代表」「プロボクサー」... - J-CASTニュース Wikipediaで「ヒト」を象徴する画像が、タイの男女に決まるまで 5年の激論を経て選ばれた「1枚」の物語 - WIRED.jp
https://w.atwiki.jp/usb_audio/pages/35.html
原文:Audio Device Document 1.0(PDF) USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 36 4 Descriptors The following sections describe the standard and class-specific USB descriptors for the Audio Interface Class. 4.1 Device Descriptor Because audio functionality is always considered to reside at the interface level, this class specification does not define a specific audio device descriptor. For audio-only devices, the device descriptor must indicate that class information is to be found at the interface level. Therefore, the bDeviceClass field of the device descriptor must contain zero so that enumeration software looks down at the interface level to determine the Interface Class. The bDeviceSubClass and bDeviceProtocol fields must be set to zero. All other fields of the device descriptor must comply with the definitions in Section 9.6.1, “Descriptor” of the USB Specification. There is no class-specific device descriptor. 4.2 Configuration Descriptor In analogy to the device descriptor, an audio configuration descriptor is applicable only in the case of audio-only devices. It is identical to the standard configuration descriptor defined in Section 9.6.2, “Configuration” of the USB Specification. There is no class-specific configuration descriptor. 4.3 AudioControl Interface Descriptors The AudioControl (AC) interface descriptors contain all relevant information to fully characterize the corresponding audio function. The standard interface descriptor characterizes the interface itself, whereas the class-specific interface descriptor provides pertinent information concerning the internals of the audio function. It specifies revision level information and lists the capabilities of each Unit and Terminal. 4.3.1 Standard AC Interface Descriptor The standard AC interface descriptor is identical to the standard interface descriptor defined in Section 9.6.3, “Interface” of the USB Specification, except that some fields have now dedicated values. Table 4-1 Standard AC Interface Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 9 1 bDescriptorType 1 Constant INTERFACE descriptor type 2 bInterfaceNumber 1 Number Number of interface. A zero-based value identifying the index in the array of concurrent interfaces supported by this configuration. 3 bAlternateSetting 1 Number Value used to select an alternate setting for the interface identified in the prior field. |4|bNumEndpoints|1|Number|Number of endpoints used by this interface (excluding endpoint 0). This number is either 0 or 1 if the optional status interrupt endpoint is present.| USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 37 Offset Field Size Value Description 5 bInterfaceClass 1 Class AUDIO. Audio Interface Class code (assigned by the USB). See Section A.1, “Audio Interface Class Code.” 6 bInterfaceSubClass 1 Subclass AUDIOCONTROL. Audio Interface Subclass code. Assigned by this specification. See Section A.2, “Audio Interface Subclass Codes.” 7 bInterfaceProtocol 1 Protocol Not used. Must be set to 0. 8 iInterface 1 Index Index of a string descriptor that describes this interface. dummy 4.3.2 Class-Specific AC Interface Descriptor The class-specific AC interface descriptor is a concatenation of all the descriptors that are used to fully describe the audio function, i.e. all Unit Descriptors (UDs) and Terminal Descriptors (TDs). The total length of the class-specific AC interface descriptor depends on the number of Units and Terminals in the audio function. Therefore, the descriptor starts with a header that reflects the total length in bytes of the entire class-specific AC interface descriptor in the wTotalLength field. The bcdADC field identifies the release of the Audio Device Class Specification with which this audio function and its descriptors are compliant. The bInCollection field indicates how many AudioStreaming and MIDIStreaming interfaces there are in the Audio Interface Collection to which this AudioControl interface belongs. The baInterfaceNr() array contains the interface numbers of all the AudioStreaming and MIDIStreaming interfaces in the Collection. The bInCollection and baInterfaceNr() fields together provide all necessary information to determine which interfaces together constitute the entire USB interface to the audio function, i.e. describe the Audio Interface Collection. The order in which the Unit and Terminal descriptors are reported is not important because every descriptor can be identified through its bDescriptorType and bDescriptorSubtype field. The bDescriptorType field identifies the descriptor as being a class-specific interface descriptor. The bDescriptorSubtype field further qualifies the exact nature of the descriptor. The following table defines the class-specific AC interface header descriptor. Table 4-2 Class-Specific AC Interface Header Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 8+n 1 bDescriptorType 1 Constant CS_INTERFACE descriptor type. 2 bDescriptorSubtype 1 Constant HEADER descriptor subtype. 3 bcdADC 2 BCD Audio Device Class Specification Release Number in Binary-Coded Decimal. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 38 Offset Field Size Value Description 5 wTotalLength 2 Number Total number of bytes returned for the class-specific AudioControl interface descriptor. Includes the combined length of this descriptor header and all Unit and Terminal descriptors. 7 bInCollection 1 Number The number of AudioStreaming and MIDIStreaming interfaces in the Audio Interface Collection to which this AudioControl interface belongs n 8 baInterfaceNr(1) 1 Number Interface number of the first AudioStreaming or MIDIStreaming interface in the Collection. … … … … … 8+(n-1) baInterfaceNr(n) 1 Number Interface number of the last AudioStreaming or MIDIStreaming interface in the Collection. This header is followed by one or more Unit and/or Terminal Descriptors. The layout of the descriptors depends on the type of Unit or Terminal they represent. There are seven types of Unit and Terminal Descriptors possible. They are summarized in the following sections. The first four fields are common for all Unit and Terminal Descriptors. They contain the Descriptor Length, Descriptor Type, Descriptor Subtype, and Unit or Terminal ID. Each Unit and Terminal within the audio function is assigned a unique identification number, the Unit ID (UID) or Terminal ID (TID), contained in the bUnitID or bTerminalID field of the descriptor. The value 0x00 is reserved for undefined ID, effectively restricting the total number of addressable Entities in the audio function (both Units and Terminals) to 255. Besides uniquely identifying all addressable Entities in an audio function, the IDs also serve to describe the topology of the audio function; i.e. the bSourceID field of a Unit or Terminal descriptor indicates to which other Unit or Terminal this Unit or Terminal is connected. 4.3.2.1 Input Terminal Descriptor The Input Terminal descriptor (ITD) provides information to the Host that is related to the functional aspects of the Input Terminal. The Input Terminal is uniquely identified by the value in the bTerminalID field. No other Unit or Terminal within the same alternate setting of the AudioControl interface may have the same ID. This value must be passed in the TerminalID field of each request that is directed to the Terminal. The wTerminalType field provides pertinent information about the physical entity that the Input Terminal represents. This could be a USB OUT endpoint, an external Line In connection, a microphone, etc. A complete list of Terminal Type codes is provided in a separate document, USB Audio Terminal Types, that is considered part of this specification. The bAssocTerminal field is used to associate an Output Terminal to this Input Terminal, effectively implementing a bi-directional Terminal pair. If the bAssocTerminal field is used, both associated Terminals must belong to the bi-directional Terminal Type group. If no association exists, the bAssocTerminal field must be set to zero. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 39 The Host software can treat the associated Terminals as being physically related. In many cases, one Terminal can not exist without the other. A typical example of such a Terminal pair is an Input Terminal, which represents the microphone, and an Output Terminal, which represents the earpiece of a headset. The bNrChannels, wChannelConfig and iChannelNames fields together constitute the cluster descriptor. They characterize the cluster that leaves the Input Terminal over the single Output Pin (‘downstream’ connection). For a detailed description of the cluster descriptor, see Section 3.7.2.3, “Audio Channel Cluster Format.” An index to a string descriptor is provided to further describe the Input Terminal. The following table presents an outline of the Input Terminal descriptor. Table 4-3 Input Terminal Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 12 1 bDescriptorType 1 Constant CS_INTERFACE descriptor type. 2 bDescriptorSubtype 1 Constant INPUT_TERMINAL descriptor subtype. 3 bTerminalID 1 Constant Constant uniquely identifying the Terminal within the audio function. This value is used in all requests to address this Terminal. 4 wTerminalType 2 Constant Constant characterizing the type of Terminal. See USB Audio Terminal Types. 6 bAssocTerminal 1 Constant ID of the Output Terminal to which this Input Terminal is associated. 7 bNrChannels 1 Number Number of logical output channels in the Terminal’s output audio channel cluster. 8 wChannelConfig 2 Bitmap Describes the spatial location of the logical channels. 10 iChannelNames 1 Index Index of a string descriptor, describing the name of the first logical channel. 11 iTerminal 1 Index Index of a string descriptor, describing the Input Terminal. 4.3.2.2 Output Terminal Descriptor The Output Terminal descriptor (OTD) provides information to the Host that is related to the functional aspects of the Output Terminal. The Output Terminal is uniquely identified by the value in the bTerminalID field. No other Unit or Terminal within the same alternate setting of the AudioControl interface may have the same ID. This value must be passed in the UnitID field of each request that is directed to the Terminal. The wTerminalType field provides pertinent information about the physical entity the Output Terminal represents. This could be a USB IN endpoint, an external Line Out connection, a speaker system etc. A USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 40 complete list of Terminal Type codes is provided in a separate document, USB Audio Terminal Types that is considered part of this specification. The bAssocTerminal field is used to associate an Input Terminal to this Output Terminal, effectively implementing a bi-directional Terminal pair. If the bAssocTerminal field is used, both associated Terminals must belong to the bi-directional Terminal Type group. If no association exists, the bAssocTerminal field must be set to zero. The Host software can treat the associated Terminals as being physically related. In many cases, one Terminal can not exist without the other. A typical example of such a Terminal pair is an Input Terminal, which represents the microphone, and an Output Terminal, which represents the earpiece of a headset. The bSourceID field is used to describe the connectivity for this Terminal. It contains the ID of the Unit or Terminal to which this Output Terminal is connected via its Input Pin. The cluster descriptor, describing the logical channels entering the Output Terminal is not repeated here. It is up to the Host software to trace the connection ‘upstream’ to locate the cluster descriptor pertaining to this audio channel cluster. An index to a string descriptor is provided to further describe the Output Terminal. The following table presents an outline of the Output Terminal descriptor. Table 4-4 Output Terminal Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 9 1 bDescriptorType 1 Constant CS_INTERFACE descriptor type. 2 bDescriptorSubtype 1 Constant OUTPUT_TERMINAL descriptor subtype. 3 bTerminalID 1 Constant Constant uniquely identifying the Terminal within the audio function. This value is used in all requests to address this Terminal. 4 wTerminalType 2 Constant Constant characterizing the type of Terminal. See USB Audio Terminal Types. 6 bAssocTerminal 1 Constant Constant, identifying the Input Terminal to which this Output Terminal is associated. 7 bSourceID 1 Constant ID of the Unit or Terminal to which this Terminal is connected. 8 iTerminal 1 Index Index of a string descriptor, describing the Output Terminal. 4.3.2.3 Mixer Unit Descriptor The Mixer Unit is uniquely identified by the value in the bUnitID field of the Mixer Unit descriptor (MUD). No other Unit or Terminal within the same alternate setting of the AudioControl interface may have the same ID. This value must be passed in the UnitID field of each request that is directed to the Mixer Unit. 1 - 6 - 11 - 16 - 21 - 26 - 31 - 36 - 41 - 46 - 51 - 56 - 61 - 66 - 71 - 76 - 81 - 86 - 91 - 96 - 101 - 106 - 111 - 116 - 121 - 126 ここを編集
https://w.atwiki.jp/usb_audio/pages/41.html
原文:Audio Device Document 1.0(PDF) USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 61 4.6.1 AS Isochronous Audio Data Endpoint Descriptors The standard and class-specific audio data endpoint descriptors provide pertinent information on how audio data streams are communicated to the audio function. In addition, specific endpoint capabilities and properties are reported. 4.6.1.1 Standard AS Isochronous Audio Data Endpoint Descriptor The standard AS isochronous audio data endpoint descriptor is identical to the standard endpoint descriptor defined in Section 9.6.4, “Endpoint,” of the USB Specification and further expanded as defined in the Universal Serial Bus Class Specification. D7 of the bEndpointAddress field indicates whether the endpoint is an audio source (D7 = 1) or an audio sink (D7 = 0). The bmAttributes Field bits are set to reflect the isochronous type of the endpoint. The synchronization type is indicated by D3..2 and must be set to Asynchronous, Adaptive or Synchronous. For further details, refer to Section 5.10.4.1, “Synchronous Type,” of the USB Specification. Table 4-20 Standard AS Isochronous Audio Data Endpoint Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 9 1 bDescriptorType 1 Constant ENDPOINT descriptor type 2 bEndpointAddress 1 Endpoint The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows D7 Direction. 0 = OUT endpoint 1 = IN endpoint D6..4 Reserved, reset to zero D3..0 The endpoint number, determined by the designer. 3 bmAttributes 1 Bit Map D3..2 Synchronization type 01 = Asynchronous 10 = Adaptive 11 = Synchronous D1..0 Transfer type 01 = Isochronous All other bits are reserved. 4 wMaxPacketSize 2 Number Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. This is determined by the audio bandwidth constraints of the endpoint. 6 bInterval 1 Number Interval for polling endpoint for data transfers expressed in milliseconds. Must be set to 1. 7 bRefresh 1 Number Reset to 0. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 62 Offset Field Size Value Description 8 bSynchAddress 1 Endpoint The address of the endpoint used to communicate synchronization information if required by this endpoint. Reset to zero if no synchronization pipe is used. 4.6.1.2 Class-Specific AS Isochronous Audio Data Endpoint Descriptor The bmAttributes field indicates which endpoint-specific Controls this endpoint supports through bits D6..0. Bit D7 is reserved to indicate whether the endpoint always needs USB packets of wMaxPacketSize length (D7 = 1) or that it can handle short packets (D7 = 0). In any case, the endpoint is required to support null packets. This bit must be used by the Host software to determine if the driver should pad all potential short packets (except null packets) with zero bytes to wMaxPacketSize length before sending them to an OUT endpoint. Likewise, when receiving data from an IN endpoint, the Host software must be prepared to receive more bytes than expected and discard the superfluous zero bytes. The bLockDelayUnits and wLockDelay fields are used to indicate to the Host how long it takes for the clock recovery circuitry of this endpoint to lock and reliably produce or consume the audio data stream. This information can be used by the Host to take appropriate action so that no meaningful data gets lost during the locking period. (for instance, sending digital silence during lock period) Depending on the implementation, the locking period can be a fixed amount of time or can be proportional to the sampling frequency. In this case, it usually takes a fixed amount of samples to become locked. To accommodate both cases, the bLockDelayUnits field indicates whether the wLockDelay field is expressed in time (milliseconds) or number of samples. Note Some implementations may use locking strategies that do not lead to either fixed time or fixed number of samples lock delay. In this case, a worst case value can be reported back to the Host. The bLockDelayUnits and wLockDelay fields are only applicable for synchronous and adaptive endpoints. For asynchronous endpoints, the clock is generated internally in the audio function and is completely independent. In this case, bLockDelayUnits and wLockDelay must be set to zero. Table 4-21 Class-Specific AS Isochronous Audio Data Endpoint Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 7 1 bDescriptorType 1 Constant CS_ENDPOINT descriptor type. 2 bDescriptorSubtype 1 Constant EP_GENERAL descriptor subtype. 3 bmAttributes 1 Bit Map A bit in the range D6..0 set to 1 indicates that the mentioned Control is supported by this endpoint. D0 Sampling Frequency D1 Pitch D6..2 Reserved Bit D7 indicates a requirement for wMaxPacketSize packets. D7 MaxPacketsOnly USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 63 Offset Field Size Value Description 4 bLockDelayUnits 1 Number Indicates the units used for the wLockDelay field 0 Undefined 1 Milliseconds 2 Decoded PCM samples 3..255 Reserved 5 wLockDelay Number Indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry. Units used depend on the value of the bLockDelayUnits field. 4.6.2 AS Isochronous Synch Endpoint Descriptor This descriptor is present only when one or more isochronous audio data endpoints of the adaptive source type or the asynchronous sink type are implemented. 4.6.2.1 Standard AS Isochronous Synch Endpoint Descriptor The isochronous synch endpoint descriptor is identical to the standard endpoint descriptor defined in Section 9.6.4, “Endpoint,” of the USB Specification and further expanded as defined in the Universal Serial Bus Class Specification. The bmAttributes field bits are set to reflect the isochronous type and synchronization type of the endpoint. Table 4-22 Standard AS Isochronous Synch Endpoint Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 9 1 bDescriptorType 1 Constant ENDPOINT descriptor type. 2 bEndpointAddress 1 Endpoint The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows D7 Direction. 0 = OUT endpoint for sources 1 = IN endpoint for sinks D6..4 Reserved, reset to zero D3..0 The endpoint number, determined by the designer. 3 bmAttributes 1 Bit Map D3..2 Synchronization type 00 = None D1..0 Transfer type 01 = Isochronous All other bits are reserved. 4 wMaxPacketSize 2 Number Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 64 Offset Field Size Value Description 6 bInterval 1 Number Interval for polling endpoint for data transfers expressed in milliseconds. Must be set to 1. 7 bRefresh 1 Number This field indicates the rate at which an isochronous synchronization pipe provides new synchronization feedback data. This rate must be a power of 2, therefore only the power is reported back and the range of this field is from 1 (2 ms) to 9 (512 ms). 8 bSynchAddress 1 Endpoint Must be reset to zero. 4.6.2.2 Class-Specific AS Isochronous Synch Endpoint Descriptor There is no class-specific AS isochronous synch endpoint descriptor. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 65 5 Requests 5.1 Standard Requests The Audio Device Class supports the standard requests described in Section 9, “USB Device Framework,” of the USB Specification. The Audio Device Class places no specific requirements on the values for the standard requests. 5.2 Class-Specific Requests Most class-specific requests are used to set and get audio related Controls. These Controls fall into two main groups those that manipulate the audio function Controls, such as volume, tone, selector position, etc. and those that influence data transfer over an isochronous endpoint, such as the current sampling frequency. · AudioControl Requests. Control of an audio function is performed through the manipulation of the attributes of individual Controls that are embedded in the Units of the audio function. The classspecific AudioControl interface descriptor contains a collection of Unit descriptors, each indicating which Controls are present in every Unit. AudioControl requests are always directed to the single AudioControl interface of the audio function. The request contains enough information (Unit ID, Channel Number, and Control Selector) for the audio function to decide to where a specific request must be routed. The same request layout can be used for vendor-specific requests to Extension Units. However, they are not covered by this specification. · AudioStreaming Requests. Control of the class-specific behavior of an AudioStreaming interface is performed through manipulation of either interface Controls or endpoint Controls. These can be either standard Controls, as defined in this specification or vendor-specific. In either case, the same request layout can be used. AudioStreaming requests are directed to the recipient where the Control resides. This can be either the interface or its associated isochronous endpoint. The Audio Device Class supports additional class-specific request · Memory Requests. Every addressable Entity in the audio function (Terminal, Unit, and endpoint) can expose a memory-mapped interface that provides the means to generically manipulate the Entity. Vendor-specific Control implementations could be based on this type of request. · The Get Status request is a general query to an Entity in the AudioControl interface or one of the Audio Streaming interfaces and does not manipulate Controls. In principle, all requests are optional. If an audio function does not support a certain request, it must indicate this by stalling the control pipe when that request is issued to the function. However, if a certain Set request is supported, the associated Get request must also be supported. Get requests may be supported without the associated Set request being supported. The rest of this section describes the class-specific requests used to manipulate both audio Controls and endpoint Controls. 5.2.1 Request Layout The following paragraphs describe the general structure of the Set and Get requests. Subsequent paragraphs detail the use of the Set/Get requests for the different request types. 1 - 6 - 11 - 16 - 21 - 26 - 31 - 36 - 41 - 46 - 51 - 56 - 61 - 66 - 71 - 76 - 81 - 86 - 91 - 96 - 101 - 106 - 111 - 116 - 121 - 126 ここを編集
https://w.atwiki.jp/usb_audio/pages/66.html
原文:Audio Devices Rev. 2.0 Spec and Adopters Agreement(ZIP) Universal Serial Bus Device Class Definition for Audio Data Formats Release 2.0 May 31, 2006 31 Name bmFormats PCM8 D1 IEEE_FLOAT D2 ALAW D3 MULAW D4 MPEG D5 AC-3 D6 WMA D7 IEC61937_AC-3 D8 IEC61937_MPEG-1_Layer1 D9 IEC61937_MPEG-1_Layer2/3 or IEC61937_MPEG-2_NOEXT D10 IEC61937_MPEG-2_EXT D11 IEC61937_MPEG-2_AAC_ADTS D12 IEC61937_MPEG-2_Layer1_LS D13 IEC61937_MPEG-2_Layer2/3_LS D14 IEC61937_DTS-I D15 IEC61937_DTS-II D16 IEC61937_DTS-III D17 IEC61937_ATRAC D18 IEC61937_ATRAC2/3 D19 TYPE_III_WMA D20 IEC60958_PCM D21 Reserved. Must be set to 0. D31..D22 A.3 Side Band Protocol Codes Table A-6 Side Band Protocol Codes Protocol Code Value PROTOCOL_UNDEFINED 0x00 Universal Serial Bus Device Class Definition for Audio Data Formats Release 2.0 May 31, 2006 32 Protocol Code Value PRES_TIMESTAMP_PROTOCOL 0x01 1 - 6 - 11 - 16 - 21 - 26 - 31 ここを編集
https://w.atwiki.jp/usb_audio/pages/40.html
原文:Audio Device Document 1.0(PDF) USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 56 Extension Unit is not available in this case because it is bypassed). Default behavior is assumed when set to off. In the case of a single Input Pin, logical channels that enter the Extension Unit are passed unaltered for those channels that are also present in the output cluster. Logical channels not available in the output cluster are absorbed by the Extension Unit. Logical channels present in the output cluster but unavailable in the input cluster are muted. In case of multiple Input Pins, corresponding logical input channels are equally mixed together before being passed to the output. An index to a string descriptor is provided to further describe the Extension Unit. The following table outlines the Extension Unit descriptor. Table 4-15 Extension Unit Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 13+p+n 1 bDescriptorType 1 Constant CS_INTERFACE descriptor type. 2 bDescriptorSubtype 1 Constant EXTENSION_UNIT descriptor subtype. 3 bUnitID 1 Number Constant uniquely identifying the Unit within the audio function. This value is used in all requests to address this Unit. 4 wExtensionCode 2 Constant Vendor-specific code identifying the Extension Unit. 6 bNrInPins 1 Number Number of Input Pins of this Unit p 7 baSourceID(1) 1 Number ID of the Unit or Terminal to which the first Input Pin of this Extension Unit is connected. … … … … … 7+(p-1) baSourceID (p) 1 Number ID of the Unit or Terminal to which the last Input Pin of this Extension Unit is connected. 7+p bNrChannels 1 Number Number of logical output channels in the audio channel cluster of the Extension Unit. 7+p+1 wChannelConfig 2 Bitmap Describes the spatial location of the logical channels in the audio channel cluster of the Extension Unit. 7+p+3 iChannelNames 1 Index Index of a string descriptor, describing the name of the first logical channel in the audio channel cluster of the Extension Unit. 11+p bControlSize 1 Number Size, in bytes, of the bmControls field n USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 57 Offset Field Size Value Description 12+p bmControls n Bitmap A bit set to 1 indicates that the mentioned Control is supported D0 Enable Processing D1..(n*8-1) Reserved 12+p+n iExtension 1 Index Index of a string descriptor, describing this Extension Unit. 4.3.2.8 Associated Interface Descriptor The Associated Interface descriptor provides a means to indicate a relationship between a Terminal or a Unit and an interface, external to the audio function. It directly follows the Entity descriptor to which it is related. The bInterfaceNr field contains the interface number of the associated interface. The remainder of the descriptor depends both on the Entity to which it is related and on the interface class of the target interface. At this moment, no specific layouts are defined by this specification. The following table outlines the Associated Interface descriptor. Table 4-16 Associated Interfaces Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 4+x 1 bDescriptorType 1 Constant CS_INTERFACE descriptor type. 2 bDescriptorSubtype 1 Constant ASSOC_INTERFACE descriptor subtype. 3 bInterfaceNr 1 Number The interface number of the associated interface. 4 Association-specific x Number Association-specific extension to the open-ended descriptor. 4.4 AudioControl Endpoint Descriptors The following sections describe all possible endpoint-related descriptors for the AudioControl interface. 4.4.1 AC Control Endpoint Descriptors 4.4.1.1 Standard AC Control Endpoint Descriptor Because endpoint 0 is used as the AudioControl control endpoint, there is no dedicated standard control endpoint descriptor. 4.4.1.2 Class-Specific AC Control Endpoint Descriptor There is no dedicated class-specific control endpoint descriptor. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 58 4.4.2 AC Interrupt Endpoint Descriptors 4.4.2.1 Standard AC Interrupt Endpoint Descriptor The interrupt endpoint descriptor is identical to the standard endpoint descriptor defined in Section 9.6.4, “Endpoint,” of the USB Specification and further expanded as defined in the Universal Serial Bus Class Specification. Its fields are set to reflect the interrupt type of the endpoint. This endpoint is optional. The following table outlines the standard AC Interrupt Endpoint descriptor. Table 4-17 Standard AC Interrupt Endpoint Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 9 1 bDescriptorType 1 Constant ENDPOINT descriptor type 2 bEndpointAddress 1 Endpoint The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows D7 Direction. 1 = IN endpoint D6..4 Reserved, reset to zero D3..0 The endpoint number, determined by the designer. 3 bmAttributes 1 Bit Map D3..2 Synchronization type 00 = None D1..0 Transfer type 11 = Interrupt All other bits are reserved. 4 wMaxPacketSize 2 Number Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. Used here to pass 2-byte status information. Set to 2 if not shared, set to the appropriate value if shared. 6 bInterval 1 Number Left to the designer’s discretion. A value of 10 ms or more seems sufficient. 7 bRefresh 1 Number Reset to 0. 8 bSynchAddress 1 Endpoint Reset to 0. 4.4.2.2 Class-Specific AC Interrupt Endpoint Descriptor There is no class-specific AudioControl interrupt endpoint descriptor. 4.5 AudioStreaming Interface Descriptors The AudioStreaming (AS) interface descriptors contain all relevant information to characterize the AudioStreaming interface in full. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 59 4.5.1 Standard AS Interface Descriptor The standard AS interface descriptor is identical to the standard interface descriptor defined in Section 9.6.3, “Interface,” of the USB Specification, except that some fields now have dedicated values. Table 4-18 Standard AS Interface Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 9 1 bDescriptorType 1 Constant INTERFACE descriptor type 2 bInterfaceNumber 1 Number Number of interface. A zero-based value identifying the index in the array of concurrent interfaces supported by this configuration. 3 bAlternateSetting 1 Number Value used to select an alternate setting for the interface identified in the prior field. 4 bNumEndpoints 1 Number Number of endpoints used by this interface (excluding endpoint 0). 5 bInterfaceClass 1 Class AUDIO Audio Interface Class code (assigned by the USB). See Section A.1, “Audio Interface Class Code.” 6 bInterfaceSubClass 1 Subclass AUDIO_STREAMING Audio Interface Subclass code. Assigned by this specification. See Section A.2, “Audio Interface Subclass Codes.” 7 bInterfaceProtocol 1 Protocol Not used. Must be set to 0. 8 iInterface 1 Index Index of a string descriptor that describes this interface. 4.5.2 Class-Specific AS Interface Descriptor The bTerminalLink field contains the unique Terminal ID of the Input or Output Terminal to which this interface is connected. The bDelay field holds a value that is a measure for the delay that is introduced in the audio data stream due to internal processing of the signal within the audio function. The Host software can take this value into account when phase relations between audio streams, processed by different audio functions, are important. The wFormatTag field holds information about the Audio Data Format that should be used when communicating with this interface. If the interface has a USB isochronous endpoint associated with it, the wFormatTag field describes the Audio Data Format that should be used when exchanging data with this endpoint. If the interface has no endpoint, the wFormatTag field describes the Audio Data Format that is used on the (external) connection this interface represents. This specification defines a number of standard Formats, ranging from Mono 8-bit PCM to MPEG2 7.1 encoded audio streams. A complete list of supported Audio Data Formats is provided in a separate document, USB Audio Data Formats, that is considered part of this specification. Further specific USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 60 information concerning the Audio Data Format for this interface is reported in a separate type-specific descriptor, see Section 4.5.3, “Class-Specific AS Format Type Descriptor.” This can optionally be supplemented by format-specific information through a format-specific descriptor, see Section 4.5.4, “Class-Specific AS Format-Specific Descriptor.” Table 4-19 Class-Specific AS Interface Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor in bytes 7 1 bDescriptorType 1 Constant CS_INTERFACE descriptor type. 2 bDescriptorSubtype 1 Constant AS_GENERAL descriptor subtype. 3 bTerminalLink 1 Constant The Terminal ID of the Terminal to which the endpoint of this interface is connected. 4 bDelay 1 Number Delay (d) introduced by the data path (see Section 3.4, “Inter Channel Synchronization”). Expressed in number of frames. 5 wFormatTag 2 Number The Audio Data Format that has to be used to communicate with this interface. 4.5.3 Class-Specific AS Format Type Descriptor The wFormatTag field in the class-specific AS Interface Descriptor implicitly indicates which Format Type should be used to communicate with the connection (USB or external) this interface represents. (Each Audio Data Format belongs to a certain Format Type as outlined in USB Audio Data Formats.) Each Format Type has a specific Format Type descriptor associated with it. This class-specific AS Format Type descriptor follows the class-specific AS interface descriptor and delivers format type-specific information to the Host. The details and layout of this descriptor for each of the supported Format Types is found in USB Audio Data Formats. 4.5.4 Class-Specific AS Format-Specific Descriptor As stated earlier, the wFormatTag field in the class-specific AS Interface Descriptor not only describes to what Format Type the interface belongs. It also states exactly what Audio Data Format should be used to communicate with the connection (USB or external) this interface represents. Some Audio Data Formats need additional format-specific information conveyed to the Host. Therefore, the Format Type descriptor may be followed by a class-specific AS format-specific descriptor. The details and layout of this descriptor for the Audio Data Formats that need it, is outlined in USB Audio Data Formats. 4.6 AudioStreaming Endpoint Descriptors The following sections describe all possible endpoint-related descriptors for the AudioStreaming interface. 1 - 6 - 11 - 16 - 21 - 26 - 31 - 36 - 41 - 46 - 51 - 56 - 61 - 66 - 71 - 76 - 81 - 86 - 91 - 96 - 101 - 106 - 111 - 116 - 121 - 126 ここを編集
https://w.atwiki.jp/usb_audio/pages/48.html
原文:Audio Device Document 1.0(PDF) USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 96 Pitch Control, etc.) If the request specifies an unknown CS to that endpoint, the control pipe must indicate a stall. For a description of the parameter block for the endpoint Control Selectors, see Section 5.2.3.2.3, “Endpoint Controls.” 5.2.3.2.3 Endpoint Controls 5.2.3.2.3.1 Sampling Frequency Control The Sampling Frequency Control is used to set the initial sampling frequency for an isochronous audio data endpoint. This allows the endpoints’ clock recovery system to lock onto the incoming clock much faster. Adaptive endpoints can benefit from this. The Sampling Frequency Control can support all possible Control attributes (CUR, MIN, MAX, and RES). The settings for the CUR, MIN, and MAX attributes can range from 0 Hz (0x000000) to 8388607 Hz (0x7FFFFF) in steps of 1 Hz (0x0001). The Sampling Frequency Control honors the request to the best of its abilities. If the endpoint operates at a fixed sampling frequency, setting this Control has no effect. If the endpoint supports a discrete number of sampling frequencies, setting the tSampleFreq value to a non-supported value causes the Control to round it to the closest available value. This also happens when the sampling frequency is set outside the range for a continuous sampling frequency endpoint. It will report the rounded setting when queried during a Get Control request. Table 5-58 Sampling Frequency Control Parameter Block Control Selector SAMPLING_FREQ_CONTROL wLength 3 Offset Field Size Value Description 0 tSampleFreq 3 Number The sampling frequency expressed in Hz. 5.2.3.2.3.2 Pitch Control The Pitch Control enables or disables the ability of an adaptive endpoint to dynamically track its sampling frequency. The Control is necessary because the clock recovery circuitry must be informed whether it should allow for relatively large swings in the sampling frequency. A Pitch Control can have only the current setting attribute (CUR). The position of a Pitch Control CUR attribute can be either TRUE or FALSE. Table 5-59 Pitch Control Parameter Block Control Selector PITCH_CONTROL wLength 1 Offset Field Size Value Description 0 bPitchEnable 1 Bool Pitch Control on when TRUE, off when FALSE. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 97 5.2.4 Additional Requests 5.2.4.1 Memory Requests The Host can interact with an addressable Entity (Terminal, Unit or endpoint) within the audio function in a very generic way. The Entity presents a memory space to the Host whose layout depends on the implementation. The Memory request provides full access to this memory space. 5.2.4.1.1 Set Memory Request This request is used to download a parameter block into a particular Entity of the audio function. Table 5-60 Set Memory Request Values bmRequest Type bRequest wValue wIndex wLength Data 00100001B Entity ID and Interface 00100010B SET_MEM Offset Endpoint Length of parameter block Parameter block The bRequest field indicates that the MEM attribute of the Entity is addressed. The wValue field specifies a zero-based offset value that can be used to access only parts of the Entity’s memory space. The layout of the parameter block is implementation dependent. A device is required to reevaluate its memory space at the end of each Set Memory request. 5.2.4.1.2 Get Memory Request This request is used to upload a parameter block from a particular Entity of the audio function. Table 5-61 Get Memory Request Values bmRequest Type bRequest wValue wIndex wLength Data 10100001B Entity ID and Interface 10100010B GET_MEM Offset Endpoint Length of parameter block Parameter block The bRequest field indicates that the MEM attribute of the Entity is addressed. The wValue field specifies a zero-based offset value that can be used to access only parts of the Entity’s parameter space. The layout of the parameter block is implementation dependent. 5.2.4.2 Get Status Request This request is used to retrieve status information from an Entity within the audio function. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 98 Table 5-62 Get Status Request Values bmRequest Type bRequest wValue wIndex wLength Data 10100001B Entity ID and Interface 10100010B GET_STAT Zero Endpoint Status message length Status message The bRequest field contains the GET_STAT constant, defined in Section A.9, “Audio Class-Specific Request Codes.” The wValue field is currently unused and must be set to zero. The wLength field specifies the number of bytes to return. If the status message is longer than the wLength field, only the initial bytes of the status message are returned. If the status message is shorter than the wLength field, the function indicates the end of the control transfer by sending short packet when further data is requested. The contents of the status message is reserved for future use. For the time being, a null packet should be returned in the data stage of the control transfer. USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 99 Appendix A. Audio Device Class Codes A.1 Audio Interface Class Code Table A-1 Audio Interface Class Code Audio Interface Class Code Value AUDIO 0x01 A.2 Audio Interface Subclass Codes Table A-2 Audio Interface Subclass Codes Audio Subclass Code Value SUBCLASS_UNDEFINED 0x00 AUDIOCONTROL 0x01 AUDIOSTREAMING 0x02 MIDISTREAMING 0x03 A.3 Audio Interface Protocol Codes Table A-3 Audio Interface Protocol Codes Audio Protocol Code Value PR_PROTOCOL_UNDEFINED 0x00 A.4 Audio Class-Specific Descriptor Types Table A-4 Audio Class-specific Descriptor Types Descriptor Type Value CS_UNDEFINED 0x20 CS_DEVICE 0x21 CS_CONFIGURATION 0x22 CS_STRING 0x23 CS_INTERFACE 0x24 CS_ENDPOINT 0x25 USB Device Class Definition for Audio Devices Release 1.0 March 18, 1998 100 A.5 Audio Class-Specific AC Interface Descriptor Subtypes Table A-5 Audio Class-Specific AC Interface Descriptor Subtypes Descriptor Subtype Value AC_DESCRIPTOR_UNDEFINED 0x00 HEADER 0x01 INPUT_TERMINAL 0x02 OUTPUT_TERMINAL 0x03 MIXER_UNIT 0x04 SELECTOR_UNIT 0x05 FEATURE_UNIT 0x06 PROCESSING_UNIT 0x07 EXTENSION_UNIT 0x08 A.6 Audio Class-Specific AS Interface Descriptor Subtypes Table A-6 Audio Class-Specific AS Interface Descriptor Subtypes Descriptor Subtype Value AS_DESCRIPTOR_UNDEFINED 0x00 AS_GENERAL 0x01 FORMAT_TYPE 0x02 FORMAT_SPECIFIC 0x03 A.7 Processing Unit Process Types Table A-7 Processing Unit Process Types wProcessType Value PROCESS_UNDEFINED 0x00 UP/DOWNMIX_PROCESS 0x01 DOLBY_PROLOGIC_PROCESS 0x02 3D_STEREO_EXTENDER_PROCESS 0x03 REVERBERATION_PROCESS 0x04 1 - 6 - 11 - 16 - 21 - 26 - 31 - 36 - 41 - 46 - 51 - 56 - 61 - 66 - 71 - 76 - 81 - 86 - 91 - 96 - 101 - 106 - 111 - 116 - 121 - 126 ここを編集
https://w.atwiki.jp/usb_audio/pages/25.html
原文:Audio Data Formats 1.0(PDF) USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 21 The Scaling Control can support all possible Control attributes (CUR, MIN, MAX, and RES). The valid range for the CUR, MIN, MAX, and RES attributes is from zero (0x00) to 255/256 (0xFF). The Scaling Control honors the request to the best of its abilities. It may round the bScale attribute value to its closest available setting. It will report this rounded setting when queried during a Get MPEG Control request. Table 2-14 Scaling Control Parameter Block Control Selector MP_SCALING_CONTROL wLength 1 Offset Field Size Value Description 0 bScale 1 Number The setting for the attribute of the Scaling Control. 2.3.8.1.2.3.6 High/Low Scaling Control The High/Low Scaling Control is used to manipulate the two scaling coefficients used by MPEG decoders that implement an independent boost and cut scaling value for Dynamic Range Control (D5..4 = ‘11’ in the bmMPEGFeatures field of the MPEG format-specific descriptor). If this Control is addressed on a non-‘11’ decoder, the control pipe must indicate a stall. The High/Low Scaling Control can support all possible Control attributes (CUR, MIN, MAX, and RES). The valid range for the CUR, MIN, MAX, and RES attributes is from zero (0x00) to 255/256 (0xFF). The High/Low Scaling Control honors the request to the best of its abilities. It may round the bLowScale and bHighScale attribute values to their closest available settings. It will report these rounded settings when queried during a Get MPEG Control request. The bLowScale value is used by the MPEG decoder to scale the Dynamic Range control words that apply a gain increase (for low sound levels). The bHighScale value is used by the MPEG decoder to scale the Dynamic Range control words that apply a gain reduction (for high level sounds). Table 2-15 High/Low Scaling Control Parameter Block Control Selector MP_HILO_SCALING_CONTROL wLength 2 Offset Field Size Value Description 0 bLowScale 1 Number The setting for the attribute of the low level Scaling Control. 1 bHighScale 1 Number The setting for the attribute of the high level Scaling Control. 2.3.8.2 AC-3 Format In the current specification, only AC-3 decoding aspects are considered. Real-time AC-3 encoding peripherals are not (yet) available and consequently are not covered by this specification. 2.3.8.2.1 AC-3 Format-Specific Descriptor The wFormatTag field is a duplicate of the wFormatTag field in the class-specific AudioStreaming interface descriptor. The same field is used here to identify the format-specific descriptor. USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 22 The bmBSID bitmap field describes which bit stream ID modes this decoder is capable of processing. BSID modes can range from 0 to 31. A bit set indicates that BSID mode [bit_position] is supported. Standard AC-3 decoders must be capable of processing at least BSID modes 0 to 8. Therefore, the lower 9 bits of the bmBSID field must be set. The bmAC3Features bitmap field indicates compression-related features. Bits D3..0 indicate which mode the decoder supports. To ease the design of decoder products, Dolby Digital ICs offer standard operating modes called “Line Mode” and “RF Mode.” These modes are included within the Dolby Digital decoder IC itself, thus greatly simplifying the implementation of dialog normalization, dynamic range control and downmixing functions, all of which are necessary in Dolby Digital products. Two “Custom Modes” offer additional design flexibility aimed at more esoteric audio products for which additional implementation cost and complexity are not of primary concern. Bits D5..4. indicate which type of Dynamic Range Control the AC-3 decoder supports. Some decoders do not implement DRC (D5..4 = ‘00’). If implemented, the DRC can either use the stream embedded gain parameters as is (D5..4 = ‘01’) or can provide for additional DRC scaling factors either a single scaling factor that influences both the boost and cut value simultaneously (D5..4 = ‘10’), or a separate scaling factor for the boost and the cut value (D5..4 = ‘11’) All other bits are reserved. Table 2-16 AC-3 Format-Specific Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 10 1 bDescriptorType 1 Constant CS_INTERFACE descriptor type. 2 bDescriptorSubtype 1 Constant FORMAT_SPECIFIC descriptor subtype. 3 wFormatTag 2 Constant AC-3. Constant identifying the precise format the AudioStreaming interface is using. 5 bmBSID 4 Bitmap A bit set to 1 indicates that the corresponding BSID mode is supported. 9 bmAC3Features 1 Bitmap A bit set to 1 indicates that the mentioned feature is supported D0 RF modeD1 Line modeD2 Custom0 modeD3 Custom1 modeD5..4 Internal Dynamic Range Control 00 = not supported.01 = supported but not scalable.10 = scalable, common boost and cut scaling value.11 = scalable, separate boost and cut scaling value.D7..6 Reserved USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 23 2.3.8.2.2 AC-3 Format-Specific Requests The following paragraphs describe the Set and Get AC-3 Control requests. 2.3.8.2.2.1 Set AC-3 Control Request This request is used to set an attribute of an AC-3 Control inside an AudioStreaming interface of the audio function. Table 2-17 Set AC-3 Control Request Values bmRequest Type bRequest wValue wIndex wLength Data 00100001B SET_CURSET_MINSET_MAXSET_RES CS Zero and Interface Length of Parameter block Parameter Block The bRequest field indicates which attribute the request is manipulating. The MIN, MAX, and RES attributes are usually not supported for the Set request. Further details on which attributes are supported for which Controls can be found in Section 2.3.8.2.2.3, “AC-3 Controls.” The wValue field specifies the Control Selector (CS) in the high byte and zero in the low byte. The Control Selector indicates which type of control this request is manipulating. If the request specifies an unknown or unsupported CS to that interface, the control pipe must indicate a stall. For a description of the parameter blocks for the different Controls that can be addressed through the Set AC-3 Control request, see Section 2.3.8.2.2.3, “AC-3 Controls.” 2.3.8.2.2.2 Get AC-3 Control Request This request returns the attribute setting of a specific AC-3 Control inside an AudioStreaming interface of the audio function. Table 2-18 Get AC-3 Control Request Values bmRequest Type bRequest wValue wIndex wLength Data 10100001B SET_CURSET_MINSET_MAXSET_RES CS Zero and Interface Length of Parameter block Parameter Block The bRequest field indicates which attribute the request is reading. The wValue field specifies the Control Selector (CS) in the high byte and zero in the low byte. The Control Selector indicates which type of control this request is addressing. If the request specifies an unknown or unsupported CS to that interface, the control pipe must indicate a stall. For a description of the parameter blocks for the different Controls that can be addressed through the Get AC-3 Control request, see Section 2.3.8.2.2.3, “AC-3 Controls.” 2.3.8.2.2.3 AC-3 Controls The following paragraphs present a detailed description of all possible AC-3 Controls an AudioStreaming interface can incorporate. For each Control, the layout of the parameter block together with the USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 24 appropriate Control Selector are listed. The Control Selector codes are defined in Section A.3.2, “AC-3 Control Selectors.” 2.3.8.2.2.3.1 Mode Control The Mode Control is used to change the compression mode of the AC-3 decoder in the AudioStreaming interface. A Mode Control can only support the CUR attribute. The valid range for the CUR attribute is described through the bmComprFeatures field of the AC-3 format-specific descriptor. Bits D3..0 describe which compression modes the AC-3 decoder supports. Valid values are · 0 RF mode · 1 Line mode · 2 Custom0 mode · 3 Custom1 mode If the Mode Control request specifies an unsupported mode, the control pipe must indicate a stall. The current setting can be queried during a Get AC-3 Control request. Table 2-19 Mode Control Parameter Block Control Selector AC_MODE_CONTROL wLength 1 Offset Field Size Value Description 0 bMode 1 Number The setting for the attribute of the Compression Mode Control 0 RF mode1 Line mode2 Custom0 mode3 Custom1 modeAll other values are reserved. 2.3.8.2.2.3.2 Dynamic Range Control The Dynamic Range Control (DRC) is used to enable or disable the Dynamic Range Control functionality of the decoder. The Dynamic Range Control can have only the current setting attribute (CUR). The position of the Dynamic Range Control switch can be either TRUE or FALSE. TRUE means that the AC- 3 decoder is using the Dynamic Range control words (possibly with additional scaling) contained in the AC-3 bit stream to control the audio dynamic range. FALSE means the control words are being ignored and the original signal dynamic range is being reproduced. The current setting of the Control can be queried using a Get AC-3 Control request. Table 2-20 Dynamic Range Control Parameter Block Control Selector MP_DYN_RANGE_CONTROL wLength 1 USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 25 Offset Field Size Value Description 0 bEnable 1 Bool The setting for the Dynamic Range Control CUR attribute. Enabled when TRUE, disabled when FALSE. 2.3.8.2.2.3.3 Scaling Control The Scaling Control is used to manipulate the single scaling coefficient used by AC-3 decoders that implement a common boost/cut scaling value for Dynamic Range Control. (D5..4 = ‘10’ in the bmAC3Features field of the AC-3 format-specific descriptor.) If this Control is addressed on a non-‘10’ decoder, the control pipe must indicate a stall. The Scaling Control can support all possible Control attributes (CUR, MIN, MAX, and RES). The valid range for the CUR, MIN, MAX, and RES attributes is from zero (0x00) to 255/256 (0xFF). The Scaling Control honors the request to the best of its abilities. It may round the bScale attribute value to its closest available setting. It will report this rounded setting when queried during a Get AC-3 Control request. Table 2-21 Scaling Control Parameter Block Control Selector AC_SCALING_CONTROL wLength 1 Offset Field Size Value Description 0 bScale 1 Number The setting for the attribute of the Scaling Control. 2.3.8.2.2.3.4 High/Low Scaling Control The High/Low Scaling Control is used to manipulate the two scaling coefficients used by AC-3 decoders that implement an independent boost and cut scaling value for Dynamic Range Control. (D5..4 = ‘11’ in the bmAC3Features field of the AC-3 format-specific descriptor.) If this Control is addressed on a non- ‘11’ decoder, the control pipe must indicate a stall. The High/Low Scaling Control can support all possible Control attributes (CUR, MIN, MAX, and RES). The valid range for the CUR, MIN, MAX, and RES attributes is from zero (0x00) to 255/256 (0xFF). The High/Low Scaling Control honors the request to the best of its abilities. It may round the bLowScale and bHighScale attribute values to their closest available settings. It will report these rounded settings when queried during a Get AC-3 Control request. The bLowScale value is used by the AC-3 decoder to scale the Dynamic Range control words which apply a gain increase (for low sound levels). The bHighScale value is used by the AC-3 decoder to scale the Dynamic Range control words which apply a gain reduction (for high level sounds). Table 2-22 High/Low Scaling Control Parameter Block Control Selector AC_HILO_SCALING_CONTROL wLength 2 1 - 6 - 11 - 16 - 21 - 26 - 31 ここを編集
https://w.atwiki.jp/usb_audio/pages/23.html
原文:Audio Data Formats 1.0(PDF) USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 16 Bit D6 indicates that the multilingual information that is encoded at normal sampling rates (32 kHz, 44.1 kHz or 48 kHz). This bit is only applicable for MPEG-2 decoders. Bit D7 indicates that the decoder is capable of processing streams that are encoded using adaptive multichannel prediction. Bits D9..8 indicate if the decoder can process embedded multilingual information. Multilingual capabilities can consist of being able to process multilingual information encoded at the same sampling frequency as the main audio channels (D9..8 = ‘01’). Some decoders may provide the additional capability to process multilingual information encoded at half the sampling frequency of the main audio channels (D9..8 = ‘11’). Bits D15..10 are reserved for future extensions. The bmMPEGFeatures field indicates compression-related features. Bits D5..4 report which type of Dynamic Range Control the MPEG decoder supports. Some decoders do not implement DRC (D5..4 = ‘00’). If implemented, the DRC can either use the stream embedded gain parameters as is (D5..4 = ‘01’) or can provide for additional DRC scaling factors, either a single scaling factor that influences both the boost and cut value simultaneously (D5..4 = ‘10’) or a separate scaling factor for the boost and the cut value (D5..4 = ‘11’) All other bits are reserved. Table 2-7 MPEG Format-Specific Descriptor Offset Field Size Value Description 0 bLength 1 Number Size of this descriptor, in bytes 9 1 bDescriptorType 1 Constant CS_INTERFACE descriptor type. 2 bDescriptorSubtype 1 Constant FORMAT_SPECIFIC descriptor subtype. 3 wFormatTag 2 Constant MPEG. Constant identifying the precise format the AudioStreaming interface is using. USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 17 Offset Field Size Value Description 5 bmMPEGCapabilities 2 Bitmap Bitmap identifying the MPEG capabilities of the decoder. A bit set indicates that the capability is supported D2..0 Layer support D0 = Layer ID1 = Layer IID2 = Layer IIID3 MPEG-1 only.D4 MPEG-1 dual-channel.D5 MPEG-2 second stereo.D6 MPEG-2 7.1 channel augmentation.D7 Adaptive multi-channel prediction.D9..8 MPEG-2 multilingual support 00 = Not supported01 = Supported at Fs10 = Reserved11 = Supported at Fs and ½Fs.D15..10 Reserved. 7 bmMPEGFeatures 1 Bitmap Bitmap identifying the features the decoder supports. A bit set indicates that the feature is supported D3..0 Reserved.D5..4 Internal Dynamic Range Control 00 = not supported.01 = supported but not scalable.10 = scalable, common boost and cut scaling value.11 = scalable, separate boost and cut scaling value.D7..6 Reserved. 2.3.8.1.2 MPEG Format-Specific Requests The following paragraphs describe the Set and Get MPEG Control requests. Some of the requests control parameters that are also dependent on the content of the incoming MPEG data stream. In general, the behavior of the MPEG decoder is primarily controlled by the incoming bitstream. Parameters set using MPEG Control requests retain their setting, even if that setting is not applicable to the current incoming bitstream. As an example, consider a decoder that is receiving a stream containing two independent stereo channel pairs. In this case, the Select Second Stereo Control can be enabled so that the second stereo channel is reproduced over the Left and Right channel. If the incoming stream is now switched to a full 5.1 encoded stream, the Select Second Stereo Control has no more influence and the decoder overrides its setting and produces full 5.1 sound. However, if the incoming stream switches back to the previous format, the Select Second Stereo Control becomes active again and resumes its previous setting so that the second stereo channel is reproduced again over the Left and Right channel. USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 18 2.3.8.1.2.1 Set MPEG Control Request This request is used to set an attribute of an MPEG Control inside an AudioStreaming interface of the audio function. Table 2-8 Set MPEG Control Request Values bmRequest Type bRequest wValue wIndex wLength Data 00100001B SET_CURSET_MINSET_MAXSET_RES CS Zero and Interface Length of parameter block Parameter plock The bRequest field indicates which attribute the request is manipulating. The MIN, MAX and RES attributes are usually not supported for the Set request. Further details on which attributes are supported for which Controls can be found in Section 2.3.8.1.2.3, “MPEG Controls.” The wValue field specifies the Control Selector (CS) in the high byte and zero in the low byte. The Control Selector indicates which type of control this request is manipulating. If the request specifies an unknown or unsupported CS to that interface, the control pipe must indicate a stall. For a description of the parameter blocks for the different Controls that can be addressed through the Set AC-3 Control request, see Section 2.3.8.1.2.3, “MPEG Controls.” 2.3.8.1.2.2 Get MPEG Control Request This request returns the attribute setting of a specific MPEG Control inside an AudioStreaming interface of the audio function. Table 2-9 Get MPEG Control Request Values bmRequest Type bRequest wValue wIndex wLength Data 10100001B GET_CURGET_MINGET_MAXGET_RES CS Zero and Interface Length of parameter block Parameter block The bRequest field indicates which attribute the request is reading. The wValue field specifies the Control Selector (CS) in the high byte and zero in the low byte. The Control Selector indicates which type of control this request is addressing. If the request specifies an unknown or unsupported CS to that interface, the control pipe must indicate a stall. For a description of the parameter blocks for the different Controls that can be addressed through the Get AC-3 Control request, see Section 2.3.8.1.2.3, “MPEG Controls.” 2.3.8.1.2.3 MPEG Controls The following paragraphs present a detailed description of all possible AC-3 Controls an AudioStreaming interface can incorporate. For each Control, the layout of the parameter block together with the appropriate Control Selector is listed. The Control Selector codes are defined in Section A.3.1, “MPEG Control Selectors.” USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 19 2.3.8.1.2.3.1 Dual Channel Control The Dual Channel Control is used to select which of the two available channels in the MPEG-1 base stream is actually retrieved and reproduced over the Left and Right output channels. If this Control is addressed on a decoder that does not implement Dual Channel Control (D4 = ‘0’ in the bmMPEGCapabilities field of the MPEG format-specific descriptor), the control pipe must indicate a stall. The Dual Channel Control can have only the current setting attribute (CUR). The position of the Channel2Enable switch can be either TRUE or FALSE. When FALSE, Channel I is selected, and when TRUE, Channel II is selected. The current setting of the Control can be queried using a Get MPEG Control request. Table 2-10 Dual Channel Control Parameter Block Control Selector MP_DUAL_CHANNEL_CONTROL wLength 1 Offset Field Size Value Description 0 BChannel2Enable 1 Number The setting for the attribute of the Dual Channel Control. Channel I selected when FALSE, Channel II selected when TRUE. 2.3.8.1.2.3.2 Second Stereo Control The Second Stereo Control is used to select the second stereo channel pair that can be encoded in an MPEG-2 stream instead of the multi-channel stereophonic information (3/2). If this Control is addressed on a decoder that does not implement Second Stereo support (D5 = ‘0’ in the bmMPEGCapabilities field of the MPEG format-specific descriptor), the control pipe must indicate a stall. The Second Stereo Control can have only the current setting attribute (CUR). The position of the 2ndStereoEnable switch can be either TRUE or FALSE. When FALSE, the main stereo channel pair is selected; when TRUE, the second stereo channel pair is selected. The current setting of the Control can be queried using a Get MPEG Control request. Table 2-11 Second Stereo Control Parameter Block Control Selector MP_SECOND_STEREO_CONTROL wLength 1 Offset Field Size Value Description 0 B2ndStereoEnable 1 Number The setting for the attribute of the Second Stereo Control. Main stereo channel pair selected when FALSE, second stereo channel pair selected when TRUE. 2.3.8.1.2.3.3 Multilingual Control The Multilingual Control is used to select the multilingual channel actually retrieved from the MPEG stream. If this Control is addressed on a decoder that does not implement multilingual support (D9..8 = USB Device Class Definition for Audio Data Formats Release 1.0 March 18, 1998 20 ‘00’ in the bmMPEGCapabilities field of the MPEG format-specific descriptor), the control pipe must indicate a stall. The Multilingual Control supports only the CUR Control attribute. The valid range is from zero (0x00) to seven (0x07). The actual range depends on the incoming MPEG stream. It may contain only a limited number of multilingual channels (less than seven). The Multilingual Control honors the request to the best of its abilities. It may truncate the attribute values to its closest available settings. It will report these settings when queried during a Get MPEG Control request. Table 2-12 Multilingual Control Parameter Block Control Selector MP_MULTILINGUAL_CONTROL wLength 1 Offset Field Size Value Description 0 bMultiLingual 1 Number The setting for the attribute of the multilingual channel selection 0 = decode no channel1..7 = decode channel 1..78..255 = reserved 2.3.8.1.2.3.4 Dynamic Range Control The Dynamic Range Control (DRC) is used to enable or disable the Dynamic Range Control functionality of the decoder. If the decoder does not support Dynamic Range control (D5..4 = ‘00’ in the bmMPEGFeaturesfield of the MPEG format-specific descriptor), the control pipe must indicate a stall when receiving this request. The Dynamic Range Control can have only the current setting attribute (CUR). The position of the DRC switch can be either TRUE or FALSE. TRUE means that the MPEG decoder is using the Dynamic Range control words (possibly with additional scaling) contained in the MPEG bit stream to control the audio dynamic range. FALSE means the control words are being ignored, and the original signal dynamic range is being reproduced. The current setting of the Control can be queried using a Get MPEG Control request. Table 2-13 Dynamic Range Control Parameter Block Control Selector MP_DYN_RANGE_CONTROL wLength 1 Offset Field Size Value Description 0 bEnable 1 Bool The setting for the Dynamic Range Control CUR attribute. Enabled when TRUE, disabled when FALSE. 2.3.8.1.2.3.5 Scaling Control The Scaling Control is used to manipulate the single scaling coefficient used by MPEG decoders that implement a common boost/cut scaling value for Dynamic Range Control (D5..4 = ‘10’ in the bmMPEGFeatures field of the MPEG format-specific descriptor). If this Control is addressed on a non- ‘10’ decoder, the control pipe must indicate a stall. 1 - 6 - 11 - 16 - 21 - 26 - 31 ここを編集
https://w.atwiki.jp/is01rebuild/pages/79.html
現在、まったく分かっていません…orz アドバイス等あれば、 Twitter か下記コメント欄に記入して頂けると幸いです。 現在の状況 完了 msm_audio_dev_ctrl への入出力 ae2drv をkernelモジュール化した ae2drv の完全可視化は完了(※エラー処理除く) ae2drv関連については別ページにした。→ae2関連 /dev/msm_* は kernel/arch/arm/mach-msm/qdsp6 以下にある /dev/ae2 をオープンすると、ma_Open が呼ばれる Audio初期化ルーチン周辺でkernel の ma_Open が呼ばれる→ae2関連 確認中 ae2drv.c 内で GPIO 関連の呼び出しがある→GPIO関連 どうも再生時に /dev/i2c-0 へ書き込みをしている→I2C関連 無保証です。DEBUG中に2回ほど、リブートしました。(/dev/ae2 を2重openするとダメのようだ) 電源管理(音源チップ、スピーカアンプ)→kernel関連??? msm8k_cad はkernel内で呼び出されているようだ。 現状の未着手な課題 I2Cの内容は不明 I2Sの内容も未解明 (仕様すら調べていない…) smd_shdiag_open とは何か? ボリューム調整 kernel の pmem の調査 /dev/pmem_adsp は全く着手していない 予想される流れ、進捗と現在 /dev/msm_audio_dev_ctrl 初期化 実装完了 ↓ /dev/ae2 初期化 ソースコード部分ほぼ実装完了。 変数、未完了。 → ae2drv 内にてGPIOもONされる ↓ どこかで、パワーマネージメント関連が関係?? /dev/power以下を試験中 ↓ I2Cアクセス 実装完了 変数、未完了 ↓ (I2S)→(msm8k_cad)→(msm8k_eqlzr) ↓ /dev/msm_pcm へ Audio データ転送 実装完了 ( )は直接コールせず、kernel内で連鎖的に呼び出されるかも(?)な項目 ae2…dump&trace完了 ただし、バイナリの意味は不明 GPIO…dump&trace半完了 ただし、バイナリの意味は不明 msm_audio_dev_ctrl…dump&trace完了 内容もほぼ判明 msm_pcm…デフォルトのDEBUGをonにした。詳細未解明だが、PCMデータを流し込めばいけそう。 本内容について 2ch root4スレにて、27氏の発言169-172における sound コマンド fi01氏の214における /dev/i2c-0 周り情報 kernel 内にて必要箇所の DEBUG を有効にした結果 をまとめたもの。 はじめに 私はコレをチェックせずにちょっと遠回りした。 ls -l /dev/ | grep audio crw-rw-rw- system audio 239, 0 2011-02-10 23 50 ae2 crw-rw---- system audio 10, 1 2011-02-10 23 50 pmem_adsp crw-rw---- system audio 10, 44 2011-02-10 23 50 msm_qcelp_in crw-rw---- system audio 10, 45 2011-02-10 23 50 msm_evrc_in crw-rw-rw- system audio 10, 46 2011-02-10 23 50 msm_audio_dev_ctrl crw-rw-rw- system audio 10, 49 2011-02-10 23 50 msm_voice crw-rw---- system audio 10, 51 2011-02-10 23 50 msm_mp3 crw-rw---- system audio 10, 52 2011-02-10 23 50 msm_aac_in crw-rw---- system audio 10, 53 2011-02-10 23 50 msm_aac crw-rw-rw- system audio 10, 54 2011-02-10 23 50 msm_pcm_in crw-rw-rw- system audio 10, 55 2011-02-10 23 50 msm_pcm アドレスで分かっている事 kernel/drivers/yamaha/ae2drv.c gpsDriver- pMemory = ioremap( 0x90000000, 64 ); 物理アドレス0x90000000を先頭として64バイト幅をカーネル空間へマッピング? IRQ周り 抽出しただけで、まだ定義を追いかけていない。 kernel/drivers/yamaha/ae2drv.c gpsDriver- dIrq = MSM_GPIO_TO_INT(28); sdResult = request_irq( gpsDriver- dIrq, ma_IrqHandler, IRQF_TRIGGER_FALLING, MA_DEVICE_NAME, gpsDriver ); GPIO周り 番号 方向 プル状態 Drive Strength (?) 有効/無効 027 出力 無し GPIO_2MA 有効 028 入力 プルダウン GPIO_2MA 有効 102 出力 無し GPIO_2MA 有効 121 出力 無し GPIO_2MA 有効 ソース部分 kernel/drivers/yamaha/ae2drv.c gpio_tlmm_config(GPIO_CFG(27, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA), GPIO_ENABLE); gpio_tlmm_config(GPIO_CFG(28, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), GPIO_ENABLE); gpio_tlmm_config(GPIO_CFG(102, 1, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA), GPIO_ENABLE); gpio_tlmm_config(GPIO_CFG(121, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA), GPIO_ENABLE); arch/arm/mach-msm/board-deckard.c static unsigned audio_gpio_on[] = { GPIO_CFG(68, 1, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),/* PCM_DOUT */ GPIO_CFG(69, 1, GPIO_INPUT, GPIO_NO_PULL, GPIO_2MA),/* PCM_DIN */ GPIO_CFG(70, 2, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),/* PCM_SYNC */ GPIO_CFG(71, 2, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),/* PCM_CLK */ GPIO_CFG(142, 2, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),/* CC_I2S_CLK */ GPIO_CFG(143, 1, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),/* SADC_WSOUT */ GPIO_CFG(144, 1, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA),/* SADC_DIN */ GPIO_CFG(145, 1, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),/* SDAC_DOUT */ GPIO_CFG(146, 2, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),/* MA_CLK_OUT */ }; /dev/msm_* 関連の include ファイル kernel/include/linux/msm_audio.h kernel/arch/arm/mach-msm/include/mach/qdsp6/msm8k_cad_ioctl.h kernel/arch/arm/mach-msm/include/mach/qdsp6/msm8k_cad_devices.h kernel/arch/arm/mach-msm/include/mach/qdsp6/msm8k_cad_volume.h kernel/arch/arm/mach-msm/include/mach/qdsp6/msm8k_adsp_audio_device.h /dev/msm_* 関連の DEBUG を有効にする。 kernelにおいて Audio 周りをつかさどっているであろう部分で DEBUG 情報を出力するように改変する。 kernel/arch/arm/mach-msm/qdsp6 以下にある、*.c ファイルの下記部分を #if 0 #define D(fmt, args...) printk(KERN_INFO "msm8k_pcm " fmt, ##args) #else #define D(fmt, args...) do {} while (0) #endif を片っ端から次のように編集する。 #if 1 #define D(fmt, args...) printk(KERN_INFO "msm8k_pcm " fmt, ##args) #else #define D(fmt, args...) do {} while (0) #endif これで、かなりの DEBUG メッセージが dmesg すると出てくるようになる。 さらに、ioctl されているが、内容が分からないので出力するように変更した。 下記は、msm8k_pcm.c の例である。 $ diff -u msm8k_pcm.c.orig msm8k_pcm.c --- msm8k_pcm.c.orig2011-02-09 00 39 31.563458406 +0900 +++ msm8k_pcm.c2011-02-07 23 36 23.694297428 +0900 @@ -89,7 +89,7 @@ #include mach/qdsp6/msm8k_cad_volume.h #include mach/qdsp6/msm8k_cad_q6eq_drvi.h -#if 0 +#if 1 #define D(fmt, args...) printk(KERN_INFO "msm8k_pcm " fmt, ##args) #else #define D(fmt, args...) do {} while (0) @@ -237,7 +237,7 @@ u32 percentage; struct cad_event_struct_type eos_event; -D("%s\n", __func__); +D("%s cmd=%x , arg=%lx\n", __func__ , cmd , arg ); memset( cad_dev, 0, sizeof(struct cad_device_struct_type)); memset( cad_stream_dev, 0, あとは、make、boot.img化、ubi化して実機に転送すればok。 私の環境では、make は下記のようになる、CROSS_COMPILE=以降は適宜、自分の環境に合わせて欲しい。 make ARCH=arm CROSS_COMPILE=../../froyo_orig/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi- kernel は arch/arm/boot/Image がその本体である。 cp -a arch/arm/boot/Image ../../mtd/froyo_boot/ /dev/msm_* 関連の DEBUG 情報の見方 DEBUGを有効にして起動したkernelにて、 # dmesg した結果を抜粋して、数値データの意味を説明する。 6 [ 134.871839] msm8k_cad Registered the async callback function!!! 6 [ 134.871859] msm8k_pcm msm8k_pcm_ioctl cmd=80046103 , arg=7e896b08 6 [ 134.871886] msm8k_pcm msm8k_pcm_ioctl cmd=40046104 , arg=7e896b08 6 [ 134.872099] msm8k_pcm msm8k_pcm_ioctl cmd=40046100 , arg=0 まず、cmd = 80046103 等の cmd の値だが、 $ANDROID_SRC/system/extras/sound/playwav.c を例に挙げて説明すると、 #include linux/ioctl.h (省略) #define AUDIO_IOCTL_MAGIC a #define AUDIO_START _IOW(AUDIO_IOCTL_MAGIC, 0, unsigned) #define AUDIO_STOP _IOW(AUDIO_IOCTL_MAGIC, 1, unsigned) #define AUDIO_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 2, unsigned) #define AUDIO_GET_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 3, unsigned) #define AUDIO_SET_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 4, unsigned) #define AUDIO_GET_STATS _IOR(AUDIO_IOCTL_MAGIC, 5, unsigned) (省略) /* config change should be a read-modify-write operation */ if (ioctl(afd, AUDIO_GET_CONFIG, cfg)) { で、AUDIO_GET_CONFIG は _IOR(AUDIO_IOCTL_MAGIC, 3, unsigned) と変換される。 _IOR や _IOW は kernelのヘッダファイルの linux/ioctl.h で定義されている。 ざっと見た感じでは、unsigned int に変換されていて、下記のようなフォーマットに至る。(と思う…あとで、確認します^^;) cmd = 80046103 だと、 32bit 2bit 14bit 8bit 8bit read write 引数のsize(バイト数) type nr 1 0 (unsigned int)=32bi=4byte=0x004 AUDIO_IOCTL_MAGIC= a =0x61 AUDIO_GET_CONFIG=3 と言う事になる(ようだ^^;)。 間違ってたらごめんなさい。 (書いてるときに面倒になってきて、ヘッダファイルのビット数の所確認していない。32bitが4になってるので4バイトか4オクテットの意味と思う) arg は変数へのポインタなので実行時によって変わるはず。 また、AUDIO_START等のioctlでの全cmd定義は kernel/linux/msm_audio.h にある。 間違いが多く含まれているかもしれません、何かお気づきの点が有りましたら、Twitterか下記まで。 コメント IS01 root スレ4 で、goroh_kun さんがオーディオ関連の情報を書き込んでいました。 以下に引用します。 カーネルのソースコード見ると、 arch/arm/mach-msm/pmic_debugfs.c っていうのがあって、 #mount -t debugfs debugfs /sys/kernel/debug #/sys/kernel/debug/pmic #ls debug index # cat /proc/kmsg # echo 9 index #RTC_GET_TIME_PROC # cat debug とかやると、いろいろなデバッグ用関数を呼び出せます。 debugはechoでパラメータ入れてあげるか、catで内容を見れます。 indexに書き込む数字とdebugへの操作はソースコード参照してください。 arch/arm/mach-msm/pmic.cを見るとだいたいindexに書き込む数字と 機能の割り当て対応は分かると思います。 音源関連のデバッグ関数も多数存在します。 -- (Yukto8492) 2011-03-30 10 57 31 名前 コメント すべてのコメントを見る
https://w.atwiki.jp/bokuyo/pages/25.html
XAudio2 WAVEFORMATEX構造体■ チャンネル数 1(モノラル), 2(ステレオ) ビット深度 8bit, 16bit サンプリングレート 8.0 kHz, 11.025 kHz, 22.05 kHz, 44.1 kHz ビットレート 1411bps(=2(stereo)*16bit*44.1bit)以下 XAUDIO2 WARNING High-bit-depth PCM format should be expressed using WAVEFORMATEXTENSIBLE XAUDIO2 WARNING High-bit-depth PCM format should be expressed using WAVEFORMATEXTENSIBLE これはサンプルレート24bitをWAVEFORMATEX構造体を使って呼んだ場合。 WAVEFORMATEX構造体はサンプルレート8bitか16bitしか対応してないため怒られる。 解決策 wavファイルを16bit/44.100Hzにエンコードする。 WAVEFORMATEXTENSIBLE構造体を使う。 WAVEFORMATEXTENSIBLE構造体■ WAVEFORMATEX構造体で対応できない解像度の高いwavファイルを扱える。 チャンネル数 3以上 ビット深度 WAVEFORMATEXより高いビット深度(24bit) サンプリングレート WAVEFORMATEXより高い周波数(44.8Hzとか) XAUDIO2_BUFFER構造体■ Loopの回数や、Loopするところの指定はすべてここで行う。 LoopCount 0~XAUDIO2_MAX_LOOP_COUNT(=254)回指定できる。 無限ループする場合は、XAUDIO2_LOOP_INFINITE(=255) 0回の場合ループは実行されず、LoopBeginとLoopLengthの値を0にしないといけない。 256をいれるとどうなるのか? →256が入るけれど、バッファを送るときに強制終了(ブレークポイント発動!)する。 じゃあ-1をいれるとどうなるのか? →buffer.LoopCount=4294967295の値が入るけれど同じく、CreateSourceVoice();で中断(ブレークポイント発動!!)させられる。 Voice ソースボイス サブミックスボイス マスターボイス があって、ソースボイスはオーディオファイルを読み込んだもの、 サブミックスボイスはソースボイスやサブミックスボイスをミックスしたもの。 マスターボイスはソースボイスやサブミックスボイスをミックスして、サウンドカードに渡す唯一無二のもの。 MSDN - XAudio2 ボイス MSDN - IXAudio2SourceVoice インターフェイス MSDN - IXAudio2MasteringVoice インターフェイス SourceVoice IXAudio2SourceVoice Start()■ WaveFileClass SDK付属のwav読み込みクラス。便利。 C \Program Files\Microsoft DirectX SDK (February 2010)\Samples\C++\Direct3D10\GPUSpectrogram の中にあるよ。 関連項目 XAudio2で出てくるエラー 参考文献 MSDN - XAudio2 におけるオーディオ障害のデバッグ