LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-28-2019, 09:29 AM   #1
Steve R.
Member
 
Registered: Jun 2009
Location: Cleveland, TN
Distribution: Mint 21.3
Posts: 527

Rep: Reputation: 98
Cannot Record Audio From "line-in" as the Source


I'm going to take a stab that this is really a hardware issue as opposed to a software issue. I am attempting to record audio from a cassette recorder where it is plugged into the "line-in" jack.

I can hear the audio from "line-in" on the speakers, but when I attempt to record with Audacity (version 2.3.3) all I get is a very loud crackling static. I am also using PulseAudio Volume Control and the volume bar, by going up and down, implies that an audio signal is being processed. Additionally, I can hear sound out of the speakers.

The computer is dual boot. I tested imputing audio from "line-in" under Windows10 using Audacity and it successfully recorded the audio from "line-in".

Under Linux, I am using Mint 19.3. The kernel being used is: 4.15.0-72-generic
 
Old 12-28-2019, 10:47 AM   #2
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Hi Steve

In my opinion, this is definitely not a hardware problem, since you were able to get satisfactory results in Windows with Audacity on the same computer.

My home recording studio (sounds more impressive than it is - a hobby of mine) is based on Linux and I regularly use Audacity for analog - digital conversion (what you're trying to do, essentially). For the computer I use in the studio, I tend to avoid PulseAudio like the plague, as I feel it adds an unnecessary layer to the sound path. My setup is built around plain old Alsa and Jack.

Unless this is a once-in-a-blue-moon thing you're doing (i.e. you don't spend a lot of time on sound conversion or recording with this computer), my first attempt at a solution would involve removing PulseAudio from the equation. Also, you need to make sure Audacity is properly set up (source, recording levels ...), but since you managed well with it under Windows, chances are that is not your problem.

Let us know if this helps.
 
Old 12-28-2019, 11:09 AM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,372
Blog Entries: 7

Rep: Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939
Quote:
I'm going to take a stab that this is really a hardware issue as opposed to a software issue
Quote:
I can hear the audio from "line-in" on the speakers.
One solution:
You can make a virtual loopback device and record what is coming through the sound device.
There is a kernel module that allows that. snd-aloop

You need a virtual loopback device.

Example loopback config ~/.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
  }
}
Then:
Code:
modprobe snd-aloop
Capture what you want, how you want. Example:
Code:
ffmpeg -f alsa -i hw:1,1 -c:a libmp3lame -b:a 32k -vn capture.mp3
Or dump it raw.
That will allow you to capture anything coming through your sound device.

Then unload the loopback when you are done if you want.
Code:
mv ~/.asoundrc ~/.loop_asoundrc
modprobe -r snd-aloop
You'll need to use your own parameters.
There are example ~/.asoundrc files on the net.
 
1 members found this post helpful.
Old 12-28-2019, 01:36 PM   #4
Steve R.
Member
 
Registered: Jun 2009
Location: Cleveland, TN
Distribution: Mint 21.3
Posts: 527

Original Poster
Rep: Reputation: 98
Quote:
Originally Posted by Rickkkk View Post
In my opinion, this is definitely not a hardware problem, since you were able to get satisfactory results in Windows with Audacity on the same computer.
I pondered that issue, but I opted for considering it to be hardware related since Windows and Linux would not be using the same kernel.

Quote:
Originally Posted by Rickkkk View Post
.. my first attempt at a solution would involve removing PulseAudio from the equation. Also, you need to make sure Audacity is properly set up (source, recording levels ...) ...
A fine-print problem. I had previously looked at this webpage No Sound Fix Tips which had the end-of-the-world warning below.
Quote:
Note: Cinnamon users should not purge pulseaudio. Use apt install --reinstall pulseaudio instead
In researching, I have run across pulseaudio complaints. So there is probably a workaround for how to excise pulseaudio form cinnamon that has been posted somewhere.

Quote:
Originally Posted by Rickkkk View Post
Unless this is a once-in-a-blue-moon thing you're doing (i.e. you don't spend a lot of time on sound conversion or recording with this computer) ...
This would be a one-time event, that is solvable under Windows (which I am trying to avoid). I am viewing this as a Linux learning opportunity.

Quote:
Originally Posted by teckk View Post
One solution:
You can make a virtual loopback device and record what is coming through the sound device.
There is a kernel module that allows that. snd-aloop
Thanks for that suggestion. Will have to work on it.
 
Old 12-29-2019, 04:29 PM   #5
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Hi again Steve R,

I applaud your wishing to look at this as a Linux learning opportunity. I was determined to find a way to convert my studio from Windows to Linux and eventually got around to it 3 years ago. I actually *did* have a hardware compatibility (M-Audio firewire external sound card) that required I replace that piece of equipment with another sound interface. Since then, I've been using a Linux-based solution.

All this to say that it takes a bit of trial and error getting used to the Linux way of doing things at first. So if you really are just looking to digitize something once, you might be better off using Windows and then deciding how much effort you want to put into getting used to sound capturing on Linux.

Although I understand your reluctance to remove PulseAudio given the warnings you have encountered in your research, you may be able to simple configure Audacity to ignore it and simply use basic Alsa as its source.

Let us know how you're doing.
 
Old 12-29-2019, 06:29 PM   #6
Steve R.
Member
 
Registered: Jun 2009
Location: Cleveland, TN
Distribution: Mint 21.3
Posts: 527

Original Poster
Rep: Reputation: 98
Quote:
Originally Posted by Rickkkk View Post
I applaud your wishing to look at this as a Linux learning opportunity. I was determined to find a way to convert my studio from Windows to Linux and eventually got around to it 3 years ago. I actually *did* have a hardware compatibility (M-Audio firewire external sound card) that required I replace that piece of equipment with another sound interface. Since then, I've been using a Linux-based solution.

All this to say that it takes a bit of trial and error getting used to the Linux way of doing things at first. So if you really are just looking to digitize something once, you might be better off using Windows and then deciding how much effort you want to put into getting used to sound capturing on Linux.

Although I understand your reluctance to remove PulseAudio given the warnings you have encountered in your research, you may be able to simple configure Audacity to ignore it and simply use basic Alsa as its source.

Let us know how you're doing.
The tapes that I have "all of sudden" become consumed with digitizing are approximately 14 years old and essentially untouched. Obviously, I really didn't need them since they have been unused for all this time.

Back-story break for why I got started on this tangent. A person on another forum has a collection of audiobooks on tape. His car does not have a tape deck. So he posted a request for how he could solve this problem. I researched it for him. He is using a Windows based computer.

Anyway, if things don't work-out, I can use Windows, which I would be reluctant to do. Still caught-up with Christmas and end-of-the-year stuff that will be taking-up some time.

Last edited by Steve R.; 12-29-2019 at 06:54 PM.
 
Old 12-30-2019, 11:18 AM   #7
Steve R.
Member
 
Registered: Jun 2009
Location: Cleveland, TN
Distribution: Mint 21.3
Posts: 527

Original Poster
Rep: Reputation: 98
I'm sitting down at the computer to follow-up. One program that I overlooked discussing in the prior posts above was "Audio Recorder – capture and record audio from any device". The program did not work. Got the same static. More research may prove helpful.

The reason for making this post, is that the website is dated ("Notice: This repository will not be updated after April 2015 !"). Do not accept the PPA. Read the notes and you will see the following message:

Quote:
You are about to add the following PPA:
Audio-recorder project.
For latest versions, please go to
https://launchpad.net/~audio-recorde...ive/ubuntu/ppa
 
Old 12-30-2019, 04:02 PM   #8
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Hi again Steve R,

I realize you have marked this thread as "Solved", but just for the sake of clarity.

I had deduced from your 1st post that you were using Audacity to attempt to record ... In your last post you mention "Audio Recorder", which, from the link you posted, seems to be some Mint applet ... Which application *are* you attempting to use ?

Lastly, to encourage you, I recently finished up a digitizing project where I digitized around 25 old cassette tapes from the late 70's, early 80's (recordings of radio shows I did at college and university .. ) .. The tapes were, for the most part, still viable (if not perfect) and the project was a success .. All under Linux (Arch, in my case ..) with Audacity.

Cheers, and Happy Holidays !
 
1 members found this post helpful.
Old 12-30-2019, 04:10 PM   #9
Steve R.
Member
 
Registered: Jun 2009
Location: Cleveland, TN
Distribution: Mint 21.3
Posts: 527

Original Poster
Rep: Reputation: 98
Audio Recorder is working!

Apparently you can not have both Audio Recorder and Audacity active at the same time. I loaded Audio Recorder by itself and it successfully recorded. I used "System's default device" as the audio source. There does not appear to be an actual "Line-in" source option.

I did activate Pulseaudio Volume Control. That did not have an adverse effect on the operation of Audio Recorder.

I will take a look at teckk proposed solution.

Thanks for your suggestions and help.
 
Old 12-30-2019, 04:13 PM   #10
Steve R.
Member
 
Registered: Jun 2009
Location: Cleveland, TN
Distribution: Mint 21.3
Posts: 527

Original Poster
Rep: Reputation: 98
Quote:
Originally Posted by Rickkkk View Post
Hi again Steve R,

I realize you have marked this thread as "Solved", but just for the sake of clarity.

I had deduced from your 1st post that you were using Audacity to attempt to record ... In your last post you mention "Audio Recorder", which, from the link you posted, seems to be some Mint applet ... Which application *are* you attempting to use ?

Lastly, to encourage you, I recently finished up a digitizing project where I digitized around 25 old cassette tapes from the late 70's, early 80's (recordings of radio shows I did at college and university .. ) .. The tapes were, for the most part, still viable (if not perfect) and the project was a success .. All under Linux (Arch, in my case ..) with Audacity.

Cheers, and Happy Holidays !
That was FAST!! You responded while I was still typing. I basically loaded each application individually and determined that Audio Recorder and Audacity cannot both be active at the same time. As an additional observation, it appears that Audacity (by itself) will not record at all.

Last edited by Steve R.; 12-30-2019 at 08:08 PM. Reason: Added Observation that Audacity does not work.
 
Old 12-30-2019, 05:34 PM   #11
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by Steve R. View Post
That was FAST!! You responded while I was still typing. I basically loaded each application individually and determined that Audio Recorder and Audacity cannot both be active at the same time.
That makes sense. You can have both installed and choose the one with which you're more comfortable, but having 2 or more applications simultaneously *running* and trying to compete for the same audio source (with PulseAudio thrown in the mix to complicate things even more ..) is likely to yield unsatisfactory results.

Glad you're up and running - best of success with your project.

Come back any time for any Linux-related questions.
 
  


Reply

Tags
audacity, line-in, static


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
awk command line: blank line record sep, new line field sep robertmarkbram Programming 4 02-21-2010 06:25 AM
grab the line below a blank line and the line above the next blank line awk or perl? Pantomime Linux - General 7 06-26-2008 09:13 AM
Help With Java Problem Please"""""""""""" suemcholan Linux - Newbie 1 04-02-2008 07:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:58 AM.

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