[Solved]Full Duplex sound playback recording config?

Getting your soundcard to work, using Debian on non-i386 hardware, etc

[Solved]Full Duplex sound playback recording config?

Postby bkpsusmitaa » 2018-09-07 05:44

This is for my laptop (Debian Wheezy):
Hardinfo report:
-PCI Devices-
Host bridge : NVIDIA Corporation MCP79 Host Bridge
RAM memory : NVIDIA Corporation MCP79 Memory Controller
ISA bridge : NVIDIA Corporation MCP79 LPC Bridge
RAM memory : NVIDIA Corporation MCP79 Memory Controller
SMBus : NVIDIA Corporation MCP79 SMBus
RAM memory : NVIDIA Corporation MCP79 Memory Controller
Co-processor : NVIDIA Corporation MCP79 Co-processor
USB controller : NVIDIA Corporation MCP79 OHCI USB 1.1 Controller
USB controller : NVIDIA Corporation MCP79 EHCI USB 2.0 Controller
USB controller : NVIDIA Corporation MCP79 OHCI USB 1.1 Controller
USB controller : NVIDIA Corporation MCP79 EHCI USB 2.0 Controller
Audio device : NVIDIA Corporation MCP79 High Definition Audio
PCI bridge : NVIDIA Corporation MCP79 PCI Bridge
Ethernet controller : NVIDIA Corporation MCP79 Ethernet
IDE interface : NVIDIA Corporation MCP79 SATA Controller
PCI bridge : NVIDIA Corporation MCP79 PCI Express Bridge
PCI bridge : NVIDIA Corporation MCP79 PCI Express Bridge
PCI bridge : NVIDIA Corporation MCP79 PCI Express Bridge
PCI bridge : NVIDIA Corporation MCP79 PCI Express Bridge
VGA compatible controller : NVIDIA Corporation C79 [GeForce 9200M G]
Ethernet controller : Atheros Communications Inc. AR242x / AR542x Wireless Network Adapter
Mass storage controller : VIA Technologies, Inc. Device 401a
SD Host controller : VIA Technologies, Inc. Device 401b


Found these lines from unix.stackexchange.
Added the lines to
Code: Select all
/etc/pulse/default.pa

Code: Select all
load-module module-alsa-sink device=hw:0,0
#load-module module-alsa-sink device=hdmi:0
load-module module-combine-sink sink_name=combined
set-default-sink combined

I didn't understand the requirement for hdmi port, as I don't have a functional one. So silenced it. The above lines related to pulseaudio, but I have problem with alsa. Don't know whether these lines are appropriate.

/var/lib/alsa and /etc/alsa are empty. No config. files there. Raed the manpage for alsa. The format is :
alsactl [options] [store|restore|init] <card # or id or device>
My card from alsamixer is
Code: Select all
0  HDA NVidia

So the command from root should be
Code: Select all
alsactl store 0
?

Got the following file:
Code: Select all
/var/lib/alsa/asound.state
asound_state.zip
the fileasound.state
(729 Bytes) Downloaded 1 time


I have never tried, so didn't know this issue existed in my hardware. I have nvidia drivers installed and they are working fine. Sound playback and record work fine separately. I also have pulseaudio installed, for playing movies and songs from YouTube. So this need for Duplex operation arose for audio, for recording songs directly while playing them from YouTube.

How could a detailed report by alsactl be generated into a text file? I have the following config files in
Code: Select all
/proc/asound

Code: Select all
dr-xr-xr-x 4 root root 0 Sep  7 12:09 card0
-r--r--r-- 1 root root 0 Sep  7 12:09 cards
-r--r--r-- 1 root root 0 Sep  7 12:09 devices
lrwxrwxrwx 1 root root 5 Sep  7 12:09 NVidia -> card0
dr-xr-xr-x 2 root root 0 Sep  7 12:09 oss
-r--r--r-- 1 root root 0 Sep  7 12:09 pcm
dr-xr-xr-x 2 root root 0 Sep  7 12:09 seq
-r--r--r-- 1 root root 0 Sep  7 12:09 timers
-r--r--r-- 1 root root 0 Sep  7 12:09 version

Only problem is with duplex recording and playback. Audacity also doesn't record duplex. The recorder runs, alright, but only records silence and minute spikes.

There are posts found with the search parameters: "duplex playback recording"
+duplex +playback +recording]

There are many. But the relevant ones are the following:

(1) PulseAudio loopback guide
A lengthy, but awesome guide, my ultimate guide, I guess. But I am not trying to learn so much on this issue. Looking for a simpler solution, if any.
This guy, an advanced programmer, had just three posts, and then ... silence. Vanished into the underbellies of a Multinational Software Company, perhaps. Last seen in 2014. So the gifted and hallowed individual can't be accessed any longer, I guess.

(2) alsa: can record but can't echo input
Received no reply.

(3) Debian 8, no sound, Realtek ALC1150
Received replies, but the problem wasn't solved.

Now moving towards our final target step by step:

1st:
Code: Select all
sudo modinfo snd-aloop

"Outputs"
Code: Select all
filename:       /lib/modules/3.9.6/kernel/sound/drivers/snd-aloop.ko
license:        GPL
description:    A loopback soundcard
author:         Jaroslav Kysela <perex@perex.cz>
depends:       
intree:         Y
vermagic:       3.9.6 SMP preempt mod_unload modversions 486
parm:           index:Index value for loopback soundcard. (array of int)
parm:           id:ID string for loopback soundcard. (array of charp)
parm:           enable:Enable this loopback soundcard. (array of bool)
parm:           pcm_substreams:PCM substreams # (1-8) for loopback driver. (array of int)
parm:           pcm_notify:Break capture when PCM format/rate/channels changes. (array of int)


2nd:
Code: Select all
sudo aplay -l

Outputs:
Code: Select all
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC268 Analog [ALC268 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


Then, we do,
Code: Select all
sudo modprobe snd-aloop
We're to remember, not modinfo but modprobe.
followed by:
Code: Select all
aplay -l

"outputs"
Code: Select all
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC268 Analog [ALC268 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7


Thus, the line
Code: Select all
sudo modprobe snd-aloop
creates the virtual cards.



3rd:
Again
Code: Select all
sudo alsactl store

Will save the loopback set up.

Now we have to be careful. The help pages on the web are very ancient. For example, the suggestion in Matrix:Module-aloop with the code:
Code: Select all
modinfo soundcore
: was last edited in 2 March 2008‎!

The pdf file of Jens Getreu thrown up by Google Search, is based on the above ancient webpage!

And I finally reach the Debian Wiki page on audio loopback with alsa!

It was lying there, all the time! When I posted this query: To grab the output from a code to a wave file?

But I couldn't have known about this file without the learning curve that I overcame only today, the 7th Aug 2018. This scenario perhaps depicts the sad fate of FOSS — diamonds strewn everywhere, but no one knows their utility except in jewelry.

Installed the other required software:
pavucontrol_1.0-1_i386.deb
pasystray_0.4.0-1_i386.deb

I am now trying to figure out how to use a part of the audio output to Loopback recording.

Now here is my final query:
Could this page be explained with a simple Sound Recorder application rather than Gnome_Record_My_Desktop please?

Yes, it is very simple with PAVUcontrol. PASYstray is not required. In the Output Device Tab of pavucontrol, activate and couple all devices except the system beeps.
Use Gnome Sound Recorder and begin recording. This is IMPORTANT.
As soon as a recorder is ON, the recording tab of pavucontrol begins to show the recorder action. Not Before.
So the steps are:
(1) Just the Built-in Audio Stereo and the Loopback Stereo needs to be coupled.
(2) Recorder needs to be recording.

Good day and happy recording.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home
bkpsusmitaa
 
Posts: 368
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

Return to Hardware

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable