[pulseaudio-discuss] [PATCH] alsa: Don't try to use ELD controls with UCM
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Thu Feb 12 05:08:22 PST 2015
On Mon, 2015-02-09 at 11:28 +0100, David Henningsson wrote:
> Ack.
Thanks, pushed.
-- Tanu
> On 2015-02-06 23:15, Tanu Kaskinen wrote:
> > This fixes a crash that occurred when trying to access non-existent
> > port data. Doing this:
> >
> > pa_alsa_port_data *data = PA_DEVICE_PORT_DATA(port);
> >
> > is not a good idea when using UCM, because in the UCM mode ports don't
> > have any data, so the data pointer points to some random memory.
> > ---
> > src/modules/alsa/module-alsa-card.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
> > index df04155..a7fec04 100644
> > --- a/src/modules/alsa/module-alsa-card.c
> > +++ b/src/modules/alsa/module-alsa-card.c
> > @@ -455,6 +455,12 @@ static void init_eld_ctls(struct userdata *u) {
> > if (!u->mixer_handle)
> > return;
> >
> > + /* The code in this function expects ports to have a pa_alsa_port_data
> > + * struct as their data, but in UCM mode ports don't have any data. Hence,
> > + * the ELD controls can't currently be used in UCM mode. */
> > + if (u->use_ucm)
> > + return;
> > +
> > PA_HASHMAP_FOREACH(port, u->card->ports, state) {
> > pa_alsa_port_data *data = PA_DEVICE_PORT_DATA(port);
> > snd_mixer_elem_t* melem;
> >
>
More information about the pulseaudio-discuss
mailing list