pcm                    return L_PCM;
 rawmidi                        return L_RAWMIDI;
 playback               return L_PLAYBACK;
-record                 return L_RECORD;
+capture                        return L_CAPTURE;
 output                 return L_OUTPUT;
 input                  return L_INPUT;
 iec958ocs              return L_IEC958OCS;
 
 static void build_control_switch(char *name);
 static void build_mixer_switch(char *name);
 static void build_pcm_playback_switch(char *name);
-static void build_pcm_record_switch(char *name);
+static void build_pcm_capture_switch(char *name);
 static void build_rawmidi_output_switch(char *name);
 static void build_rawmidi_input_switch(char *name);
 
 %token L_DOUBLE1
        /* other keywords */
 %token L_SOUNDCARD L_MIXER L_ELEMENT L_SWITCH L_RAWDATA
-%token L_CONTROL L_PCM L_RAWMIDI L_PLAYBACK L_RECORD L_INPUT L_OUTPUT
+%token L_CONTROL L_PCM L_RAWMIDI L_PLAYBACK L_CAPTURE L_INPUT L_OUTPUT
 %token L_SWITCH1 L_SWITCH2 L_SWITCH3 L_VOLUME1 L_3D_EFFECT1 L_ACCU3
 %token L_MUX1 L_MUX2 L_TONE_CONTROL1
 %token L_IEC958OCS L_3D L_RESET L_USER L_VALID L_DATA L_PROTECT L_PRE2
        ;
 
 pcm    : L_PLAYBACK '{' playbacks '}'
-       | L_RECORD '{' records '}'
+       | L_CAPTURE '{' captures '}'
        | error                 { yyerror("an unknown keyword in the pcm{} section"); }
        ;
 
        | error                 { yyerror("an unknown keyword in the playback{} section"); }
        ;
 
-records : record
-       | records record
+captures : capture
+       | captures capture
        ;
 
-record : L_SWITCH '(' string   { build_pcm_record_switch($3); }
-         ',' switches ')'      { build_pcm_record_switch(NULL); }
-       | error                 { yyerror("an unknown keyword in the record{} section"); }
+capture        : L_SWITCH '(' string   { build_pcm_capture_switch($3); }
+         ',' switches ')'      { build_pcm_capture_switch(NULL); }
+       | error                 { yyerror("an unknown keyword in the capture{} section"); }
        ;
 
 rawmidis : rawmidi
        build_switch(&Xpcm->pswitches, name);
 }
 
-static void build_pcm_record_switch(char *name)
+static void build_pcm_capture_switch(char *name)
 { 
        build_switch(&Xpcm->rswitches, name);
 }
 
                        soundcard_setup_merge_sw(mixer->switches, rmixer->switches, soundcard->no, mixer->no, "mixer");
                }
                for (rpcm = rsoundcard->pcms; rpcm; rpcm = rpcm->next) {
-                       for (pcm = rsoundcard->pcms; pcm; pcm = pcm->next) {
+                       for (pcm = soundcard->pcms; pcm; pcm = pcm->next) {
                                if (!strncmp(pcm->info.name, rpcm->info.name, sizeof(pcm->info.name)))
                                        break;
                        }
                                        }
                        }
                }
-               if(ctlhandle) {
+               if (ctlhandle) {
                        snd_ctl_close(ctlhandle);
                        ctlhandle = NULL;
                }
                                mixhandle = NULL;
                        }
                }
-               if(ctlhandle) {
+               if (ctlhandle) {
                        snd_ctl_close(ctlhandle);
                        ctlhandle = NULL;
                }
 
                                continue;
                        fprintf(out, "  pcm(\"%s\") {\n", pcm->info.name);
                        if (pcm->pswitches) {
-                               fprintf(out, "    playback {");
+                               fprintf(out, "    playback {\n");
                                soundcard_setup_write_switches(out, "      ", SND_INTERFACE_PCM, &pcm->pswitches);
                                fprintf(out, "    }\n");
                        }
                        if (pcm->rswitches) {
-                               fprintf(out, "    capture {");
+                               fprintf(out, "    capture {\n");
                                soundcard_setup_write_switches(out, "      ", SND_INTERFACE_PCM, &pcm->rswitches);
                                fprintf(out, "    }\n");
                        }
                                continue;
                        fprintf(out, "  rawmidi(\"%s\") {\n", rawmidi->info.name);
                        if (rawmidi->oswitches) {
-                               fprintf(out, "    output {");
+                               fprintf(out, "    output {\n");
                                soundcard_setup_write_switches(out, "      ", SND_INTERFACE_RAWMIDI, &rawmidi->oswitches);
                                fprintf(out, "    }\n");
                        }
                        if (rawmidi->iswitches) {
-                               fprintf(out, "    input {");
+                               fprintf(out, "    input {\n");
                                soundcard_setup_write_switches(out, "      ", SND_INTERFACE_RAWMIDI, &rawmidi->iswitches);
                                fprintf(out, "    }\n");
                        }