You are not logged in.

#1 2018-04-08 01:04:26

Automath
Member
Registered: 2016-05-16
Posts: 115

Easiest way to record mic and line in simultaneosly and without pain?

Im using arch-linux with alsa, pulseaudio, pavucontrol, jack, and whatever else. I want to record a microphone and a guitar simultaneously no matter how low level i should get.
There are several posts on how to create a virtual pulseaudio sink with two channels linked to rear mic on one channel and line in on the other and connected to the monitor or connecting jack sinks, but nothing make sense in my current setup.
My default.pa file is

         #!/usr/bin/pulseaudio -nF
         #
         # This file is part of PulseAudio.
         #
         # PulseAudio is free software; you can redistribute it and/or modify it
         # under the terms of the GNU Lesser General Public License as published by
         # the Free Software Foundation; either version 2 of the License, or
         # (at your option) any later version.
         #
         # PulseAudio is distributed in the hope that it will be useful, but
         # WITHOUT ANY WARRANTY; without even the implied warranty of
         # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
         # General Public License for more details.
         #
         # You should have received a copy of the GNU Lesser General Public License
         # along with PulseAudio; if not, see <[url]http://www.gnu.org/licenses/[/url]>.
         
         # This startup script is used only if PulseAudio is started per-user
         # (i.e. not in system mode)
         
         .fail
         
         ### Automatically restore the volume of streams and devices
         load-module module-device-restore
         load-module module-stream-restore
         load-module module-card-restore
         
         ### Automatically augment property information from .desktop files
         ### stored in /usr/share/application
         load-module module-augment-properties
         
         ### Should be after module-*-restore but before module-*-detect
         load-module module-switch-on-port-available
         
         ### Load audio drivers statically
         ### (it's probably better to not load these drivers manually, but instead
         ### use module-udev-detect -- see below -- for doing this automatically)
         #load-module module-alsa-sink
         #load-module module-alsa-source device=hw:1,0
         #load-module module-oss device="/dev/dsp" sink_name=output source_name=input
         #load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
         #load-module module-null-sink
         #load-module module-pipe-sink
         
         ### Automatically load driver modules depending on the hardware available
         .ifexists module-udev-detect.so
         load-module module-udev-detect
         .else
         ### Use the static hardware detection module (for systems that lack udev support)
         load-module module-detect
         .endif
         
         ### Automatically connect sink and source if JACK server is present
         .ifexists module-jackdbus-detect.so
         .nofail
         load-module module-jackdbus-detect channels=2
         .fail
         .endif
         
         ### Automatically load driver modules for Bluetooth hardware
         .ifexists module-bluetooth-policy.so
         load-module module-bluetooth-policy
         .endif
         
         .ifexists module-bluetooth-discover.so
         load-module module-bluetooth-discover
         .endif
         
         ### Load several protocols
         .ifexists module-esound-protocol-unix.so
         load-module module-esound-protocol-unix
         .endif
         load-module module-native-protocol-unix
         
         ### Network access (may be configured with paprefs, so leave this commented
         ### here if you plan to use paprefs)
         #load-module module-esound-protocol-tcp
         #load-module module-native-protocol-tcp
         #load-module module-zeroconf-publish
         
         ### Load the RTP receiver module (also configured via paprefs, see above)
         #load-module module-rtp-recv
         
         ### Load the RTP sender module (also configured via paprefs, see above)
         #load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
         #load-module module-rtp-send source=rtp.monitor
         
         ### Load additional modules from GConf settings. This can be configured with the paprefs tool.
         ### Please keep in mind that the modules configured by paprefs might conflict with manually
         ### loaded modules.
         .ifexists module-gconf.so
         .nofail
         load-module module-gconf
         .fail
         .endif
         
         ### Automatically restore the default sink/source when changed by the user
         ### during runtime
         ### NOTE: This should be loaded as early as possible so that subsequent modules
         ### that look up the default sink/source get the right value
         load-module module-default-device-restore
         
         ### Automatically move streams to the default sink if the sink they are
         ### connected to dies, similar for sources
         load-module module-rescue-streams
         
         ### Make sure we always have a sink around, even if it is a null sink.
         load-module module-always-sink
         
         ### Honour intended role device property
         load-module module-intended-roles
         
         ### Automatically suspend sinks/sources that become idle for too long
         load-module module-suspend-on-idle
         
         ### If autoexit on idle is enabled we want to make sure we only quit
         ### when no local session needs us anymore.
         .ifexists module-console-kit.so
         load-module module-console-kit
         .endif
         .ifexists module-systemd-login.so
         load-module module-systemd-login
         .endif
         
         ### Enable positioned event sounds
         load-module module-position-event-sounds
         
         ### Cork music/video streams when a phone stream is active
         load-module module-role-cork
         
         ### Modules to allow autoloading of filters (such as echo cancellation)
         ### on demand. module-filter-heuristics tries to determine what filters
         ### make sense, and module-filter-apply does the heavy-lifting of
         ### loading modules and rerouting streams.
         load-module module-filter-heuristics
         load-module module-filter-apply
         
         ### Make some devices default
         #set-default-sink output
         #set-default-source input

For example i found this bash script to accomplish the first:
 

       
         #!/bin/bash
          
         #    Script to map two pulseaudio hardware input sources as mono inputs
         #    to left and right channel of a new loopback-sink respectively. This
         #    sink can be used e.g. to use VoIP or record two microphones seperately.
         #    Copyright (C) 2013, Henning Hollermann, laclaro@mail.com
         #
         #    This program is free software: you can redistribute it and/or modify
         #    it under the terms of the GNU General Public License as published by
         #    the Free Software Foundation, either version 3 of the License, or
         #    (at your option) any later version.
         #
         #    This program is distributed in the hope that it will be useful,
         #    but WITHOUT ANY WARRANTY; without even the implied warranty of
         #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
         #    GNU General Public License for more details.
         #
         #    You should have received a copy of the GNU General Public License
         #    along with this program.  If not, see <[url]http://www.gnu.org/licenses/[/url]>.
          
         do_activate() {
             while [ "x" = "x$LEFT" ]; do
                 echo "Choose Source for left channel by ID"
                 pactl list short sources
                 read ID
                 LEFT=$(pactl list short sources|awk '/^'$ID'/{print $2}')
             done
             while [ "x" = "x$RIGHT" ]; do
                 echo "Choose Source for right channel by ID"
                 pactl list shrot sources | grep -v $LEFT
                 read ID
                 RIGHT=$(pactl list short sources | grep -v $LEFT|awk '/^'$ID'/{print $2}')
             done
             # Create the name of the Combined sink
             NAME="Combined_Mics:_Left:_"$(echo $LEFT|awk -F'.' '$0=$2')"_Right:_"$(echo $RIGHT|awk 
         -F'.' '$0=$2')
          
             echo "[LOAD] null sink as \"$NAME\" to connect the two mics to"
             pactl load-module module-null-sink \
                     sink_name=combined channels=2 \
                     sink_properties="device.description=$NAME"
          
             echo "[LOAD] map source 1 ($LEFT) to left channel of \"$NAME\""
             pactl load-module module-remap-source \
                     source_name=${LEFT}_left_channel master=$LEFT channels=2 \
                     master_channel_map=mono,mono channel_map=left,left
             pactl load-module module-loopback sink=combined source=${LEFT}_left_channel
          
             echo "[LOAD] map source 2 ($RIGHT) to right channel of \"$NAME\""
             pactl load-module module-remap-source \
                     source_name=${RIGHT}_right_channel master=$RIGHT channels=2 \
                     master_channel_map=mono,mono channel_map=right,right
             pactl load-module module-loopback sink=combined source=${RIGHT}_right_channel
             echo "[DONE] Now adjust the left and right channel volume of the new sink to be equally 
         loud"
         }
          
         do_deactivate() {
             echo "[UNLOAD] pulseaudio modules..."
             echo "[UNLOAD] module-loopback"
             pactl unload-module module-loopback
             echo "[UNLOAD] module-remap-source"
             pactl unload-module module-remap-source
             echo "[UNLOAD] module-null-sink"
             pactl unload-module module-null-sink
         }
          
         init() {
             for exe in /usr/bin/pulseaudio /usr/bin/pactl; do
                 if [ ! -x "$exe" ]; then
                     echo "[ERROR] required file $exe not found or not  executable"
                     exit 1
                 fi
             done
             [ ! -x /usr/bin/pavucontrol ] && echo "[NOTICE] pavucontrol might be very useful."
         }
          
         # MAIN
         init;
         case $1 in
         activate|enable|start)
             do_activate;;
         deactivate|disable|stop)
             do_deactivate;;
         *)
             echo "Usage: $0 [enable|disable]";;
         esac;

but which is in the script:

 @Pantheon ~]$ pactl list short sources

outputs:

     0	alsa_output.pci-0000_00_1b.0.analog-stereo.monitor	module-alsa-           card.c	s16le 2ch 44100Hz	RUNNING
     1	alsa_input.pci-0000_00_1b.0.analog-stereo	module-alsa-card.c	s16le 2ch 44100Hz	RUNNING

but what i need is something like:

     @Pantheon ~]$ pactl list sources|grep input

what outputs:

	Name: alsa_input.pci-0000_00_1b.0.analog-stereo
		analog-input-front-mic: Front Microphone (priority: 8500, not   available)
		analog-input-rear-mic: Rear Microphone (priority: 8200, not available)
		analog-input-linein: En línea (priority: 8100, not available)
	Puerto Activo: analog-input-front-mic

which are not devices but ports.
output from arecord is

     $ arecord -l
     **** List of CAPTURE Hardware Devices ****
     card 0: Intel [HDA Intel], device 0: VT1708B 8-Ch Analog [VT1708B 8-Ch Analog]
      Subdevices: 0/1
      Subdevice #0: subdevice #0

So; how could i access those ports either through alsa or through pulseaudio?
Or even should be a more straight forward solution like:

    $ arecord 1 channel1.wav&arecord 2 channel2.wav

Last edited by Automath (2018-04-08 01:05:59)

Offline

#2 2018-04-08 15:16:32

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: Easiest way to record mic and line in simultaneosly and without pain?

Try jack-dbus and Ardour. "Wiring" is much more comfortable with a gui.

If you really need shell recording, create a snd-loop device, wire all your sources (line, mic) to it with qjackctl and record the corresponding snd-loop output device.

https://alsa.opensrc.org/Jack_and_Loopb … ack_bridge

Last edited by Maniaxx (2018-04-08 15:38:04)


sys2064

Offline

#3 2018-04-08 23:39:13

Automath
Member
Registered: 2016-05-16
Posts: 115

Re: Easiest way to record mic and line in simultaneosly and without pain?

Just with a quick test i would be glad, no conf, nor excellency, just a proof that it works to demonstrate the opposite that they told me here.
Here is my aplay -l output:

@Pantheon flags]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: VT1708B 8-Ch Analog [VT1708B 8-Ch Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: VT1708B 8-Ch Alt Analog [VT1708B 8-Ch Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Last edited by Automath (2018-04-08 23:42:14)

Offline

#4 2018-04-09 04:23:08

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: Easiest way to record mic and line in simultaneosly and without pain?

Start qjackctl and lookup the 'capture' devices in 'connections'. There should be 8 capture channels. Wire them to Ardour or snd-loop devices (that create new devices).


sys2064

Offline

#5 2018-04-11 21:09:11

Automath
Member
Registered: 2016-05-16
Posts: 115

Re: Easiest way to record mic and line in simultaneosly and without pain?

Maniaxx wrote:

Start qjackctl and lookup the 'capture' devices in 'connections'. There should be 8 capture channels. Wire them to Ardour or snd-loop devices (that create new devices).

I started qjackctl as you said and i think that there are only two capture devices from this scheme:
system
   |-capture_2
   |-capture_1

PulseAudioJack Sink
   |-front-right
   |-front-left

Offline

#6 2018-04-12 12:28:56

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: Easiest way to record mic and line in simultaneosly and without pain?

Please post this:
lspci -v | grep -i audio
cat /proc/asound/devices
lsmod | grep snd
head -n 1 /proc/asound/card0/codec*

Last edited by Maniaxx (2018-04-12 12:44:19)


sys2064

Offline

#7 2018-04-14 21:54:49

Automath
Member
Registered: 2016-05-16
Posts: 115

Re: Easiest way to record mic and line in simultaneosly and without pain?

here you have:

@Pantheon ~]$ lspci -v | grep -i audio
00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 01)
	Subsystem: Elitegroup Computer Systems NM10/ICH7 Family High Definition Audio Controller
@Pantheon ~]$ cat /proc/asound/devices
  1:        : sequencer
  2: [ 0]   : control
  3: [ 0- 0]: digital audio playback
  4: [ 0- 0]: digital audio capture
  5: [ 0- 2]: digital audio playback
  6: [ 0- 0]: hardware dependent
 33:        : timer
@Pantheon ~]$ lsmod | grep snd
snd_seq_dummy          16384  0
snd_seq                81920  1 snd_seq_dummy
snd_seq_device         16384  1 snd_seq
snd_hda_codec_via      24576  1
snd_hda_codec_generic    86016  1 snd_hda_codec_via
snd_hda_intel          45056  3
snd_hda_codec         151552  3 snd_hda_intel,snd_hda_codec_generic,snd_hda_codec_via
snd_hda_core           94208  4 snd_hda_intel,snd_hda_codec,snd_hda_codec_generic,snd_hda_codec_via
snd_hwdep              20480  1 snd_hda_codec
snd_pcm               135168  3 snd_hda_intel,snd_hda_codec,snd_hda_core
snd_timer              36864  2 snd_seq,snd_pcm
snd                    98304  15 snd_hda_intel,snd_hwdep,snd_seq,snd_hda_codec,snd_timer,snd_hda_codec_generic,snd_seq_device,snd_pcm,snd_hda_codec_via
soundcore              16384  1 snd
@Pantheon ~]$ head -n 1 /proc/asound/card0/codec*
Codec: VIA VT1708B 8-Ch

Offline

#8 2018-04-15 00:31:34

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: Easiest way to record mic and line in simultaneosly and without pain?

I don't see anything related to 8-channel audio. The audio chip might not be fully supported in Linux:
https://ubuntuforums.org/showthread.php … ost9209502


sys2064

Offline

Board footer

Powered by FluxBB