alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Troubles using the external SDK
       [not found] <mailman.5292.1266501879.2074.alsa-devel@alsa-project.org>
@ 2010-02-18 22:44 ` Hans-Kristian Arntzen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans-Kristian Arntzen @ 2010-02-18 22:44 UTC (permalink / raw)
  To: alsa-devel

I am trying to make an alsa output plugin that streams the audio over 
network (something like esd, just even more simplistic) using the 
external SDK, however, I am having trouble implementing some things 
correctly it seems, and the docs weren't descriptive enough.

So far, it works quite well with music playback that doesn't really care 
about audio blocking, etc. The main problem is audio sync and blocking 
with more complex applications like MPlayer. As far as I can see in the 
MPlayer source, to retain audio sync, it uses

     snd_pcm_delay() for delay, and
     snd_pcm_status_get_avail() to figure out how much it can write 
without audio blocking.

This is fine, but how can snd_pcm_status_get_avail() get the data it 
needs from the plugins? It doesn't seem to call on any callbacks to do this.
It seems so far that snd_pcm_status_get_avail() always returns 
buffer_size, since I seem to get working audio, but the video starts to 
stutter. The stuttering goes away when I force a really small maximum 
buffer size (we're talking 512-ish bytes), but this is really, really 
bad, and doesn't work
too well on my netbook (performance/timing issues I guess). Is it 
possible to define a snd_pcm_status_get_avail() callback in the SDK in 
some way?

Anyways. I want to know how you'd do this. The OSS driver for example 
doesn't even seem to define a delay() callback, which strikes me as odd.
How can it know about the delay?

Also, I want to know the reasoning behind the pointer() function. It 
seems to be called all the time. I don't know what it really does, and 
what good it does. Is it supposed to represent where in the buffer we 
are? As in, it's supposed to stay somewhere between 0 and buffer_size? 
If so, my experience with it doesn't make sense at all. If I return that 
actual value, the programs simply stop up and loop endlessly over the 
pointer() function. The temporary "hack" (as in probably very wrong) was 
to return the total amount of data that's been sent since the start. Can 
anyone help a frustrated programmer? :P

  -- Themaister

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Troubles using the external SDK
@ 2010-02-25  0:27 Raymond Yau
  0 siblings, 0 replies; 2+ messages in thread
From: Raymond Yau @ 2010-02-25  0:27 UTC (permalink / raw)
  To: alsa-devel

>> Anyways. I want to know how you'd do this.
>> The OSS driver for example doesn't even seem to define a delay()
callback,
>> which strikes me as odd.How can it know about the delay?

http://git.alsa-project.org/?p=alsa-plugins.git;a=blob_plain;f=doc/README-pcm-oss

This plugin converts the ALSA API over OSS API.  With this plugin,
ALSA native apps can run on OSS drivers.

The function supported by this plugin is limited.  For example, you
cannot use dmix together with this plugin.  Don't expect too much :)



Please note that this plugin require a real OSS driver , not ALSA oss
kernel emulation

e.g. you can use this oss plugin to use the aureal binary driver
http://aureal.sourceforge.net/ [^ <http://aureal.sourceforge.net/>] on
Fedore Core 1 when alsa au88x0 driver was not written

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-25  0:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5292.1266501879.2074.alsa-devel@alsa-project.org>
2010-02-18 22:44 ` Troubles using the external SDK Hans-Kristian Arntzen
2010-02-25  0:27 Raymond Yau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).