Граф коммитов

5 Коммитов

Автор SHA1 Сообщение Дата
Takashi Sakamoto 84eaaef2ae ALSA: dice: unuse second stream for MIDI conformant data channel for TC Electronic models
At present, all of models produced by TC Electronic except for Konnekt Live
are supported with hard-coded their stream formats. Studio Konnekt 48 is
sore model to support dual streams for both directions. The second stream
has no MIDI conformant data channel in its data block. But current
implementation transfers the second stream with MIDI conformant data
channel.

This commit fixes this issue.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-27 08:32:08 +02:00
Takashi Sakamoto 1ceb506d63 ALSA: dice: fix stream format parameters for TC Electronic Studio Konnekt 48
TC Electronic Studio Konnekt 48 is an application of combination of
WaveFront Dice II STD and TC Applied Technologies (TCAT) TCD2210 (Dice
Mini). The latter is on a board with BNC and optical interfaces, thus
used for signal processing for word clock, S/PDIF and ADAT. This model
doesn't support TCAT extended application protocol. For such devices,
ALSA dice driver needs to have hard-coded parameters for stream formats.

This commit fixes stream format parameters for this model. Unfortunately, at
sampling transmission frequencies over 48.0kHz, I confirmed that current
ALSA dice driver doesn't drive the device appropriately to generate sounds
(silence). I guess that this comes from timestamping quirk of Dice-based
devices, which I reported.

[alsa-devel] Dice packet sequence quirk and ALSA firewire stack in Linux 4.6
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-May/107715.html

$ cd linux-firewire-utils/src
$ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400  04044a26  bus_info_length 4, crc_length 4, crc 18982
404  31333934  bus_name "1394"
408  e0ff8112  irmc 1, cmc 1, isc 1, bmc 0, pmc 0, cyc_clk_acc 255,
               max_rec 8 (512), max_rom 1, gen 1, spd 2 (S400)
40c  00016604  company_id 000166     |
410  08a65810  device_id 0408a65810  | EUI-64 0001660408a65810

               root directory
               -----------------------------------------------------------------
414  00062ab9  directory_length 6, crc 10937
418  03000166  vendor
41c  8100000a  --> descriptor leaf at 444
420  17000022  model
424  8100000f  --> descriptor leaf at 460
428  0c0087c0  node capabilities per IEEE 1394
42c  d1000001  --> unit directory at 430

               unit directory at 430
               -----------------------------------------------------------------
430  0004d5c5  directory_length 4, crc 54725
434  12000166  specifier id
438  13000001  version
43c  17000022  model
440  8100000f  --> descriptor leaf at 47c

               descriptor leaf at 444
               -----------------------------------------------------------------
444  0006c490  leaf_length 6, crc 50320
448  00000000  textual descriptor
44c  00000000  minimal ASCII
450  54432045  "TC E"
454  6c656374  "lect"
458  726f6e69  "roni"
45c  63000000  "c"

               descriptor leaf at 460
               -----------------------------------------------------------------
460  0006e08e  leaf_length 6, crc 57486
464  00000000  textual descriptor
468  00000000  minimal ASCII
46c  53747564  "Stud"
470  696f4b6f  "ioKo"
474  6e6e656b  "nnek"
478  74343800  "t48"

               descriptor leaf at 47c
               -----------------------------------------------------------------
47c  0006e08e  leaf_length 6, crc 57486
480  00000000  textual descriptor
484  00000000  minimal ASCII
488  53747564  "Stud"
48c  696f4b6f  "ioKo"
490  6e6e656b  "nnek"
494  74343800  "t48"

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-27 08:32:00 +02:00
Takashi Sakamoto d0aa590962 ALSA: dice: add stream format parameters for TC Electronic Digital Konnekt x32
TC Electronic Digital Konnekt x32 is an application of WaveFront DiceII STD
and doesn't support TCAT extended application protocol. For such devices,
ALSA dice driver needs to have hard-coded parameters for stream formats.

This commit adds stream format parameters for this model. Unfortunately, at
sampling transmission frequencies of 88.2/96.0kHz, I confirmed that current
ALSA dice driver doesn't drive the device appropriately due to detecting
packet discontinuities.

$ journalctl
kernel: snd_dice fw1.0: Detect discontinuity of CIP: 90 80

At the frequencies, the device transfers 16 data blocks per packet and 16
data channels per data block, as a result one packet includes 1032 bytes
if it's not NODATA. However, as long as I checked, the device often
postpone packet transmission and continue with truncated payload than
metadata in isochronous packet header. Below is a sample of sequence I got.

sec cycle bytes       CIP1       CIP2
 37  3314  1032 0x01100090 0x900449E2
 37  3315     8 0x011000A0 0x9004FFFF
 37  3316  1032 0x011000A0 0x900461E2
 37  3317  1032 0x011000B0 0x900475E2
 37  3318  1032 0x011000C0 0x900489E2
 37  3319     8 0x011000D0 0x9004FFFF
 37  3320  1032 0x011000D0 0x9004A1E2
 37  3321  1032 0x011000E0 0x9004B5E2
 37  3322  1032 0x011000F0 0x9004C9E2
 37  3323     8 0x01100000 0x9004FFFF
 37  3324  1032 0x01100000 0x9004E1E2
 37  3325  1032 0x01100010 0x9004F5E2
 37  3326  1032 0x01100020 0x900409E2
 37  3327     8 0x01100030 0x9004FFFF
 37  3328  1032 0x01100030 0x900421E2
 37  3329  1032 0x01100040 0x900435E2
 37  3330  (skip)
 37  3331  (skip)
 37  3332  (skip)
 37  3333  (skip)
 37  3334  (skip)
 37  3335  (skip)
 37  3336  (skip)
 37  3337  (skip)
 37  3338  (skip)
 37  3339  (skip)
 37  3340  (skip)
 37  3341  (skip)
 37  3342  (skip)
 37  3343  (skip)
 37  3344  (skip)
 37  3345  (skip)
 37  3346  (skip)
 37  3347  (skip)
 37  3348  (skip)
 37  3349  (skip)
 37  3350  (skip)
 37  3351  (skip)
 37  3352  (skip)
 37  3353  (skip)
 37  3354  (skip)
 37  3355  (skip)
 37  3356  (skip)
 37  3357  (skip)
 37  3358  (skip)
 37  3359  (skip)
 37  3360  (skip)
 37  3361  (skip)
 37  3362  (skip)
 37  3363  (skip)
 37  3364  (skip)
 37  3365  (skip)
 37  3366  (skip)
 37  3367  1032 0x01100050 0x900461E1
 37  3368  1032 0x01100060 0x900475E1
 37  3369  1032 0x01100070 0x9004A1E1
 37  3370  1032 0x01100080 0x9004A1E1 but content of payload is truncated.
 37  3371  (skip)
 37  3371  1032 0x01100080 0x9004B5E0 detect discontinuity
 37  3372  1032 0x01100090 0x9004C9E0
 37  3373  1032 0x011000A0 0x9004E1E0
 37  3374  1032 0x011000B0 0x9004F5E0
 37  3375  1032 0x011000C0 0x900409E0
 37  3376  1032 0x011000D0 0x900421E0
 37  3377  1032 0x011000E0 0x900435E0
 37  3378  1032 0x011000F0 0x900449DF
 37  3379     8 0x01100000 0x9004FFFF
 37  3380  1032 0x01100000 0x900461DF
 37  3381  1032 0x01100010 0x900475DF
 37  3382  1032 0x01100020 0x900489DF
 37  3383     8 0x01100030 0x9004FFFF
 37  3384  1032 0x01100030 0x9004A1DF
 37  3385  1032 0x01100040 0x9004B5DF
 37  3386  1032 0x01100050 0x9004C9DF
 37  3387     8 0x01100060 0x9004FFFF

I cannot confirm this quirks with Windows driver. ALSA dice driver has a
cause if assumed differences between these two drivers are ways of
timestampling to RX packets from the drivers to the device. I've already
reported timestamping quirk of Dice-based devices and this might bring
this issue.

[alsa-devel] Dice packet sequence quirk and ALSA firewire stack in Linux 4.6
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-May/107715.html

Well, nevertheless, I enable ALSA dice driver to work at the frequencies.
This may brings inconvenience to users but I expect developers and users
to fix it.

$ cd linux-firewire-utils/src
$ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400  040423bb  bus_info_length 4, crc_length 4, crc 9147
404  31333934  bus_name "1394"
408  e0ff8112  irmc 1, cmc 1, isc 1, bmc 0, pmc 0, cyc_clk_acc 255,
               max_rec 8 (512), max_rom 1, gen 1, spd 2 (S400)
40c  00016604  company_id 000166     |
410  0c232c28  device_id 040c232c28  | EUI-64 000166040c232c28

               root directory
               -----------------------------------------------------------------
414  0006b6cb  directory_length 6, crc 46795
418  03000166  vendor
41c  8100000a  --> descriptor leaf at 444
420  17000030  model
424  8100000f  --> descriptor leaf at 460
428  0c0087c0  node capabilities per IEEE 1394
42c  d1000001  --> unit directory at 430

               unit directory at 430
               -----------------------------------------------------------------
430  000476c2  directory_length 4, crc 30402
434  12000166  specifier id
438  13000001  version
43c  17000030  model
440  81000010  --> descriptor leaf at 480

               descriptor leaf at 444
               -----------------------------------------------------------------
444  0006c490  leaf_length 6, crc 50320
448  00000000  textual descriptor
44c  00000000  minimal ASCII
450  54432045  "TC E"
454  6c656374  "lect"
458  726f6e69  "roni"
45c  63000000  "c"

               descriptor leaf at 460
               -----------------------------------------------------------------
460  000772b4  leaf_length 7, crc 29364
464  00000000  textual descriptor
468  00000000  minimal ASCII
46c  44696769  "Digi"
470  74616c4b  "talK"
474  6f6e6e65  "onne"
478  6b747833  "ktx3"
47c  32000000  "2"

               descriptor leaf at 480
               -----------------------------------------------------------------
480  000772b4  leaf_length 7, crc 29364
484  00000000  textual descriptor
488  00000000  minimal ASCII
48c  44696769  "Digi"
490  74616c4b  "talK"
494  6f6e6e65  "onne"
498  6b747833  "ktx3"
49c  32000000  "2"

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-21 11:33:37 +02:00
Dan Carpenter ed1812c44c ALSA: dice: fix a bounds check in snd_dice_detect_tcelectronic_formats()
The "entry" pointer is always non-NULL so this test for out of bounds
won't work.

Fixes: f1f0f330b1 ("ALSA: dice: add parameters of stream formats for models produced by TC Electronic")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-18 13:38:34 +02:00
Takashi Sakamoto f1f0f330b1 ALSA: dice: add parameters of stream formats for models produced by TC Electronic
TC Electronic shipped some models with DICE ASICs. All of them just support
DICE original protocol and drivers can't retrieve all of available stream
formats without changing status of sampling transmission frequency
actually.

This commit puts some hard-coded parameters for the models. When detecting
the models, the corresponding parameters are copied as cache of stream
formats.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02 16:01:55 +02:00