[pulseaudio-discuss] [PATCH 6/6] alsa: load jack detection module

Margarita Olaya magi at slimlogic.co.uk
Wed Apr 6 16:35:05 PDT 2011


Hi David,

On Wed, Apr 6, 2011 at 1:08 AM, David Henningsson
<david.henningsson at canonical.com> wrote:
> Hi Margarita,
>
> I have a question, maybe you can explain to me (see below) :
>
> On 2011-04-05 22:34, Margarita Olaya wrote:
>>
>> @@ -352,6 +372,40 @@ static void verify_access(struct userdata *u,
>> struct device *d) {
>>      }
>>  }
>>
>> +static void verify_input_access(struct userdata *u, struct device *d) {
>> +    char *cd;
>> +    char *args;
>> +    pa_card *card;
>
> (The "card" variable is not used in the function.)
>
I will remove it.

>> +    pa_bool_t accessible;
>> +
>> +    pa_assert(u);
>> +    pa_assert(d);
>> +
>> +    cd = pa_sprintf_malloc("%s/input/event%s",
>> udev_get_dev_path(u->udev), path_get_input_id(d->path));
>> +    accessible = access(cd, R_OK)>= 0;
>> +    pa_log_debug("%s is accessible: %s", cd, pa_yes_no(accessible));
>> +
>> +    if (d->module == PA_INVALID_INDEX) {
>> +
>> +        /* If we are not loaded, try to load */
>> +        if (accessible) {
>> +            pa_module *m;
>> +
>> +            args = pa_sprintf_malloc("device_id=\"%s\""
>> +                            "card_name=\"%s\" ", cd, d->card_name);
>
> It seems like d->card_name is only set in card_changed, which is not called
> for input devices. Won't this card name always be empty?
>
true, I didn't catch this happens with my latest code.

> Also, if a card is marked PULSE_IGNORE, will that make the card's input
> devices to be ignored as well? Before starting the module jack detection
> module, can you make sure that the card is loaded by PA?
>
yes, I'll check this along with the previous point, I will send the update soon.

Thanks for your comments.

Regards,
Margarita
> --
> David Henningsson, Canonical Ltd.
> http://launchpad.net/~diwic
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>



More information about the pulseaudio-discuss mailing list