Skip to contentSkip to conversation

AD1985 full-duplex(?)

Alsa-user Adam Tlałka 4 participants 5 messages Sep 28, 2004 – Sep 29, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

you're simply wrong about this. if an interrupt is blocked for longer than the buffer size, GETOPTR can't help you.

It depends of kernel driver behaviour. If it could not detect this situaction then of course no. But this is easy to detect just by monitoring actual system time and amount of data send to/received from device. We know what should be the proper value. Anyway if this situaction occurs how ALSA driver detects it?
hw_ptr is not moved and appl_ptr too so how ALSA is doing that?

Quoted 7 lines

thats my whole point. the facilities offered by OSS to track this stuff all presuppose that this kind of disaster can't happen, but it *does* happen. ALSA obviously cannot do any better in that situation, but it has an infrastructure in place that doesn't make the assumption that things just work. It would be easy to get ALSA to indicate an xrun in the above situation; it would be quite hard to get OSS to do so.

So ALSA is not any better in that situaction ;-(. Talking about OSS
if we modify the driver so it detects hardware xruns it can report them
in a same manner as software ones. For example GETOPTR bytes value should return count of bytes which would be processed by a device if there was no xrun. hw_ptr will be unchanged. So we can correct our sample position because we know the delay and the hw_ptr. I think that the problem is not in the API but in the kernel driver.
It should detect this situaction - both ALSA and OSS driver.

Quoted 9 lines

anyway, we're way off topic here. the essential issue is that you want an API that allows for large buffers but also lets you overwrite stuff you have written in the past, in order to offer the illusion of low latency without impacting CPU load too much. by contrast, the pro-audio/music world wants small buffer sizes to reduce latency because we do everything in real time. the consumer audio world wants virtual devices with various specific capabilities that hide the complexity of the underlying hardware. the kernel developers don't want emulators, sample rate converters and so on in the kernel.

Yes and almost all of this problems could be solved by mixing this kernel/userspace approach. A kernel module emulating /dev access and ioctl's communicating with RT daemon which is doing real job and contacting with physical device.

/dev access is needed for compability and access granting (chmod and ACL's) and also simple cat file.wav > /dev/dsp possibilities, OSS apps also need that

more sophisticated apps can talk directly to the daemon and through it to the hw device

Quoted 6 lines

in the windows world, the two outlined goals are viewed as orthogonal, and nobody uses the same audio driver API to achieve them. that maybe changing with WDM, but at least until recently, the pro-audio world focused on ASIO which no games use; games used directX, which almost no audio apps did.

Linux is not only for pro-audio world I think. And placeing something in kernel (ALSA drivers I mean) should not break existing normal apps.

Quoted 3 lines

and anyway, i am not really sure what you want. ALSA lets you do what you want but at the cost of having to make a few more function calls to cover the handling of virtual devices. you don't like the cost,

current ALSA could not meet my requirements because of swapping/scheduling effects which makes distorted sound in normal non RT apps. Doing just a few more calls doesn't help in this case ;-[.

Quoted 3 lines

you'd rather move the cost so that its in the
kernel or a library rather than be in your code. that's the best i can understand so far.

Yes - that's the point. Common operations like format changeing, resampling, remixing and additional effects should be done
in one place not in every app by itself.
I want to have possibility of doing cat file.wav > /dev/dsp
and play it with 5.1 or 2 speakers or with headphones with special stereo effects applied just by one click or keypress on special mixer app on the fly without restarting anything and fiddling with config files and program execution arguments. Current ALSA design is not user friendly and rather not meets these end user requirements. May be it should be only for audio profs?

Regards

Signature · 11 lines
Adam Tla/lka      mailto:[email protected]    ^v^ ^v^ ^v^
System  & Network Administration Group           ~~~~~~
Computer Center,  Gdansk University of Technology, Poland
PGP public key:   finger [email protected]


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
#2 lore raw
Quoted 2 lines · Adam Tlałka

And placeing something in kernel (ALSA drivers I mean) should not break existing normal apps.

We don't break normal apps. You're referring mostly to commercial product (OSS/Unix). The OSS code in Linux kernel does not offer functionality you requested, too.

Quoted 7 lines

I want to have possibility of doing cat file.wav > /dev/dsp and play it with 5.1 or 2 speakers or with headphones with special stereo effects applied just by one click or keypress on special mixer app on the fly without restarting anything and fiddling with config files and program execution arguments.
Current ALSA design is not user friendly and rather not meets these end user requirements. May be it should be only for audio profs?

Help us. I have all those ideas in my brain, but they are not implemented due lack of time. Crying - that something is not implemented - will not help us at all.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php

#3 lore raw
In reply to Adam Tlałka
Quoted 3 lines

current ALSA could not meet my requirements because of swapping/scheduling effects which makes distorted sound in normal non RT apps. Doing just a few more calls doesn't help in this case ;-[.

oh c'mon. thats not ALSA. the *kernel* can't meet your requirements. ALSA has nothing to do with it. OSS apps and drivers can't change the way the kernel schedules tasks. the same broken device drivers will coexist with any kernel-side API that you propose. you're mistaking where these issues exist.

Quoted 6 lines
Quoted 3 lines

you'd rather move the cost so that its in the
kernel or a library rather than be in your code. that's the best i can understand so far.

Yes - that's the point. Common operations like format changeing, resampling, remixing and additional effects should be done in one place not in every app by itself.

*** -lasound ****

Quoted 2 lines

I want to have possibility of doing cat file.wav > /dev/dsp and play it with 5.1 or 2 speakers or with headphones with special

and you want this to work with no clicks or pops? and it will, i'm guessing, because you think that /dev/dsp is somehow going to magically know that it should use the maximum size buffer when used with no parameters?

Quoted 2 lines

stereo effects applied just by one click or keypress on special mixer app on the fly without restarting anything and fiddling with config

special mixer app eh? for which audio interface? who wrote it? does it work with my foobar GH8782 audio chipset?

Quoted 3 lines

files and program execution arguments.
Current ALSA design is not user friendly and rather not meets these end user requirements. May be it should be only for audio profs?

ALSA is not particularly friendly for audio profs. its not particularly friendly to *anyone*. but that is a completely different issue than the design of the API.

--p

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php

#4 lore raw

At Tue, 28 Sep 2004 10:57:26 -0400,

Quoted 10 lines · Paul Davis
Quoted 4 lines

current ALSA could not meet my requirements because of swapping/scheduling effects which makes distorted sound in normal non RT apps. Doing just a few more calls doesn't help in this case ;-[.

oh c'mon. thats not ALSA. the *kernel* can't meet your requirements. ALSA has nothing to do with it. OSS apps and drivers can't change the way the kernel schedules tasks. the same broken device drivers will coexist with any kernel-side API that you propose. you're mistaking where these issues exist.

I agree with Paul. It's the kernel issue. For example, with the Con Kolivas's patch, you can choose another scheduler class which works much better in such a situation (it's a kind of safe soft-RT w/o root priv).

However, having a functionality to creata a kernel-thread (with a slightly higher priority) for the large intermediate buffer handling sounds not too difficult. It might be even a good idea - at least, all opererations can be transparent.

This will offer the more stable playback but of course much worse audio control. But it will surely make the life of some people easier :)

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php

#5 lore raw
In reply to Paul Davis
Quoted 5 lines

oh c'mon. thats not ALSA. the *kernel* can't meet your requirements. ALSA has nothing to do with it. OSS apps and drivers can't change the way the kernel schedules tasks. the same broken device drivers will coexist with any kernel-side API that you propose. you're mistaking where these issues exist.

The problem is that we have a new api and same problems as in old OSS api case. So we should improve drivers and their functionality - xrun detection and some additional features without changeing the api. As you said it's not the api problem so why change it?
Broken compability, non working closed source apps or non portable between different operating systems that is the price of api change.
But do we have better functionality? Only a bit and old problems remain.

Quoted 3 lines
Quoted 2 lines

Yes - that's the point. Common operations like format changeing, resampling, remixing and additional effects should be done in one place not in every app by itself.

*** -lasound ****

a program lib functions are working in this program context so without special RT program design we will always end up with bad sound effects.

Quoted 6 lines
Quoted 2 lines

I want to have possibility of doing cat file.wav > /dev/dsp and play it with 5.1 or 2 speakers or with headphones with special

and you want this to work with no clicks or pops? and it will, i'm guessing, because you think that /dev/dsp is somehow going to magically know that it should use the maximum size buffer when used with no parameters?

It is the driver implementation - I think buffer should be large but period as small as possible. Swithing modes will not work without some sound effects but we could mute the sound for the moment. And if done in kernel or RT daemon it should be fast enough. Anyway you are not doing that every second or so.

Quoted 3 lines
Quoted 1 line

stereo effects applied just by one click or keypress on special mixer app on the fly without restarting anything and fiddling with config

special mixer app eh? for which audio interface? who wrote it? does it work with my foobar GH8782 audio chipset?

Probably you should write it or someone who has access to doc and hw device. It should be an extension plugin for the RT audio daemon which provides additional funtionality.

Quoted 3 lines

ALSA is not particularly friendly for audio profs. its not particularly friendly to *anyone*. but that is a completely different issue than the design of the API.

True so we don't need a new one.

Regards

Signature · 11 lines
Adam Tla/lka      mailto:[email protected]    ^v^ ^v^ ^v^
System  & Network Administration Group           ~~~~~~
Computer Center,  Gdansk University of Technology, Poland
PGP public key:   finger [email protected]


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl