Commit 5ec85c19 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai
Browse files

ALSA: bebob: distinguish M-Audio ProFire Lightbridge quirk



In former commit, ALSA IEC 61883-1/6 packet streaming engine drops
initial tx packets till the packet includes any event. This allows ALSA
bebob driver not to give option to skip initial packet since the engine
does drop the initial packet.

However, M-Audio ProFire Lightbridge has a quirk to stop packet
transmission after start multiplexing event to the packet. After several
thousands cycles, it restart packet transmission again.

This commit specializes the usage of initial skip option for the model.
Additionally, this commit expands timeout enough to wait processing
content of tx packet.

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


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 266807f9
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -64,6 +64,7 @@ static DECLARE_BITMAP(devices_used, SNDRV_CARDS);
#define MODEL_MAUDIO_AUDIOPHILE_BOTH	0x00010060
#define MODEL_MAUDIO_AUDIOPHILE_BOTH	0x00010060
#define MODEL_MAUDIO_FW1814		0x00010071
#define MODEL_MAUDIO_FW1814		0x00010071
#define MODEL_MAUDIO_PROJECTMIX		0x00010091
#define MODEL_MAUDIO_PROJECTMIX		0x00010091
#define MODEL_MAUDIO_PROFIRELIGHTBRIDGE	0x000100a1


static int
static int
name_device(struct snd_bebob *bebob)
name_device(struct snd_bebob *bebob)
@@ -210,6 +211,13 @@ do_registration(struct work_struct *work)
	if (err < 0)
	if (err < 0)
		goto error;
		goto error;


	// M-Audio ProFire Lightbridge has a quirk to transfer packets with discontinuous cycle or
	// data block counter in early stage of packet streaming. The cycle span from the first
	// packet with event is variable.
	if (bebob->entry->vendor_id == VEN_MAUDIO1 &&
	    bebob->entry->model_id == MODEL_MAUDIO_PROFIRELIGHTBRIDGE)
		bebob->discontinuity_quirk = true;

	err = snd_bebob_stream_init_duplex(bebob);
	err = snd_bebob_stream_init_duplex(bebob);
	if (err < 0)
	if (err < 0)
		goto error;
		goto error;
@@ -476,7 +484,7 @@ static const struct ieee1394_device_id bebob_id_table[] = {
	/* M-Audio NRV10 */
	/* M-Audio NRV10 */
	SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010081, &maudio_nrv10_spec),
	SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010081, &maudio_nrv10_spec),
	/* M-Audio, ProFireLightbridge */
	/* M-Audio, ProFireLightbridge */
	SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x000100a1, &spec_normal),
	SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_PROFIRELIGHTBRIDGE, &spec_normal),
	/* Firewire 1814 */
	/* Firewire 1814 */
	SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010070, NULL),	/* bootloader */
	SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010070, NULL),	/* bootloader */
	SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_FW1814,
	SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_FW1814,
+1 −0
Original line number Original line Diff line number Diff line
@@ -115,6 +115,7 @@ struct snd_bebob {


	/* For BeBoB version quirk. */
	/* For BeBoB version quirk. */
	unsigned int version;
	unsigned int version;
	bool discontinuity_quirk;


	struct amdtp_domain domain;
	struct amdtp_domain domain;
};
};
+7 −5
Original line number Original line Diff line number Diff line
@@ -7,7 +7,7 @@


#include "./bebob.h"
#include "./bebob.h"


#define READY_TIMEOUT_MS	2500
#define READY_TIMEOUT_MS	4000


/*
/*
 * NOTE;
 * NOTE;
@@ -644,12 +644,14 @@ int snd_bebob_stream_start_duplex(struct snd_bebob *bebob)
		if (err < 0)
		if (err < 0)
			goto error;
			goto error;


		// Some devices transfer isoc packets with discontinuous counter in the beginning
		if (!bebob->discontinuity_quirk)
		// of packet streaming.
			tx_init_skip_cycles = 0;
		if (bebob->version < 2)
			tx_init_skip_cycles = 3200;
		else
		else
			tx_init_skip_cycles = 16000;
			tx_init_skip_cycles = 16000;

		// MEMO: In the early stage of packet streaming, the device transfers NODATA packets.
		// After several hundred cycles, it begins to multiplex event into the packet with
		// syt information.
		err = amdtp_domain_start(&bebob->domain, tx_init_skip_cycles);
		err = amdtp_domain_start(&bebob->domain, tx_init_skip_cycles);
		if (err < 0)
		if (err < 0)
			goto error;
			goto error;