diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2015-09-20 21:18:55 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-09-24 11:44:25 +0200 |
commit | 13f3a46d2a6cbdff1bbb06fac6de7dce753db8e1 (patch) | |
tree | d613ab66ef9890d2d15d1e2b238d293e611bd024 /sound/firewire/oxfw/oxfw.c | |
parent | 0052b7dcf9d9ec6be4fc3fe815a2ceda623bb9d1 (diff) | |
download | linux-13f3a46d2a6cbdff1bbb06fac6de7dce753db8e1.tar.bz2 |
ALSA: oxfw: add Mackie Onyx Satellite quirk to inform wrong value in 'dbs' field in tx CIP header
Mackie Onyx Satellite has two usage; standalone and with base station.
These two modes has different stream formats. In standalone mode, rx data
block includes 2 Multi Bit Linear Audio (MBLA) data channels and tx data
block includes 2. With base station, they're 6 and 2.
Although, with base station, the actual tx packet include wrong value in
'dbs' field in its CIP header. This quirk causes packet streaming layer to
detect packet discontinuity and to stop PCM substream.
This is a response of 'single' subfunction 'extended stream format
information' command in AV/C Stream Format Information Specification 1.1.
It means that a data block in tx packets includes 2 MBLA data channels.
$ ./firewire-request /dev/fw1 fcp 0x01ffbfc001000000ffffffff
response: 000: 0c ff bf c0 01 00 00 00 ff 00 90 40 03 02 01 02
response: 010: 06
Current OXFW driver parses the response and detects stream formats
correctly.
$ cat /proc/asound/card1/firewire/formation
...
Output Stream from device:
Rate PCM MIDI
* 48000 2 0
44100 2 0
88200 2 0
96000 2 0
On the other hand, in actual tx CIP, the 'dbs' field has 6. But the number
of quadlets in CIP payload is not multiple of 6. Seeing the subtraction of
two successive payload quadlets, it should be multiple of 2.
payload CIP CIP
quadlets header0 header1
24 00060052 9002ffff
24 0006005e 9002ffff
26 0006006a 9002ffff
24 00060077 9002ffff
24 00060083 9002ffff
26 0006008f 9002ffff
24 0006009c 9002ffff
24 000600a8 9002ffff
26 000600b4 9002ffff
24 000600c1 9002ffff
This commit adds support for this quirk to OXFW driver, by using
CIP_WRONG_DBS flag. When this flag is set, packet streaming layer uses
the value of its 'data_block_quadlets' member instead of the value in CIP
header. This value is already set by OXFW driver and no discontinuity is
detected.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/oxfw/oxfw.c')
-rw-r--r-- | sound/firewire/oxfw/oxfw.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index 8c6ce019f437..d606e3a9ce97 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -19,6 +19,8 @@ #define VENDOR_BEHRINGER 0x001564 #define VENDOR_LACIE 0x00d04b +#define MODEL_SATELLITE 0x00200f + #define SPECIFIER_1394TA 0x00a02d #define VERSION_AVC 0x010001 @@ -129,6 +131,31 @@ static void oxfw_card_free(struct snd_card *card) mutex_destroy(&oxfw->mutex); } +static void detect_quirks(struct snd_oxfw *oxfw) +{ + struct fw_device *fw_dev = fw_parent_device(oxfw->unit); + struct fw_csr_iterator it; + int key, val; + int vendor, model; + + /* Seek from Root Directory of Config ROM. */ + vendor = model = 0; + fw_csr_iterator_init(&it, fw_dev->config_rom + 5); + while (fw_csr_iterator_next(&it, &key, &val)) { + if (key == CSR_VENDOR) + vendor = val; + else if (key == CSR_MODEL) + model = val; + } + + /* + * Mackie Onyx Satellite with base station has a quirk to report a wrong + * value in 'dbs' field of CIP header against its format information. + */ + if (vendor == VENDOR_LOUD && model == MODEL_SATELLITE) + oxfw->wrong_dbs = true; +} + static int oxfw_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) { @@ -157,6 +184,8 @@ static int oxfw_probe(struct fw_unit *unit, if (err < 0) goto error; + detect_quirks(oxfw); + err = name_card(oxfw); if (err < 0) goto error; |