I just found this forum. I previously asked my question at https://unix.stackexchange.com/q/88067/15010 but due to lack of response so far, I want to ask here. (I can delete that prior question if advised.)
I am attempting to record phone interviews conducted via VoIP (using SIP, not Skype). I want the caller's voice on one channel and my voice on the other. The Skype Call Recorder offers this option, but I need to do this on my local box running Linux and a SIP client that does not have built-in recording.
I think avconv
might allow me to accomplish my goal, but my question is broader because I'm inviting any response that will steer me in the right direction. However, if avconv
is the right direction, I need help defining the audio stream inputs (see below).
My distro is Kubuntu 12.04 LTS.
My audio source hardware is listed at the bottom. Specifically, I believe the two sources I want to record at the same time are:
- alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo.monitor/#2: Monitor of Scarlett 2i2 USB Analog Stereo
- alsa_input.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo/#3: Scarlett 2i2 USB Analog Stereo
I have confirmed that when I am conducting a VoIP interview, the interview subject's voice is on the monitor source above and my voice is on the other source listed above. I can record either source separately in Audacity.
So far I cannot record both sources in a full duplex mode. Furthermore, so far I cannot achieve my goal of one voice recorded to the left channel and the other voice recorded to the right channel.
This great tutorial gave me some clues but ultimately the full duplex mode described there does not meet my goals (and I cannot even get it to work - it crashes pulse audio on my machine).
This also seems relevant, but I am struggling to understand it: http://ubuntuforums.org/showthread.php?t=1962947
Based on the link above, my first guess about how to do this is this simple script:
#!/bin/bash
OUTPUT="audio_`date +%Y-%m-%d_%H%M`"
avconv \
-f alsa -ac 2 -i <alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo.monitor> \
-f alsa -ac 1 -i <alsa_input.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo> \
-map 0:0 -map 1:0 \
-acodec flac \
-threads 0 \
-y $OUTPUT
I assume I need to replace what is in angle brackets with the correct notation.
I have no idea if the rest of the above script is even close... If I am on the right track with avconv
I would appreciate some help with the above command.
Here's my hardware info:
$ pacmd list-cards
Welcome to PulseAudio! Use "help" for usage information.
>>> 3 card(s) available.
[snip other cards]
index: 2
name: <alsa_card.usb-Focusrite_Scarlett_2i2_USB-00-USB>
driver: <module-alsa-card.c>
owner module: 6
properties:
alsa.card = "1"
alsa.card_name = "Scarlett 2i2 USB"
alsa.long_card_name = "Focusrite Scarlett 2i2 USB at usb-0000:04:00.0-2, high speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:04:00.0-usb-0:2:1.0"
sysfs.path = "/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/usb3/3-2/3-2:1.0/sound/card1"
udev.id = "usb-Focusrite_Scarlett_2i2_USB-00-USB"
device.bus = "usb"
device.vendor.id = "1235"
device.vendor.name = "Novation EMS"
device.product.id = "8006"
device.product.name = "Scarlett 2i2 USB"
device.serial = "Focusrite_Scarlett_2i2_USB"
device.string = "1"
device.description = "Scarlett 2i2 USB"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
profiles:
output:analog-stereo: Analog Stereo Output (priority 6000)
output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060)
output:analog-stereo+input:iec958-stereo: Analog Stereo Output + Digital Stereo (IEC958) Input (priority 6055)
output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500)
output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5560)
output:iec958-stereo+input:iec958-stereo: Digital Stereo Duplex (IEC958) (priority 5555)
input:analog-stereo: Analog Stereo Input (priority 60)
input:iec958-stereo: Digital Stereo (IEC958) Input (priority 55)
off: Off (priority 0)
active profile: <output:analog-stereo+input:analog-stereo>
sinks:
alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo/#1: Scarlett 2i2 USB Analog Stereo
sources:
alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo.monitor/#2: Monitor of Scarlett 2i2 USB Analog Stereo
alsa_input.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo/#3: Scarlett 2i2 USB Analog Stereo
ports:
analog-output: Analog Output (priority 9900, available: unknown)
properties:
analog-input: Analog Input (priority 10000, available: unknown)
properties:
iec958-stereo-input: iec958-stereo-input (priority 0, available: unknown)
properties:
iec958-stereo-output: Digital Output (S/PDIF) (priority 0, available: unknown)
properties:
Here is more info on this hardware:
$ cat /proc/asound/cards
1 [USB ]: USB-Audio - Scarlett 2i2 USB
Focusrite Scarlett 2i2 USB at usb-0000:04:00.0-2, high speed
$ cat /proc/asound/card1/pcm0c/info
card: 1
device: 0
subdevice: 0
stream: CAPTURE
id: USB Audio
name: USB Audio
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 0
$ cat /proc/asound/card1/pcm0p/info
card: 1
device: 0
subdevice: 0
stream: PLAYBACK
id: USB Audio
name: USB Audio
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1