make some sound concepts clear

[17:12] <raywang> juhovh: i have a question
[17:13] <raywang> juhovh: what’s the relationship between gsteamer and pulseaudio?
[17:13] <juhovh> there’s no relationship as far as I know
[17:13] <juhovh> except that gstreamer has a pulseaudio output plugin
[17:14] <juhovh> if I could just make any sense out of gstreamer APIs I would probably rewrite their ASF parser
[17:14] <raywang> juhovh: there are too much audio related softwares, PulseAudio, Esound, Gstreamer, Xine. I can’t figure out their relationship
[17:15] <juhovh> pulseaudio is an esound replacement
[17:15] <juhovh> it works between the kernel audio interface and applications
[17:15] <juhovh> gstreamer and xine are both libraries for demuxing/decoding/mixing etc. audio and video streams
[17:16] <juhovh> they can output directly to the kernel interfaces (ALSA, OSS) or to pulseaudio, esd, jack etc
[17:16] <juhovh> the benefit of having something like pulseaudio in the middle is more control
[17:16] <juhovh> and you can for example stream all output over network to another pulseaudio daemon
[17:16] <juhovh> direct output to the kernel doesn’t make that possible
[17:17] <juhovh> then there’s the horrible thing of ALSA that in addition to kernel API includes a userspace library to make accessing it more simple
[17:17] <juhovh> but I don’t like ALSA that much
[17:17] <juhovh> alsa and oss mainly work inside the kernel
[17:17] <juhovh> and provide a consistent api that will work with all sound cards
[17:17] <juhovh> otherwise you would have to write drivers for each sound card separately
[17:17] <juhovh> like in the DOS days
[17:18] <juhovh> I’m xmms2 developer myself, so I haven’t done that much with the gstreamer and xine and stuff except read their code
[17:19] <raywang> juhovh: could i sum up it as "alsa and oss are kernel audio APIs, and PulseAudio and Esound coordinate with them and Gsteamer and Xine?"
[17:20] <juhovh> yeah, alsa and oss are kernel audio APIs, pulseaudio and esound are userspace audio daemons, gstreamer and xine are audio/video players/recorders/whatever
[17:20] <juhovh> and they have a graphical frontend that is usually separate
[17:22] <raywang> juhovh: what’s the sound server in nowadays, is it essential in a distro?
[17:23] <juhovh> sound server is exactly the daemons like pulseaudio
[17:23] <juhovh> it’s not essential, but can make things easier
[17:25] <raywang> juhovh: so the sound server don’t need to start until to make thing easied?
[17:25] <juhovh> raywang: for example some sound cards (many cheap ones) only accept one audio stream, so you can only use one application that outputs sound at the same time
[17:26] <juhovh> raywang: there are some workarounds for this in alsa, but the easiest way is to set up a sound server and make all applications output audio into it
[17:26] <juhovh> and it will do the mixing and forward the sound to alsa
[17:40] <raywang> juhovh: the applications could talk to kernel diectly thought alsa or oss, but lack some features?
[17:40] <juhovh> they don’t really lack features
[17:41] <juhovh> but the goal of drivers in kernel spaces is to be as minimal as possible
[17:41] <juhovh> to keep the kernel maintainable
[17:41] <juhovh> so there’s just more things you can do in userspace
[17:41] <juhovh> OSS4 is quite interesting audio API, but that’s not in kernel, at least not yet
[17:41] <juhovh> I would kind of like to see a move from ALSA back to OSS…
[17:42] <juhovh> bad experience from alsa config files
[17:42] <raywang> juhovh: ah alsa and oss behave as a abstract layer?
[17:43] <juhovh> that’s what kernel APIs do :p
[17:43] <juhovh> abstract the hardware from vendor specific details
[17:43] <juhovh> but added functionality should be in user space
[17:44] <raywang> understand
[17:44] <raywang> juhovh: nowadays, oss was replaced by alsa, and esound was replaced by PulseAudio?
[17:44] <juhovh> brings us to the microkernel discussion :p
[17:44] <juhovh> yeah
[17:44] <juhovh> and the new OSS (OSS4) was a proprietary sound driver system
[17:44] <juhovh> but they recently released it as GPL
[17:44] <raywang> cool
[17:45] <juhovh> and from what I know it seems better than ALSA
[17:45] <juhovh> no one just wants to make another big change
[17:45] <juhovh> when the OSS->ALSA switch was just finished :p
[17:45] <raywang> yeah
[17:45] <juhovh> and the whole reason for OSS4 to become GPLed was that ALSA developers started promoting making ALSA-only applications
[17:46] <juhovh> the business idea of OSS4 was to make all Linux sound applications work on other *nix systems like Solaris, AIX etc.
[17:46] <juhovh> but if Linux applications are ALSA-only they will be obsolete
[17:46] <juhovh> bad for business
[17:47] <raywang> alsa mean advanced linux sound architeture, that’s why alsa will dominate the Linux market. lol
[17:47] <juhovh> so by GPL release they’re trying bringing up-to-date OSS system and try to keep applications supporting OSS
[17:47] <juhovh> yeah, the old OSS in Linux (FreeOSS) was outdated
[17:47] <juhovh> therefore compared to that ALSA is advanced
[17:48] <juhovh> but the proprietary OSS was developed internally and has pretty much comparable features
[17:48] <raywang> juhovh: so you must be a kernel hacker. 🙂
[17:48] <juhovh> no, I’m not really
[17:48] <juhovh> I like my kernel to just work
[17:49] <juhovh> other people are paid to do that :p
[17:49] <raywang> juhovh: I was wondering why there is not any sound server appear when i type "ps ax", now i have a sense of it. , thanks you 🙂
[17:50] <raywang> juhovh: you open my mind, and make me clear of that.
[17:51] <raywang> that’s the top issue confused me a lot. 😀
[17:51] <juhovh> for me there is
[17:51] <juhovh> 7049 ?        Sl     0:15 /usr/bin/pulseaudio –log-target=syslog
[17:52] <juhovh> but I’m running pretty plain ubuntu these days
[17:52] <raywang> there is not any in my opensuse
[17:52] <juhovh> then it probably uses alsa
[17:52] <juhovh> with correct configuration one doesn’t need a sound server
[17:53] <raywang> juhovh: do you mean my application talk to kernel directlly without a sound server?
[17:53] <juhovh> yeah, although in case of ALSA probably through libalsa :p
[17:54] <juhovh> to make things more complicated
[17:54] <juhovh> but libalsa doesn’t count as a sound server, because it’s just loaded to the application
[17:54] <raywang> make sense!
[17:56] <raywang> juhovh: anything else to add or explain? do you mind i post what we talk in my blog, i hope i could save those important words. 🙂
[17:57] <juhovh> I just remembered this
[17:57] <juhovh> it somewhat lists all the libraries and stuff in linux :p
[17:57] <juhovh> but skips stuff like pulseaudio
[17:57] <juhovh> and is somewhat biased
[17:57] <juhovh> so should be taken with a grain of salt :p
[17:58] <raywang> grain of salt? it’s a slang, i don’t understand 😛
[17:59] <juhovh>
[17:59] <juhovh> wikipedia to the resque 🙂
[17:59] <raywang> haha , thank you
[18:00] <raywang> juhovh: so do you mind i post what we talk in my blog? 🙂
[18:00] <juhovh> it will be embarrassing if I made some mistakes :p
[18:01] <juhovh> but you can
[18:01] <raywang> hehe, thank you 😀

This entry was posted in GNU/Linux and tagged . Bookmark the permalink.

Leave a Reply

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