Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: firewire-tascam: reserve resources for transferred isochronous packets at S400

TASCAM FW-1884/FW-1804/FW-1082 have a quirk that they often freeze when
receiving isochronous packets at S400. This behaviour is suppressed by a
new quirk flag added in Linux FireWire core to restrict maximum speed.
Consequently both of the asynchronous transactions and isochronous
transmissions are done at S200. However, the device still transfers
isochronous packet at S400, and the way to indicate the transmission
speed is not cleared yet.

This commit correctly reserves isochronous resources for the transferred
packet stream at S400. As a beneficial side effect, the pair of
isochronous transmissions for FW-1884 fits within the bandwidth capacity
of the bus.

Link: https://lore.kernel.org/r/20251018035532.287124-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

+11 -10
+11 -10
sound/firewire/tascam/tascam-stream.c
··· 282 282 struct amdtp_stream *stream) 283 283 { 284 284 struct fw_iso_resources *resources; 285 + int speed; 285 286 int err; 286 287 287 - if (stream == &tscm->tx_stream) 288 + if (stream == &tscm->tx_stream) { 288 289 resources = &tscm->tx_resources; 289 - else 290 + speed = fw_parent_device(tscm->unit)->max_speed; 291 + } else { 290 292 resources = &tscm->rx_resources; 293 + speed = SCODE_400; 294 + } 291 295 292 296 err = amdtp_tscm_set_parameters(stream, rate); 293 297 if (err < 0) 294 298 return err; 295 299 296 - return fw_iso_resources_allocate(resources, 297 - amdtp_stream_get_max_payload(stream), 298 - fw_parent_device(tscm->unit)->max_speed); 300 + return fw_iso_resources_allocate(resources, amdtp_stream_get_max_payload(stream), speed); 299 301 } 300 302 301 303 static int init_stream(struct snd_tscm *tscm, struct amdtp_stream *s) ··· 457 455 } 458 456 459 457 if (!amdtp_stream_running(&tscm->rx_stream)) { 460 - int spd = fw_parent_device(tscm->unit)->max_speed; 461 458 unsigned int tx_init_skip_cycles; 462 459 463 460 err = set_stream_formats(tscm, rate); ··· 467 466 if (err < 0) 468 467 goto error; 469 468 470 - err = amdtp_domain_add_stream(&tscm->domain, &tscm->rx_stream, 471 - tscm->rx_resources.channel, spd); 469 + err = amdtp_domain_add_stream(&tscm->domain, &tscm->rx_stream, tscm->rx_resources.channel, 470 + fw_parent_device(tscm->unit)->max_speed); 472 471 if (err < 0) 473 472 goto error; 474 473 475 - err = amdtp_domain_add_stream(&tscm->domain, &tscm->tx_stream, 476 - tscm->tx_resources.channel, spd); 474 + err = amdtp_domain_add_stream(&tscm->domain, &tscm->tx_stream, tscm->tx_resources.channel, 475 + SCODE_400); 477 476 if (err < 0) 478 477 goto error; 479 478