Linux Media Controller development
 help / color / mirror / Atom feed
From: David Wood <d01.devel@gmail.com>
To: mchehab@kernel.org
Cc: linux-media@vger.kernel.org
Subject: [PATCH v2] media: em28xx: add StarTech.com SVID2USB23 with working audio capture
Date: Fri, 18 Sep 2026 18:07:32 -0400	[thread overview]
Message-ID: <20260918220732.2042033-1-d01.devel@gmail.com> (raw)
In-Reply-To: <20260913231013.30b18fcc@foz.lan>

The StarTech.com SVID2USB23 is an EM2860 + TVP5150AM1 + EMP202 capture
dongle that ships with the generic eb1a:5051 USB ID, so it is picked up
as the EM2860/TVP5150 reference design. Video works, but analog audio
capture is silent: the ALSA device yields a flat noise floor of about
-85 dBFS whether or not anything is connected.

Audio on this board is not on the em28xx vendor path. Chip config
register 0x00 reads 0x50, so the board exposes a USB Audio Class
interface, claimed by snd-usb-audio, that is fed by the EMP202 ADC.
The ADC record source is selected by AC97_REC_SEL, which
em28xx_audio_analog_set() only programs when EM28XX_AOUT_PCM_IN is set
in the input's .aout. With .amux alone only the mixer volume registers
are written, and the record source stays at its reset value (Mic, not
wired on this board), so the ADC captures nothing.

Add a board entry for the SVID2USB23 with .aout selecting the PCM
record path from Line In, and identify the board by its EEPROM hash,
leaving the reference design entry untouched. Boards with this USB ID
that do not match a hash keep the reference design as before, without
any extra log output. card=114 also selects the entry by hand.

Verified on the SVID2USB23: the board is identified as card=114 and the
driver programs AC97_REC_SEL to 0x0404 on its own at probe. Toggling
that register alone with everything else held constant is what
separates working (-22 dBFS, line level) from silent (-85 dBFS)
capture. AC97_POWERDOWN reads 0x420d (ADC, analog and reference all
ready) throughout, so this is not a power or GPIO problem.

The V4L2 mute control still defaults to 1 and gates the bridge audio
path, so clearing it remains necessary to hear anything; that is a
separate issue.

Signed-off-by: David Wood <d01.devel@gmail.com>
---
v2:
 - board-specific entry, identified by EEPROM hash, instead of changing
   the reference design entry (Mauro)
 - .aout reduced to EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_LINE, the two
   bits that select the record source; EM28XX_AOUT_MASTER was only
   carried over from the old fallback and is not needed (Mauro)
 - real name in Signed-off-by (Mauro)
 - em28xx-cardlist.rst row

 .../admin-guide/media/em28xx-cardlist.rst     |  4 ++
 drivers/media/usb/em28xx/em28xx-cards.c       | 38 +++++++++++++++++++
 drivers/media/usb/em28xx/em28xx.h             |  1 +
 3 files changed, 43 insertions(+)

diff --git a/Documentation/admin-guide/media/em28xx-cardlist.rst b/Documentation/admin-guide/media/em28xx-cardlist.rst
index 741aa7f..df2595b 100644
--- a/Documentation/admin-guide/media/em28xx-cardlist.rst
+++ b/Documentation/admin-guide/media/em28xx-cardlist.rst
@@ -450,3 +450,7 @@ EM28xx cards list
      - StarTech SVID2USB232
      - em28281
      - eb1a:8286
+   * - 114
+     - StarTech.com SVID2USB23
+     - em2860
+     - eb1a:5051
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index b7c534f..8440eaf 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -1194,6 +1194,28 @@ const struct em28xx_board em28xx_boards[] = {
 			.amux     = EM28XX_AMUX_LINE_IN,
 		} },
 	},
+	/*
+	 * eb1a:5051 StarTech.com SVID2USB23
+	 * Ships with the generic EM2860/TVP5150 reference design USB ID and
+	 * is told apart by EEPROM hash. Audio leaves over a USB Audio Class
+	 * endpoint fed by the EMP202 ADC, so the record source must be set.
+	 */
+	[EM2860_BOARD_STARTECH_SVID2USB23] = {
+		.name          = "StarTech.com SVID2USB23",
+		.tuner_type    = TUNER_ABSENT,	/* Capture only device */
+		.decoder       = EM28XX_TVP5150,
+		.input         = { {
+			.type     = EM28XX_VMUX_COMPOSITE,
+			.vmux     = TVP5150_COMPOSITE1,
+			.amux     = EM28XX_AMUX_LINE_IN,
+			.aout     = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_LINE,
+		}, {
+			.type     = EM28XX_VMUX_SVIDEO,
+			.vmux     = TVP5150_SVIDEO,
+			.amux     = EM28XX_AMUX_LINE_IN,
+			.aout     = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_LINE,
+		} },
+	},
 	[EM2861_BOARD_PLEXTOR_PX_TV100U] = {
 		.name         = "Plextor ConvertX PX-TV100U",
 		.tuner_type   = TUNER_TNF_5335MF,
@@ -3093,6 +3115,7 @@ static const struct em28xx_hash_table em28xx_eeprom_hash[] = {
 	{0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
 	{0x85dd871e, EM2882_BOARD_ZOLID_HYBRID_TV_STICK, TUNER_XC2028},
 	{0x8f597549, EM2860_BOARD_MYGICA_UTV3, TUNER_TENA_TNF_931D_DFDR1},
+	{0x11b79572, EM2860_BOARD_STARTECH_SVID2USB23, TUNER_ABSENT},
 };
 
 /* I2C devicelist hash table for devices with generic USB IDs */
@@ -3457,6 +3480,21 @@ static void em28xx_card_setup(struct em28xx *dev)
 			em28xx_pre_card_setup(dev);
 		}
 		break;
+	case EM2860_BOARD_TVP5150_REFERENCE_DESIGN:
+		/*
+		 * Retail boards shipping with the generic eb1a:5051 USB ID
+		 * land here. Pick out the ones that need a board-specific
+		 * setup by EEPROM hash; the rest keep the reference design.
+		 */
+		for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
+			if (dev->hash == em28xx_eeprom_hash[i].hash) {
+				dev->model = em28xx_eeprom_hash[i].model;
+				dev->tuner_type = em28xx_eeprom_hash[i].tuner;
+				break;
+			}
+		}
+		em28xx_set_model(dev);
+		break;
 	default:
 		em28xx_set_model(dev);
 	}
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h
index 8eee639..c916b15 100644
--- a/drivers/media/usb/em28xx/em28xx.h
+++ b/drivers/media/usb/em28xx/em28xx.h
@@ -162,6 +162,7 @@
 /* Params for validated field */
 #define EM28XX_BOARD_NOT_VALIDATED 1
 #define EM28XX_BOARD_VALIDATED	   0
+#define EM2860_BOARD_STARTECH_SVID2USB23          114
 
 /* Params for em28xx_cmd() audio */
 #define EM28XX_START_AUDIO      1

      parent reply	other threads:[~2026-09-18 22:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-13 20:23 [PATCH] media: em28xx: fix silent audio capture on EM2860/TVP5150 reference design d01
2026-09-13 21:10 ` Mauro Carvalho Chehab
2026-09-18 22:07   ` David Wood
2026-09-18 22:07   ` David Wood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260918220732.2042033-1-d01.devel@gmail.com \
    --to=d01.devel@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox