#/bin/bash

# These didn't really work, I think I tried to copy the entire HDA verb sequence
# from the Windows driver. Running these both before and after adjusting the pin
# configuration didn't appear to do anything. Maybe I messed something up.
# You can see the ASUS blog post for more information on to how to assemble these
# commands yourself. 

# # Just going to try the direct sequence from windows first

device=/dev/snd/hwC0D0

# # each of these pairs might change _something_

# # hda-verb $device 0x20 0x500 0x00 
# # hda-verb $device 0x20 0x400 0x4013

# # hda-verb $device 0x20 0x500 0x01 
# # hda-verb $device 0x20 0x400 0xA5A8

# # hda-verb $device 0x20 0x500 0x02 
# # hda-verb $device 0x20 0x400 0x8E95

# # hda-verb $device 0x20 0x500 0x03 
# # hda-verb $device 0x20 0x400 0x0042

# # hda-verb $device 0x20 0x500 0x04 
# # hda-verb $device 0x20 0x400 0xAF67

# # hda-verb $device 0x20 0x500 0x05 
# # hda-verb $device 0x20 0x400 0x2BE0

# # hda-verb $device 0x20 0x500 0x06 
# # hda-verb $device 0x20 0x400 0x1100

# # hda-verb $device 0x20 0x500 0x07 
# # hda-verb $device 0x20 0x400 0x0200

# # hda-verb $device 0x20 0x500 0x08 
# # hda-verb $device 0x20 0x400 0x2FCF

# # hda-verb $device 0x20 0x500 0x09 
# # hda-verb $device 0x20 0x400 0xD010

# hda-verb $device 0x20 0x500 0x0A 
# hda-verb $device 0x20 0x400 0x0100

# hda-verb $device 0x20 0x500 0x0B 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x0C 
# hda-verb $device 0x20 0x400 0x011E

# hda-verb $device 0x20 0x500 0x0D 
# hda-verb $device 0x20 0x400 0x2800

# hda-verb $device 0x20 0x500 0x0E 
# hda-verb $device 0x20 0x400 0x6F80

# hda-verb $device 0x20 0x500 0x0F 
# hda-verb $device 0x20 0x400 0x0062

# hda-verb $device 0x20 0x500 0x10 
# hda-verb $device 0x20 0x400 0x0E21

# hda-verb $device 0x20 0x500 0x11 
# hda-verb $device 0x20 0x400 0x7418

# hda-verb $device 0x20 0x500 0x12 
# hda-verb $device 0x20 0x400 0xE3C0

# hda-verb $device 0x20 0x500 0x13 
# hda-verb $device 0x20 0x400 0x242F

# hda-verb $device 0x20 0x500 0x14 
# hda-verb $device 0x20 0x400 0x2C60

# hda-verb $device 0x20 0x500 0x15 
# hda-verb $device 0x20 0x400 0x8CCC

# hda-verb $device 0x20 0x500 0x16 
# hda-verb $device 0x20 0x400 0x0018

# hda-verb $device 0x20 0x500 0x17 
# hda-verb $device 0x20 0x400 0xFF00

# hda-verb $device 0x20 0x500 0x18 
# hda-verb $device 0x20 0x400 0x0003

# hda-verb $device 0x20 0x500 0x19 
# hda-verb $device 0x20 0x400 0x0017

# hda-verb $device 0x20 0x500 0x1A 
# hda-verb $device 0x20 0x400 0xC000

# hda-verb $device 0x20 0x500 0x1B 
# hda-verb $device 0x20 0x400 0x0068

# hda-verb $device 0x20 0x500 0x1C 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x1D 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x1E 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x1F 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x20 
# hda-verb $device 0x20 0x400 0x0020

# hda-verb $device 0x20 0x500 0x21 
# hda-verb $device 0x20 0x400 0x8847

# hda-verb $device 0x20 0x500 0x22 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x23 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x24 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x25 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x26 
# hda-verb $device 0x20 0x400 0x3000

# hda-verb $device 0x20 0x500 0x27 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x28 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x29 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x2A 
# hda-verb $device 0x20 0x400 0x0F08

# hda-verb $device 0x20 0x500 0x2B 
# hda-verb $device 0x20 0x400 0x0C10

# hda-verb $device 0x20 0x500 0x2C 
# hda-verb $device 0x20 0x400 0x000D

# hda-verb $device 0x20 0x500 0x2D 
# hda-verb $device 0x20 0x400 0xC020

# hda-verb $device 0x20 0x500 0x2E 
# hda-verb $device 0x20 0x400 0x0250

# hda-verb $device 0x20 0x500 0x2F 
# hda-verb $device 0x20 0x400 0x404C

# hda-verb $device 0x20 0x500 0x30 
# hda-verb $device 0x20 0x400 0x2421

# hda-verb $device 0x20 0x500 0x31 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x32 
# hda-verb $device 0x20 0x400 0x3F00

# hda-verb $device 0x20 0x500 0x33 
# hda-verb $device 0x20 0x400 0x0208

# hda-verb $device 0x20 0x500 0x34 
# hda-verb $device 0x20 0x400 0x5614

# hda-verb $device 0x20 0x500 0x35 
# hda-verb $device 0x20 0x400 0x1AA5

# hda-verb $device 0x20 0x500 0x36 
# hda-verb $device 0x20 0x400 0x6AC0

# hda-verb $device 0x20 0x500 0x37 
# hda-verb $device 0x20 0x400 0x1000

# hda-verb $device 0x20 0x500 0x38 
# hda-verb $device 0x20 0x400 0x04C1

# hda-verb $device 0x20 0x500 0x39 
# hda-verb $device 0x20 0x400 0x7418

# hda-verb $device 0x20 0x500 0x3A 
# hda-verb $device 0x20 0x400 0xE800

# hda-verb $device 0x20 0x500 0x3B 
# hda-verb $device 0x20 0x400 0x223E

# hda-verb $device 0x20 0x500 0x3C 
# hda-verb $device 0x20 0x400 0x0C60

# hda-verb $device 0x20 0x500 0x3D 
# hda-verb $device 0x20 0x400 0x8CCC

# hda-verb $device 0x20 0x500 0x3E 
# hda-verb $device 0x20 0x400 0x0858

# hda-verb $device 0x20 0x500 0x3F 
# hda-verb $device 0x20 0x400 0x00FF

# hda-verb $device 0x20 0x500 0x40 
# hda-verb $device 0x20 0x400 0x41FF

# hda-verb $device 0x20 0x500 0x41 
# hda-verb $device 0x20 0x400 0xFF00

# hda-verb $device 0x20 0x500 0x42 
# hda-verb $device 0x20 0x400 0x0003

# hda-verb $device 0x20 0x500 0x43 
# hda-verb $device 0x20 0x400 0x0520

# hda-verb $device 0x20 0x500 0x44 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x45 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x46 
# hda-verb $device 0x20 0x400 0x0300

# hda-verb $device 0x20 0x500 0x47 
# hda-verb $device 0x20 0x400 0x8010

# hda-verb $device 0x20 0x500 0x48 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x49 
# hda-verb $device 0x20 0x400 0x4004

# hda-verb $device 0x20 0x500 0x4A 
# hda-verb $device 0x20 0x400 0x1012

# hda-verb $device 0x20 0x500 0x4B 
# hda-verb $device 0x20 0x400 0x3401

# hda-verb $device 0x20 0x500 0x4C 
# hda-verb $device 0x20 0x400 0x0910

# hda-verb $device 0x20 0x500 0x4D 
# hda-verb $device 0x20 0x400 0x0400

# hda-verb $device 0x20 0x500 0x4E 
# hda-verb $device 0x20 0x400 0x43FE

# hda-verb $device 0x20 0x500 0x4F 
# hda-verb $device 0x20 0x400 0xB029

# hda-verb $device 0x20 0x500 0x50 
# hda-verb $device 0x20 0x400 0x1000

# hda-verb $device 0x20 0x500 0x51 
# hda-verb $device 0x20 0x400 0x9420

# hda-verb $device 0x20 0x500 0x52 
# hda-verb $device 0x20 0x400 0x50C9

# hda-verb $device 0x20 0x500 0x53 
# hda-verb $device 0x20 0x400 0x0496

# hda-verb $device 0x20 0x500 0x54 
# hda-verb $device 0x20 0x400 0xCF00

# hda-verb $device 0x20 0x500 0x55 
# hda-verb $device 0x20 0x400 0x8000

# hda-verb $device 0x20 0x500 0x56 
# hda-verb $device 0x20 0x400 0x001E

# hda-verb $device 0x20 0x500 0x57 
# hda-verb $device 0x20 0x400 0x0004

# hda-verb $device 0x20 0x500 0x58 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x59 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x5A 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x5B 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x5C 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x5D 
# hda-verb $device 0x20 0x400 0x0030

# hda-verb $device 0x20 0x500 0x5E 
# hda-verb $device 0x20 0x400 0x3FFF

# hda-verb $device 0x20 0x500 0x5F 
# hda-verb $device 0x20 0x400 0x1CA7

# hda-verb $device 0x20 0x500 0x60 
# hda-verb $device 0x20 0x400 0x0F99

# hda-verb $device 0x20 0x500 0x61 
# hda-verb $device 0x20 0x400 0xAD65

# hda-verb $device 0x20 0x500 0x62 
# hda-verb $device 0x20 0x400 0xAFE7

# hda-verb $device 0x20 0x500 0x63 
# hda-verb $device 0x20 0x400 0x1B02

# hda-verb $device 0x20 0x500 0x64 
# hda-verb $device 0x20 0x400 0x7F01

# hda-verb $device 0x20 0x500 0x65 
# hda-verb $device 0x20 0x400 0x0095

# hda-verb $device 0x20 0x500 0x66 
# hda-verb $device 0x20 0x400 0x0404

# hda-verb $device 0x20 0x500 0x67 
# hda-verb $device 0x20 0x400 0x1111

# hda-verb $device 0x20 0x500 0x68 
# hda-verb $device 0x20 0x400 0x1016

# hda-verb $device 0x20 0x500 0x69 
# hda-verb $device 0x20 0x400 0x273F

# hda-verb $device 0x20 0x500 0x6A 
# hda-verb $device 0x20 0x400 0x30AA

# hda-verb $device 0x20 0x500 0x6B 
# hda-verb $device 0x20 0x400 0x7006

# hda-verb $device 0x20 0x500 0x6C 
# hda-verb $device 0x20 0x400 0xFC05

# hda-verb $device 0x20 0x500 0x6D 
# hda-verb $device 0x20 0x400 0x6908

# hda-verb $device 0x20 0x500 0x6E 
# hda-verb $device 0x20 0x400 0x110A

# hda-verb $device 0x20 0x500 0x6F 
# hda-verb $device 0x20 0x400 0x0010

# hda-verb $device 0x20 0x500 0x70 
# hda-verb $device 0x20 0x400 0x60D8

# hda-verb $device 0x20 0x500 0x71 
# hda-verb $device 0x20 0x400 0x00D4

# hda-verb $device 0x20 0x500 0x72 
# hda-verb $device 0x20 0x400 0xC23A

# hda-verb $device 0x20 0x500 0x73 
# hda-verb $device 0x20 0x400 0xAA28

# hda-verb $device 0x20 0x500 0x74 
# hda-verb $device 0x20 0x400 0x8001

# hda-verb $device 0x20 0x500 0x75 
# hda-verb $device 0x20 0x400 0xC802

# hda-verb $device 0x20 0x500 0x76 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x77 
# hda-verb $device 0x20 0x400 0x207E

# hda-verb $device 0x20 0x500 0x78 
# hda-verb $device 0x20 0x400 0xA000

# hda-verb $device 0x20 0x500 0x79 
# hda-verb $device 0x20 0x400 0x6AC0

# hda-verb $device 0x20 0x500 0x7A 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x7B 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x7C 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x7D 
# hda-verb $device 0x20 0x400 0x03C8

# hda-verb $device 0x20 0x500 0x7E 
# hda-verb $device 0x20 0x400 0x2028

# hda-verb $device 0x20 0x500 0x7F 
# hda-verb $device 0x20 0x400 0xF008

# hda-verb $device 0x20 0x500 0x80 
# hda-verb $device 0x20 0x400 0x0011

# hda-verb $device 0x20 0x500 0x81 
# hda-verb $device 0x20 0x400 0x5FC0

# hda-verb $device 0x20 0x500 0x82 
# hda-verb $device 0x20 0x400 0x4408

# hda-verb $device 0x20 0x500 0x83 
# hda-verb $device 0x20 0x400 0x1641

# hda-verb $device 0x20 0x500 0x84 
# hda-verb $device 0x20 0x400 0x31BB

# hda-verb $device 0x20 0x500 0x85 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x86 
# hda-verb $device 0x20 0x400 0x0193

# hda-verb $device 0x20 0x500 0x87 
# hda-verb $device 0x20 0x400 0x0193

# hda-verb $device 0x20 0x500 0x88 
# hda-verb $device 0x20 0x400 0xA0A0

# hda-verb $device 0x20 0x500 0x89 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x8A 
# hda-verb $device 0x20 0x400 0x0008

# hda-verb $device 0x20 0x500 0x8B 
# hda-verb $device 0x20 0x400 0x06FC

# hda-verb $device 0x20 0x500 0x8C 
# hda-verb $device 0x20 0x400 0x3AFF

# hda-verb $device 0x20 0x500 0x8D 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x8E 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x8F 
# hda-verb $device 0x20 0x400 0x1008

# hda-verb $device 0x20 0x500 0x90 
# hda-verb $device 0x20 0x400 0x002F

# hda-verb $device 0x20 0x500 0x91 
# hda-verb $device 0x20 0x400 0x0077

# hda-verb $device 0x20 0x500 0x92 
# hda-verb $device 0x20 0x400 0x0000

# hda-verb $device 0x20 0x500 0x93 
# hda-verb $device 0x20 0x400 0x0CD0

# hda-verb $device 0x20 0x500 0x94 
# hda-verb $device 0x20 0x400 0x0001

# hda-verb $device 0x20 0x500 0x95 
# hda-verb $device 0x20 0x400 0x4AA0


hda-verb $device 0x20 0x500 0x10
hda-verb $device 0x20 0x400 0x0E21