2 * Copyright (C) 2005-2008 by Pieter Palmers
4 * This file is part of FFADO
5 * FFADO = Free Firewire (pro-)audio drivers for linux
7 * FFADO is based upon FreeBoB.
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 2 of the License, or
12 * (at your option) version 3 of the License.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #warning Metric Halo support is currently useless
26 #include "metrichalo/mh_avdevice.h"
28 #include "libieee1394/configrom.h"
29 #include "libieee1394/ieee1394service.h"
31 #include "libavc/avc_definitions.h"
33 #include "debugmodule/debugmodule.h"
35 #include "devicemanager.h"
40 #include "libutil/ByteSwap.h"
44 #include <libraw1394/csr.h>
46 namespace MetricHalo
{
48 Device::Device( DeviceManager
& d
,
49 std::auto_ptr
<ConfigRom
>( configRom
))
50 : FFADODevice( d
, configRom
)
52 debugOutput( DEBUG_LEVEL_VERBOSE
, "Created MetricHalo::Device (NodeID %d)\n",
53 getConfigRom().getNodeId() );
62 Device::probe( Util::Configuration
& c
, ConfigRom
& configRom
, bool generic
)
67 // check if device is in supported devices list
68 unsigned int vendorId
= configRom
.getNodeVendorId();
69 unsigned int modelId
= configRom
.getModelId();
71 Util::Configuration::VendorModelEntry vme
= c
.findDeviceVME( vendorId
, modelId
);
72 return c
.isValid(vme
) && vme
.driver
== Util::Configuration::eD_MetricHalo
;
77 Device::createDevice( DeviceManager
& d
,
78 std::auto_ptr
<ConfigRom
>( configRom
))
80 return new Device(d
, configRom
);
86 unsigned int vendorId
= getConfigRom().getNodeVendorId();
87 unsigned int modelId
= getConfigRom().getModelId();
89 Util::Configuration
&c
= getDeviceManager().getConfiguration();
90 Util::Configuration::VendorModelEntry vme
= c
.findDeviceVME( vendorId
, modelId
);
92 if (c
.isValid(vme
) && vme
.driver
== Util::Configuration::eD_MetricHalo
) {
93 debugOutput( DEBUG_LEVEL_VERBOSE
, "found %s %s\n",
94 vme
.vendor_name
.c_str(),
95 vme
.model_name
.c_str());
97 debugWarning("Using generic Metric Halo support for unsupported device '%s %s'\n",
98 getConfigRom().getVendorName().c_str(), getConfigRom().getModelName().c_str());
105 Device::getSamplingFrequency( ) {
110 Device::getSupportedSamplingFrequencies()
112 std::vector
<int> frequencies
;
116 FFADODevice::ClockSourceVector
117 Device::getSupportedClockSources() {
118 FFADODevice::ClockSourceVector r
;
123 Device::setActiveClockSource(ClockSource s
) {
127 FFADODevice::ClockSource
128 Device::getActiveClockSource() {
135 Device::getConfigurationId( ) {
140 Device::setSamplingFrequency( int samplingFrequency
)
162 unsigned int vendorId
= getConfigRom().getNodeVendorId();
163 unsigned int modelId
= getConfigRom().getModelId();
165 Util::Configuration
&c
= getDeviceManager().getConfiguration();
166 Util::Configuration::VendorModelEntry vme
= c
.findDeviceVME( vendorId
, modelId
);
168 debugOutput(DEBUG_LEVEL_VERBOSE
,
169 "%s %s at node %d\n", vme
.vendor_name
.c_str(), vme
.model_name
.c_str(), getNodeId());
179 Device::getStreamCount() {
183 Streaming::StreamProcessor
*
184 Device::getStreamProcessorByIndex(int i
) {
190 Device::startStreamByIndex(int i
) {
195 Device::stopStreamByIndex(int i
) {