You are not logged in.

#1 2012-08-28 16:13:35

TheRatze94
Member
Registered: 2012-07-01
Posts: 33

[Solved] Recording internal audio with alsa and recordmydesktop

I record Let's Plays and wanted to record them with recordmydesktop.
I first tried to record using ALSA but after reading much threads about that problem I decided to use pulseaudio because it seems to be easier.
But I want ALSA back so I decided to ask here if anyone knows a solution for the ALSA sound server.

Can anyone help me? smile

Last edited by TheRatze94 (2012-08-31 19:25:42)

Offline

#2 2012-08-29 10:28:44

ChemBro
Member
Registered: 2008-10-22
Posts: 704

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Ha, ha, ha, ha, ha.

No seriously, the only thing that helps you is a good soundcard and I don't mean these pseudo-onboard-soundcards. But even then...

Let's say: Good luck.

Offline

#3 2012-08-29 14:30:32

TheRatze94
Member
Registered: 2012-07-01
Posts: 33

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Your answer is not very helpful.
I didn't ask which soundcard is the best.
I just wanted to know if anyone knows a way to record the internal audio using the ALSA soundserver.
Pulseaudio is just making problems and i want to get rid of it.

Offline

#4 2012-08-29 15:23:06

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,420

Re: [Solved] Recording internal audio with alsa and recordmydesktop

modprobe snd-aloop

should give you another virtual sound card with an input connected to an output.

Then set up a /~.asoundrc that let you play the stream to the loopback interface and the real speakers too, i used this in the past and it worked:


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
  }
}

Last edited by kokoko3k (2012-08-31 20:00:00)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#5 2012-08-31 12:50:18

TheRatze94
Member
Registered: 2012-07-01
Posts: 33

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Thank you for your answer kokoko3k.

For some reason I get the message, that there was an error while opening/configuring the soundcard.
I've done exactly what you wrote after uninstalling the pulseaudio sound server.
Have you got an idea what I could have done wrong?

Offline

#6 2012-08-31 13:14:53

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,420

Re: [Solved] Recording internal audio with alsa and recordmydesktop

When and where do you get that message?
What does it says exactly?
Please, post the output of

aplay -l







--EDIT (just guessing...)
If you modprobed snd-aloop at system boot via /etc/modules-load.d/something.conf it is possible that snd-aloop has got priority over your real sound card so that card #0 is the loop and card #1 is the real one.
In that case, you may want to edit/create: /etc/modprobe.d/sound.conf to fix indexes:

# cat /etc/modprobe.d/sound.conf
options snd_hda_intel index=0
options snd_aloop index=1

Change hda_intel with the module that manages your soundcard.

Last edited by kokoko3k (2012-08-31 13:22:25)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#7 2012-08-31 14:14:21

TheRatze94
Member
Registered: 2012-07-01
Posts: 33

Re: [Solved] Recording internal audio with alsa and recordmydesktop

The message appears when I try recording using gt-recordmyDesktop.
It's german, but it says that there was an error while opening/configuring the soundcard.

 [ratze@ratze ~]$ aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: SB [HDA ATI SB], Gerät 0: ALC887 Analog [ALC887 Analog]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 0: SB [HDA ATI SB], Gerät 1: ALC887 Digital [ALC887 Digital]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: HDMI [HDA ATI HDMI], Gerät 3: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 2: Loopback [Loopback], Gerät 0: Loopback PCM [Loopback PCM]
  Sub-Geräte: 8/8
  Sub-Gerät #0: subdevice #0
  Sub-Gerät #1: subdevice #1
  Sub-Gerät #2: subdevice #2
  Sub-Gerät #3: subdevice #3
  Sub-Gerät #4: subdevice #4
  Sub-Gerät #5: subdevice #5
  Sub-Gerät #6: subdevice #6
  Sub-Gerät #7: subdevice #7
Karte 2: Loopback [Loopback], Gerät 1: Loopback PCM [Loopback PCM]
  Sub-Geräte: 8/8
  Sub-Gerät #0: subdevice #0
  Sub-Gerät #1: subdevice #1
  Sub-Gerät #2: subdevice #2
  Sub-Gerät #3: subdevice #3
  Sub-Gerät #4: subdevice #4
  Sub-Gerät #5: subdevice #5
  Sub-Gerät #6: subdevice #6
  Sub-Gerät #7: subdevice #7

Offline

#8 2012-08-31 14:50:37

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,420

Re: [Solved] Recording internal audio with alsa and recordmydesktop

You're right, i've modified the .asoundrc in the previous post, please try again and make sure gtk-recordmydesktop
will record from looprec
I tested it right now, and works good.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#9 2012-08-31 18:21:14

TheRatze94
Member
Registered: 2012-07-01
Posts: 33

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Thank you very much kokoko3k!
Now it works perfectly smile

Offline

#10 2012-09-16 00:12:36

sagirfahmid3
Member
From: Planet Kerbin
Registered: 2012-09-16
Posts: 3

Re: [Solved] Recording internal audio with alsa and recordmydesktop

kokoko3k, I would like to give a big THANK YOU to you because the simple instructions you posted worked FLAWLESSLY the first time I tried it. I had previously spent over TWO WEEKS trying to get Jack set up with GTK-RMD but to no avail. As a matter of fact, to show my appreciation, I actually registered just for this post. I am a Debian user with around two years experience lol.

Offline

#11 2012-09-16 18:23:30

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,420

Re: [Solved] Recording internal audio with alsa and recordmydesktop

You're welcome sagirfahmid3, but as far a si remember, it was just a copy/paste from different .asoundrc i spotted around wink


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#12 2013-03-01 13:28:07

SneakySnake
Member
Registered: 2012-03-30
Posts: 21

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Wow, thanks, this worked perfectly!

Offline

#13 2013-03-01 13:37:54

AndrzejL
Member
Registered: 2012-12-07
Posts: 160

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Wow guys this is a great thread. I was looking for a way to do this for a while now!

Thanks!

Regards.

Andrzej


The worst thing about censorship is ██████ ██ ████ ████████████ and ██████ ███████ ███ ███████████.

Offline

#14 2013-04-08 01:23:29

qubodup
Member
Registered: 2008-01-19
Posts: 66

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Hello, thanks for this thread and replying to it too, I have been dreaming for years to be able to record from onboard sound without having to install pulseaudio.

I followed both instructions by kokoko3k but get the error message:

$ speaker-test 

speaker-test 1.0.26

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
Playback open error: -16,Device or resource busy

My alsa-info: http://www.alsa-project.org/db/?f=c8774 … 4debc03513

Hopefully you can help me and whoever else has this problem.

Offline

#15 2013-07-06 15:48:30

dixDel
Member
From: Liège, Belgium
Registered: 2013-07-06
Posts: 3

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Thanks @kokoko3k, your solution works perfectly. I just recorded internal audio with Audacity by selecting the looprec device.

Offline

#16 2013-12-12 08:31:33

avalon
Member
Registered: 2013-12-12
Posts: 7

Re: [Solved] Recording internal audio with alsa and recordmydesktop

FYI there is another methog - to use the `tee` or `file` alsa pcm device. See this section in audacity wiki:
http://manual.audacityteam.org/o/man/tu … A_PCM_file

Basically you create an alsa device like one of the below pcm devices and then set it as default or play only particular programs through it. You don't even have to use a recording program which is nice:

pcm.teeraw {
   type empty
   slave.pcm "tee:default,'/tmp/out.raw',raw"
   # 48000 S16_LE 2ch (aplay -t raw -f dat)
}
pcm.teewav {
   type copy
   slave.pcm "tee:default,'/tmp/out.raw',wav"
}
pcm.teemp3 {
    type file
    format "raw"
    slave.pcm "default"
    file '|/usr/local/bin/lame -S -r -s %r --bitwidth %b -m j - /tmp/asound-$$.mp3'
}

Last edited by avalon (2013-12-12 08:38:29)

Offline

#17 2013-12-12 13:45:13

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,420

Re: [Solved] Recording internal audio with alsa and recordmydesktop

The drawback of the latter is that one have to choose the output alsa device everytime, the former is more like a "set it and forget it" method


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#18 2013-12-12 20:44:22

avalon
Member
Registered: 2013-12-12
Posts: 7

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Both have upsides and downsides. For example when you record something you usually don't want to record your skype and other IM notifications or whatever program decides to output noises at the time. So when recording I usually set the program to use a particular PCM.

Offline

#19 2015-09-12 23:08:29

frg
Member
Registered: 2015-09-12
Posts: 2

Re: [Solved] Recording internal audio with alsa and recordmydesktop

kokoko3k wrote:
modprobe snd-aloop

should give you another virtual sound card with an input connected to an output.

Then set up a /~.asoundrc that let you play the stream to the loopback interface and the real speakers too, i used this in the past and it worked:

After setting up asoundrc like this I got the behaviour when only one application can use ALSA at a time. Some can be restarted to get sound, for the others it doesn’t help. Thanks big_smile

Offline

#20 2015-09-13 03:37:53

frg
Member
Registered: 2015-09-12
Posts: 2

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Also CPU load by MPD goes 100% on one core every time.

Offline

#21 2015-09-17 10:18:21

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,399
Website

Re: [Solved] Recording internal audio with alsa and recordmydesktop

Please don't necrobump, frg; especially when the thread is marked as solved.

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB