My thoughts on Slackware, life and everything

A journey into recording sound & video in Slackware

ssr When it comes to audio and sounds in Slackware, we’re happy to have ALSA as the sound subsystem. It works reliably, and has done so ever since it replaced OSS in Slackware all those years ago. In due course ALSA got capable of dynamically mixing multiple sound sources – which is basically what a sound server does, too. We were never plagued with the issues of other distros when they abandoned ALSA for PulseAudio.
When the Arts sound daemon of KDE was deprecated and finally removed with the release of KDE4, Slackware was left without a sound “server” that ran out of the box. We still have ESD, the Enlightened Sound Daemon but that one has limited use because of the wrapper programs it needs.
There are however scenarios where you wish Slackware had some sort of audio server. Until now, the only times when that thought crossed my mind it was related to streaming audio over a network – think of remote desktop sessions and virtual machines. I may write some more about that topic in a future post because I think I have the solution now – read on.

A more immediate need arose when I went looking for software that can record videos of my Slackware desktop – individual program windows and gameplay footage. My son is a huge Minecraft fan and wants to be able to do in Slackware what he already does with Fraps in Windows. My intention is to task him with creating some Slackware “end-user” videos to attract newcomers to the distro 🙂

It turns out that there really is not all that many good desktop video recording software in Linux land. I have tried recordmydesktop and like it well enough (that is how it ended up in Slackware’s “/extra” section) but it does not deliver stellar videos, in particular I don’t think it is suited for recording gameplay. It also produces OGG video only, which is OK since that gives you the only free and open video format and codecs… but I believe this design decision limits my options too much.

I read up on ArsTechnica’s attempts to record gameplay footage on SteamOS. To this day, the ArsTechnica folk have not found a way to record the audio of a game… apparently it is not as easy as you might think, to record OpenGL games. Programs like FFMPEG and VLC are able to record (parts of) your desktop but it is cumbersome and also does not deliver high-quality video with properly synced audio. These programs are not capable of intercepting OpenGL renders either, which limits their use.
So I went looking… and came across GLC, an ALSA & OpenGL recording software for Linux which was inspired by Fraps and Yukon, but it seems mostly abandoned by its author. Then there also is SimpleScreenRecorder, a relatively new piece of work by Maarten Baert. The program uses FFMPEG’s codecs to allow you to record audio and video into any format supported by the locally installed version of ffmpeg. It supports the recording of ALSA sound sources (think of a microphone). The word “simple” in its name only characterizes the ease-of-use, not the featureset! And it has a Qt-based GUI which nicely blends into my KDE desktop. By means of an OpenGL injection library it also supports direct recording of OpenGL renders (read: games). That should produce superior videos compared to merely recording the desktop window (because that produces lower frame rate videos or lower quality).

Unfortunately it turned out that SimpleScreenRecorder was not capable of recording my Slackware desktop’s sound, and therefore game videos are silent.
That is a show stopper… apparently you need a sound server like PulseAudio in order to record the audio as well. I am not prepared to install PulseAudio on Slackware – as you are well aware, this is a personal issue I have with the PA author and the way he writes code. So I investigated further, and found out that the unreleased GIT sources of SimpleScreenRecorder support JACK as a new sound source next to ALSA (and PulseAudio). I built the program from its GIT sources and then went on to learn about JACK Audio Connection Kit. I knew that JACK is primarily used by audio professionals and musicians because of its low-latency core design. But as it goes with versatile programs, it is inherently difficult to grasp its concepts and complex to configure. But I persevered and ultimately found a way to configure JACK on my desktop, and reconfigure my ALSA setup so that all the programs that I use can still emit sound, and SimpleScreenRecorder is now capable of recording video and audio! I put a demo video online which I recorded for the intro sequence from the Metro: Last Light game.

As you can see, the game stutters a bit, but that is not caused by the recording software – it’s my desktop PC which is just not fast enough for the game.

ssr_qtui

My next post will be about how I built and configured JACK, and what I had to change in my ALSA configuration so that for instance Steam games (using SDL for audio) and MineCraft (using OpenAL for audio) would still make sounds.

In the meantime, if you want to try SimpleScreenRecorder, there’s a couple of dependencies you need to install as well. SimpleScreenRecorder was built against ffmpeg (version 2.1 to be precise – please note that upgrades of ffmpeg will usually break a lot of applications that depend on it due to a change in library versions). Also, the package which I released has been built against jack – even if you do not plan on using it, you’ll have to install it… or you can rebuild SimpleScreenRecorder yourself.
If you want to use SimpleScreenRecorder to record 32-bit OpenGL programs (Steam games, WINE based games) and are running a 64-bit Slackware, it will have to be a multilib system and you will have to use the “convertpkg-compat32″ script (part of my compat32-tools package) to convert and install the 32-bits “compat32” versions of the simplescreenrecorder, ffmpeg and jack packages as well as the 64-bit versions.
If you want to try and record a Steam game without the Steam windows being visible (those are also rendered in OpenGL), you’ll definitely have to read these instructions: http://www.maartenbaert.be/simplescreenrecorder/recording-steam-games/#native-steam-for-linux because currently it involves some manual tweaking to get this working (I expect that this will get easier in time). Judging by his Wiki, Maarten is responsive to the users of his program and is able to write meaningful documentation.

Get packages (and sources) here:

Have fun! Eric

21 Comments

  1. Me

    Thanks Eric 🙂
    I also like SSR and recommends it .
    Looking forward for part 2.
    I also found an other video on your youtube channel that i will listen to.
    And about Poettering i always say to myself that the moment slackware introduces any of Poetterings “babies” i will change distro.
    I couldn’t agree more with this blog post 😉

    Happy holidays!

  2. Marcelo

    I think the jack no updated. =/

  3. Niki Kovacs

    That was an interesting read, Eric. BTW, your inclusion of recordmydesktop in Slackware’s extra/ is well appreciated. I discovered this little tool some time ago, and wrote a little HOWTO about it.

    http://www.microlinux.fr/slackware/Linux-HOWTOs/RecordMyDesktop-HOWTO.txt

    Cheers,

    Niki

  4. bratpit

    I personally not use jack or pulseaudio.
    I do not like such redundant programs .
    So to record sound I use separate .asoundrc file.

    http://privatepaste.com/941a0277af

    It uses snd_aloop module.

  5. alienbob

    Hi bratpit,

    Usually I do not have a need for Jack audio either (if you are a musician running a Digital Audio Workstation then Jack is a requirement). My solution to tie ALSA and Jack together also uses snd_aloop 🙂

    Eric

  6. bratpit

    Bob

    There is one drawback in that asoundrc.
    No mixing from multiple input to 1 output .
    So I have to use 2 conf files depending on what I’m doing 🙂

    For grabbing I use ffmpeg with keybinding script , and what do you mean saing that “does not deliver high-quality video with properly synced audio.”.
    I do not agree for the video. its a codec matter e.g. x264 produces decent quality , but sync with audio is sometimes problem, but most of the time is the matter of proper use options and filters.
    But buggy muxer to mkv in ffmpeg there was a problem too.

  7. alienbob

    Hi bratpit

    When I am finished with my next article we will compare our .asoundrc files. Mine is targeted at bridging ALSA and Jack Audio but I think there must be a way to just skip Jack.

    Eric

  8. alienbob

    Me:

    Ultimately the choice whether to include or reject software into Slackware is determined by two factors: pressure from other upstream projects versus the willingness to change the course of the Slackware distribution in order to stick with its core philosophy. What if KDE or XFCE would adopt a hard dependency on SystemD or Wayland for instance?

    It is not hard to think how people will react if Slackware would abandon major desktop environments, or even lower level utilities like udev and dbus, udisks, policykit, consolekit in an attempt to remain true to the UNIX ideals of old.

    It’s like with PAM: as long as it is not absolutely required for the distro to function, it is not going to be added. The same could not be said for other software that has been introduced to Slackware over the past few years – luckily those additions were less intrusive than say, PAM or SystemD or Wayland.

    Think of a Slackware with only X.Org and fluxbox as your graphical work environment and you can see how that would appeal to part of the Slackware user community while at the same time repelling another part of that same community.

    Eric

  9. Roy

    > as you are well aware, this is a personal issue I have with the
    > PA author and the way he writes code

    No, I was not aware of it; by the way, I discover the name of
    this given “PA author” today for the first time. Anyway, and
    provided I am not mistaken on my interpretation of your “personal
    issue,” agreed!, systemd is crap — why?, I invite everyone to
    attentively read here:

    http://skarnet.org/software/s6/why.html
    Why another supervision suite ?

    Fingers crossed on Slackware, my god… I hope it never will
    embrace systemd! (I am looking with apprehension at, e.g., Arch
    Linux.) And, as an aside: of course!, s6 works like a beauty on
    my (slackware) laptop.

    Cheers.

  10. zezaocapoeira

    Salve mano .Consegui fazer a instalação do SimpleScreenRecorder com Jack Audio http://www.youtube.com/watch?v=xp45pkIQFtQ .Parabéns pelos excelentes tutoriais .
    Obrigado pela atenção ,salve !!!

  11. Amaro

    Hello, Eric!

    On Slackware 14.1 32bit I get
    simplescreenrecorder: error while loading shared libraries: libx264.so.140: cannot open shared object file: No such file or directory
    Where to get this, even http://rpm.pbone.net/ doesn’t have it?

  12. alienbob

    Hi Amaro.

    rpm.pbone.net??? Slackware does not use RPM’s.
    If you have installed my package for simplescreenrecorder, as well as my packages for ffmpeg, jack and opus, you should not have gotten that error.

  13. Amaro

    Thanks, Eric!

    Installed your ffmpeg and jack packages and it worked! Thank you very much!

  14. Har

    Dear Eric,

    I installed your ffmpeg, jack, simplescreenrecorder, and opus on Slackware 14.2 32bit and I still got this message
    simplescreenrecorder: error while loading shared libraries: libavformat.so.55: cannot open shared object file: No such file or directory.
    Please tell me what to do. Thanks in advance.

  15. alienbob

    Har, the error means that simplescreenrecorder needs to be recompiled to pick up the newer versions of the ffmpeg libraries.

  16. Har

    Dear Eric,

    Thanks for your quick response. As I am completely dumb about this “recompile” stuff, I did reinstall SlackBuilds’ ssr and run it along with your ffmpeg, switch the audio back end from PulseAudio to ALSA, and … voila! It works as I need! Thank you so much, Eric. God bless you and your works.

  17. slackartist

    I did try this before just using padsp aoss for my oss gaming medal of honor allied assault. I was getting mostly everything except binary launchers of these type. So my problem was a lot more simpler. And my steam games were more out of the box also. Maybe I’ll need jack for something else as it does play nice with alsa but not oss which is covered by alsa anyways as I found out with those two things. (two wrappers together)

  18. Tea Teathief

    To be honest I haven’t used a distro yet that when you install bluez pulls in pulseaudio.

    In none of the distros I use does bluez require pulseaudio.

    But to be honest I’ve never directly used the thing seeing as I just got my first device with bluetooth support (Pi 3).

    I’m probable going to install Alphine on my Pi 3 and I’m probable going to be unsuprised to see it also does not require pulseaudio for bluez.

  19. alienbob

    The reason for tie-ing bluez5 to pulseaudio in Slackware is this (copied from the Slackware ChangeLog.txt):

    After upgrading to BlueZ 5 recently, everything seemed to be working great,
    but then it was pointed out that Bluetooth audio was no longer working.
    The reason was that the newer BlueZ branch had dropped ALSA support and now
    required PulseAudio. So with some trepidation, we began investigating adding
    PulseAudio to Slackware. Going back to BlueZ 4 wasn’t an option with various
    dependent projects either having dropped support for it, or considering doing
    so. After several iterations here refining the foundation packages and
    recompiling and tweaking other packages to use PulseAudio, it’s working well
    and you’ll likely not notice much of a change. But if you’re using Bluetooth
    audio, or needing to direct audio through HDMI, you’ll probably find it a lot
    easier to accomplish that.

    The cuplrit: https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/configure.ac?id=4ff9b99292eca193dc0c149722328cb0b1ab0818

    Read also: http://alien.slackbook.org/blog/pulseaudio-comes-to-slackware-current-beta/

  20. Tea Thief

    Weird I have bluez 5.45_1 on right now.

    I need to get some bluetooth audio devices for testing…

    As it stands Arch, Void, and Alpine insteall bluez just fine without pulseaudio, but that isn’t the same as outputing audio through it.

    If they do have it, I wonder what magic they’re using to get it done…

  21. alienbob

    Well, perhaps they do not list pulseaudio as a dependency because pulseaudio is irremovable in the core of these distros? That could explain why it is not an explicit dependency.

Leave a Reply to Tea Thief Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2024 Alien Pastures

Theme by Anders NorenUp ↑