You are not logged in.

#1 2014-12-01 17:36:22

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

[SOLVED] Can't record system sound (ALSA)

Hello folks,
I can't record system sound (Firefox, vice, fs-uae ecc...) with Audacity (or SimpleScreenRecorder) using ALSA (i haven't pulseaudio, i dont want it)

i tried all input profile of Audacity: http://oi61.tinypic.com/2uii2a8.jpg
but the sound is noise and low volume:
http://quellen.altervista.org/provola.mp3

why?

i use a Desktop PC with LXDE and HDA VIA VT82xx audio card, i haven't microphone.


$ arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=VT82xx
    HDA VIA VT82xx, ALC883 Analog
    Default Audio Device
sysdefault:CARD=VT82xx
    HDA VIA VT82xx, ALC883 Analog
    Default Audio Device
front:CARD=VT82xx,DEV=0
    HDA VIA VT82xx, ALC883 Analog
    Front speakers
surround21:CARD=VT82xx,DEV=0
    HDA VIA VT82xx, ALC883 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=VT82xx,DEV=0
    HDA VIA VT82xx, ALC883 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=VT82xx,DEV=0
    HDA VIA VT82xx, ALC883 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=VT82xx,DEV=0
    HDA VIA VT82xx, ALC883 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=VT82xx,DEV=0
    HDA VIA VT82xx, ALC883 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=VT82xx,DEV=0
    HDA VIA VT82xx, ALC883 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers

2u7t9hg.jpg
(i tried to change volume of Capture/Device but i not solved)

Thanks.

Last edited by quellen (2019-10-28 11:25:38)


sorry for my bad english

Offline

#2 2014-12-01 17:59:09

smirky
Member
From: Bulgaria
Registered: 2013-02-23
Posts: 277
Website

Re: [SOLVED] Can't record system sound (ALSA)

As far as I learned you need a loopback sound device which can be invoked through loading a kernel module. I think the module was called snd-aloop. Additional configurations will be needed in ~/.asoundrc. I gave up headbanging on the topic for now, cause I don't quite understand alsa configurations.
There's also another way. You can use a two-sided aux cable and capture the output with it.

EDIT: you can take a look here: https://bbs.archlinux.org/viewtopic.php?id=147852

Last edited by smirky (2014-12-01 18:00:19)


Personal spot  ::  https://www.smirky.net/  ::  Try not to get lost!

Offline

#3 2014-12-01 18:45:41

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

Re: [SOLVED] Can't record system sound (ALSA)

smirky wrote:

There's also another way. You can use a two-sided aux cable and capture the output with it.

you mean connect line-in and line-out of motherboard with a jack cable?

i tried and works good! thanks!
but isn't dangerous?

p.s.
i also tried to load module snd-aloop and edit .asoundrc like that topic, but doesn't works.

Last edited by quellen (2014-12-01 18:54:28)


sorry for my bad english

Offline

#4 2014-12-01 20:16:35

smirky
Member
From: Bulgaria
Registered: 2013-02-23
Posts: 277
Website

Re: [SOLVED] Can't record system sound (ALSA)

This whole thing with the device loopback is a big mess if you ask me. I personally hate the fact that such a simple functionality isn't made clear how to be achieved. You have to be an alsa guru of some sort to get it done right. I personally done it (magic I think) but it grabs the output and doesn't go well with other apps that require to use the sound output too.

Here's my configuration which I also think it won't work out for you if you don't modify it a little bit:

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
#slave.pcm "dmix"
  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
  }
}

After setting this up, I had to manually specify to ffmpeg (that's what I use to record video and audio) the audio device which is listed with:

$ aplay -l

If you really want to get through this, you need patience!

Last edited by smirky (2014-12-01 20:17:47)


Personal spot  ::  https://www.smirky.net/  ::  Try not to get lost!

Offline

#5 2014-12-02 13:33:02

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

Re: [SOLVED] Can't record system sound (ALSA)

thx.
i loaded "snd-aloop" and tried your .asoundrc but doesnt works (don't record system sounds)
maybe i must edit it.

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: VT82xx [HDA VIA VT82xx], device 0: ALC883 Analog [ALC883 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: VT82xx [HDA VIA VT82xx], device 1: ALC883 Digital [ALC883 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

i tried edit this:

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

i tried also device 0 subdevice 1.
but doesnt works.

Last edited by quellen (2014-12-02 13:38:20)


sorry for my bad english

Offline

#6 2014-12-02 15:30:52

smirky
Member
From: Bulgaria
Registered: 2013-02-23
Posts: 277
Website

Re: [SOLVED] Can't record system sound (ALSA)

I don't see the loopback listed in your case. Are you sure you loaded the module?
Here's what I have after loading the module (it's not loaded automatically after reboot):

 0 « root » /home/smirky » aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: 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 2: 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

Personal spot  ::  https://www.smirky.net/  ::  Try not to get lost!

Offline

#7 2014-12-02 20:46:44

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 364

Re: [SOLVED] Can't record system sound (ALSA)

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: VT82xx [HDA VIA VT82xx], device 0: ALC883 Analog [ALC883 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: VT82xx [HDA VIA VT82xx], device 1: ALC883 Digital [ALC883 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: 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 2: 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

EDIT:
then i SOLVED loading "snd-aloop" and using "looprec: Line: 1" on Audacity or ffmpeg with this command:

$ ffmpeg -f alsa -i hw:2,1 cazzo.mp3

Last edited by quellen (2019-10-28 11:56:00)


sorry for my bad english

Offline

Board footer

Powered by FluxBB