3

I have installed the wip on my raspberry, but when I want to use it I get this error

[wit] initialized sox: 14.4.0    
[wit] init state machine
[wit] initialized with device: default    
[wit] ready. state=idle    
formats: can't open input  `default': snd_pcm_open error: No such file or directory
[wit] couldn't open input device using alsa. Trying with coreaudio...
formats: no handler for given file type `coreaudio'    
[wit] Failed to open input device    
task '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value',
/home/martin/rust/src/libcore/option.rs:357
Tom Zych
  • 13,329
  • 9
  • 36
  • 53
  • It seems that your audio recording device cannot be found. Is it configured properly? To test you can try to record something with `arecord` for example. – noziar Jan 27 '15 at 17:19

2 Answers2

3

Edit ~/.asoundrc and add the following:

pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "hw:0,0"
    }
    capture.pcm {
        type plug
        slave.pcm "hw:1,0"
    } 
}

This little ALSA configuration setting uses the default soundcard as playback device (hw:0,0) and sets hw:1,0 (that suppose to be your USB-mic) to become the default capture device.

(Taken from http://wiki.audacityteam.org/wiki/USB_mic_on_Linux under "Setting default recording device".)

To determine what should be written after slave.pcm, run the following commands:

aplay -l
arecord -l

The result will indicate what should go under playback.pcm and capture.pcm, respectively.

For example, arecord -l results in the the following output on my machine:

**** List of CAPTURE Hardware Devices ****
card 1: USBSA [Andrea PureAudio USB-SA], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

The text beside slave.cpm should read "hw:X,Y", where X and Y are taken from the second line in the output above:

card X: ..., device Y: ...
Michael Innes
  • 2,045
  • 5
  • 25
  • 41
Richard
  • 639
  • 2
  • 8
  • 24
1

Correction to the above. Need to edit ~/.asoundrc

Note the "a" in the file name.

pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "hw:0,0"
    }
    capture.pcm {
        type plug
        slave.pcm "hw:1,0"
    } 
}
eyllanesc
  • 235,170
  • 19
  • 170
  • 241