LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-16-2017, 10:54 PM   #1
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Jessie, Bunsenlabs
Posts: 586

Rep: Reputation: 38
Need Audio recorder for capturing from output of soundcard


Using Debian Jesie

I need something to record from my soundcard. I have tried audacity but not able to get it working. I need something that works. What are some good recording software that works in linux? I do google searches with not much luck. Mostly get hits for Audacity.I cna't get audio control set up properly for Audacity. It would be good to have more than one audio recorder anyway.

Thanks,

Joe
 
Old 02-17-2017, 03:34 AM   #2
bat999
LQ Newbie
 
Registered: Sep 2013
Location: UK
Distribution: Linux Mint 18 "Sarah" - Xfce (64-bit)
Posts: 29

Rep: Reputation: Disabled
...

Last edited by bat999; 02-18-2017 at 12:19 AM.
 
Old 02-17-2017, 10:46 AM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
If you have snd-aloop kernel module
Code:
find /lib/modules/`uname -r` | grep snd
Make a virtual loopback device, then you can record whatever comes through the sound device, regardless of having a sound device that doesn't allow it.

Example:
~/.asoundrc
Code:
pcm.!default {
  type asym
  playback.pcm "LoopAndReal"
  #capture.pcm "looprec"
  capture.pcm "hw:0,0"
}

pcm.looprec {
    type hw
    card "Loopback"
    device 1
    subdevice 0
}


pcm.LoopAndReal {
  type plug
  slave.pcm mdev
  route_policy "duplicate"
}


pcm.mdev {
  type multi
  slaves.a.pcm pcm.MixReale
  slaves.a.channels 2
  slaves.b.pcm pcm.MixLoopback
  slaves.b.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1
}


pcm.MixReale {
  type dmix
  ipc_key 1024
  slave {
    pcm "hw:0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}

pcm.MixLoopback {
  type dmix
  ipc_key 1025
  slave {
    pcm "hw:Loopback,0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}
Load the kernel module
Code:
modprobe snd-aloop
Capture Audio to m4a:
Code:
ffmpeg -f alsa -i hw:1,1 -c:a aac -b:a 32k -vn OutFile.m4a
When you are done if you want:
Code:
mv ~/.asoundrc ~/.loop_asoundrc && modprobe -r snd-aloop
You'll need to use your own device parameters.
 
Old 02-17-2017, 02:49 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
I'd find out why AudacityŽ didn't work. (funny, they copy protected the name)

Using pulse, jack or alsa may be part of the issue??

lspci | grep -i AUDIO

dmesg | grep -i sound

Last edited by jefro; 02-17-2017 at 02:54 PM.
 
Old 02-17-2017, 09:39 PM   #5
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Jessie, Bunsenlabs
Posts: 586

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by teckk View Post
If you have snd-aloop kernel module
Code:
find /lib/modules/`uname -r` | grep snd
Make a virtual loopback device, then you can record whatever comes through the sound device, regardless of having a sound device that doesn't allow it.

Example:
~/.asoundrc
Code:
pcm.!default {
  type asym
  playback.pcm "LoopAndReal"
  #capture.pcm "looprec"
  capture.pcm "hw:0,0"
}

pcm.looprec {
    type hw
    card "Loopback"
    device 1
    subdevice 0
}


pcm.LoopAndReal {
  type plug
  slave.pcm mdev
  route_policy "duplicate"
}


pcm.mdev {
  type multi
  slaves.a.pcm pcm.MixReale
  slaves.a.channels 2
  slaves.b.pcm pcm.MixLoopback
  slaves.b.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1
}


pcm.MixReale {
  type dmix
  ipc_key 1024
  slave {
    pcm "hw:0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}

pcm.MixLoopback {
  type dmix
  ipc_key 1025
  slave {
    pcm "hw:Loopback,0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}
This is what I sound for my snd-aloop:
/lib/modules/3.16.0-4-amd64/kernel/sound/drivers/snd-aloop.ko
Can I just use your script?

Quote:
Capture Audio to m4a:
Code:
ffmpeg -f alsa -i hw:1,1 -c:a aac -b:a 32k -vn OutFile.m4a
Does pulse mess up the use of alsa?
 
Old 02-17-2017, 10:47 PM   #6
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Jessie, Bunsenlabs
Posts: 586

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by jefro View Post
I'd find out why AudacityŽ didn't work. (funny, they copy protected the name)

Using pulse, jack or alsa may be part of the issue??

lspci | grep -i AUDIO

joe@BunsenLabs:~$ lspci | grep -i AUDIO
00:05.0 Audio device: NVIDIA Corporation MCP61 High Definition Audio (rev a2)

dmesg | grep -i sound

joe@BunsenLabs:~$ dmesg | grep -i sound
[ 11.456032] sound hdaudioC0D0: autoconfig: line_outs=4 (0x14/0x15/0x16/0x17/0x0) type:line
[ 11.456039] sound hdaudioC0D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 11.456042] sound hdaudioC0D0: hp_outs=1 (0x1b/0x0/0x0/0x0/0x0)
[ 11.456045] sound hdaudioC0D0: mono: mono_out=0x0
[ 11.456047] sound hdaudioC0D0: inputs:
[ 11.456051] sound hdaudioC0D0: Front Mic=0x19
[ 11.456054] sound hdaudioC0D0: Rear Mic=0x18
[ 11.456057] sound hdaudioC0D0: Line=0x1a
[ 13.276961] input: HDA NVidia Front Mic as /devices/pci0000:00/0000:00:05.0/sound/card0/input8
[ 13.277134] input: HDA NVidia Rear Mic as /devices/pci0000:00/0000:00:05.0/sound/card0/input9
[ 13.277301] input: HDA NVidia Line as /devices/pci0000:00/0000:00:05.0/sound/card0/input10
[ 13.277458] input: HDA NVidia Line Out Front as /devices/pci0000:00/0000:00:05.0/sound/card0/input11
[ 13.277616] input: HDA NVidia Line Out Surround as /devices/pci0000:00/0000:00:05.0/sound/card0/input12
[ 13.277788] input: HDA NVidia Line Out CLFE as /devices/pci0000:00/0000:00:05.0/sound/card0/input13
[ 13.288538] input: HDA NVidia Line Out Side as /devices/pci0000:00/0000:00:05.0/sound/card0/input14
[ 13.288757] input: HDA NVidia Front Headphone as /devices/pci0000:00/0000:00:05.0/sound/card0/input15

I don't know what to do with this.

I got Audacity to work today. I don't know why that is. I don't see what I did different. I chose monitor built-in audio analogue stereo. Yesterday Audacity kept freezing on me and I had to terminate it with kill.

I also tried vlc today to record. Using view > advanced controls, > chose audio capture > built-in audio capture
However when I played the file the sound was only a whisper. Xould hardly hear it.

If I tried moniter built-in audio capture I get a bad sound while listening.

I don't really understand pulse.
 
Old 02-18-2017, 03:12 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
When I think of the times I had problems with volume levels there were two issues. One was some setting like -20db that was checked. The other was I was using mic as input and not internal line passthrough to capture sound.
 
Old 02-20-2017, 09:48 AM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Pulse doesn't understand pulse.

I tend to use a pulseaudio over jackd configuration. When you need to do something fancy / odd you can use qjackctl to change the routes to get what you need. Otherwise you need the loop stuff and direct access.

$ find /lib/modules/$(uname -r)/ -iname '*snd*loop*'

Audacity can be pretty non-functional without a .asoundrc to tell it which end is up. Or other less than obvious configurations for other audio applications. Like hostname and /etc/hosts to be setup and configured, so the client and server model functions even though nothing else about it uses networking. Kids these days.
 
Old 02-20-2017, 01:56 PM   #9
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Audacity works fine for me in Fedora 25 w/ pulse. It was a little tricky to set up, first visit was to the pulse audio volume control to choose Monitor as an input source (monitor devices weren't enabled by default for me) Then I had to fiddle with the Device toolbar in Audacity to set the audio host, recording device and playback device properly.

After those one-time setup steps I've been able to record anything that was playing sound without any problems.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Mint Audio-Recorder Output Not Played by Speaker julianvb Linux - Software 4 01-04-2017 01:45 PM
MIDI file - no audio output from standard PC soundcard? Z_Tagr Linux - Software 2 08-07-2011 06:46 AM
VOX Recorder and Audio Timer Recorder? devmoc Linux - Software 6 10-23-2009 11:55 PM
[SOLVED] Onboard Audio (hda_intel) for Mic Input and Soundcard (ca0106) for Audio Output? snowdonkey Linux - General 1 07-11-2009 03:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration