NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/56980: Support missing for Sound Blaster Audigy Rx audio card



>Number:         56980
>Category:       kern
>Synopsis:       The Sound Blaster Audigy Rx is not supported by NetBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 26 08:55:00 +0000 2022
>Originator:     Pierre Pronchery <khorben%defora.org@localhost>
>Release:        NetBSD 9.3_STABLE
>Organization:
>Environment:
System: NetBSD Insomniac 9.3_STABLE NetBSD 9.3_STABLE (GENERIC) #0: Mon Aug 22 06:20:14 UTC 2022 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
The NetBSD kernel does not support the Sound Blaster Audigy Rx. It is
not recognised at all by the emuxki(4) driver, which should be the one
responsible for implementing it: its hardware is very close to that of
the Audigy 2.
>How-To-Repeat:
Insert a Sound Blaster Audigy Rx into a PCIe port, and boot NetBSD.
>Fix:
The following patch modifies the emuxki(4) driver to recognise the card.
However, more changes are required in order to actually be able to
output audio, which could not be confirmed with this patch alone.

emuxki0 at pci6 dev 0 function 0: vendor 1102 product 0008 (rev. 0x00)
emuxki0: interrupting at ioapic3 pin 0
emuxki0: ac97: SigmaTel STAC9750/51 codec; headphone, 20 bit DAC, 20 bit ADC, SigmaTel 3D
emuxki0: ac97: ext id 0x605<AC97_22,AMAP,SPDIF,VRA>
audio0 at emuxki0: playback, capture, full duplex, independent

diff --git a/sys/dev/pci/emuxki.c b/sys/dev/pci/emuxki.c
index 6a700e20f31c..43d1bb747764 100644
--- a/sys/dev/pci/emuxki.c
+++ b/sys/dev/pci/emuxki.c
@@ -139,7 +139,8 @@ struct emuxki_softc {
 		EMUXKI_SBLIVE = 0x00,
 		EMUXKI_AUDIGY = 0x01,
 		EMUXKI_AUDIGY2 = 0x02,
-		EMUXKI_LIVE_5_1 = 0x04,
+		EMUXKI_AUDIGY2_VALUE = 0x04,
+		EMUXKI_LIVE_5_1 = 0x08,
 		EMUXKI_APS = 0x08
 	} sc_type;
 	audio_device_t		sc_audv;	/* for GETDEV */
@@ -479,6 +480,7 @@ emuxki_match(device_t parent, cfdata_t match, void *aux)
 	case PCI_PRODUCT_CREATIVELABS_SBLIVE:
 	case PCI_PRODUCT_CREATIVELABS_SBLIVE2:
 	case PCI_PRODUCT_CREATIVELABS_AUDIGY:
+	case PCI_PRODUCT_CREATIVELABS_SBAUDIGY4:
 		return 1;
 	default:
 		return 0;
@@ -538,7 +540,13 @@ emuxki_attach(device_t parent, device_t self, void *aux)
 	aprint_normal_dev(self, "interrupting at %s\n", intrstr);
 
 	/* XXX it's unknown whether APS is made from Audigy as well */
-	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CREATIVELABS_AUDIGY) {
+	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CREATIVELABS_SBAUDIGY4) {
+		sc->sc_type = EMUXKI_AUDIGY;
+		sc->sc_type |= EMUXKI_AUDIGY2;
+		sc->sc_type |= EMUXKI_AUDIGY2_VALUE;
+		strlcpy(sc->sc_audv.name, "Audigy2 (value)",
+		    sizeof(sc->sc_audv.name));
+	} else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CREATIVELABS_AUDIGY) {
 		sc->sc_type = EMUXKI_AUDIGY;
 		if (PCI_REVISION(pa->pa_class) == 0x04) {
 			sc->sc_type |= EMUXKI_AUDIGY2;
@@ -707,7 +715,20 @@ emuxki_init(struct emuxki_softc *sc)
 	emuxki_write(sc, 0, EMU_SPCS1, spcs);
 	emuxki_write(sc, 0, EMU_SPCS2, spcs);
 
-	if (sc->sc_type & EMUXKI_AUDIGY2) {
+	if (sc->sc_type & EMUXKI_AUDIGY2_VALUE) {
+		emuxki_write(sc, 0, EMU_A2_SPDIF_SAMPLERATE,
+		    EMU_A2_SPDIF_UNKNOWN);
+
+		emuxki_writeptr(sc, EMU_A2_PTR, EMU_A2_DATA, EMU_A2_SRCSEL,
+		    EMU_A2_SRCSEL_ENABLE_SPDIF | EMU_A2_SRCSEL_ENABLE_SRCMULTI);
+
+		emuxki_writeptr(sc, EMU_A2_PTR, EMU_A2_DATA, 0x7a0000, 0xff000000);
+
+		emuxki_writeio_4(sc, EMU_A_IOCFG,
+		    emuxki_readio_4(sc, EMU_A_IOCFG) & ~0x8);
+	} else if (sc->sc_type & EMUXKI_AUDIGY2) {
 		emuxki_write(sc, 0, EMU_A2_SPDIF_SAMPLERATE,
 		    EMU_A2_SPDIF_UNKNOWN);
 



Home | Main Index | Thread Index | Old Index