Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ffbcf8d authored by Mingshu Pang's avatar Mingshu Pang
Browse files

hal: fix no sound issue when using some USB headset.

The RX bit-width is overwritten when getting the RX and
TX capabilities with same memory.
Use different variables to fix the issue.

CRs-Fixed: 2426606
Change-Id: Ib254eaa3ff3ce04eb77299757ff3cbfaeff9e57a
parent ecbe97d4
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1168,8 +1168,14 @@ void usb_add_device(audio_devices_t device, int card)
            usb_card_info->usb_card = card;
            usb_card_info->usb_device_type = device;
            usb_get_sidetone_mixer(usb_card_info);
            if (!usb_get_device_cap_config(usb_card_info, card))
            struct usb_card_config *usb_card_info_temp = NULL;
            usb_card_info_temp = calloc(1, sizeof(struct usb_card_config));
            if (usb_card_info_temp != NULL) {
                list_init(&usb_card_info_temp->usb_device_conf_list);
                if (!usb_get_capability(USB_CAPTURE, usb_card_info_temp, card))
                    usbmod->is_capture_supported = true;
                free(usb_card_info_temp);
            }
            list_add_tail(&usbmod->usb_card_conf_list, &usb_card_info->list);
            goto exit;
        }