Moving on: 64bit Linux, PulseAudio, Fedora 10 and so on

Tux
With the release of Fedora 10 I took the opportunity to finally switch over to 64bit Linux – including the proprietary stuff like Flash, Skype, and so on. Also, Fedora 10 itself had several rather pleasing surprises for me.

I already used Fedora 10 since it’s Beta release. However, recently I decided to re-install it, this time in 64bit, and check how that would go. Also, since I had some rather strange problems and performance issues I wondered if a re-install would fix them.

64bit in General

Switching from 32bit to 64bit on an operating system is a huge and complicated task involving effectively all larger applications. This can e a real pain – unless you have an operating system where all software usually supports 64bit anyway. This is the case with most open source operating systems and therefore also with Linux. So grabbing the 64bit image and installing it was just like grabbing the 32bit image. In case of Fedora the download link offered by default was 32bit, but 64bit was just a click away. I wonder when that will change.

There are numerous advantages and disadvantages regarding 32bit and 64bit, for a first introduction start with the Wikipedia article.

Flash

The problems regarding 64bit arise when you deal with non-Open Source software: this might only be provided as 32bit. In case it depends on any other library, the system must provide these libraries in 32bit and 64bit. While on RPM systems this is not a problem at all, this can be rather problematic when browser plugins are 32bit only, because then the browser needs to be 32bit only as well, the same is true then for all other plugins, and so on. There are wrappers to deal with that, but these are sub-optimal.

Luckily, Adobe has now released a 64bit Alpha version of their Flash player. While it is still missing several features and is not even provided as a rpm or deb file, in my first tests it worked without problems. As a side note, the 64bit versions for Windows and Mac OS are still not out there – Linux is a clear technology and development pusher here!

For the sake of completion (and since someone would point it out in a comment anyway), there are also free (as in FLOSS) alternatives to the Flash player – which are available in 64bit for quite some time now, of course.

Skype

Another issue is Skype – this is not provided as a 64bit version at all (bug report). For Ubuntu users there is at least a 32bit version modified for easy installation on 64bit systems. Btw., hardly anyone seems to know that, even the German Ubuntu wiki doesn’t mention that at all.

Anyway, that doesn’t help the Fedora community anyway – but since Fedora runs on RPM installing all the compatibility libraries is just a question of hard disk space:

yum --nogpgcheck localinstall skype*rpm
yum install alsa-plugins-pulseaudio-1.0.18-1.rc3.fc10.i386

That’s it. In my tests Skpe indeed worked, even a video test image was shown although I haven’t actually made a real video call. Also, I had problems with the microphone, but that might be due to problems with PulseAudio. I appreciate any tips on that issue.

PulseAudio

Well, PulseAudio is a difficult thing. It has a rather strong community and people are making sure it comes up everywhere and works everywhere like it should. However, while I read all the rather long papers and documents why I should need PA, nothing of these papers really stuck, and I always wonder why it is really needed – apart from the more esoteric reasons that Alsa is not suitable for the future. Besides, I do wonder if the Alsa guys would say the same.
Additionally, in my first tests PA worked just fine – under Gnome, but not in KDE. So my first step after installing Fedora since my first contact with PA was always to remove PA.

But I always tend to give things another try, and this time I didn’t remove it. And indeed, almost everything works, and I haven’t even met a delay yet. It all just works, even on KDE with its Phonon!

So it looks like PA finally fits in well. Now what I only need some ideas what to do with it :D Seriously, what I would appreciate to see is a simple one sheet drawing with all the usual suspects of the Linux audio blob (from Phonon over xine down to Alsa) to see where PA fits in and what it does there.

KDE, Nvidia and performance

Fedora 10 now includes KDE 4.1.3 (included in the updates), and together with RPM Fusion Nvidia drivers are just a

yum install kmod-nvidia

away. While I had trouble with this way with the beta version, and general serious performance problems with the drivers installed manually, it turned out that with Fedora 10 final everything works like a charm – fast and snappy!

I am slightly surprised and wonder what was wrong with my Fedora 10 Beta setup. But on the other hand, my work machine is running Kubuntu 8.10 and there the performance is similar fast. So to me it looks like the days of slow KDE 4.x on Nvidia hardware are finally over, given that the drivers are the newest stable ones and KDE is of version 4.1.3.

Fedora’s encryption

This time I decided to not go with a full hard disk encryption, but rather with a home disk encryption. And while I still dislike Fedora’s disk druid for not letting me chose the disk setup in detail I appreciate that clicking a checkbox was all I had to do to activate the home partition encryption. It is even nicely integrated with the boot process.

Overall impression

The overall impression of Fedora 10 is very good. Most bugs I encountered running the Beta version are fixed – except for a strange coding problem, but I will survive that one.

Also, my first move into the lands of 64bit are also far less complicated than expected. Your mileage may vary, depending on the used proprietary software, but then again kvm might be a solution to work around that problem.

About these ads

27 thoughts on “Moving on: 64bit Linux, PulseAudio, Fedora 10 and so on

  1. I find it amusing reading about a transition to 64bit. I’ve been happily using 64bit Linux for about 5 years now.

  2. How did you get Flash 64 bit to work w/ Fedora 10? I’ve had no luck by putting it in ~/.mozilla/plugins on a brand new install. I’ve tried changing the owner to root and turning off SELinux – still no joy.

  3. I have a laptop. And since I don’t like all these cables, all I do at home is connect one(1) usb cable to it and have my real mouse,keyboard and sound. I had to use pulseaudio to move the sound from my internal soundcard to my usb-soundcard on the fly. Since kde4 I don’t need this anymore :-)

  4. The very best thing about PA is that it lets you change sources and sinks on fly.

    To experience that you have to install PA settings panel (or maybe Fedora already included some version of it in their GUI?)

    Anyway. On Ubuntu I’m installing PA settings and then I can, for example – launch skype or a movie, plug in my headphones and drag&drop the movie source to headphones sink. Or create a virtual sink that goes to both, headphones and laptop speakers and d&d it there.

    But that’s just beginning. I can enable zeroconf network and say, set up two laptops playing a movie on one and sound on another over zeroconf. To make it more realistic, I can watch the movie on desktop and make one laptop serve as a left speaker and another as a right speaker… It works beautifully.

    Another thing I know of is that in latest releases PA supports some kind of glitch-free sound. I’m not an expert so better google an article on that, but it gives you less chance to have a choppy sound.

    Overall, PA seems to be a damn good thing even if I will never understand how gstreamer, xine, alsa, oss, pulsaudio and phonon are supposed to be layered and why do we need so many of them.

  5. The diagram you’re asking for is fairly simple:
    KDE app -> Phonon -> xine-lib -> libpulse \
    KDE app -> Phonon -> xine-lib -> libpulse -*-> PA daemon -> ALSA
    KDE app -> Phonon -> xine-lib -> libpulse /
    Xine-lib handles the decoding, PA the mixing.

    And non-KDE apps also plug into this at various levels, there are several ways to talk to PA: ESD protocol emulation, the ALSA plugin, abstraction libraries like libao or SDL etc. In all cases, the apps don’t talk directly to the hardware, but to the PA daemon, which ensures that no one app monopolizes the hardware.

  6. @gandalf: The PA settings panel you’re referring to is called pavucontrol (PA Volume Control), it’s installed by default on the Fedora desktop spins (both the KDE and the GNOME one).

  7. @Jim
    I got it to work by copying the downloaded alhpa version (which is just the .so file) to /usr/lib64/mozilla/plugins/

    I also have the 32bit .rpm installed but I doubt that is necessary.

  8. Funny to read this article BTW, I used the installation of Fedora 10 to switch to 64 bit as well. I tried it some years ago but it was just too much hassle to get everthing to work.

    Now everything seems to work just fine. The only thing I haven’t tried yet are the Windows codecs ofr things like mplayer, I know this was one of the problems I had last time so I hope this will work better now this time around.

    So far I’m pretty satisfied with F10, they even seem to be doing a bit more work to get proper KDE support. Although in my case this led to the strange effect that I have both a gnome and a kde version of the tray applet that checks for updates.

  9. Stefan, I was maybe too afraid in the last years. But keep in mind that this is about desktop only :)

    Jim, I just put the .so file into .mozilla/plugins/ and looked the plugin up in about:plugins. It even works in Konqueror.

    Christoph, am I right that you now move the sound via Phonon?

    gandalf, afaik the sink thing is also possible with Phonon – which seems to be much more lightweight. However, the network transparency is indeed rather nice.

    Kevin, thx for the information! However, Alsa can mix as well – and it worked for me for years, that was indeed my main reason to switch from OSS to Alsa – so why is PA so much better than the Alsa mixer?

    Quintesse, nice incident :) And I must admit that I haven’t tried any windows codecs yet, but vlc runs, an I guess that will do in worst case anyway.
    About the task panel things: I know the problem – there is no way to deactivate Gnome systray apps, they just keep popping up and I most often de-install them…

  10. ALSA can mix through the dmix plugin, however PA wants to be a better mixer than dmix. For one, by also emulating ESD and by getting apps to talk its native protocol, it works with more apps than dmix (there is the drawback that the PA ALSA plugin doesn’t support mmap access, so some apps don’t work with it yet: the main offenders are PortAudio and JACK apps, running PA on top of JACK solves that (also for PortAudio because it supports JACK), but increases latency for the majority of apps which work fine with PulseAudio, a better solution would be helpful there; I’m working on fixing PortAudio, which would also allow running JACK on top of PulseAudio because JACK has a PortAudio backend, though in that case we have once again the stack of sound servers and the resulting high latency; I’m not sure how to best solve the JACK/PA problem). Another advantage is that it supports network transparency, so you can have sound over X11 forwarding (needs a very fast network though, even 802.11g WiFi is borderline too slow).

  11. Can someone explain to me why on earth do we need PulseAudio for low-latency which only increases the sound daemons stack, and thus latency, instead of simply having a JACK backend for phonon, which was built from ground up to be low latency and to patch things up the way you want it, and to be as stable as possible.

    The way I see it if the guys reinventing the weel at PulseAudio helped JACK become network transparent and feature complete, Linux would rise above any other OS including osx for professional, and otherwise, audio manipulation :P

  12. A year ago, PulseAudio was fresh and funky and everyone wanted to replace his ESD (on Gnome though) with that X-like network-aware sound-server. Having used PM for 2 Ubuntu iterations was mostly pain (Skype, Flash, Rhythmbox and out-of-sync sound in videos) and no real use. So removing it was the logical conclusion and the visible difference: absolutely zero. For some strange reason Ubuntu currently has a package dependency on libpulse0 for libxine and the phonon-xine backend but neither libxine nor libpulse link against libpulse.

    Reason why we should install yet-another-sound-daemon are warmly welcome :-)

  13. Answer to the question: “Seriously, what I would appreciate to see is a simple one sheet drawing with all the usual suspects of the Linux audio blob (from Phonon over xine down to Alsa) to see where PA fits in and what it does there”

    are maybe these articles by Lennart Poetering himself:
    http://0pointer.de/blog/projects/the-linux-audio-stack.html

    http://0pointer.de/blog/projects/guide-to-sound-apis.html

    Though, as Lennart mentions in his comments, Xine is left out of the comparison and diagram…

  14. monitor, I know these links, and I read them, but they do not meet my needs. Additionally the guide-to-sound-APIs is nice – when you use Gnome or have a Gnome centric view to the Linux Desktop. I don’t have that, so it’s not what I need.
    Anyway, to be more clear on the pressing questions:
    - Knowing the KDE experience I know that sound servers are evil – and that dmix (or even Xine/GStreamer) does what it is supposed to do. Why add just again a sound server when we just got rid of it, thankfully?
    - Is PA developed in a way which will work perfectly fine with Xine on the one hand and Phonon on the other? [1] I mean, when I choose my backend in Phonon, will that still work even when PA is running?
    - Are you pressing me, or will I always have the option to remove PA if I don’t want it?
    - Why not use GStreamer to implement the missing features there? Why not fix Alsa directly?

    I guess the main problem I have with PA is indeed the sound server thing. You introduce latencies, no matter what you try. And there must be an unbelievable strong reason to do so, otherwise the sound experience will be bad in the end.

    [1] Yes, this *is* a KDE centric view. It is backed up by the KDE developers who tried to write an Gstreamer backend for Amarok – and failed eventually. *That* is the reason KDE defaulted to Xine with KDE 4.0 – because Gstreamer was too hard to incorporate with KDE’s needs, even when people tried it who really wanted it and liked GStreamer!

  15. You have to understand that dmix _also_ adds latency. _All_ software mixing does that. In fact, internally, dmix is essentially a sound server. It just hides it from you through an ALSA plugin, not too different from alsa-plugins-pulseaudio if you think of it. And no, xine-lib and GStreamer can’t mix audio from different applications (no library inside apps can do that, only a sound server can do that, be it a hidden one like dmix or a visible one like PA), so unless your sound card supports hardware mixing, you’re out of luck. As for “fixing ALSA”, that’s exactly what dmix tried to do and what alsa-plugins-pulseaudio now tries to do.

    I’ve thought the same as you when I initially read about the plans for PA, but I’ve been convinced that it is really just a better dmix. It doesn’t hide the sound server, but that’s for the better.

    As for the comparison with aRts, you have to look at why aRts got frowned upon:
    * it is KDE-3-specific. Many non-KDE apps have no or broken support for it. Which means that either aRts can output sound or they can. PulseAudio solves this by the ALSA plugin (on top of which you can also run aRts if you have to, and it will no longer monopolize your sound hardware, but hopefully aRts apps will eventually die out with the migration to KDE 4 and Phonon), ESD protocol emulation and native backends for several abstraction libraries (e.g. libao, SDL etc.) and decoding libraries (e.g. xine-lib, GStreamer etc.). It also manages to get a cross-desktop community behind it, not just one desktop. Interest in PA from the KDE community is growing, it’s no longer just a crazy setup Fedora’s KDE SIG is using. ;-)
    * it is quite buggy/unstable. Unfortunately IMHO PA still has work to do on that front as well, but it is not as bad as aRts where attempts to support aRts in non-KDE apps very often crashed the app (which may have been the fault of the aRts client libraries or of whoever wrote the glue code, but it happened in more than one place – one example: https://bugzilla.redhat.com/show_bug.cgi?id=180079 ).
    * nobody was willing to really maintain the code, the original developer had long given up and everyone else was scared of the code. The previous paragraph might have had something to do with it. ;-) All this to the point where KDE upstream no longer processes aRts bugs now. This is not the case of PA, which is being actively developed by Lennart and is getting more and more attention from various communities.

    As for Phonon and xine-lib, the Phonon xine-lib backend is actually the _only_ one to reliably work with PulseAudio in Fedora right now (because of the weird way Phonon-GStreamer does output device selection – I started working on fixing that, I need to finish that work), and this is one of the reasons we’re defaulting to it in F10. (The others: it’s upstream’s default, and the Amarok folks say the GStreamer backend is horribly broken.) That said, if you really want to use GStreamer, you can get it to work with PA (you have to tweak some config file to force it to use the pulsesink as its GStreamer sink, it will only offer devices from the preselected sink, so you can’t set it up through systemsettings), but I recommend against Phonon-GStreamer because of the reports of breakage, the output device selection is just the tip of the iceberg, unfortunately.

    Now it _is_ possible to remove PA in F8, F9 and F10. I don’t know what the plans are for the future though.

  16. The list of existing audio-backends is impressing. Seems the NIH is strong in that area. A pain for those who just like to build up on something and are forced to adopt to the newest collest solution. Guess now I do understand why something like phonon that removes that burden makes a lot of sense.

  17. You mention that for Skype it is just a matter of installing all the compatibility libraries

    That worked for me.. however .. no luck on setting up a test call so far :(

    And also which skype rpm are you using ?

  18. We’re on the same boat, you and I! I recently switched to Slamd64 after some time spent acquainting myself with good ol’ Slackware, and I must confess I’m rather satisfied about it. Had to ditch my X-Fi because I couldn’t be bothered again with the pain that is OSS, so now I got my onboard chip to do all the job for me, works well enough too. I still have some performance issues, but I think they might be related with the alpha/beta state of the 64bit Flash…time will tell.

  19. Kevin, thx for the information about dmix, I wasn’t aware that dmix can also be seen as a sound server. Then I maybe should just relax a little bit more and see how it will evolve – as long as there is dmix to choose anyway.

    Kris, I was able to hear, but not to speak last time I tried. The rpm I used was the default Fedora rpm.

    Mattia – good luck to you, however I wonder why you still kept OSS – ALSA was the way to go for years now!

  20. About pulse audio… You don’t need it, you don’t want it, you need jack – jack provides low (and often zero) latency between audio applications, uses hardly any CPU, can do all the network audio stuff, is rock solid, allows flexible routing of audio sources – sure, its a pro-audio solution but why not use a professional solution? It doesn’t cost anything extra.. So far pulse has been nothing but pain in my experience, there’s no need for it, there’s already a working solution, its called jack. The unfortunate situation is that pulse is just adding confusion and yet another sound system that doesn’t quite work yet. jack works, get jack, it was invented by people who really know what they’re doing.

  21. I have fedora 10 with kde 4.2 on my computer and an on-board 5.1 intel. when I use pulseaudio I can’t control 5.1 volumes that’s why I want to use jack audio system by default. when I run “/usr/bin/jackd -v -R -p128 -dalsa -dhw:0 -r48000 -p2048 -n2 -P -S -o2″ I can play music with xmms, audacious, I can use audacity, see movies with kmplayer, but I can’t see movies with mplayer and hear sound in firefox (flash movies).
    I wrote this in ~/.jack.pa:
    #!/usr/bin/pulseaudio -nF
    #
    load-module module-jack-sink
    load-module module-jack-source

    load-module module-native-protocol-unix
    load-module module-volume-restore
    load-module module-default-device-restore
    load-module module-rescue-streams
    load-module module-suspend-on-idle
    .ifexists module-gconf.so
    .nofail
    load-module module-gconf
    .fail
    .endif
    .ifexists module-x11-publish.so
    .nofail
    load-module module-x11-publish
    .fail
    .endif

    and I made it start by default at kde start.
    Still I can’t hear anything in flash movies (youtube and such).

    what can I do?
    thanks in advance!

Comments are closed.