linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ALSA: emu10k1: hide MPU-401 ports for Audigy Rx
@ 2024-10-13  1:47 Icenowy Zheng
  2024-10-13  1:47 ` [PATCH 1/2] ALSA: emu10k1: add a capability bit for no MIDI Icenowy Zheng
  2024-10-13  1:47 ` [PATCH 2/2] ALSA: emu10k1: hide ext. MIDI ports for Audigy Rx Icenowy Zheng
  0 siblings, 2 replies; 5+ messages in thread
From: Icenowy Zheng @ 2024-10-13  1:47 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Oswald Buddenhagen, linux-sound, linux-kernel, Icenowy Zheng

The Audigy Rx card HW has no external MIDI ports (either directly on the
card or as an optional breakout), however the current drivers still
create MPU-401 MIDI ports on it, leads to confusion of DAW software.

Hide the MPU-401 MIDI ports for it.

Icenowy Zheng (2):
  ALSA: emu10k1: add a capability bit for no MIDI
  ALSA: emu10k1: hide ext. MIDI ports for Audigy Rx

 include/sound/emu10k1.h          | 1 +
 sound/pci/emu10k1/emu10k1.c      | 4 +++-
 sound/pci/emu10k1/emu10k1_main.c | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.47.0


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

* [PATCH 1/2] ALSA: emu10k1: add a capability bit for no MIDI
  2024-10-13  1:47 [PATCH 0/2] ALSA: emu10k1: hide MPU-401 ports for Audigy Rx Icenowy Zheng
@ 2024-10-13  1:47 ` Icenowy Zheng
  2024-10-13  9:54   ` Oswald Buddenhagen
  2024-10-13  1:47 ` [PATCH 2/2] ALSA: emu10k1: hide ext. MIDI ports for Audigy Rx Icenowy Zheng
  1 sibling, 1 reply; 5+ messages in thread
From: Icenowy Zheng @ 2024-10-13  1:47 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Oswald Buddenhagen, linux-sound, linux-kernel, Icenowy Zheng

Audigy Rx is a card born in the era that USB MIDI has been the
mainstream form of PC MIDI interface, and no external MIDI I/O is made
available on Audigy Rx.

Add a capability bit for emu10k1 driver to be able to hide the MPU-401
ports.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
---
 include/sound/emu10k1.h     | 1 +
 sound/pci/emu10k1/emu10k1.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 38db50b280eba..9172674838627 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -1673,6 +1673,7 @@ struct snd_emu_chip_details {
 	unsigned int i2c_adc:1;		/* I2C interface for ADC; requires ca0108_chip */
 	unsigned int adc_1361t:1;	/* Use Philips 1361T ADC */
 	unsigned int invert_shared_spdif:1;  /* analog/digital switch inverted */
+	unsigned int no_midi:1;		/* Has no MIDI */
 	const char *driver;
 	const char *name;
 	const char *id;		/* for backward compatibility - can be NULL if not needed */
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index dadeda7758cee..d323ebbc0368f 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -133,7 +133,9 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci,
 		if (err < 0)
 			return err;
 	}
-	if (emu->audigy) {
+	if (emu->card_capabilities->no_midi) {
+		dev_info(emu->card->dev, "Card has no ext. MIDI ports.\n");
+	} else if (emu->audigy) {
 		err = snd_emu10k1_audigy_midi(emu);
 		if (err < 0)
 			return err;
-- 
2.47.0


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

* [PATCH 2/2] ALSA: emu10k1: hide ext. MIDI ports for Audigy Rx
  2024-10-13  1:47 [PATCH 0/2] ALSA: emu10k1: hide MPU-401 ports for Audigy Rx Icenowy Zheng
  2024-10-13  1:47 ` [PATCH 1/2] ALSA: emu10k1: add a capability bit for no MIDI Icenowy Zheng
@ 2024-10-13  1:47 ` Icenowy Zheng
  1 sibling, 0 replies; 5+ messages in thread
From: Icenowy Zheng @ 2024-10-13  1:47 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Oswald Buddenhagen, linux-sound, linux-kernel, Icenowy Zheng

Audigy Rx is a card w/o any external MIDI ports available.

Set the capability bit to hide its MPU-401 ports to prevent confusion.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
---
 sound/pci/emu10k1/emu10k1_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 5b8a5ba825bdb..c9240126f78e3 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -947,6 +947,7 @@ static const struct snd_emu_chip_details emu_chip_details[] = {
 	 .id = "Audigy2",
 	 .emu10k2_chip = 1,
 	 .ca0108_chip = 1,
+	 .no_midi = 1,
 	 .spk71 = 1,
 	 .adc_1361t = 1,  /* 24 bit capture instead of 16bit */
 	 .ac97_chip = 1},
-- 
2.47.0


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

* Re: [PATCH 1/2] ALSA: emu10k1: add a capability bit for no MIDI
  2024-10-13  1:47 ` [PATCH 1/2] ALSA: emu10k1: add a capability bit for no MIDI Icenowy Zheng
@ 2024-10-13  9:54   ` Oswald Buddenhagen
  2024-10-13 10:04     ` Icenowy Zheng
  0 siblings, 1 reply; 5+ messages in thread
From: Oswald Buddenhagen @ 2024-10-13  9:54 UTC (permalink / raw)
  To: Icenowy Zheng; +Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, linux-kernel

On Sun, Oct 13, 2024 at 09:47:12AM +0800, Icenowy Zheng wrote:
>+++ b/sound/pci/emu10k1/emu10k1.c
>@@ -133,7 +133,9 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci,
> 		if (err < 0)
> 			return err;
> 	}
>-	if (emu->audigy) {
>+	if (emu->card_capabilities->no_midi) {
>+		dev_info(emu->card->dev, "Card has no ext. MIDI ports.\n");
>
seems like excess verbosity. there are much more important things that
are not reported.

>+	} else if (emu->audigy) {
>
i would eliminate that, and instead populate the card table properly.
that's a bit more code, but it's more uniform, and the resulting binary
is even a tiny bit smaller.

also, i would squash the patches, as i see no point in having them
separate, given their size.

regards

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

* Re: [PATCH 1/2] ALSA: emu10k1: add a capability bit for no MIDI
  2024-10-13  9:54   ` Oswald Buddenhagen
@ 2024-10-13 10:04     ` Icenowy Zheng
  0 siblings, 0 replies; 5+ messages in thread
From: Icenowy Zheng @ 2024-10-13 10:04 UTC (permalink / raw)
  To: Oswald Buddenhagen
  Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, linux-kernel

在 2024-10-13星期日的 11:54 +0200,Oswald Buddenhagen写道:
> On Sun, Oct 13, 2024 at 09:47:12AM +0800, Icenowy Zheng wrote:
> > +++ b/sound/pci/emu10k1/emu10k1.c
> > @@ -133,7 +133,9 @@ static int snd_card_emu10k1_probe(struct
> > pci_dev *pci,
> >                 if (err < 0)
> >                         return err;
> >         }
> > -       if (emu->audigy) {
> > +       if (emu->card_capabilities->no_midi) {
> > +               dev_info(emu->card->dev, "Card has no ext. MIDI
> > ports.\n");
> > 
> seems like excess verbosity. there are much more important things
> that
> are not reported.
> 
> > +       } else if (emu->audigy) {
> > 
> i would eliminate that, and instead populate the card table properly.
> that's a bit more code, but it's more uniform, and the resulting
> binary
> is even a tiny bit smaller.

Well in fact I just insert this here to prevent a re-indent of the
following MIDI code.

Well it could be better to be a 
```
if (!emu->card_capabilities->no_midi) {
        The original code
}
```

> 
> also, i would squash the patches, as i see no point in having them
> separate, given their size.
> 
> regards


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

end of thread, other threads:[~2024-10-13 10:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-13  1:47 [PATCH 0/2] ALSA: emu10k1: hide MPU-401 ports for Audigy Rx Icenowy Zheng
2024-10-13  1:47 ` [PATCH 1/2] ALSA: emu10k1: add a capability bit for no MIDI Icenowy Zheng
2024-10-13  9:54   ` Oswald Buddenhagen
2024-10-13 10:04     ` Icenowy Zheng
2024-10-13  1:47 ` [PATCH 2/2] ALSA: emu10k1: hide ext. MIDI ports for Audigy Rx Icenowy Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).