# Patch audio với VoodooHDA

## Cài đặt

### Từ Catalina trở xuống

**B1**: Tải xuống kext từ nguồn [sau](https://sourceforge.net/projects/voodoohda/)

**B2**: Thêm kext vào folder trong EFI sau đó snapshot lại config

**B3**: Restart và tận hưởng&#x20;

### Từ Big Sur trở lên

**B1**: Tải xuống file từ nguồn [sau](https://github.com/chris1111/VoodooHDA-OC)&#x20;

> Đối với clover các bạn tải kext từ nguồn [sau](https://github.com/chris1111/VoodooHDA-2.9.2-Clover)

**B2**: Mở file `.dmg` và bỏ app vào desktop&#x20;

> Đối với Clover chạy file `pkg` lên

**B3**: Chạy app và kéo phân vùng ổ cứng vào

**B4**: Bỏ kext vào `L/E` bằng [kext droplet v2](https://github.com/chris1111/Kext-Droplet)&#x20;

**B5**: Xóa kext ở `bootloader` và `restart`

{% hint style="warning" %}
Lưu ý&#x20;

Ở bigsur trở lên các bạn bắt buộc phải disable sip thì mới có thể tiếp tục

> Xem chi tiết [tại đây](https://basic.heavietnam.com/universal/sip-va-gatekeeper)
> {% endhint %}

## Tinh chỉnh

### Dump codec

**B1**: Tải xuống file `get_dump` từ nguồn sau về [tại đây](https://sourceforge.net/projects/voodoohda/files/getdump.zip/download)

**B2 :** Chạy file `getdump` lên

**B3**: Các bạn copy hết "đóng" code vừa dum và copy vào 1 file `.docx`  hoặc `.txt`

**B4**: Ấn tổ hợp phím `Command+F` để tìm từ khóa `patched pins configration`

<figure><img src="/files/0GyEpctPvtkTNZjSqGfW" alt=""><figcaption></figcaption></figure>

**B5**: Copy mục `patched pins configration` ra 1 file khác&#x20;

```
Patched pins configuration:
 nid 17 0x4033c040 as  4 seq  0 CD            None  ATAPI   N/A     External Res.C   misc 0 [DISABLED]
 nid 18 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 20 0x01014010 as  1 seq  0 Line-out      Jack  1/8     Rear    External Green   misc 0
 nid 21 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 22 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 23 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 24 0x01a19040 as  4 seq  0 Microphone    Jack  1/8     Rear    External Pink    misc 0
 nid 25 0x02a19050 as  5 seq  0 Microphone    Jack  1/8     Front   External Pink    misc 0
 nid 26 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 27 0x02214020 as  2 seq  0 Headphones    Jack  1/8     Front   External Green   misc 0
 nid 28 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 30 0x01441130 as  3 seq  0 SPDIF-out     Jack  RCA     Rear    External Black   misc 0 NoPresenceDetect
 nid 31 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
```

<figure><img src="/files/yHESUYI9CcwolD9yo1Ib" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Chú ý:

Bước 5 chỉ để cho dễ phân biệt còn đối với các bạn "super" thì bỏ qu‌a bước này và bước 6 cũng được :smile:
{% endhint %}

**B6**: Copy các dòng không chữ DISABLED ra 1 phần riêng

```
Inject
 nid 20 0x01014010 as  1 seq  0 Line-out      Jack  1/8     Rear    External Green   misc 0
 nid 24 0x01a19040 as  4 seq  0 Microphone    Jack  1/8     Rear    External Pink    misc 0
 nid 25 0x02a19050 as  5 seq  0 Microphone    Jack  1/8     Front   External Pink    misc 0
 nid 27 0x0221401f as  2 seq  0 Headphones    Jack  1/8     Front   External Green   misc 0
 nid 30 0x01441130 as  3 seq  0 SPDIF-out     Jack  RCA     Rear    External Black   misc 0 NoPresenceDetect

Disabled
 nid 31 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 28 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 26 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 21 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 22 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 23 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 17 0x4033c040 as  4 seq  0 CD            None  ATAPI   N/A     External Res.C   misc 0 		     [DISABLED]
 nid 18 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
```

<figure><img src="/files/hTDaCtPy6QVZIKmUIZQN" alt=""><figcaption></figcaption></figure>

**B7**: Mở file `info.plist` và file [`tmp info.plist`](https://drive.heavietnam.com/d/s/zBcyVWdMPTZZlwFmjSpjWeXnqtu5Pddd/h0Cqfg5-ldoe0ptqWi3N0lqznC9nWz6B-ZrlA3NaVggs)

> Backup file [tmp info.plist](https://www.mediafire.com/file/0bivqpf0iggrwx2/heavietnam_tmp_info.plist/file)

<figure><img src="/files/zcHUsPDMnM3G0aoFtKnx" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
File `info.plist` nằm ở trong `voodoohda --> content --> info.plist`
{% endhint %}

<figure><img src="/files/eDXHXdmb7ntqVlVqcCAb" alt=""><figcaption></figcaption></figure>

### Inject node

**B1**: Tìm phần `nodes to pad` và xóa các `node` trong đấy đi và copy mục 0 của file `tmp info.plist` trong mục  `nodes to pad` qua file `info.plist`

> Mục `0` dùng để `inject` các `codec` thực

**B2**: Các bạn `clone` mục `0` thành nhiều mục

{% hint style="info" %}
Số mục tương ứng với các mục của của `codec` thực ở đây của mình là 5
{% endhint %}

<figure><img src="/files/PsaZCe02JI01hdVjrhe8" alt=""><figcaption></figcaption></figure>

Sửa dòng node của file `info.plist` theo các `codec` thực &#x20;

```
 nid 20 0x01014010 as  1 seq  0 Line-out      Jack  1/8     Rear    External Green   misc 0
 nid 24 0x01a19040 as  4 seq  0 Microphone    Jack  1/8     Rear    External Pink    misc 0
 nid 25 0x02a19050 as  5 seq  0 Microphone    Jack  1/8     Front   External Pink    misc 0
 nid 27 0x0221401f as  2 seq  0 Headphones    Jack  1/8     Front   External Green   misc 0
 nid 30 0x01441130 as  3 seq  0 SPDIF-out     Jack  RCA     Rear    External Black   misc 0 NoPresenceDetect
 
 //Như ở đây mình có các node thực là 20, 24, 25, 27,30
```

<figure><img src="/files/iQHTR5FJtPflxYAvTB9c" alt=""><figcaption></figcaption></figure>

**B3**: Copy các mục config của file của các codec vào config trong `nodes to pad`  của file `info.plist`

<pre><code> nid 20 0x01014010 as  1 seq  0 Line-out      Jack  1/8     Rear    External Green   misc 0
 nid 24 0x01a19040 as  4 seq  0 Microphone    Jack  1/8     Rear    External Pink    misc 0
 nid 25 0x02a19050 as  5 seq  0 Microphone    Jack  1/8     Front   External Pink    misc 0
<strong> nid 27 0x02214020 as  2 seq  0 Headphones    Jack  1/8     Front   External Green   misc 0
</strong> nid 30 0x01441130 as  3 seq  0 SPDIF-out     Jack  RCA     Rear    External Black   misc 0 NoPresenceDetect

// Ví dụ của mình sẽ là 0x01014010, 0x01a19040, 0x02a19050, 0x02214020, 0x01441130
</code></pre>

<figure><img src="/files/JpevibNo1aTyN9gIEmU7" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Chú ý:

Nhưng nếu bạn config như vậy thì khi cắm headphone vào thì trong setting sẽ xuất hiện cả Speaker lẫn headphones để cho nó auto detect bạn sẽ chỉnh lại config của headphone như sau

* Tìm đến config của headphone
* Xoá hai ký tự cuối đi
* Điền `1f` vào vị trí vừa xoá
  {% endhint %}

```
nid 27 0x02214020 as  2 seq  0 Headphones    Jack  1/8     Front   External Green   misc 0
// Ví dụ:
0x02214020 --> 0x0221401f
```

<figure><img src="/files/PtT2dKuFTEYfDRV7bZMb" alt=""><figcaption></figcaption></figure>

**B4**: Ở phần codec các bạn để là `0` như mặc định số `0` này là của phần  hda codec của các bạn như của mình là

<figure><img src="/files/kxqo9l6V0rfq6XSpHACd" alt=""><figcaption></figcaption></figure>

### Disable node

{% hint style="info" %}
Như các bạn có thể thấy trong phần `Patched pins configuration`&#x20;

> Có các node disable đây chính là các node ảo và ta cần disable nó đi
> {% endhint %}

**B1**: Bây giờ các bạn copy mục `1` ở file `tmp info.plist` phần `nodes to pad` sang file `info.plist` và `clone` ra tương ứng bằng số `codec` ảo của bạn

<figure><img src="/files/UmhFLcgU4lGOzLfBJ9en" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Như của mình là 8
{% endhint %}

<figure><img src="/files/YjsdroBonudBYzulhflZ" alt=""><figcaption></figcaption></figure>

**B2**: tiếp đến các bạn làm như trên copy phần `nod` của các codec ảo sang phần `nodes to pad --> node` của file `info.plist`  như mình sau khi copy xong sẽ là&#x20;

```
Disabled
 nid 31 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 28 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 26 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 21 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 22 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 23 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 nid 17 0x4033c040 as  4 seq  0 CD            None  ATAPI   N/A     External Res.C   misc 0 		     [DISABLED]
 nid 18 0x411111f0 as 15 seq  0 Speaker       None  1/8     Rear    External Black   misc 0 NoPresenceDetect [DISABLED]
 //Như của mình ở đây sẽ là 31, 28, 26, 21, 22, 23, 17, 18
```

<figure><img src="/files/HWsfsACdWiXzYKoPEXVj" alt=""><figcaption></figcaption></figure>

**B3**: Tiếp theo copy toàn bộ mục `MixerValues` của file `tmp info.plist` sang file `info.plist`

{% hint style="info" %}
Các bạn cứ việc xoá phần `MixerValues` trong `file` info đi rồi copy từ file `template` qua là được
{% endhint %}

<figure><img src="/files/utByTUMp3qbmPSf6vFGF" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Gần xong rồi cố lên nhé :smile:&#x20;
{% endhint %}

### Adjust quirk

**B1**: Các bạn chỉnh mục `noise` trong file `info.plist` về `5`

<figure><img src="/files/5d5RsNKJA3PpXnh2PWgL" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Như thế là đã loại bỏ triệt để rè nhưng nếu các bạn hơi khó tính thì nên bỏ thêm kext codec commander theo nguồn [sau](https://bitbucket.org/RehabMan/os-x-eapd-codec-commander/downloads/)  vào mục `kext` và `snaps` lại&#x20;
{% endhint %}

**B2**: Tiếp theo chỉnh các mục fix theo file `tmp info.plist` đây là của mình sau khi chỉnh xong&#x20;

<figure><img src="/files/QH7NOqeVw7kC31wiWVWJ" alt=""><figcaption></figcaption></figure>

### Load Kext

#### Catalina trở xuống

B1: Tiến hành mount phân vùng EFI bằng hackintool

B2: Copy file `info.plist` vừa chỉnh sửa vào `VoodooHDA --> Contents`&#x20;

B3: Bỏ kext vào `EFI -> OC -> Kext`&#x20;

> Hoặc `EFI -> Clover -> Kext -> Other`

B4: Snapshot lại và reboot

{% hint style="warning" %}
Nếu dùng clover có thể bỏ qua việc snapshot
{% endhint %}

#### BigSur trở lên

B1: Copy file `info.plist` vừa chỉnh sửa vào `VoodooHDA --> Contents`&#x20;

B2: Chạy xoá kext `voodooHDA` trong `LE` đã thêm ở phần cài đặt

> Để hiểu LE là gì vui lòng xem lại bài [này](https://install.heavietnam.com/general/kien-thuc-co-ban)

B3: Nhập vào setting và nhập password để allow việc rebuild cache

B4: Reboot

{% hint style="success" %}
Đây là đoạn âm thanh sau khi đã tinh chỉnh `voodoohda` [Audio recording 2018-03-02 00-05-57.wav](https://drive.google.com/file/d/1zxraP_Aq65pbEp6AZxLfez5j37TtsS_W/view)&#x20;

> Backup 1 [tại đây](https://drive.heavietnam.com/d/s/zGcBTMHH1KYP3TFlKLLsmxh97zl7KLzw/3gLWZTFNuaJEtyzBuAzj3xixqy0jXAQX-srlgxQKWggs)
>
> > Backup 2 [tại đây](https://www.mediafire.com/file/9ickyl4ht8o8c0z/Audio_recording_2018-03-02_00-05-57.wav/file)
> > {% endhint %}

{% hint style="info" %}
Source tham khảo: [Hướng dẫn chi tiết cài đặt âm thanh cho Hackintosh với VoodooHDA](https://youtu.be/TMjlI79f4KU)&#x20;

> Nếu như thấy bài viết hơi khó hiểu cũng có thể xem video này nhé&#x20;
> {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://advance.heavietnam.com/audio/patch-audio-voi-voodoohda.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
