public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] sound: dice: Firestudio Mobile
@ 2022-10-15 23:33 George Hilliard
  2022-10-15 23:33 ` [PATCH 1/2] sound: dice: Fix "Firestudio" typo George Hilliard
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: George Hilliard @ 2022-10-15 23:33 UTC (permalink / raw)
  To: Clemens Ladisch, Takashi Sakamoto; +Cc: alsa-devel, linux-kernel

This short series adds a configuration block for the Firestudio Mobile I
just acquired.  Very similar to the Firestudio, but a lower port count.

My understanding is that the Low, Medium, and High speeds refer to
48kHz, 96kHz, and 192kHz sample rates, of which only the first two are
supported by this hardware line.  Please correct me if this is not
correct.

Thanks!



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] sound: dice: Fix "Firestudio" typo
  2022-10-15 23:33 [PATCH 0/2] sound: dice: Firestudio Mobile George Hilliard
@ 2022-10-15 23:33 ` George Hilliard
  2022-10-16  1:37   ` Takashi Sakamoto
  2022-10-15 23:33 ` [PATCH 2/2] sound: dice: Add support for Firestudio Mobile George Hilliard
  2022-10-16  1:37 ` [PATCH 0/2] sound: dice: " Takashi Sakamoto
  2 siblings, 1 reply; 5+ messages in thread
From: George Hilliard @ 2022-10-15 23:33 UTC (permalink / raw)
  To: Clemens Ladisch, Takashi Sakamoto
  Cc: alsa-devel, linux-kernel, George Hilliard

No functionality change, just a small cleanup before adding the
Firestudio Mobile.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
---
 sound/firewire/dice/dice-presonus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/firewire/dice/dice-presonus.c b/sound/firewire/dice/dice-presonus.c
index 967cc3119a64..c85178e64667 100644
--- a/sound/firewire/dice/dice-presonus.c
+++ b/sound/firewire/dice/dice-presonus.c
@@ -11,7 +11,7 @@ struct dice_presonus_spec {
 	bool has_midi;
 };
 
-static const struct dice_presonus_spec dice_presonus_firesutio = {
+static const struct dice_presonus_spec dice_presonus_firestudio = {
 	.tx_pcm_chs = {{16, 16, 0}, {10, 2, 0} },
 	.rx_pcm_chs = {{16, 16, 0}, {10, 2, 0} },
 	.has_midi = true,
@@ -23,7 +23,7 @@ int snd_dice_detect_presonus_formats(struct snd_dice *dice)
 		u32 model_id;
 		const struct dice_presonus_spec *spec;
 	} *entry, entries[] = {
-		{0x000008, &dice_presonus_firesutio},
+		{0x000008, &dice_presonus_firestudio},
 	};
 	struct fw_csr_iterator it;
 	int key, val, model_id;
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] sound: dice: Add support for Firestudio Mobile
  2022-10-15 23:33 [PATCH 0/2] sound: dice: Firestudio Mobile George Hilliard
  2022-10-15 23:33 ` [PATCH 1/2] sound: dice: Fix "Firestudio" typo George Hilliard
@ 2022-10-15 23:33 ` George Hilliard
  2022-10-16  1:37 ` [PATCH 0/2] sound: dice: " Takashi Sakamoto
  2 siblings, 0 replies; 5+ messages in thread
From: George Hilliard @ 2022-10-15 23:33 UTC (permalink / raw)
  To: Clemens Ladisch, Takashi Sakamoto
  Cc: alsa-devel, linux-kernel, George Hilliard

This device is of the same vintage as the already-supported FireStudio,
but with a reduced input (10) and output (6) count.  Add a configuration
block for it.

	$ crpp < /sys/bus/firewire/devices/fw1/config_rom
	               ROM header and bus information block
	               ---------------------------------------------------
	400  0404bc6a  bus_info_length 4, crc_length 4, crc 48234
	404  31333934  bus_name "1394"
	408  e0008102  irmc 1, cmc 1, isc 1, bmc 0, cyc_clk_acc 0, max_rec 8 (512)
	40c  000a9204  company_id 000a92     | Presonus Corporation
	410  047da647  device_id 04047da647  | EUI-64 000a9204047da647

	               root directory
	               ---------------------------------------------------
	414  0006147f  directory_length 6, crc 5247
	418  03000a92  vendor: Presonus Corporation
	41c  8100000a  --> descriptor leaf at 444
	420  17000011  model
	424  8100000e  --> descriptor leaf at 45c
	428  0c0087c0  node capabilities per IEEE 1394
	42c  d1000001  --> unit directory at 430

	               unit directory at 430
	               ---------------------------------------------------
	430  00048030  directory_length 4, crc 32816
	434  12000a92  specifier id: Presonus Corporation
	438  13000001  version
	43c  17000011  model
	440  8100000f  --> descriptor leaf at 47c

	               descriptor leaf at 444
	               ---------------------------------------------------
	444  00057914  leaf_length 5, crc 30996
	448  00000000  textual descriptor
	44c  00000000  minimal ASCII
	450  50726553  "PreS"
	454  6f6e7573  "onus"
	458  00000000

	               descriptor leaf at 45c
	               ---------------------------------------------------
	45c  000792a9  leaf_length 7, crc 37545
	460  00000000  textual descriptor
	464  00000000  minimal ASCII
	468  46495245  "FIRE"
	46c  53545544  "STUD"
	470  494f5f4d  "IO_M"
	474  4f42494c  "OBIL"
	478  45000000  "E"

	               descriptor leaf at 47c
	               ---------------------------------------------------
	47c  000792a9  leaf_length 7, crc 37545
	480  00000000  textual descriptor
	484  00000000  minimal ASCII
	488  46495245  "FIRE"
	48c  53545544  "STUD"
	490  494f5f4d  "IO_M"
	494  4f42494c  "OBIL"
	498  45000000  "E"

Tested-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
---
 sound/firewire/dice/dice-presonus.c | 7 +++++++
 sound/firewire/dice/dice.c          | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/sound/firewire/dice/dice-presonus.c b/sound/firewire/dice/dice-presonus.c
index c85178e64667..8b62495846f1 100644
--- a/sound/firewire/dice/dice-presonus.c
+++ b/sound/firewire/dice/dice-presonus.c
@@ -17,6 +17,12 @@ static const struct dice_presonus_spec dice_presonus_firestudio = {
 	.has_midi = true,
 };
 
+static const struct dice_presonus_spec dice_presonus_firestudio_mobile = {
+	.tx_pcm_chs = {{10, 10, 0}, {0, 0, 0} },
+	.rx_pcm_chs = {{ 6,  6, 0}, {0, 0, 0} },
+	.has_midi = true,
+};
+
 int snd_dice_detect_presonus_formats(struct snd_dice *dice)
 {
 	static const struct {
@@ -24,6 +30,7 @@ int snd_dice_detect_presonus_formats(struct snd_dice *dice)
 		const struct dice_presonus_spec *spec;
 	} *entry, entries[] = {
 		{0x000008, &dice_presonus_firestudio},
+		{0x000011, &dice_presonus_firestudio_mobile},
 	};
 	struct fw_csr_iterator it;
 	int key, val, model_id;
diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c
index f75902bc8e74..f31ea2bb7766 100644
--- a/sound/firewire/dice/dice.c
+++ b/sound/firewire/dice/dice.c
@@ -374,6 +374,14 @@ static const struct ieee1394_device_id dice_id_table[] = {
 		.model_id	= 0x000008,
 		.driver_data	= (kernel_ulong_t)snd_dice_detect_presonus_formats,
 	},
+	// Presonus FireStudio Mobile.
+	{
+		.match_flags	= IEEE1394_MATCH_VENDOR_ID |
+				  IEEE1394_MATCH_MODEL_ID,
+		.vendor_id	= OUI_PRESONUS,
+		.model_id	= 0x000011,
+		.driver_data	= (kernel_ulong_t)snd_dice_detect_presonus_formats,
+	},
 	// Lexicon I-ONYX FW810S.
 	{
 		.match_flags	= IEEE1394_MATCH_VENDOR_ID |
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] sound: dice: Firestudio Mobile
  2022-10-15 23:33 [PATCH 0/2] sound: dice: Firestudio Mobile George Hilliard
  2022-10-15 23:33 ` [PATCH 1/2] sound: dice: Fix "Firestudio" typo George Hilliard
  2022-10-15 23:33 ` [PATCH 2/2] sound: dice: Add support for Firestudio Mobile George Hilliard
@ 2022-10-16  1:37 ` Takashi Sakamoto
  2 siblings, 0 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2022-10-16  1:37 UTC (permalink / raw)
  To: George Hilliard; +Cc: Clemens Ladisch, alsa-devel, linux-kernel

Hi,

On Sat, Oct 15, 2022 at 06:33:28PM -0500, George Hilliard wrote:
> This short series adds a configuration block for the Firestudio Mobile I
> just acquired.  Very similar to the Firestudio, but a lower port count.
> 
> My understanding is that the Low, Medium, and High speeds refer to
> 48kHz, 96kHz, and 192kHz sample rates, of which only the first two are
> supported by this hardware line.  Please correct me if this is not
> correct.
> 
> Thanks!

Thanks for the patches, while the device, FireStudio Mobile, is
already supported by ALSA dice driver since it has an entry of moddevice
table which matches your device:

```
	{
		.match_flags = IEEE1394_MATCH_VERSION,
		.version     = DICE_INTERFACE,
	},
```

I think you have the other troubles except for device detection.


In general protocol defined by TC Applied Technologies (the company
which designed DICE ASICs and firmwares), two fields of content of
configuration ROM have pre-defined values.

One of the fields is version field of unit directory. The value is
0x000001 (=DICE_INTERFACE). In your case, the content of unit directory
is below. We can see the value of version field is 0x000001.

```
               unit directory at 430
               ---------------------------------------------------
430  00048030  directory_length 4, crc 32816
434  12000a92  specifier id: Presonus Corporation
438  13000001  version
43c  17000011  model
440  8100000f  --> descriptor leaf at 47c
```

Another is EUI-64 field in bus information block. the part of field
is used for 8 bit `category ID` and the value is 0. In your case,
the value is below. The way to parese the field, please refer to
`check_dice_category` function in `sound/firewire/dice/dice.c`[1].

```
               ROM header and bus information block
               ---------------------------------------------------
400  0404bc6a  bus_info_length 4, crc_length 4, crc 48234
404  31333934  bus_name "1394"
408  e0008102  irmc 1, cmc 1, isc 1, bmc 0, cyc_clk_acc 0, max_rec 8 (512)
40c  000a9204  company_id 000a92     | Presonus Corporation
410  047da647  device_id 04047da647  | EUI-64 000a9204047da647
```

For the content of configuration ROM itself, documentation by 1394
Trading Association (vendor association back in several years ago) will
be a great help[2].


As a supplement, TCAT general protocol has no way to share available
stream formats at all of supported sampling transfer frequencies. It
allows software just to read available stream formats at current
sampling transfer frequency, while TCAT protocol extension has the
function.  ALSA dice driver is programmed to try the extension to detect,
then works at limitation mode at failure. The pre-defined table you coded
is for the case that the extension is not supported by device, but
your device supports the extension.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/tree/sound/firewire/dice/dice.c#n33
[2] https://web.archive.org/web/20210216003042/http://1394ta.org/wp-content/uploads/2015/07/1999027.pdf


Thanks

Takashi Sakamoto

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] sound: dice: Fix "Firestudio" typo
  2022-10-15 23:33 ` [PATCH 1/2] sound: dice: Fix "Firestudio" typo George Hilliard
@ 2022-10-16  1:37   ` Takashi Sakamoto
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2022-10-16  1:37 UTC (permalink / raw)
  To: George Hilliard; +Cc: Clemens Ladisch, alsa-devel, linux-kernel

On Sat, Oct 15, 2022 at 06:33:29PM -0500, George Hilliard wrote:
> No functionality change, just a small cleanup before adding the
> Firestudio Mobile.
> 
> Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
> ---
>  sound/firewire/dice/dice-presonus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
 
Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

> diff --git a/sound/firewire/dice/dice-presonus.c b/sound/firewire/dice/dice-presonus.c
> index 967cc3119a64..c85178e64667 100644
> --- a/sound/firewire/dice/dice-presonus.c
> +++ b/sound/firewire/dice/dice-presonus.c
> @@ -11,7 +11,7 @@ struct dice_presonus_spec {
>  	bool has_midi;
>  };
>  
> -static const struct dice_presonus_spec dice_presonus_firesutio = {
> +static const struct dice_presonus_spec dice_presonus_firestudio = {
>  	.tx_pcm_chs = {{16, 16, 0}, {10, 2, 0} },
>  	.rx_pcm_chs = {{16, 16, 0}, {10, 2, 0} },
>  	.has_midi = true,
> @@ -23,7 +23,7 @@ int snd_dice_detect_presonus_formats(struct snd_dice *dice)
>  		u32 model_id;
>  		const struct dice_presonus_spec *spec;
>  	} *entry, entries[] = {
> -		{0x000008, &dice_presonus_firesutio},
> +		{0x000008, &dice_presonus_firestudio},
>  	};
>  	struct fw_csr_iterator it;
>  	int key, val, model_id;
> -- 
> 2.38.0
 

Thanks

Takashi Sakamoto

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-16  1:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-15 23:33 [PATCH 0/2] sound: dice: Firestudio Mobile George Hilliard
2022-10-15 23:33 ` [PATCH 1/2] sound: dice: Fix "Firestudio" typo George Hilliard
2022-10-16  1:37   ` Takashi Sakamoto
2022-10-15 23:33 ` [PATCH 2/2] sound: dice: Add support for Firestudio Mobile George Hilliard
2022-10-16  1:37 ` [PATCH 0/2] sound: dice: " Takashi Sakamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox