[PATCH 0/2] MR325: pulse/alsa: Set device path for all devices

Andrew Eikum (@aeikum) wine at gitlab.winehq.org
Tue Jun 28 08:30:00 CDT 2022


Andrew Eikum (@aeikum) commented about dlls/winealsa.drv/alsa.c:
> -            WARN("Could not open %s for reading\n", uevent);
> -            params->result = E_NOTIMPL;
> +        /* As hardly any audio devices have serial numbers, Windows instead
> +        appears to use a persistent random number. We emulate this here
> +        by instead using the last 8 hex digits of the GUID. */
> +        serial_number = (guid->Data4[4] << 24) | (guid->Data4[5] << 16) | (guid->Data4[6] << 8) | guid->Data4[7];
> +
> +        if(connection == AudioDeviceConnectionType_USB)
> +            sprintf(buf, "{1}.USB\\VID_%04X&PID_%04X\\%u&%08X",
> +                    vendor_id, product_id, device, serial_number);
> +        else if (connection == AudioDeviceConnectionType_PCI)
> +            sprintf(buf, "{1}.HDAUDIO\\FUNC_01&VEN_%04X&DEV_%04X\\%u&%08X",
> +                    vendor_id, product_id, device, serial_number);
> +        else
> +        {
> +            ERR("name: %s\n", name);
Is this ERR intentional? If so it should be a bit more descriptive I think.

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/325#note_2862



More information about the wine-devel mailing list