81c254a6 | 17-Jan-2023 |
Dan Carpenter <error27@gmail.com> |
ALSA: fireface: fix locking bug in ff400_copy_msg_to_user()
The ff400_copy_msg_to_user() function drops the spin lock to call copy_to_user(). However, if the copy_to_user() fails, then it must take
ALSA: fireface: fix locking bug in ff400_copy_msg_to_user()
The ff400_copy_msg_to_user() function drops the spin lock to call copy_to_user(). However, if the copy_to_user() fails, then it must take the lock again before returning. Failure to take the lock leads to a double unlock in the caller, hwdep_read().
Fixes: acdebd8b4c0c ("ALSA: fireface: implement message parser for Fireface 400") Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/Y8at+W/7OGvEBY8O@kili Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
acdebd8b | 12-Jan-2023 |
Takashi Sakamoto <o-takashi@sakamocchi.jp> |
ALSA: fireface: implement message parser for Fireface 400
This commit implements message parser for Fireface 400 to pass data of knob control to user space. The parser has FIFO which can store maxim
ALSA: fireface: implement message parser for Fireface 400
This commit implements message parser for Fireface 400 to pass data of knob control to user space. The parser has FIFO which can store maximum 32 events without no overrun detection since it doesn't matter to lose the event.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20230112120954.500692-7-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
c31909fa | 12-Jan-2023 |
Takashi Sakamoto <o-takashi@sakamocchi.jp> |
ALSA: fireface: add local framework to message parser
This commit adds local framework to message parser. This is preparation for future work to pass event of knob control for Fireface 400 to user s
ALSA: fireface: add local framework to message parser
This commit adds local framework to message parser. This is preparation for future work to pass event of knob control for Fireface 400 to user space.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20230112120954.500692-6-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
aed713bf | 12-Jan-2023 |
Takashi Sakamoto <o-takashi@sakamocchi.jp> |
ALSA: fireface: add helper function to parse MIDI messages transmitted by Fireface 400
This is minor code refactoring to add helper function to parse MIDI message bytes in quadlet message.
Signed-o
ALSA: fireface: add helper function to parse MIDI messages transmitted by Fireface 400
This is minor code refactoring to add helper function to parse MIDI message bytes in quadlet message.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20230112120954.500692-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
4bdcb8d2 | 12-Jan-2023 |
Takashi Sakamoto <o-takashi@sakamocchi.jp> |
ALSA: fireface: pick up time stamp for request subaction of asynchronous transaction
The time stamp of isochronous cycle at which asynchronous transaction is sent is perhaps useful somehow. A commit
ALSA: fireface: pick up time stamp for request subaction of asynchronous transaction
The time stamp of isochronous cycle at which asynchronous transaction is sent is perhaps useful somehow. A commit b2405aa948b9 ("firewire: add kernel API to access packet structure in request structure for AR context") adds kernel API to retrieve the time stamp in inner structure of request subaction.
This commit changes local framework to handle message delivered by the asynchronous transaction so that time stamp is picked up by the kernel API.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20230112120954.500692-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
50c597c7 | 12-Jan-2023 |
Takashi Sakamoto <o-takashi@sakamocchi.jp> |
ALSA: fireface: rename callback functions
It's cleared that Fireface 400 transmits quadlet message for two purposes at least; received MIDI messages and notification of knob control operation. Never
ALSA: fireface: rename callback functions
It's cleared that Fireface 400 transmits quadlet message for two purposes at least; received MIDI messages and notification of knob control operation. Nevertheless current implementation uses callback function name just for MIDI messages.
This commit renames the callback functions.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20230112120954.500692-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
a36183f6 | 10-Jan-2023 |
Takashi Sakamoto <o-takashi@sakamocchi.jp> |
ALSA: firewire-lib: move parameter for pcm frame multiplier from context payload processing layer
The current implementation delegates the task to calculate the number of processed PCM frames into t
ALSA: firewire-lib: move parameter for pcm frame multiplier from context payload processing layer
The current implementation delegates the task to calculate the number of processed PCM frames into the context payload processing layer. It looks good as long as frame calculation is done for a single purpose. Nevertheless, another purpose, the computation of extra delay for the runtime of PCM substream, requires frame calculation, too.
This commit refactors the current implementation so that the packet stream processing layer is responsible for the calculation of PCM frame, too. The member is moved to stream structure for multiplier between data block count and PCM frame count.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20230110134933.322794-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
dfacca39 | 30-May-2021 |
Takashi Sakamoto <o-takashi@sakamocchi.jp> |
ALSA: fireface: perform sequence replay for media clock recovery
This commit takes ALSA fireface driver to perform sequence replay for media clock recovery.
The protocol specific to RME Fireface se
ALSA: fireface: perform sequence replay for media clock recovery
This commit takes ALSA fireface driver to perform sequence replay for media clock recovery.
The protocol specific to RME Fireface series is not compliant to IEC 61883-1/6 since it has no CIP header, therefore presentation time is not used for media clock recovery. The sequence of the number of data blocks per packet is important.
I note that the device skips an isochronous cycle corresponding to an empty packet or a NODATA packet in blocking transmission method of IEC 61883-1/6. For sequence replay, the cycle is handled as receiving an empty packet. Furthermore, it doesn't start packet transmission till receiving any packet.
The sequence replay is tested with below models:
* Fireface 400 * Fireface 800 * Fireface 802
I note that it is better to initialize Fireface 400 in advance by initialization transaction implemented in snd-fireface-ctl-service of snd-firewire-ctl-services project. You can see whether initialized or not by HOST LED on the device. Unless, the device often stops packet transmission even if session starts.
I guess the sequence replay also works well with below models:
* Fireface UFX * Fireface UCX
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20210531025103.17880-7-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
f9e5ecdf | 27-May-2021 |
Takashi Sakamoto <o-takashi@sakamocchi.jp> |
ALSA: firewire-lib: add replay target to cache sequence of packet
In design of audio and music unit in IEEE 1394 bus, feedback of effective sampling transfer frequency (STF) is delivered by packets
ALSA: firewire-lib: add replay target to cache sequence of packet
In design of audio and music unit in IEEE 1394 bus, feedback of effective sampling transfer frequency (STF) is delivered by packets transferred from device. The devices supported by ALSA firewire stack are categorized to three groups regarding to it.
* Group 1: * Echo Audio Fireworks board module * Oxford Semiconductor OXFW971 ASIC * Digidesign Digi00x family * Tascam FireWire series * RME Fireface series
* Group 2: * BridgeCo. DM1000/DM1100/DM1500 ASICs for BeBoB solution * TC Applied Technologies DICE ASICs
* Group 3: * Mark of the Unicord FireWire series
In group 1, the effective STF is determined by the sequence of the number of events per packet. In group 2, the sequence of presentation timestamp expressed in syt field of CIP header is interpreted as well. In group 3, the presentation timestamp is expressed in source packet header (SPH) of each data block.
I note that some models doesn't take care of effective STF with large internal buffer. It's reasonable to name it as group 0:
* Group 0 * Oxford Semiconductor OXFW970 ASIC
The effective STF is known to be slightly different from nominal STF for all of devices, and to be different between the devices. Furthermore, the effective STF is known to be shifted for long-period transmission. This makes it hard for software to satisfy the effective STF when processing packets to the device.
The effective STF is deterministic as a result of analyzing the batch of packet transferred from the device. For the analysis, caching the sequence of parameter in the packet is required.
This commit adds an option so that AMDTP domain structure takes AMDTP stream structure to cache the sequence of parameters in packet transferred from the device. The parameters are offset ticks of syt field against the cycle to receive the packet and the number of data blocks per packet.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20210527122611.173711-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
f4514249 | 25-Jan-2021 |
Dan Carpenter <dan.carpenter@oracle.com> |
ALSA: fireface: remove unnecessary condition in hwdep_read()
Smatch complains that "count" is not clamped when "ff->dev_lock_changed" and it leads to an information leak. Fortunately, that's not ac
ALSA: fireface: remove unnecessary condition in hwdep_read()
Smatch complains that "count" is not clamped when "ff->dev_lock_changed" and it leads to an information leak. Fortunately, that's not actually possible and the condition can be deleted.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/YA6n6I8EcNAO5ZFs@mwanda Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
1f65e668 | 10-May-2020 |
Takashi Sakamoto <o-takashi@sakamocchi.jp> |
ALSA: fireface: add support for RME Fireface UFX (untested)
Fireface UFX was shipped by RME GmbH in 2010, and now discontinued. Although this model has some enhanced feature which Fireface 802 doesn
ALSA: fireface: add support for RME Fireface UFX (untested)
Fireface UFX was shipped by RME GmbH in 2010, and now discontinued. Although this model has some enhanced feature which Fireface 802 doesn't have (e.g. on-board USB mass storage device class, configuration interface with color display), the functionality relevant to packet communication on IEEE 1394 bus seems to be the same as Fireface 802 (e.g. available number of channels for PCM frame in each sampling transfer frequency).
With the assumption, this commit adds support for Fireface UFX. In ALSA fireface driver, these two models are handled as the same one.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20200510074301.116224-7-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|