summaryrefslogtreecommitdiff
path: root/sound/firewire/dice
AgeCommit message (Collapse)Author
2021-07-15ALSA: dice: fix stream format at middle sampling rate for Alesis iO 26Takashi Sakamoto
commit 1b6604896e78969baffc1b6cc6bc175f95929ac4 upstream. Alesis iO 26 FireWire has two pairs of digital optical interface. It delivers PCM frames from the interfaces by second isochronous packet streaming. Although both of the interfaces are available at 44.1/48.0 kHz, first one of them is only available at 88.2/96.0 kHz. It reduces the number of PCM samples to 4 in Multi Bit Linear Audio data channel of data blocks on the second isochronous packet streaming. This commit fixes hardcoded stream formats. Cc: <stable@vger.kernel.org> Fixes: 28b208f600a3 ("ALSA: dice: add parameters of stream formats for models produced by Alesis") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20210513125652.110249-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-15ALSA: dice: fix stream format for TC Electronic Konnekt Live at high ↵Takashi Sakamoto
sampling transfer frequency commit 4c6fe8c547e3c9e8c15dabdd23c569ee0df3adb1 upstream. At high sampling transfer frequency, TC Electronic Konnekt Live transfers/receives 6 audio data frames in multi bit linear audio data channel of data block in CIP payload. Current hard-coded stream format is wrong. Cc: <stable@vger.kernel.org> Fixes: f1f0f330b1d0 ("ALSA: dice: add parameters of stream formats for models produced by TC Electronic") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20210518012612.37268-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-24ALSA: dice: fix null pointer dereference when node is disconnectedTakashi Sakamoto
commit dd7b836d6bc935df95c826f69ff4d051f5561604 upstream. When node is removed from IEEE 1394 bus, any transaction fails to the node. In the case, ALSA dice driver doesn't stop isochronous contexts even if they are running. As a result, null pointer dereference occurs in callback from the running context. This commit fixes the bug to release isochronous contexts always. Cc: <stable@vger.kernel.org> # v5.4 or later Fixes: e9f21129b8d8 ("ALSA: dice: support AMDTP domain") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20210312093407.23437-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-23ALSA: dice: fix fallback from protocol extension into limited functionalityTakashi Sakamoto
commit 3e2dc6bdb56893bc28257e482e1dbe5d39f313df upstream. At failure of attempt to detect protocol extension, ALSA dice driver should be fallback to limited functionality. However it's not. This commit fixes it. Cc: <stable@vger.kernel.org> # v4.18+ Fixes: 58579c056c1c9 ("ALSA: dice: use extended protocol to detect available stream formats") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20200113084630.14305-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-16ALSA: dice: fix wrong packet parameter for Alesis iO26Takashi Sakamoto
At higher sampling rate (e.g. 192.0 kHz), Alesis iO26 transfers 4 data channels per data block in CIP. Both iO14 and iO26 have the same contents in their configuration ROM. For this reason, ALSA Dice driver attempts to distinguish them according to the value of TX0_AUDIO register at probe callback. Although the way is valid at lower and middle sampling rate, it's lastly invalid at higher sampling rate because because the two models returns the same value for read transaction to the register. In the most cases, users just plug-in the device and ALSA dice driver detects it. In the case, the device runs at lower sampling rate and the driver detects expectedly. For this reason, this commit leaves the way to detect as is. Fixes: 28b208f600a3 ("ALSA: dice: add parameters of stream formats for models produced by Alesis") Cc: <stable@vger.kernel.org> # v4.18+ Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20190916101851.30409-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-29ALSA: dice: fix error path for initialization of stream structuresTakashi Sakamoto
When introducing AMDTP domain to ALSA dice driver, error path does not handle error correctly. This commit fixes the bug. Fixes: e9f21129b8d8 ("ALSA: dice: support AMDTP domain") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-05ALSA: dice: support AMDTP domainTakashi Sakamoto
This commit adds AMDTP domain support for ALSA dice driver. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-08Merge tag 'asoc-v5.3' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.3 This is a very big update, mainly thanks to Morimoto-san's refactoring work and some fairly large new drivers. - Lots more work on moving towards a component based framework from Morimoto-san. - Support for force disconnecting muxes from Jerome Brunet. - New drivers for Cirrus Logic CS47L35, CS47L85 and CS47L90, Conexant CX2072X, Realtek RT1011 and RT1308. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-07ALSA: dice: fix wrong reference count for stream functionality at error path ↵Takashi Sakamoto
of rawmidi interface In IEC 61883-6, several types of sampling data can be multiplexed into payload of common isochronous packet (CIP). For typical audio and music units, PCM samples and MIDI messages are multiplexed into one packet streaming. ALSA dice driver allows applications of rawmidi interface to start packet streaming for transmission of MIDI messages. However at error path, the reference count of stream functionality is not operated correctly. This can brings a bug that packet streaming is not stopped when all referrers release the count. This commit fixes the bug. Fixes: 3cd2c2d780a2 ("ALSA: dice: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-21ALSA: dice: unify stop and release method for duplex streamsTakashi Sakamoto
>From callbacks for pcm and rawmidi interfaces, the functions to stop and release duplex streams are called at the same time. This commit merges the two functions. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-13ALSA: dice: fix compiler warning due to returning uninitialized valueTakashi Sakamoto
This commit fixes the warning due to returning uninitialized value from start_streams() helper function. sound/firewire/dice/dice-stream.c: In function 'start_streams.isra.0': >> sound/firewire/dice/dice-stream.c:350:6: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] int err; ^~~ Reported-by: kbuild test robot <lkp@intel.com> Fixes: 3cd2c2d780a2 ("ALSA: dice: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-11ALSA: dice: code refactoring for pcm.hw_params/hw_free callbacksTakashi Sakamoto
The pairs of pcm.hw_params callbacks and .hw_free callbacks for both direction have no differences. This commit unifies the pairs. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-11ALSA: dice: update isochronous resources when starting packet streaming ↵Takashi Sakamoto
after bus-reset After bus reset, isochronous resource manager releases all of allocated isochronous resources. The nodes to transfer isochronous packet should request reallocation of the resources. However, between the bus-reset and invocation of 'struct fw_driver.update' handler, ALSA PCM application can detect this situation by XRUN because the target device cancelled to transmit packets once bus-reset occurs. Due to the above mechanism, ALSA fireface driver just stops packet streaming in the update handler, thus pcm.prepare handler should request the reallocation. This commit requests the reallocation in pcm.prepare callback when bus generation is changed. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-11ALSA: dice: reserve/release isochronous resources in pcm.hw_params/hw_free ↵Takashi Sakamoto
callbacks Once allocated, isochronous resources are available for packet streaming, even if the streaming is cancelled. For this reason, current implementation handles allocation of the resources and starting packet streaming at the same time. However, this brings complicated procedure to start packet streaming. This commit separates the allocation and starting. The allocation is done in pcm.hw_params callback and available till pcm.hw_free callback. Even if any XRUN occurs, pcm.prepare callback is done to restart packet streaming without releasing/allocating the resources. There are two points to stop packet streaming; in pcm.hw_params and pcm.prepare callbacks. The former point is a case that packet streaming is already started for any MIDI substream then packet streaming is requested with different sampling transfer frequency for any PCM substream. The latter point is cases of any XRUN or packet queueing error. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-11ALSA: dice: code refactoring to keep isochronous resourcesTakashi Sakamoto
This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. This commit adds a helper function to allocate isochronous resources, separated from operations to start packet streaming, I note that some dice-based devices have two pair of endpoints for isochronous packet straeming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-11ALSA: dice: code refactoring to stop packet streamingTakashi Sakamoto
This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. There're three points to finish packet streaming but no helper functions for common operations for it. This commit adds a helper function for operations to finish packet streaming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345Thomas Gleixner
Based on 1 normalized pattern(s): licensed under the terms of the gnu general public license version 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 88 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000437.521539229@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-20ALSA: dice: add stream format parameters for PreSonus FireStudioTakashi Sakamoto
FireStudio was launched by PreSonus 2009. This model consists of three ICs for its packet processing on IEEE 1394 bus: - Texus Instruments TSB41AB2 for physical layer of IEEE 1394 bus - WaveFront semiconductor, Dice II STD ASIC for link layer of IEEE 1394 bus and protocol layer - Xilinx Spartan XG3S500E FPGA for signal processing This model don't support TCAT extended application protocol. For such devices, ALSA dice driver needs to have hard-coded parameters for stream formats. This commit adds hard-coded table for this model. As a result, sampling transfer frequencies of 88.2/96.0 kHz are supported. I note that this patch can be backported to Linux kernel v4.18 and later. $ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 400 04042eda bus_info_length 4, crc_length 4, crc 11994 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 000a9204 company_id 000a92 | 410 023a8b7f device_id 04023a8b7f | EUI-64 000a9204023a8b7f root directory ----------------------------------------------------------------- 414 000661b6 directory_length 6, crc 25014 418 03000a92 vendor 41c 8100000a --> descriptor leaf at 444 420 17000008 model 424 8100000d --> descriptor leaf at 458 428 0c0087c0 node capabilities per IEEE 1394 42c d1000001 --> unit directory at 430 unit directory at 430 ----------------------------------------------------------------- 430 00041c75 directory_length 4, crc 7285 434 12000a92 specifier id 438 13000001 version 43c 17000008 model 440 8100000c --> descriptor leaf at 470 descriptor leaf at 444 ----------------------------------------------------------------- 444 00047c11 leaf_length 4, crc 31761 448 00000000 textual descriptor 44c 00000000 minimal ASCII 450 50726553 "PreS" 454 6f6e7573 "onus" descriptor leaf at 458 ----------------------------------------------------------------- 458 0005d7b3 leaf_length 5, crc 55219 45c 00000000 textual descriptor 460 00000000 minimal ASCII 464 46495245 "FIRE" 468 53545544 "STUD" 46c 494f0000 "IO" descriptor leaf at 470 ----------------------------------------------------------------- 470 0005d7b3 leaf_length 5, crc 55219 474 00000000 textual descriptor 478 00000000 minimal ASCII 47c 46495245 "FIRE" 480 53545544 "STUD" 484 494f0000 "IO" Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-02-06ALSA: firewire: Remove superfluous snd_info_register() callsTakashi Iwai
The calls of snd_info_register() are superfluous and should be avoided at the procfs creation time. They are called at the end of the whole initialization via snd_card_register(). This patch drops such superfluous calls. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-01-28ALSA: dice: add support for Solid State Logic Duende Classic/MiniTakashi Sakamoto
Duende Classic was produced by Solid State Logic in 2006, as a first model of Duende DSP series. The following model, Duende Mini was produced in 2008. They are designed to receive isochronous packets for PCM frames via IEEE 1394 bus, perform signal processing by downloaded program, then transfer isochronous packets for converted PCM frames. These two models includes the same embedded board, consists of several ICs below: - Texus Instruments Inc, TSB41AB3 for physical layer of IEEE 1394 bus - WaveFront semiconductor, DICE II STD ASIC for link/protocol layer - Altera MAX 3000A CPLD for programs - Analog devices, SHARC ADSP-21363 for signal processing (4 chips) This commit adds support for the two models to ALSA dice driver. Like support for the other devices, packet streaming is just available. Userspace applications should be developed if full features became available; e.g. program uploader and parameter controller. $ ./hinawa-config-rom-printer /dev/fw1 { 'bus-info': { 'adj': False, 'bmc': False, 'chip_ID': 349771402425, 'cmc': True, 'cyc_clk_acc': 255, 'generation': 1, 'imc': True, 'isc': True, 'link_spd': 2, 'max_ROM': 1, 'max_rec': 512, 'name': '1394', 'node_vendor_ID': 20674, 'pmc': False}, 'root-directory': [ ['VENDOR', 20674], ['DESCRIPTOR', 'Solid State Logic'], ['MODEL', 112], ['DESCRIPTOR', 'Duende board'], [ 'NODE_CAPABILITIES', { 'addressing': {'64': True, 'fix': True, 'prv': True}, 'misc': {'int': False, 'ms': False, 'spt': True}, 'state': { 'atn': False, 'ded': False, 'drq': True, 'elo': False, 'init': False, 'lst': True, 'off': False}, 'testing': {'bas': False, 'ext': False}}], [ 'UNIT', [ ['SPECIFIER_ID', 20674], ['VERSION', 1], ['MODEL', 112], ['DESCRIPTOR', 'Duende board']]]]} Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-27ALSA: dice: fix to wait for releases of all ALSA character devicesTakashi Sakamoto
In a development period for Linux kernel v4.20, drivers in ALSA firewire stack were changed to wait for releases of all ALSA character devices at .remove callback of bus driver. However, ALSA dice driver is partly out of this change. This bug can bring fault to user process which holds the last of character device in unplugging. This commit fixes the driver to wait in the callback. Fixes: 61ccc6f6b27c ('ALSA: firewire: block .remove callback of bus driver till all of ALSA character devices are released') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10ALSA: firewire: simplify cleanup process when failing to register sound cardTakashi Sakamoto
In former commits, .private_free callback releases resources just for data transmission. This release function can be called without the resources are actually allocated in error paths. This commit applies a small refactoring to clean up codes in error paths. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10ALSA: firewire: release reference count of firewire unit in .remove callback ↵Takashi Sakamoto
of bus driver In a previous commit, drivers in ALSA firewire stack blocks .remove callback of bus driver. This enables to release members of private data in the callback after releasing device of sound card. This commit simplifies codes to release the members. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04ALSA: firewire: use managed-resource of fw unit device for private dataTakashi Sakamoto
At present, private data of each driver in ALSA firewire stack is allocated/freed by kernel slab allocator for corresponding unit on IEEE 1394 bus. In this case, resource-managed slab allocator is available to release memory object automatically just before releasing device structure for the unit. This idea can prevent runtime from memory leak due to programming mistakes. This commit uses the allocator for the private data. These drivers already use reference counter to maintain lifetime of device structure for the unit by a pair of fw_unit_get()/fw_unit_put(). The private data is safely released in a callback of 'struct snd_card.private_free(). Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-12Merge branch 'for-next' into for-linusTakashi Iwai
Preparation for 4.19 merge material. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-06ALSA: dice: fix wrong copy to rx parameters for Alesis iO26Takashi Sakamoto
A commit 28b208f600a3 ('ALSA: dice: add parameters of stream formats for models produced by Alesis') adds wrong copy to rx parameters instead of tx parameters for Alesis iO26. This commit fixes the bug for v4.18-rc8. Fixes: 28b208f600a3 ('ALSA: dice: add parameters of stream formats for models produced by Alesis') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Cc: <stable@vger.kernel.org> # v4.18 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-18ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc()Takashi Iwai
snd_pcm_lib_mmap_vmalloc() was supposed to be implemented with somewhat special for vmalloc handling, but in the end, this turned to just the default handler, i.e. NULL. As the situation has never changed over decades, let's rip it off. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28sound: Use octal not symbolic permissionsJoe Perches
Convert the S_<FOO> symbolic permissions to their octal equivalents as using octal and not symbolic permissions is preferred by many as more readable. see: https://lkml.org/lkml/2016/8/2/1945 Done with automated conversion via: $ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace <files...> Miscellanea: o Wrapped one multi-line call to a single line Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-27ALSA: dice: unuse second stream for MIDI conformant data channel for TC ↵Takashi Sakamoto
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-27ALSA: dice: fix stream format parameters for TC Electronic Studio Konnekt 48Takashi Sakamoto
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-21ALSA: dice: add stream format parameters for TC Electronic Digital Konnekt x32Takashi Sakamoto
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-18ALSA: dice: fix a bounds check in snd_dice_detect_tcelectronic_formats()Dan Carpenter
The "entry" pointer is always non-NULL so this test for out of bounds won't work. Fixes: f1f0f330b1d0 ("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-18ALSA: dice: add stream format parameters for Mytek devicesMelvin Vermeeren
--nextPart3916812.EicPReet6m Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Mytek manufactures some equipment with DICE-based firewire ports. These devices contain old versions of DICE firmware which lacks detailed stream format reporting for all sampling clock modes. Building upon the recent work by Takashi Sakamoto, hard-coded parameters are added for the Stereo 192 DSD-DAC. When the device vendor and model match the coded parameters are copied into the stream format cache. Signed-off-by: Melvin Vermeeren <mail@mel.vin> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merge of UAC3 fixes for applying further enhancements. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: remove local frag of force_two_pcmsTakashi Sakamoto
At present, to add PCM substreams for each of available tx/rx streams, this driver uses a condition based on model-name. This is not enough to support unknown models. In former commits, this driver gains cache of stream formats. For models which support protocol extension, all of available steam formats are cached. For known models, hard-coded stream formats are used to generate the cache. For unknown models, stream formats at current mode of sampling transmission frequency is cached. Anyway, at least, the cached formats are used to expose constrains of PCM substreams for userspace applications. Thus, The cached data can be also used to add PCM substreams themselves, instead of the name-based conditions. This commit obsoletes local frag of force_two_pcms. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: use cache for PCM constraints and rulesTakashi Sakamoto
In former commits, proxy structure gets members for cache of stream formats. The cache allows to apply correct constraints and rules to runtime of PCM substream. They allows userspace applications to change current sampling transmission frequency. This commit uses the cacher for the PCM constraints and rules. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: use stream formats to add MIDI substreamsTakashi Sakamoto
In former commits, proxy structure gets members for cache of stream formats. The cache can be used to count the number of MIDI substreams to add. This commit uses the cache for this purpose. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: enable to change current sampling transmission frequencyTakashi Sakamoto
This is a preparation for userspace applications to change current sampling transmission frequency via ALSA PCM interface. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: add a helper function to restart all of available streamsTakashi Sakamoto
This commit is a small refactoring for better readability. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: use cache of stream format to check running streamTakashi Sakamoto
At present, to check running stream, available stream formats are used at current sampling transmission frequency (stf). But when changing stf, it's convenient to use cache of stream formats. This commit applies this idea. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: use extended protocol to detect available stream formatsTakashi Sakamoto
TC Applied Technologies (TCAT) have added extension to DICE protocol. This protocol extension is called as Extended Application Protocol, a.k.a. EAP. In this protocol extension, units get additional 9 address spaces. One of it is for current configuration. In this address space, a pair of router and stream formats are exposed per mode of three sampling transmission frequencies. This commit adds support the protocol extension for address space of the current configuration to generate cache of stream formats. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: add parameters of stream formats for models produced by AlesisTakashi Sakamoto
Alesis 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. I note that each of pair of iO14/iO26 and MultiMix 8/12/16 has the same model ID on their configuration ROM. The MultiMix 8/12/16 just support one mode for sampling transmission frequency and ALSA dice driver already handles them correctly. The iO14/iO26 support three modes and need hard-coded parameters. To distinguish these two models, this commit let the driver to retrieve current stream formats and compare it to known parameters, then decide it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: add parameters of stream formats for models produced by TC ↵Takashi Sakamoto
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-02ALSA: dice: cache stream formats at current mode of sampling transmission ↵Takashi Sakamoto
frequency In former commits, proxy structure get members for cache of stream formats. This commit fills the cache with stream formats at current mode of sampling transmission frequency. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: add proc node for stream formationTakashi Sakamoto
Products with DICE interface in market can support variable stream formats for three levels of sampling transmission frequencies. To record these formats, a proxy structure got several fields in former commit. This commit adds a proc node to output the stream formats for debugging purpose. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: add 'firewire' directory for proc nodesTakashi Sakamoto
Unlike the other drivers in ALSA firewire stack, ALSA dice driver does't create 'firewire' directory for proc nodes because it has 'dice' node only. But this is inconvenient because I have a plan to add another proc node to output available stream formats from cache. This commit let the driver to create the directory and put 'dice' node into it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02ALSA: dice: add cache of stream formatsTakashi Sakamoto
A previous commit 6f688268b3f4 ('ALSA: dice: purge generating channel cache') purged cache of stream formats. DICE interface originally has no feature to assist drivers to retrieve available formats for all of supported sampling transmission frequencies, without changing the frequency actually. For later release of Dice ASICs such as TCD2210, Dice interface has extended protocol and can support the feature. This assists drivers to retrieve available stream formats. This commit is a first step to regain the cache to generate PCM rules for all of supported sampling transmission frequencies. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-26ALSA: dice: fix error path to destroy initialized stream dataTakashi Sakamoto
In error path of snd_dice_stream_init_duplex(), stream data for incoming packet can be left to be initialized. This commit fixes it. Fixes: 436b5abe2224 ('ALSA: dice: handle whole available isochronous streams') Cc: <stable@vger.kernel.org> # v4.6+ Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merge 4.17-rc3 fixes for further development. This will bump the base to 4.17-rc2, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>