1
0
Fork 0
Commit Graph

163 Commits (31f9690e6eaf549f3e643f6a8f7dab84fd31997a)

Author SHA1 Message Date
Takashi Sakamoto 3f4032861c ALSA: bebob: Fix failure to detect source of clock for Terratec Phase 88
This patch fixes a failure to open PCM device with -ENOSYS in
Terratec Phase 88.

Terratec Phase 88 has two Selector Function Blocks of AVC Audio subunit
to switch source of clock. One is to switch internal/external for the
source and another is to switch word/spdif for the external clock.

The IDs for these Selector Function Blocks are 9 and 8. But in current
implementation they're 0 and 0.

Reported-by: András Murányi <muranyia@gmail.com>
Tested-by: András Murányi <muranyia@gmail.com>
Cc: <stable@vger.kernel.org> # v3.16+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-10 17:25:30 +02:00
Takashi Sakamoto 65845f29be ALSA: firewire-lib/dice: add arrangements of PCM pointer and interrupts for Dice quirk
In IEC 61883-6, one data block transfers one event. In ALSA, the event equals one PCM frame,
hence one data block transfers one PCM frame. But Dice has a quirk at higher sampling rate
(176.4/192.0 kHz) that one data block transfers two PCM frames.

Commit 10550bea44 ("ALSA: dice/firewire-lib: Keep dualwire mode but obsolete
CIP_HI_DUALWIRE") moved some codes related to this quirk into Dice driver. But the commit
forgot to add arrangements for PCM period interrupts and DMA pointer updates. As a result, Dice
driver cannot work correctly at higher sampling rate.

This commit adds 'double_pcm_frames' parameter to amdtp structure for this quirk. When this
parameter is set, PCM period interrupts and DMA pointer updates occur at double speed than in
IEC 61883-6.

Reported-by: Daniel Robbins <drobbins@funtoo.org>
Fixes: 10550bea44 ("ALSA: dice/firewire-lib: Keep dualwire mode but obsolete CIP_HI_DUALWIRE")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: <stable@vger.kernel.org> # 3.16
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-29 09:52:07 +02:00
Takashi Sakamoto 1033eb5b5a ALSA: dice: fix wrong channel mappping at higher sampling rate
The channel mapping is initialized by amdtp_stream_set_parameters(), however
Dice driver set it before calling this function. Furthermore, the setting is
wrong because the index is the value of array, and vice versa.

This commit moves codes for channel mapping after the function and set it correctly.

Reported-by: Daniel Robbins <drobbins@funtoo.org>
Fixes: 10550bea44 ("ALSA: dice/firewire-lib: Keep dualwire mode but obsolete CIP_HI_DUALWIRE")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: <stable@vger.kernel.org> # 3.16
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-29 09:51:45 +02:00
Takashi Sakamoto 30225ed5ca ALSA: fireworks: fix specifiers in format strings for propper output
Use %d for loop counter and %X for device capabilities. This is a
supplemental patch for Hans Wennborg's patch.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-05 09:15:20 +02:00
Hans Wennborg 04b9906d8c ALSA: fireworks: fix %d confusingly prefixed with 0x in format strings
Signed-off-by: Hans Wennborg <hans@hanshq.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-04 13:17:23 +02:00
Takashi Iwai 2e65b8916c Merge branch 'for-next' into for-linus 2014-08-04 11:11:22 +02:00
Stefan Richter 27c828816d ALSA: firewire: trivial typo fixes in Kconfig
ESI Quotafire -> QuataFire
TerraTec EWS Mic4 -> Mic8
Firewire -> FireWire

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-28 10:26:42 +02:00
Takashi Sakamoto eb12f72ee7 ALSA: bebob: Correction for return value of special_clk_ctl_put() in error
This commit is a supplement to my previous patch.
http://mailman.alsa-project.org/pipermail/alsa-devel/2014-July/079190.html

The special_clk_ctl_put() still returns 0 in error handling case. It should
return -EINVAL.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-22 17:31:28 +02:00
Takashi Sakamoto f77ac91e8e ALSA: bebob: Correction for return value of .put callback
This commit is for correction of my misunderstanding about return value of
.put callback in ALSA Control interface.

According to 'Writing ALSA Driver' (*1), return value of the callback has
three patterns; 1: changed, 0: not changed, an negative value: fatal error.

But I misunderstood that it's boolean; zero or nonzero.

*1: Writing an ALSA Driver (2005, Takashi Iwai)
http://www.alsa-project.org/main/index.php/ALSA_Driver_Documentation

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-22 16:21:54 +02:00
Takashi Sakamoto 5a0438f4a6 ALSA: bebob: Use different labels for digital input/output
This commit uses different labels for control elements of digital input/output
interfaces to correct my misunderstanding about M-Audio Firewire 1814 and
ProjectMix I/O.

According to user manuals for these two models, they have two modes for
digital input; one is S/PDIF in both of optical and coaxial interfaces,
another is ADAT in optical interface only.

But in current implementation, a control element for it reduced labels which
a control element for digital output uses because of my misunderstanding
that optical interface is not available for digital input with S/PDIF mode.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-22 16:21:30 +02:00
Takashi Sakamoto 9014011664 ALSA: bebob: Fix a missing to unlock mutex in error handling case
In error handling case, special_clk_ctl_put() returns without unlock_mutex(),
therefore the mutex is still locked. This commit moves mutex_lock() after
the error handling case.

This commit is my solution for this post.

[PATCH -next] ALSA: bebob: Fix missing unlock on error in special_clk_ctl_put()
https://lkml.org/lkml/2014/7/20/12

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-22 16:21:17 +02:00
Takashi Sakamoto 1c9b8f5125 ALSA: bebob: Remove unused function prototype
snd_bebob_stream_map() is not defined.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-04 14:38:16 +02:00
Takashi Sakamoto 021fb6f275 ALSA: fireworks: Remove meaningless mutex_destroy()
Currently mutex_destroy() is called in module's cleanup function. But after
cleaned up, this mutex is automatically released. So this function call
is meaningless.

[fixed a typo in changelog by tiwai]

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-04 14:37:59 +02:00
Takashi Sakamoto f347915092 ALSA: fireworks: Remove a constant over width to which it's applied
The constants of enum snd_efw_grp_type is for struct snd_efw_phys_grp.type.
But this member is 1 byte. Although the value is between 0x00-0xff, a constant
has 0x10000. This constant is meaningless.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-04 14:36:40 +02:00
Takashi Sakamoto 72f784f7d0 ALSA: fireworks: Improve comments about Fireworks transaction
It includes descriptions to cause misreading.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-04 14:36:21 +02:00
Takashi Sakamoto cf44a136c0 ALSA: fireworks: Use safer way to arrange ring buffer pointer
To reverse a pointer for the ring buffer, subtraction by buffer
size is better than assignment to the beginning of the buffer.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-04 14:35:40 +02:00
Takashi Sakamoto c6e5e741c6 ALSA: fireworks/bebob: Shorten critical section for stream_stop_duplex()
All assignment for local variables in these functions are not related to
critical section.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-04 14:35:24 +02:00
Takashi Sakamoto c8109b573b ALSA: firewire-lib: Remove a comment about restriction of asynchronous operation
The comment for fcp_avc_transaction() describes it doesn't support this type
of operation. But it was already supported by this commit.

00a7bb81c2
ALSA: firewire-lib: Add support for deferred transaction

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-03 08:14:21 +02:00
Takashi Sakamoto a6975f2af8 ALSA: firewire-lib: Use IEC 61883-6 compliant labels for Raw Audio data
According to AM824 in IEC 61883-6:2002, 2 bits in LSB of label for Raw Audio
data means Valid Length Code (VBL). Ths value is:
- b00 for 24 bits sample (label is 0x40)
- b01 for 20 bits sample (label is 0x41)
- b10 for 16 bits sample (label is 0x42)

But current firewire-lib apply 24 bits label for both of 16/24 bits samples.

As long as developers investigate BeBoB/Fireworks/OXFW/Dice, all of them
have a behaviour to ignore the label. They can generate correct sound even
if firewire-lib gives wrong label (i.e. 0xff). On BeBoB, this is not only
for Raw Audio data channel, but also for IEC 60958 Conformant data channel.

So there is little possibility of regression.

Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-02 08:46:48 +02:00
Dan Carpenter 33a5f989de ALSA: bebob: sizeof() vs ARRAY_SIZE() typo
ARRAY_SIZE() was intended here instead of sizeof().  The
"bridgeco_freq_table" array holds integers so the original condition is
never true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-01 18:16:04 +02:00
Takashi Iwai 112cddcada ALSA: firewire: Fix dependency on PCM and rawmidi
Now snd-firewire-lib supports rawmidi in addition to PCM, thus we need
to give a proper dependency.  For fixing and simplification, move the
selections of SND_PCM and SND_RAWMIDI into SND_FIREWIRE_LIB section.
Then each driver doesn't have to select them but only
SND_FIREWIRE_LIB.

Reported-by: Jim Davis <jim.epost@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-30 15:22:06 +02:00
Dan Carpenter 396178370b ALSA: fireworks: small leak on error path
There was a typo here so we return directly instead of freeing "hwinfo".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-29 15:56:18 +02:00
Dan Carpenter aeebbddda7 ALSA: fireworks: remove some stray checks
We checked "err" earlier.  These things seem to be left over code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-29 15:56:02 +02:00
Takashi Sakamoto 51fa31d462 ALSA: bebob: Improve comments about stream format
Currently bebob driver apply Raw Audio Data channel (in IEC 61883-1:2002,
Multi Bit Linear Audio Data channel in IEC 61883-6:20005) to IEC 60958
Conformant Data channel because both fireworks and bebob based devices
can handle it by ignoring each label.

This patch improves a comment about this.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:36:24 +02:00
Takashi Sakamoto 7862126a4f ALSA: bebob: Remove meaningless mutex_unlock()
Currently mutex_unlock() is called in module's cleanup function. But after
cleaned up, this mutex is automatically released. So this function call
is meaningless.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:36:11 +02:00
Takashi Sakamoto 9fb01cdb38 ALSA: bebob: Add static specifier to identifier with file scope
Some variables were declared without static even if they're not referred
to from external files. This commit make them local symbols for better
information-hiding by file unit.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:36:01 +02:00
Takashi Sakamoto 791c67b427 ALSA: bebob: Use different names for identifiers in the same file
To suppress 'sparse' warning.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:35:48 +02:00
Takashi Sakamoto 73616c4eec ALSA: fireworks/bebob: Improve indentation
According to coding rule.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:35:38 +02:00
Takashi Sakamoto 9b5f0edfd2 ALSA: fireworks/bebob: Add suffix for long long integer literal
This commit adds suffix to register values of each device, to supress 'sparse'
warnings. Additionally, this commit changes offset values with integer literal.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:35:30 +02:00
Takashi Sakamoto a6b598bf4b ALSA: fireworks/bebob: Use the same type of variables as function parameters
The second argument of snd_efw_command_get_sampling_rate() means sampling
rate and its type is 'unsigned int'. But 'int' variable is passed as parameter.
It's better to apply the same type for the variable as its argument.

Similally, the type of variable for snd_efw_command_get_clock_source() and
avc_bridgeco_get_plug_type() should be the same type as each argument.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:35:22 +02:00
Takashi Sakamoto 4a286d5528 ALSA: fireworks/bebob: Change type of argument for sampling rate
Originally, I intent to this argument given with 'struct snd_pcm_runtime.rate'
or params_rate(). They return value of 'unsigned int'. So 'unsigned int' is
better for the type of this argument.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:35:13 +02:00
Takashi Sakamoto 93219d0649 ALSA: fireworks: Use the same prototype for functions as actual declaration
There are two modes for Fireworks, IEC 61883 compliant or Windows.
So it's better to use enum type instead of int to express the intension,
even if C language specification defines to handle enum variables as usual
integer.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:35:04 +02:00
Takashi Sakamoto ba06b2cbad ALSA: fireworks: Fix wrong value as argument for PTR_ERR()
The return value of memdup_user() should be passed to return correct error.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:34:52 +02:00
Takashi Sakamoto 51212eea4f ALSA: firewire-lib: Fix sparse warning of incorrect type in assignment
__be32 value should not be assigned directly to bool value.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:34:37 +02:00
Takashi Sakamoto f9503a68fb ALSA: firewire-lib: Use ARRAY_SIZE() instead of sizeof() for correct loop limit
This commit fixes a big for loop count with array. The limitation of loop
count should be calcurated with the number of elements in the array, not
with the number of bytes.

Aditionally, this commit apply the same declaration as a prototype in header
for the array.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-27 17:34:27 +02:00
Takashi Sakamoto 9b1ee0b2cb ALSA: firewire/bebob: Add a workaround for M-Audio special Firewire series
In post commit, a quirk of this firmware about transactions is reported.
This commit apply a workaround for this quirk.

They often fail transactions due to gap_count mismatch. This state is changed
by generating bus reset.

The fw_schedule_bus_reset() is an exported symbol in firewire-core. But there
are no header for public. This commit moves its prototype from
drivers/firewire/core.h to include/linux/firewire.h.

This mismatch still affects bus management before generating this bus reset.
It still takes a time to call driver's probe() because transactions are still
often failed.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:33:10 +02:00
Takashi Sakamoto a2b2a7798f ALSA: bebob: Send a cue to load firmware for M-Audio Firewire series
Just powering on, these devices below wait to download firmware.
 - Firewire Audiophile
 - Firewire 410
 - Firewire 1814
 - ProjectMix I/O

But firmware version 5058 or later, flash memory in the device stores the
firmware. So this driver can enable these devices by sending a certain cue to
load the firmware.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:32:58 +02:00
Takashi Sakamoto c495a4a36e ALSA: bebob: Add a quirk of data blocks for MIDI messages for some M-Audio devices
The firmwares for M-Audio Firewire 410/1814 and ProjectMix I/O has a quirk to
ignore MIDI messages in data blocks more than 8. This commit uses a flag which
Fireworks uses for a similar quirk.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:32:46 +02:00
Takashi Sakamoto 9d59124cac ALSA: bebob/firewire-lib: Add a quirk of wrong dbc in empty packet for M-Audio special Firewire series
M-Audio Firewire 1814 has a quirk, ProjectMix I/O also has. They transmit
empty packet with wrong value of dbc incremented by 8 at high sampling rate.
According to IEC 61883-1, this value should be the same as the one in
previous packet.

This commit adds a flag named as CIP_EMPTY_HAS_WRONG_DBC. With flag, the value
of dbc in empty packet is overwittern by an expected value.

This is an example of this quirk:
CIP Header 0	CIP Header 1	Payload size
010D0000	9004F759	210
010D0010	90040B59	210
010D0020	90042359	210
01020028	9004FFFF	2  <-
010D0030	90043759	210
010D0040	90044B59	210
010D0050	90046359	210
01020058	9004FFFF	2  <-
010D0060	90047759	210
010D0070	90048B59	210
010D0080	9004A359	210
01020088	9004FFFF	2  <-
010D0090	9004B759	210
010D00A0	9004CB59	210
010D00B0	9004E359	210
010200B8	9004FFFF	2  <-
010D00C0	9004F759	210
010D00D0	90040B59	210
010D00E0	90042359	210

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:32:33 +02:00
Takashi Sakamoto 3149ac489f ALSA: bebob: Add support for M-Audio special Firewire series
This commit allows this driver to support some models which M-Audio produces
with DM1000 but its firmware is special. They are:
 - Firewire 1814
 - ProjectMix I/O

They have heavily customized firmware. The usual operations can't be applied to
them. For this reason, this commit adds a model specific member to 'struct
snd_bebob' and some model specific functions. Some parameters are write-only so
this commit also adds control interface for applications to set them.

M-Audio special firmware quirks:
 - Just after powering on, they wait to download firmware. This state is
   changed when receiving cue. Then bus reset is generated and the device is
   recognized as a different model with the uploaded firmware.
 - They don't respond against BridgeCo AV/C extension commands. So drivers
   can't get their stream formations and so on.
 - They do not start to transmit packets only by establishing connection but
   also by receiving SIGNAL FORMAT command.
 - After booting up, they often fail to send response against driver's request
   due to mismatch of gap_count.

This module don't support to upload firmware.

Tested-by: Darren Anderson <darrena092@gmail.com> (ProjectMix I/O)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:32:21 +02:00
Takashi Sakamoto 9076c22ddd ALSA: bebob: Add support for M-Audio usual Firewire series
This commit allows this driver to support some models which M-Audio produces
with DM1000/DM1000E with usual firmware. They are:
 - Firewire 410
 - Firewire AudioPhile
 - Firewire Solo
 - Ozonic
 - NRV10
 - FirewireLightBridge

According to a person who worked in BridgeCo, some models are produced with
'Pre-BeBoB'. This means that these products were released before BeBoB was
officially produced, and later BeBoB specification was formed. So these models
have some quirks.

M-Audio usual firmware quirks:
 - Just after powering on, 'Firewire 410' waits to download firmware. This
   state is changed when receiving cue. Then bus reset is generated and the
   device is recognized as a different model with the uploaded firmware.
 - 'Firewire Audiophile' also waits to download firmware but its
   vendor id/model id is the same as the one after loading firmware.
 - The information of channel mapping for MIDI conformant data channel is
   invalid against BridgeCo specification.

This commit adds some codes for these quirks but don't support to upload
firmware.

This commit also adds specific operations to get metering information. The
metering information also includes status of clock synchronization if the model
supports to switch source of clock.

The specification of FirewireLightBridge is unknown. So in this time, normal
operations are applied for this model.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:32:03 +02:00
Takashi Sakamoto 25784ec2d0 ALSA: bebob: Add support for Focusrite Saffire/SaffirePro series
This commit allows this driver to support all of models which Focusrite
produces with DM1000/BeBoB. They are:
 - Saffire
 - Saffire LE
 - SaffirePro 10 I/O
 - SaffirePro 26 I/O

This commit adds Focusrite specific operations:
1. Get source of clock
2. Get/Set sampling frequency
3. Get metering information

The driver uses these functionalities to read/write specific address by async
transaction.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:31:50 +02:00
Takashi Sakamoto 8ac98a3585 ALSA: bebob: Add support for Yamaha GO series
This commit allows this driver to support all of models which Yamaha produced
with DM1000/BeBoB. They are:
 - GO44
 - GO46

This commit adds Yamaha specific operations. To get source of clock, AV/C Audio
Subunit command is used.

I note that their appearances are similar to some models of TerraTec; 'Go44' is
similar to 'PHASE 24 FW' and 'GO46' is similar to 'PHASE X24 FW'. But their
combination of Audio/Music subunits is a bit different.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:31:38 +02:00
Takashi Sakamoto 326b9cacf4 ALSA: bebob: Add support for Terratec PHASE, EWS series and Aureon
This commit allows this driver to support all of models which Terratec produced
with DM1000/BeBoB. They are:
 - PHASE 24 FW
 - PHASE X24 FW
 - PHASE 88 Rack FW
 - EWS MIC2
 - EWS MIC4
 - Aureon 7.1 Firewire

For Phase series, this commit adds a Terratec specific operation. To get source
of clock. AV/C Audio Subunit command is used.

For EWS series and Aureon, this module uses normal operations.

Tested-by: Maximilian Engelhardt <maxi@daemonizer.de> (PHASE 24 FW)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:31:25 +02:00
Takashi Sakamoto 1fc9522a08 ALSA: bebob: Prepare for device specific operations
This commit is for some devices which have its own operations or quirks.

Many functionality should be implemented in user land. Then this commit adds
functionality related to stream such as sampling frequency or clock source. For
help to debug, this commit adds the functionality to get metering information
if it's available.

To help these functionalities, this commit adds some AV/C commands defined in
'AV/C Audio Subunit Specification (1394TA).

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:31:15 +02:00
Takashi Sakamoto 618eabeae7 ALSA: bebob: Add hwdep interface
This interface is designed for mixer/control application. By using hwdep
interface, the application can get information about firewire node, can
lock/unlock kernel streaming and can get notification at starting/stopping
kernel streaming.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:31:03 +02:00
Takashi Sakamoto fbbebd2c40 ALSA: bebob: Add PCM interface
This commit adds a functionality to capture/playback PCM samples.

When AMDTP stream is already running for PCM or the source of clock is not
internal, available sampling rate is limited at current one.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:30:46 +02:00
Takashi Sakamoto 248b78027d ALSA: bebob: Add MIDI interface
This commit adds a functionality to capture/playback MIDI messages.

When no AMDTP streams are running, this module starts AMDTP stream at current
sampling rate for MIDI substream.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:30:16 +02:00
Takashi Sakamoto ad9697bad7 ALSA: bebob: Add proc interface for debugging purpose
This commit adds proc interface to get these information for debugging:
 - firmware information
 - stream formation
 - current clock source and sampling rate

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:30:00 +02:00
Takashi Sakamoto b6bc812327 ALSA: bebob/firewire-lib: Add a quirk for discontinuity at bus reset
Normal BeBoB firmware has a quirk. When receiving bus reset, it transmits
packets with discontinuous value in dbc field.

This causes two situation, one is to abort streaming by firewire-lib as a
result of detecting the discontinuity. Another is to call driver's .update()
because of bus reset. These two is generated independently. (The former
depends on isochronous stream and the latter depends on IEEE1394 bus driver.)

When BeBoB driver works with XRUN-recoverable applications, this situation
looks like stream_start_duplex() call followed by stream_update_duplex() call
because applications will call snd_pcm_prepare() immediately at XRUN.

To update connections and streams at first, this commit use completion. When
queueing error occurs, stream_start_duplex() is forced to wait maximum
1000msec. During this, when .update() is called, the completion is waken and
stream_start_duplex() is processed without breaking connections.

At bus reset, stream_start_duplex() shouldn't break/establish connections and
stream_update_duplex() should update connections because a caller of
fw_iso_resources_allocate() is responsible for calling
fw_iso_resources_update() on bus reset.

This commit also adds a flag, which has an effect to skip checking continuity
for first packet. This flag is useful for BeBoB quirk to start handling packets
during streaming.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-26 14:29:44 +02:00