blob: 92fb8309096c3c9d9c17e82470e54705082a6ffb [file] [log] [blame]
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +00001// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
dnicoara@chromium.org9f2a6f02014-01-03 21:25:00 +00005#ifndef MEDIA_MIDI_MIDI_MANAGER_ALSA_H_
6#define MEDIA_MIDI_MIDI_MANAGER_ALSA_H_
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +00007
agoode@chromium.org25227512014-06-08 05:12:05 +00008#include <alsa/asoundlib.h>
avi793390d2015-12-22 22:22:36 -08009#include <stdint.h>
danakj75afea02016-04-25 20:36:04 -070010
limasdfe59d0392015-11-19 20:28:57 -080011#include <map>
danakj75afea02016-04-25 20:36:04 -070012#include <memory>
dchengc2aeece2015-12-27 00:54:00 -080013#include <utility>
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +000014#include <vector>
15
bnc628660d2016-02-05 19:58:14 -080016#include "base/containers/hash_tables.h"
agoode55a8b522015-03-08 12:40:17 -070017#include "base/gtest_prod_util.h"
avieea95e82015-12-18 20:27:08 -080018#include "base/macros.h"
agoode@chromium.org25227512014-06-08 05:12:05 +000019#include "base/synchronization/lock.h"
Takashi Toyoshimae8240ab2018-10-03 09:30:11 +000020#include "base/thread_annotations.h"
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +000021#include "base/threading/thread.h"
agoodef212b2a2015-03-19 12:53:23 -070022#include "base/values.h"
agoode7de413f2015-04-24 00:13:39 -070023#include "device/udev_linux/scoped_udev.h"
brettw49ff0172015-05-05 12:43:04 -070024#include "media/midi/midi_export.h"
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +000025#include "media/midi/midi_manager.h"
26
toyoshime147c5e2015-05-07 21:58:31 -070027namespace midi {
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +000028
brettw49ff0172015-05-05 12:43:04 -070029class MIDI_EXPORT MidiManagerAlsa final : public MidiManager {
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +000030 public:
toyoshimf4d61522017-02-10 02:03:32 -080031 explicit MidiManagerAlsa(MidiService* service);
dcheng9e8524d2014-10-27 15:18:50 -070032 ~MidiManagerAlsa() override;
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +000033
toyoshim@chromium.orgc82e66e2014-02-04 07:05:47 +000034 // MidiManager implementation.
dcheng9e8524d2014-10-27 15:18:50 -070035 void StartInitialization() override;
36 void DispatchSendMidiData(MidiManagerClient* client,
Avi Drissman3528fd02015-12-18 20:11:31 -050037 uint32_t port_index,
38 const std::vector<uint8_t>& data,
tzik925e2c62018-02-02 07:39:45 +000039 base::TimeTicks timestamp) override;
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +000040
41 private:
agoode99d63292015-04-13 08:39:25 -070042 friend class MidiManagerAlsaTest;
agoode55a8b522015-03-08 12:40:17 -070043 FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, ExtractManufacturer);
agoode99d63292015-04-13 08:39:25 -070044 FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, ToMidiPortState);
agoode55a8b522015-03-08 12:40:17 -070045
agoodeb09423b2015-05-11 11:39:57 -070046 class AlsaCard;
danakj75afea02016-04-25 20:36:04 -070047 using AlsaCardMap = std::map<int, std::unique_ptr<AlsaCard>>;
agoodeb09423b2015-05-11 11:39:57 -070048
agoode99d63292015-04-13 08:39:25 -070049 class MidiPort {
agoodef212b2a2015-03-19 12:53:23 -070050 public:
51 enum class Type { kInput, kOutput };
52
agooded87fc0f2015-05-21 08:29:31 -070053 // The Id class is used to keep the multiple strings separate
54 // but compare them all together for equality purposes.
55 // The individual strings that make up the Id can theoretically contain
56 // arbitrary characters, so unfortunately there is no simple way to
57 // concatenate them into a single string.
58 class Id final {
59 public:
60 Id();
61 Id(const std::string& bus,
62 const std::string& vendor_id,
63 const std::string& model_id,
64 const std::string& usb_interface_num,
65 const std::string& serial);
66 Id(const Id&);
67 ~Id();
68 bool operator==(const Id&) const;
69 bool empty() const;
70
71 std::string bus() const { return bus_; }
72 std::string vendor_id() const { return vendor_id_; }
73 std::string model_id() const { return model_id_; }
74 std::string usb_interface_num() const { return usb_interface_num_; }
75 std::string serial() const { return serial_; }
76
77 private:
78 std::string bus_;
79 std::string vendor_id_;
80 std::string model_id_;
81 std::string usb_interface_num_;
82 std::string serial_;
83 };
84
agoode99d63292015-04-13 08:39:25 -070085 MidiPort(const std::string& path,
agooded87fc0f2015-05-21 08:29:31 -070086 const Id& id,
agoode99d63292015-04-13 08:39:25 -070087 int client_id,
88 int port_id,
89 int midi_device,
90 const std::string& client_name,
91 const std::string& port_name,
92 const std::string& manufacturer,
93 const std::string& version,
94 Type type);
95 ~MidiPort();
agoodef212b2a2015-03-19 12:53:23 -070096
97 // Gets a Value representation of this object, suitable for serialization.
danakj75afea02016-04-25 20:36:04 -070098 std::unique_ptr<base::Value> Value() const;
agoodef212b2a2015-03-19 12:53:23 -070099
100 // Gets a string version of Value in JSON format.
101 std::string JSONValue() const;
102
103 // Gets an opaque identifier for this object, suitable for using as the id
104 // field in MidiPort.id on the web. Note that this string does not store
105 // the full state.
106 std::string OpaqueKey() const;
107
agoode99d63292015-04-13 08:39:25 -0700108 // Checks for equality for connected ports.
109 bool MatchConnected(const MidiPort& query) const;
110 // Checks for equality for kernel cards with id, pass 1.
111 bool MatchCardPass1(const MidiPort& query) const;
112 // Checks for equality for kernel cards with id, pass 2.
113 bool MatchCardPass2(const MidiPort& query) const;
114 // Checks for equality for non-card clients, pass 1.
115 bool MatchNoCardPass1(const MidiPort& query) const;
116 // Checks for equality for non-card clients, pass 2.
117 bool MatchNoCardPass2(const MidiPort& query) const;
agoodef212b2a2015-03-19 12:53:23 -0700118
agoode99d63292015-04-13 08:39:25 -0700119 // accessors
120 std::string path() const { return path_; }
agooded87fc0f2015-05-21 08:29:31 -0700121 Id id() const { return id_; }
agoode99d63292015-04-13 08:39:25 -0700122 std::string client_name() const { return client_name_; }
123 std::string port_name() const { return port_name_; }
124 std::string manufacturer() const { return manufacturer_; }
125 std::string version() const { return version_; }
126 int client_id() const { return client_id_; }
127 int port_id() const { return port_id_; }
128 int midi_device() const { return midi_device_; }
129 Type type() const { return type_; }
Avi Drissman3528fd02015-12-18 20:11:31 -0500130 uint32_t web_port_index() const { return web_port_index_; }
agoode99d63292015-04-13 08:39:25 -0700131 bool connected() const { return connected_; }
132
133 // mutators
Avi Drissman3528fd02015-12-18 20:11:31 -0500134 void set_web_port_index(uint32_t web_port_index) {
agoode99d63292015-04-13 08:39:25 -0700135 web_port_index_ = web_port_index;
136 }
137 void set_connected(bool connected) { connected_ = connected; }
138 void Update(const std::string& path,
139 int client_id,
140 int port_id,
141 const std::string& client_name,
142 const std::string& port_name,
143 const std::string& manufacturer,
144 const std::string& version) {
145 path_ = path;
146 client_id_ = client_id;
147 port_id_ = port_id;
148 client_name_ = client_name;
149 port_name_ = port_name;
150 manufacturer_ = manufacturer;
151 version_ = version;
152 }
153
154 private:
155 // Immutable properties.
agooded87fc0f2015-05-21 08:29:31 -0700156 const Id id_;
agoode99d63292015-04-13 08:39:25 -0700157 const int midi_device_;
158
agoodef212b2a2015-03-19 12:53:23 -0700159 const Type type_;
160
agoode99d63292015-04-13 08:39:25 -0700161 // Mutable properties. These will get updated as ports move around or
162 // drivers change.
163 std::string path_;
164 int client_id_;
165 int port_id_;
166 std::string client_name_;
167 std::string port_name_;
168 std::string manufacturer_;
169 std::string version_;
170
171 // Index for MidiManager.
Avi Drissman3528fd02015-12-18 20:11:31 -0500172 uint32_t web_port_index_ = 0;
agoode99d63292015-04-13 08:39:25 -0700173
174 // Port is present in the ALSA system.
agoode5a1aa112015-06-21 20:51:00 -0700175 bool connected_ = true;
agoode99d63292015-04-13 08:39:25 -0700176
177 DISALLOW_COPY_AND_ASSIGN(MidiPort);
agoode55a8b522015-03-08 12:40:17 -0700178 };
179
agoode99d63292015-04-13 08:39:25 -0700180 class MidiPortStateBase {
181 public:
danakj75afea02016-04-25 20:36:04 -0700182 typedef std::vector<std::unique_ptr<MidiPort>>::iterator iterator;
agoodebd4be9b2015-03-16 19:17:25 -0700183
agoode99d63292015-04-13 08:39:25 -0700184 virtual ~MidiPortStateBase();
185
186 // Given a port, finds a port in the internal store.
187 iterator Find(const MidiPort& port);
188
189 // Given a port, finds a connected port, using exact matching.
190 iterator FindConnected(const MidiPort& port);
191
192 // Given a port, finds a disconnected port, using heuristic matching.
193 iterator FindDisconnected(const MidiPort& port);
194
195 iterator begin() { return ports_.begin(); }
196 iterator end() { return ports_.end(); }
197
198 protected:
199 MidiPortStateBase();
agoode5ebc4932015-12-01 08:25:12 -0800200 iterator erase(iterator position) { return ports_.erase(position); }
danakj75afea02016-04-25 20:36:04 -0700201 void push_back(std::unique_ptr<MidiPort> port) {
dchengc2aeece2015-12-27 00:54:00 -0800202 ports_.push_back(std::move(port));
203 }
agoode99d63292015-04-13 08:39:25 -0700204
205 private:
danakj75afea02016-04-25 20:36:04 -0700206 std::vector<std::unique_ptr<MidiPort>> ports_;
agoode99d63292015-04-13 08:39:25 -0700207
208 DISALLOW_COPY_AND_ASSIGN(MidiPortStateBase);
209 };
210
211 class TemporaryMidiPortState final : public MidiPortStateBase {
212 public:
agoode5ebc4932015-12-01 08:25:12 -0800213 iterator erase(iterator position) {
214 return MidiPortStateBase::erase(position);
215 };
danakj75afea02016-04-25 20:36:04 -0700216 void push_back(std::unique_ptr<MidiPort> port) {
dchengc2aeece2015-12-27 00:54:00 -0800217 MidiPortStateBase::push_back(std::move(port));
agoode5ebc4932015-12-01 08:25:12 -0800218 }
agoode99d63292015-04-13 08:39:25 -0700219 };
220
221 class MidiPortState final : public MidiPortStateBase {
222 public:
223 MidiPortState();
224
agoode5ebc4932015-12-01 08:25:12 -0800225 // Inserts a port at the end. Returns web_port_index.
danakj75afea02016-04-25 20:36:04 -0700226 uint32_t push_back(std::unique_ptr<MidiPort> port);
agoode99d63292015-04-13 08:39:25 -0700227
228 private:
Avi Drissman3528fd02015-12-18 20:11:31 -0500229 uint32_t num_input_ports_ = 0;
230 uint32_t num_output_ports_ = 0;
agoode99d63292015-04-13 08:39:25 -0700231 };
232
233 class AlsaSeqState {
234 public:
235 enum class PortDirection { kInput, kOutput, kDuplex };
236
237 AlsaSeqState();
238 ~AlsaSeqState();
239
240 void ClientStart(int client_id,
241 const std::string& client_name,
242 snd_seq_client_type_t type);
243 bool ClientStarted(int client_id);
244 void ClientExit(int client_id);
245 void PortStart(int client_id,
246 int port_id,
247 const std::string& port_name,
248 PortDirection direction,
249 bool midi);
250 void PortExit(int client_id, int port_id);
251 snd_seq_client_type_t ClientType(int client_id) const;
danakj75afea02016-04-25 20:36:04 -0700252 std::unique_ptr<TemporaryMidiPortState> ToMidiPortState(
agoodeb09423b2015-05-11 11:39:57 -0700253 const AlsaCardMap& alsa_cards);
254
255 int card_client_count() { return card_client_count_; }
agoode99d63292015-04-13 08:39:25 -0700256
257 private:
258 class Port {
259 public:
260 Port(const std::string& name, PortDirection direction, bool midi);
261 ~Port();
262
agoodeb0582872015-05-20 05:22:24 -0700263 std::string name() const { return name_; }
264 PortDirection direction() const { return direction_; }
agoode99d63292015-04-13 08:39:25 -0700265 // True if this port is a MIDI port, instead of another kind of ALSA port.
agoodeb0582872015-05-20 05:22:24 -0700266 bool midi() const { return midi_; }
agoode99d63292015-04-13 08:39:25 -0700267
268 private:
269 const std::string name_;
270 const PortDirection direction_;
271 const bool midi_;
272
273 DISALLOW_COPY_AND_ASSIGN(Port);
274 };
275
276 class Client {
277 public:
danakj75afea02016-04-25 20:36:04 -0700278 using PortMap = std::map<int, std::unique_ptr<Port>>;
agoode99d63292015-04-13 08:39:25 -0700279
280 Client(const std::string& name, snd_seq_client_type_t type);
281 ~Client();
282
agoodeb0582872015-05-20 05:22:24 -0700283 std::string name() const { return name_; }
284 snd_seq_client_type_t type() const { return type_; }
danakj75afea02016-04-25 20:36:04 -0700285 void AddPort(int addr, std::unique_ptr<Port> port);
agoode99d63292015-04-13 08:39:25 -0700286 void RemovePort(int addr);
287 PortMap::const_iterator begin() const;
288 PortMap::const_iterator end() const;
289
290 private:
291 const std::string name_;
292 const snd_seq_client_type_t type_;
293 PortMap ports_;
agoode99d63292015-04-13 08:39:25 -0700294
295 DISALLOW_COPY_AND_ASSIGN(Client);
296 };
297
danakj75afea02016-04-25 20:36:04 -0700298 std::map<int, std::unique_ptr<Client>> clients_;
agoode99d63292015-04-13 08:39:25 -0700299
agoodeb09423b2015-05-11 11:39:57 -0700300 // This is the current number of clients we know about that have
301 // cards. When this number matches alsa_card_midi_count_, we know
302 // we are in sync between ALSA and udev. Until then, we cannot generate
303 // MIDIConnectionEvents to web clients.
agoodedf1b9ff2015-06-25 18:14:50 -0700304 int card_client_count_ = 0;
agoodeb09423b2015-05-11 11:39:57 -0700305
agoode99d63292015-04-13 08:39:25 -0700306 DISALLOW_COPY_AND_ASSIGN(AlsaSeqState);
307 };
308
agoodeb09423b2015-05-11 11:39:57 -0700309 class AlsaCard {
310 public:
311 AlsaCard(udev_device* dev,
agooded87fc0f2015-05-21 08:29:31 -0700312 const std::string& name,
313 const std::string& longname,
314 const std::string& driver,
agoodeb09423b2015-05-11 11:39:57 -0700315 int midi_device_count);
316 ~AlsaCard();
agooded87fc0f2015-05-21 08:29:31 -0700317 std::string name() const { return name_; }
318 std::string longname() const { return longname_; }
319 std::string driver() const { return driver_; }
320 std::string path() const { return path_; }
321 std::string bus() const { return bus_; }
322 std::string vendor_id() const { return vendor_id_; }
323 std::string model_id() const { return model_id_; }
324 std::string usb_interface_num() const { return usb_interface_num_; }
325 std::string serial() const { return serial_; }
agoodeb09423b2015-05-11 11:39:57 -0700326 int midi_device_count() const { return midi_device_count_; }
agooded87fc0f2015-05-21 08:29:31 -0700327 std::string manufacturer() const { return manufacturer_; }
agoodeb09423b2015-05-11 11:39:57 -0700328
329 private:
330 FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, ExtractManufacturer);
331
332 // Extracts the manufacturer using heuristics and a variety of sources.
333 static std::string ExtractManufacturerString(
334 const std::string& udev_id_vendor,
335 const std::string& udev_id_vendor_id,
336 const std::string& udev_id_vendor_from_database,
agooded87fc0f2015-05-21 08:29:31 -0700337 const std::string& name,
338 const std::string& longname);
agoodeb09423b2015-05-11 11:39:57 -0700339
agooded87fc0f2015-05-21 08:29:31 -0700340 const std::string name_;
341 const std::string longname_;
342 const std::string driver_;
343 const std::string path_;
344 const std::string bus_;
345 const std::string vendor_id_;
346 const std::string model_id_;
347 const std::string usb_interface_num_;
348 const std::string serial_;
349 const int midi_device_count_;
350 const std::string manufacturer_;
agoodeb09423b2015-05-11 11:39:57 -0700351
352 DISALLOW_COPY_AND_ASSIGN(AlsaCard);
353 };
354
agoode5a1aa112015-06-21 20:51:00 -0700355 struct SndSeqDeleter {
356 void operator()(snd_seq_t* seq) const { snd_seq_close(seq); }
357 };
358
359 struct SndMidiEventDeleter {
360 void operator()(snd_midi_event_t* coder) const {
361 snd_midi_event_free(coder);
362 };
363 };
364
agoodeb2ead822016-03-11 12:14:35 -0800365 using SourceMap = base::hash_map<int, uint32_t>;
366 using OutPortMap = base::hash_map<uint32_t, int>;
danakj75afea02016-04-25 20:36:04 -0700367 using ScopedSndSeqPtr = std::unique_ptr<snd_seq_t, SndSeqDeleter>;
agoodeb2ead822016-03-11 12:14:35 -0800368 using ScopedSndMidiEventPtr =
danakj75afea02016-04-25 20:36:04 -0700369 std::unique_ptr<snd_midi_event_t, SndMidiEventDeleter>;
agoode99d63292015-04-13 08:39:25 -0700370
agoode@chromium.org25227512014-06-08 05:12:05 +0000371 // An internal callback that runs on MidiSendThread.
toyoshimefcee5e2017-06-14 07:14:39 -0700372 void SendMidiData(MidiManagerClient* client,
toyoshimf4d61522017-02-10 02:03:32 -0800373 uint32_t port_index,
374 const std::vector<uint8_t>& data);
agoode@chromium.org25227512014-06-08 05:12:05 +0000375
toyoshimefcee5e2017-06-14 07:14:39 -0700376 void EventLoop();
tzik925e2c62018-02-02 07:39:45 +0000377 void ProcessSingleEvent(snd_seq_event_t* event, base::TimeTicks timestamp);
agoode99d63292015-04-13 08:39:25 -0700378 void ProcessClientStartEvent(int client_id);
379 void ProcessPortStartEvent(const snd_seq_addr_t& addr);
380 void ProcessClientExitEvent(const snd_seq_addr_t& addr);
381 void ProcessPortExitEvent(const snd_seq_addr_t& addr);
agoode975043d2015-05-11 00:46:17 -0700382 void ProcessUdevEvent(udev_device* dev);
agoodeb09423b2015-05-11 11:39:57 -0700383 void AddCard(udev_device* dev);
384 void RemoveCard(int number);
agoode99d63292015-04-13 08:39:25 -0700385
386 // Updates port_state_ and Web MIDI state from alsa_seq_state_.
387 void UpdatePortStateAndGenerateEvents();
388
389 // Enumerates ports. Call once after subscribing to the announce port.
390 void EnumerateAlsaPorts();
agoode975043d2015-05-11 00:46:17 -0700391 // Enumerates udev cards. Call once after initializing the udev monitor.
392 bool EnumerateUdevCards();
agoode99d63292015-04-13 08:39:25 -0700393 // Returns true if successful.
Avi Drissman3528fd02015-12-18 20:11:31 -0500394 bool CreateAlsaOutputPort(uint32_t port_index, int client_id, int port_id);
395 void DeleteAlsaOutputPort(uint32_t port_index);
agoode99d63292015-04-13 08:39:25 -0700396 // Returns true if successful.
Avi Drissman3528fd02015-12-18 20:11:31 -0500397 bool Subscribe(uint32_t port_index, int client_id, int port_id);
agoode99d63292015-04-13 08:39:25 -0700398
Takashi Toyoshima0ae49702017-09-01 04:59:51 +0000399 // Allocates new snd_midi_event_t instance and wraps it to return as
400 // ScopedSndMidiEventPtr.
401 ScopedSndMidiEventPtr CreateScopedSndMidiEventPtr(size_t size);
402
agoodeb2ead822016-03-11 12:14:35 -0800403 // Members initialized in the constructor are below.
404 // Our copies of the internal state of the ports of seq and udev.
agoode99d63292015-04-13 08:39:25 -0700405 AlsaSeqState alsa_seq_state_;
406 MidiPortState port_state_;
toyoshim@chromium.org4a8657c2014-02-06 11:23:09 +0000407
agoode@chromium.org25227512014-06-08 05:12:05 +0000408 // One input port, many output ports.
Takashi Toyoshimae8240ab2018-10-03 09:30:11 +0000409 base::Lock out_ports_lock_;
410 OutPortMap out_ports_ GUARDED_BY(out_ports_lock_);
agoode@chromium.org25227512014-06-08 05:12:05 +0000411
agoodebd4be9b2015-03-16 19:17:25 -0700412 // Mapping from ALSA client:port to our index.
agoode@chromium.org25227512014-06-08 05:12:05 +0000413 SourceMap source_map_;
414
agoodeb09423b2015-05-11 11:39:57 -0700415 // Mapping from card to devices.
416 AlsaCardMap alsa_cards_;
agoodeb09423b2015-05-11 11:39:57 -0700417
418 // This is the current count of midi devices across all cards we know
419 // about. When this number matches card_client_count_ in AlsaSeqState,
420 // we are safe to generate MIDIConnectionEvents. Otherwise we need to
421 // wait for our information from ALSA and udev to get back in sync.
agoode5a1aa112015-06-21 20:51:00 -0700422 int alsa_card_midi_count_ = 0;
agoodeb09423b2015-05-11 11:39:57 -0700423
agoodeb2ead822016-03-11 12:14:35 -0800424 // ALSA seq handles and ids.
425 ScopedSndSeqPtr in_client_;
426 int in_client_id_;
Takashi Toyoshimae8240ab2018-10-03 09:30:11 +0000427 ScopedSndSeqPtr out_client_ GUARDED_BY(out_client_lock_);
428 base::Lock out_client_lock_;
agoodeb2ead822016-03-11 12:14:35 -0800429 int out_client_id_;
430 int in_port_id_;
431
agoode99d63292015-04-13 08:39:25 -0700432 // ALSA event -> MIDI coder.
agoodeb2ead822016-03-11 12:14:35 -0800433 ScopedSndMidiEventPtr decoder_;
agoode@chromium.org25227512014-06-08 05:12:05 +0000434
agoode7de413f2015-04-24 00:13:39 -0700435 // udev, for querying hardware devices.
436 device::ScopedUdevPtr udev_;
agoode975043d2015-05-11 00:46:17 -0700437 device::ScopedUdevMonitorPtr udev_monitor_;
agoode7de413f2015-04-24 00:13:39 -0700438
toyoshim@chromium.orgc82e66e2014-02-04 07:05:47 +0000439 DISALLOW_COPY_AND_ASSIGN(MidiManagerAlsa);
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +0000440};
441
toyoshime147c5e2015-05-07 21:58:31 -0700442} // namespace midi
toyoshim@chromium.orga97eebf2014-01-03 07:52:39 +0000443
dnicoara@chromium.org9f2a6f02014-01-03 21:25:00 +0000444#endif // MEDIA_MIDI_MIDI_MANAGER_ALSA_H_