Index: uspace/drv/audio/hdaudio/codec.c
===================================================================
--- uspace/drv/audio/hdaudio/codec.c	(revision dda58487beae06864d4a26c56ad58665b9ffdc22)
+++ uspace/drv/audio/hdaudio/codec.c	(revision 9034876cfc692c06e8b81525d41c70645ac2c44e)
@@ -54,7 +54,17 @@
 		resp = &myresp;
 
-	verb = (codec->address << 28) | (node << 20) | (vid << 8) | payload;
+	if ((vid & 0x700) != 0) {
+		verb = (codec->address << 28) |
+		    ((node & 0x1ff) << 20) |
+		    ((vid & 0xfff) << 8) |
+		    (payload & 0xff);
+	} else {
+		verb = (codec->address << 28) |
+		    ((node & 0x1ff) << 20) |
+		    ((vid & 0xf) << 16) |
+		    (payload & 0xffff);
+	}
 	int rc = hda_cmd(codec->hda, verb, resp);
-/*
+
 	if (resp != NULL) {
 		ddf_msg(LVL_NOTE, "verb 0x%" PRIx32 " -> 0x%" PRIx32, verb,
@@ -63,5 +73,5 @@
 		ddf_msg(LVL_NOTE, "verb 0x%" PRIx32, verb);
 	}
-*/
+
 	return rc;
 }
@@ -214,20 +224,21 @@
 		goto error;
 
+	offset = ampcaps & 0x7f;
+	ddf_msg(LVL_NOTE, "out amp caps 0x%x (offset=0x%x)",
+	    ampcaps, offset);
+
+	rc = hda_set_amp_gain_mute(codec, aw, 0xb000 + offset/2);
+	if (rc != EOK)
+		goto error;
+
 	rc = hda_get_amp_gain_mute(codec, aw, 0x8000, &gmleft);
 	if (rc != EOK)
 		goto error;
 
-	rc = hda_get_amp_gain_mute(codec, aw, 0xc000, &gmright);
-	if (rc != EOK)
-		goto error;
-
-	offset = ampcaps & 0x7f;
-	ddf_msg(LVL_NOTE, "out amp caps 0x%x (offset=0x%x)"
-	    "gain/mute: L:0x%x R:0x%x",
-	    ampcaps, offset, gmleft, gmright);
-
-	rc = hda_set_amp_gain_mute(codec, aw, 0xb000 + offset);
-	if (rc != EOK)
-		goto error;
+	rc = hda_get_amp_gain_mute(codec, aw, 0xa000, &gmright);
+	if (rc != EOK)
+		goto error;
+
+	ddf_msg(LVL_NOTE, "gain/mute: L:0x%x R:0x%x", gmleft, gmright);
 
 	return EOK;
@@ -253,9 +264,13 @@
 
 	for (i = 0; i < 15; i++) {
+		rc = hda_set_amp_gain_mute(codec, aw, 0x7000 + (i << 8) + offset/2);
+		if (rc != EOK)
+			goto error;
+
 		rc = hda_get_amp_gain_mute(codec, aw, 0x0000 + i, &gmleft);
 		if (rc != EOK)
 			goto error;
 
-		rc = hda_get_amp_gain_mute(codec, aw, 0x4000 + i, &gmright);
+		rc = hda_get_amp_gain_mute(codec, aw, 0x2000 + i, &gmright);
 		if (rc != EOK)
 			goto error;
@@ -263,8 +278,4 @@
 		ddf_msg(LVL_NOTE, "in:%d gain/mute: L:0x%x R:0x%x",
 		    i, gmleft, gmright);
-
-		rc = hda_set_amp_gain_mute(codec, aw, 0x7000 + (i << 8) + offset);
-		if (rc != EOK)
-			goto error;
 	}
 
