NetBSD-Bugs archive

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

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



The following reply was made to PR kern/56980; it has been noted by GNATS.

From: Pierre Pronchery <khorben%defora.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/56980: Support missing for Sound Blaster Audigy Rx audio
 card
Date: Fri, 26 Aug 2022 11:07:38 +0200

 After further investigation, I realised that OpenBSD is using NetBSD=E2=80=
 =99s
 driver, and added support for the chipset changes related to the Audigy
 Rx. I have updated the patch to include the corresponding changes.
 
 Unfortunately, more changes are still required in order to actually be
 able to output audio: I get a constant, faint hissing noise instead at
 the moment.
 
 Additional information FWIW:
 
 $ audiocfg list 0
 0: [*] audio0 @ emuxki0: Audigy2 (value) 0x00
        playback: 2ch, 48000Hz
        record:   2ch, 48000Hz
        (PR) slinear_le 16/16, 2ch, { 48000 }
 $ mixerctl -d /dev/mixer0 -av
 outputs.master=3D255,255 volume delta=3D8
 outputs.master.mute=3Doff  [ off on ]
 outputs.mono=3D255 volume delta=3D8
 outputs.mono.mute=3Don  [ off on ]
 outputs.mono.source=3Dmixerout  [ mixerout mic ]
 outputs.headphones=3D255,255 volume delta=3D8
 outputs.headphones.mute=3Doff  [ off on ]
 inputs.speaker=3D255 volume delta=3D16
 inputs.speaker.mute=3Doff  [ off on ]
 inputs.phone=3D191 volume delta=3D8
 inputs.phone.mute=3Don  [ off on ]
 inputs.mic=3D191 volume delta=3D8
 inputs.mic.mute=3Don  [ off on ]
 inputs.mic.preamp=3Doff  [ off on ]
 inputs.mic.source=3Dmic0  [ mic0 mic1 ]
 inputs.line=3D191,191 volume delta=3D8
 inputs.line.mute=3Doff  [ off on ]
 inputs.cd=3D191,191 volume delta=3D8
 inputs.cd.mute=3Doff  [ off on ]
 inputs.video=3D191,191 volume delta=3D8
 inputs.video.mute=3Doff  [ off on ]
 inputs.aux=3D191,191 volume delta=3D8
 inputs.aux.mute=3Doff  [ off on ]
 inputs.dac=3D191,191 volume delta=3D8
 inputs.dac.mute=3Doff  [ off on ]
 record.source=3Dmic  [ mic cd video aux line mixerout mixeroutmono phone =
 ]
 record.volume=3D0,0 volume delta=3D16
 record.volume.mute=3Doff  [ off on ]
 outputs.spatial=3Doff  [ off on ]
 outputs.spatial.center=3D0 volume delta=3D16
 outputs.spatial.depth=3D0 volume delta=3D16
 spdif.enable=3Doff  [ off on ]
 
 diff --git a/sys/dev/pci/emuxki.c b/sys/dev/pci/emuxki.c
 index 6a700e20f31c..8376655a70ec 100644
 --- a/sys/dev/pci/emuxki.c
 +++ b/sys/dev/pci/emuxki.c
 @@ -139,7 +139,8 @@ struct emuxki_softc {
                 EMUXKI_SBLIVE =3D 0x00,
                 EMUXKI_AUDIGY =3D 0x01,
                 EMUXKI_AUDIGY2 =3D 0x02,
 -               EMUXKI_LIVE_5_1 =3D 0x04,
 +               EMUXKI_AUDIGY2_VALUE =3D 0x04,
 +               EMUXKI_LIVE_5_1 =3D 0x08,
                 EMUXKI_APS =3D 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) =3D=3D =
 PCI_PRODUCT_CREATIVELABS_AUDIGY) {
 +       if (PCI_PRODUCT(pa->pa_id) =3D=3D =
 PCI_PRODUCT_CREATIVELABS_SBAUDIGY4) {
 +               sc->sc_type =3D EMUXKI_AUDIGY;
 +               sc->sc_type |=3D EMUXKI_AUDIGY2;
 +               sc->sc_type |=3D EMUXKI_AUDIGY2_VALUE;
 +               strlcpy(sc->sc_audv.name, "Audigy2 (value)",
 +                   sizeof(sc->sc_audv.name));
 +       } else if (PCI_PRODUCT(pa->pa_id) =3D=3D =
 PCI_PRODUCT_CREATIVELABS_AUDIGY) {
                 sc->sc_type =3D EMUXKI_AUDIGY;
                 if (PCI_REVISION(pa->pa_class) =3D=3D 0x04) {
                         sc->sc_type |=3D EMUXKI_AUDIGY2;
 @@ -707,7 +715,27 @@ 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) {
 +               /* Setup SRCMulti_I2S SamplingRate */
 +               emuxki_write(sc, 0, EMU_A2_SPDIF_SAMPLERATE,
 +                   emuxki_read(sc, 0, EMU_A2_SPDIF_SAMPLERATE) & =
 0xfffff1ff);
 +
 +               /* Setup SRCSel (Enable SPDIF, I2S SRCMulti) */
 +               emuxki_writeptr(sc, EMU_A2_PTR, EMU_A2_DATA, =
 EMU_A2_SRCSEL,
 +                   EMU_A2_SRCSEL_ENABLE_SPDIF | =
 EMU_A2_SRCSEL_ENABLE_SRCMULTI);
 +
 +               /* Setup SRCMulti Input Audio Enable */
 +               emuxki_writeptr(sc, EMU_A2_PTR, EMU_A2_DATA,
 +                   0x7b0000, 0xff000000);
 +
 +               /* Setup SPDIF Out Audio Enable
 +                * The Audigy 2 Value has a separate SPDIF out,
 +                * so no need for a mixer switch */
 +               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); /* clear =
 bit 3 */
 +       } else if (sc->sc_type & EMUXKI_AUDIGY2) {
                 emuxki_write(sc, 0, EMU_A2_SPDIF_SAMPLERATE,
                     EMU_A2_SPDIF_UNKNOWN);
 
 @@ -739,10 +767,12 @@ emuxki_init(struct emuxki_softc *sc)
             EMU_INTE_VOLDECRENABLE |
             EMU_INTE_MUTEENABLE);
 
 -       if (sc->sc_type & EMUXKI_AUDIGY2) {
 +       if (sc->sc_type & EMUXKI_AUDIGY2_VALUE) {
 +               emuxki_writeio_4(sc, EMU_A_IOCFG,
 +                   0x0060 | emuxki_readio_4(sc, EMU_A_IOCFG));
 +       } else if (sc->sc_type & EMUXKI_AUDIGY2) {
                 emuxki_writeio_4(sc, EMU_A_IOCFG,
 -                   emuxki_readio_4(sc, EMU_A_IOCFG) |
 -                       EMU_A_IOCFG_GPOUT0);
 +                   EMU_A_IOCFG_GPOUT0 | emuxki_readio_4(sc, =
 EMU_A_IOCFG));
         }
 
         /* enable AUDIO bit */
 
 --=20
 khorben=
 


Home | Main Index | Thread Index | Old Index