* [PATCH] media: em28xx: fix silent audio capture on EM2860/TVP5150 reference design
@ 2026-09-13 20:23 d01
2026-09-13 21:10 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 4+ messages in thread
From: d01 @ 2026-09-13 20:23 UTC (permalink / raw)
To: mchehab; +Cc: linux-media
The EM2860/TVP5150 reference design (eb1a:5051, "USB 2861 Device",
card=29) captures no analog audio. The ALSA device yields a flat noise
floor of about -85 dBFS, identical with the audio cable plugged or
unplugged and regardless of mixer settings, while video capture works
normally.
Audio on this board is not on the em28xx vendor path. Chip config
register 0x00 reads 0x50 -- bit 0x80 (vendor audio) is clear -- so the
board exposes a USB Audio Class interface claimed by snd-usb-audio, fed
by the EMP202 codec's ADC. Which input that ADC listens to is set by
AC97_REC_SEL (0x1a).
em28xx_audio_analog_set() does program AC97_REC_SEL, but only under:
if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN)
ctl_aoutput comes from the board's per-input .aout field, falling back
to EM28XX_AOUT_MASTER when it is unset (em28xx-video.c). This board's
entry sets .amux but no .aout, so EM28XX_AOUT_PCM_IN is never set, the
AC97_REC_SEL write is skipped, and the mux stays at its reset default
of 0x0000 (Mic, which is not connected on these boards). Nothing is
captured.
Set .aout on both inputs to select the PCM record path from Line In,
matching the .amux already declared. ac97_return_record_select() maps
EM28XX_AOUT_PCM_LINE to 4, which em28xx_audio_analog_set() mirrors into
both channels as 0x0404.
EM28XX_AOUT_MASTER is included so the master volume continues to track
the V4L2 volume control exactly as it did via the old fallback, keeping
the change additive. It is not required for capture -- muting
AC97_MASTER by hand while leaving everything else in place does not
affect the recorded signal.
Diagnosed on eb1a:5051 by writing AC97_REC_SEL directly over usbfs with
everything else held constant:
AC97_REC_SEL = 0x0404 (Line In) -> -21.8 dBFS, line-level audio
AC97_REC_SEL = 0x0000 (Mic) -> -85.4 dBFS, silence
Then verified with this patch applied and the rebuilt module loaded, with
no userspace register writes at all: the driver programs AC97_REC_SEL to
0x0404 on its own at probe, and capture yields -25.0 dBFS of line-level
audio once the mute control is cleared.
AC97_POWERDOWN (0x26) reads 0x420d throughout -- status bits ADC, ANL
and REF all set -- so this is not an analog-power or GPIO problem. The
codec is powered and simply listening to the wrong input.
Note that the V4L2 mute control defaults to 1, which gates the bridge
audio path via EM28XX_XCLK_AUDIO_UNMUTE in R0F. That is a separate
issue and is unchanged by this patch, so "v4l2-ctl -d /dev/videoN -c
mute=0" is still required to hear anything.
Signed-off-by: d01 <d01.devel@gmail.com>
---
drivers/media/usb/em28xx/em28xx-cards.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -1148,10 +1148,14 @@
.type = EM28XX_VMUX_COMPOSITE,
.vmux = TVP5150_COMPOSITE1,
.amux = EM28XX_AMUX_LINE_IN,
+ .aout = EM28XX_AOUT_MASTER | EM28XX_AOUT_PCM_IN |
+ EM28XX_AOUT_PCM_LINE,
}, {
.type = EM28XX_VMUX_SVIDEO,
.vmux = TVP5150_SVIDEO,
.amux = EM28XX_AMUX_LINE_IN,
+ .aout = EM28XX_AOUT_MASTER | EM28XX_AOUT_PCM_IN |
+ EM28XX_AOUT_PCM_LINE,
} },
},
[EM2861_BOARD_PLEXTOR_PX_TV100U] = {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: em28xx: fix silent audio capture on EM2860/TVP5150 reference design
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 ` [PATCH v2] media: em28xx: add StarTech.com SVID2USB23 with working audio capture David Wood
0 siblings, 2 replies; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2026-09-13 21:10 UTC (permalink / raw)
To: d01; +Cc: mchehab, linux-media
On Sun, 13 Sep 2026 16:23:12 -0400
d01 <d01.devel@gmail.com> wrote:
> The EM2860/TVP5150 reference design (eb1a:5051, "USB 2861 Device",
> card=29) captures no analog audio.
Instead of touching the reference design, and except if you have the
real em2861 reference card (unlikely unless you're a manufacturer or
if some manufacturer donated one to you), you need to create a
board-specific entry with the brand name used on it, and use
card=<number>.
Having a generic USB ID means that the vendor of your specific board
was lazy enough to not store a different USB ID at the USB table inside
its eeprom.
It may also mean that the AC97 chip - either emp202 or a different
model - is wired on a non-standard way. Those chips have multiple
inputs that are wired on different ways depending on the board.
> The ALSA device yields a flat noise
> floor of about -85 dBFS, identical with the audio cable plugged or
> unplugged and regardless of mixer settings, while video capture works
> normally.
>
> Audio on this board is not on the em28xx vendor path. Chip config
> register 0x00 reads 0x50 -- bit 0x80 (vendor audio) is clear -- so the
> board exposes a USB Audio Class interface claimed by snd-usb-audio, fed
> by the EMP202 codec's ADC. Which input that ADC listens to is set by
> AC97_REC_SEL (0x1a).
>
> em28xx_audio_analog_set() does program AC97_REC_SEL, but only under:
>
> if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN)
>
> ctl_aoutput comes from the board's per-input .aout field, falling back
> to EM28XX_AOUT_MASTER when it is unset (em28xx-video.c). This board's
> entry sets .amux but no .aout, so EM28XX_AOUT_PCM_IN is never set, the
> AC97_REC_SEL write is skipped, and the mux stays at its reset default
> of 0x0000 (Mic, which is not connected on these boards). Nothing is
> captured.
>
> Set .aout on both inputs to select the PCM record path from Line In,
> matching the .amux already declared. ac97_return_record_select() maps
> EM28XX_AOUT_PCM_LINE to 4, which em28xx_audio_analog_set() mirrors into
> both channels as 0x0404.
>
> EM28XX_AOUT_MASTER is included so the master volume continues to track
> the V4L2 volume control exactly as it did via the old fallback, keeping
> the change additive. It is not required for capture -- muting
> AC97_MASTER by hand while leaving everything else in place does not
> affect the recorded signal.
>
> Diagnosed on eb1a:5051 by writing AC97_REC_SEL directly over usbfs with
> everything else held constant:
>
> AC97_REC_SEL = 0x0404 (Line In) -> -21.8 dBFS, line-level audio
> AC97_REC_SEL = 0x0000 (Mic) -> -85.4 dBFS, silence
>
> Then verified with this patch applied and the rebuilt module loaded, with
> no userspace register writes at all: the driver programs AC97_REC_SEL to
> 0x0404 on its own at probe, and capture yields -25.0 dBFS of line-level
> audio once the mute control is cleared.
>
> AC97_POWERDOWN (0x26) reads 0x420d throughout -- status bits ADC, ANL
> and REF all set -- so this is not an analog-power or GPIO problem. The
> codec is powered and simply listening to the wrong input.
>
> Note that the V4L2 mute control defaults to 1, which gates the bridge
> audio path via EM28XX_XCLK_AUDIO_UNMUTE in R0F. That is a separate
> issue and is unchanged by this patch, so "v4l2-ctl -d /dev/videoN -c
> mute=0" is still required to hear anything.
>
> Signed-off-by: d01 <d01.devel@gmail.com>
Please use your name instead of "d01".
> ---
> drivers/media/usb/em28xx/em28xx-cards.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> --- a/drivers/media/usb/em28xx/em28xx-cards.c
> +++ b/drivers/media/usb/em28xx/em28xx-cards.c
> @@ -1148,10 +1148,14 @@
> .type = EM28XX_VMUX_COMPOSITE,
> .vmux = TVP5150_COMPOSITE1,
> .amux = EM28XX_AMUX_LINE_IN,
> + .aout = EM28XX_AOUT_MASTER | EM28XX_AOUT_PCM_IN |
> + EM28XX_AOUT_PCM_LINE,
> }, {
> .type = EM28XX_VMUX_SVIDEO,
> .vmux = TVP5150_SVIDEO,
> .amux = EM28XX_AMUX_LINE_IN,
> + .aout = EM28XX_AOUT_MASTER | EM28XX_AOUT_PCM_IN |
> + EM28XX_AOUT_PCM_LINE,
Most boards don't require adjusting aout. On most cases, just amux is
needed. The above setup also sounds weird: why does it need 3 audio lines
there?
> } },
> },
> [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
Thanks,
Mauro
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: em28xx: fix silent audio capture on EM2860/TVP5150 reference design
2026-09-13 21:10 ` Mauro Carvalho Chehab
@ 2026-09-18 22:07 ` David Wood
2026-09-18 22:07 ` [PATCH v2] media: em28xx: add StarTech.com SVID2USB23 with working audio capture David Wood
1 sibling, 0 replies; 4+ messages in thread
From: David Wood @ 2026-09-18 22:07 UTC (permalink / raw)
To: mchehab; +Cc: linux-media
On Sun, 13 Sep 2026 23:10:13 +0200, Mauro Carvalho Chehab wrote:
> Instead of touching the reference design, and except if you have the
> real em2861 reference card (unlikely unless you're a manufacturer or
> if some manufacturer donated one to you), you need to create a
> board-specific entry with the brand name used on it, and use
> card=<number>.
Agreed. It is a retail StarTech.com SVID2USB23. v2 adds a board entry
for it and leaves the reference design entry alone.
Since the USB ID is the generic eb1a:5051, v2 identifies the board by
EEPROM hash (0x11b79572), the way em28xx_eeprom_hash[] already does for
other boards with shared IDs, with a lookup in em28xx_card_setup() for
devices that arrive as the reference design. Boards that do not match a
hash keep the reference design entry exactly as before, with no extra
log output. card=114 also works.
> It may also mean that the AC97 chip - either emp202 or a different
> model - is wired on a non-standard way. Those chips have multiple
> inputs that are wired on different ways depending on the board.
It is an EMP202 (vendor ID reads back as such, features 0x6a90) and
Line In is wired as on the reference design: with the record source set
to Line In the capture is clean line level. The only thing missing is
that nothing ever programs the ADC record source, because audio on this
board leaves over a USB Audio Class endpoint fed by the EMP202 ADC
rather than the em28xx vendor path, and .amux only reaches the mixer
volume registers.
> Please use your name instead of "d01".
Done.
> Most boards don't require adjusting aout. On most cases, just amux is
> needed. The above setup also sounds weird: why does it need 3 audio
> lines there?
Two are needed. em28xx_audio_analog_set() only writes AC97_REC_SEL when
EM28XX_AOUT_PCM_IN is set, and EM28XX_AOUT_PCM_LINE is what selects
Line In as the record source, so v2 uses exactly those two, matching the
other entries that set PCM_IN. EM28XX_AOUT_MASTER was only carried over
from the old fallback so the master volume register would keep tracking
the V4L2 volume control; it has no effect on capture on this board, so
it is gone in v2.
Thanks for the review,
David
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] media: em28xx: add StarTech.com SVID2USB23 with working audio capture
2026-09-13 21:10 ` Mauro Carvalho Chehab
2026-09-18 22:07 ` David Wood
@ 2026-09-18 22:07 ` David Wood
1 sibling, 0 replies; 4+ messages in thread
From: David Wood @ 2026-09-18 22:07 UTC (permalink / raw)
To: mchehab; +Cc: linux-media
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-18 22:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2] media: em28xx: add StarTech.com SVID2USB23 with working audio capture David Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox