You are not logged in.

#1 2013-10-17 08:02:49

Amanda S
Member
Registered: 2013-09-21
Posts: 276
Website

Increasing alsa buffer size?

I can now record my games after I split the output from my MOBO into two outputs, one to my phones and the other I connect to the mic input.
Only problem is that I get "ALSA buffer xrun".

After hours of research it's clear that I need to increase the alsa buffer size. Problem is I don't know how.
I managed to look in over 100 pages of documentation but none explain WHERE this damn file is.

Command I use to record:

ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 30 -s 1280x1024 -i :0.0 -acodec mp3 -vcodec libx264 -preset ultrafast -crf 0 -threads 0 output.mp4

Line into the file /usr/include/alsa/alsa-audio.h:

#define ALSA_BUFFER_SIZE_MAX

This above needs numbers at the end of it. Most threads I searched have different numbers, so I just look at "/proc/asound/card0/pcm0c/sub0/prealoc_max" and make it double/triple/quadruple.

The best hint I have is this http://pastebin.com/4FibYN0U
But I don't have that file and directory.

Then, I created that file and directory, but still the problem is here.

-------------------------------------------------------

Also, the following command gave results that showed a folder containing lots of files related to the one I want, but with different names:

sudo find / -name alsa

Files are at /usr/include/alsa

I then created the file I need there, but still nothing, even after reboot.
-------------------------------------------------------

I also created the file in my home directory, and nothing. I then created ".asoundrc" and put the command there. Nothing.
I also noticed that I don't have the "/lib/ffmpeg" directory, but only "/lib/ffmpeg-compact". Yes, I have both installed (the compact I think was installed along with VLC)

Then after a reading at https://wiki.archlinux.org/index.php/Ad … cy_Scaling I noticed there are buffer sizes in /etc/asound.conf.

So, what to do?
-------------------------------------------------------

Sources:

http://ffmpeg.org/pipermail/ffmpeg-cvsl … 40342.html
http://ffmpeg.org/pipermail/ffmpeg-user … 14091.html
http://ffmpeg.org/doxygen/0.11/alsa-audio_8h.html
http://ffmpeg-users.933282.n4.nabble.co … 57932.html
http://pastebin.com/4FibYN0U
http://svn.perian.org/ffmpeg/libavdevice/alsa-audio.h

Last edited by Amanda S (2013-10-17 08:03:07)


If it ain't broke, you haven't tweaked it enough...

Offline

#2 2013-10-17 09:13:42

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Increasing alsa buffer size?

For buffer_size, see example in my sig.

Offline

#3 2013-10-18 06:31:02

Amanda S
Member
Registered: 2013-09-21
Posts: 276
Website

Re: Increasing alsa buffer size?

I'm assuming if I create an ".asoundrc" file in ~ then I'll be able to increase the buffer size?


If it ain't broke, you haven't tweaked it enough...

Offline

#4 2013-10-18 07:56:35

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

Re: Increasing alsa buffer size?

Of course you need to create it.
Anyway, you may want to take a look here, to capture the audio in a digital way:
https://bbs.archlinux.org/viewtopic.php?id=147852


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

Offline

#5 2013-10-18 08:02:34

Amanda S
Member
Registered: 2013-09-21
Posts: 276
Website

Re: Increasing alsa buffer size?

Hi Kokoko, I've tried for many days to record with that solution in the past but with no success. The only way to capture audio I found is via Microphone, which nows gives me that buffer error.

I appreciate your help.


If it ain't broke, you haven't tweaked it enough...

Offline

#6 2013-10-19 19:46:28

Amanda S
Member
Registered: 2013-09-21
Posts: 276
Website

Re: Increasing alsa buffer size?

Yeah, it's a lot of trouble.

I'll just record the video with ffmpeg and audio with Audacity.


If it ain't broke, you haven't tweaked it enough...

Offline

Board footer

Powered by FluxBB