Skip to contentSkip to conversation

TODO list

DISCUSSION James Courtier-Dutton 4 participants 10 messages May 25, 2006 – Jul 1, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

I was wondering what the current TODO list is for ALSA. The current one in alsa-driver hg seems somewhat out of date.
My list has the following, in no particular order:
1) Finish reverse engineering some sound cards (e.g. Creative EMU1212M)
2) Implement needed features on some already reverse engineered cards. e.g. The Creative Audigy PCMCIA.
3) Add dB gain architecture.
4) Improve dmix, specifically for 44.1 kHz and games like Doom3. Perhaps using the system clock, adjusted to match the sound card hardware clock, to provide accurate sample timing, at multiple different sample rates, irrespective of the rate the sound card runs at.
5) Perhaps use the system clock to help resample so that user space sees a single sample rate clock, but let alsa-lib automatically adjust for the different clocks of different sound cards.
6) Think of some way to simplify the mixer interface for user space mixers. Surely, it does not have to be so complex as it currently is?
7) Provide better OSS emulation support. E.g. redirect all access to /dev/dsp into user space so it can use all the features of alsa-lib without needing aoss. (aoss does not work if the application uses dynamically linked audio driver plugins.

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#1 lore raw
Quoted 5 lines · James Courtier-Dutton

7) Provide better OSS emulation support. E.g. redirect all access to /dev/dsp into user space so it can use all the features of alsa-lib without needing aoss. (aoss does not work if the application uses dynamically linked audio driver plugins.

What mechanisms does the kernel provide that could help with this?

Lee

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#2 lore raw
In reply to James Courtier-Dutton

At Thu, 25 May 2006 19:10:30 +0100,

Quoted 5 lines · James Courtier-Dutton

Hi,

I was wondering what the current TODO list is for ALSA. The current one in alsa-driver hg seems somewhat out of date.

Yep. Some documents in alsa-driver tree are obsoleted. Perhaps better to remove them.

Quoted 6 lines

My list has the following, in no particular order:
1) Finish reverse engineering some sound cards (e.g. Creative EMU1212M)
2) Implement needed features on some already reverse engineered cards. e.g. The Creative Audigy PCMCIA.
3) Add dB gain architecture.
4) Improve dmix, specifically for 44.1 kHz and games like Doom3.

Actually, it's not dmix but rate plugin that causes more problems...

Quoted 5 lines

Perhaps
using the system clock, adjusted to match the sound card hardware clock, to provide accurate sample timing, at multiple different sample rates, irrespective of the rate the sound card runs at.
5) Perhaps use the system clock to help resample so that user space sees

Quoted 8 lines

a single sample rate clock, but let alsa-lib automatically adjust for the different clocks of different sound cards.
6) Think of some way to simplify the mixer interface for user space mixers. Surely, it does not have to be so complex as it currently is?
7) Provide better OSS emulation support. E.g. redirect all access to /dev/dsp into user space so it can use all the features of alsa-lib without needing aoss. (aoss does not work if the application uses dynamically linked audio driver plugins.

A dummy kernel driver just to translate syscalls to communication with a user daemon is the only possible workaround, IMO. This idea was denied once quite ago, but I don't see any other good way right now.

My additional wishes are:

8) Improve release engineering.

9) Better organized Web pages and BTS.

10) Build standard test suite and diagnosis tools.

Takashi

#3 lore raw
Quoted 10 lines · Takashi Iwai
Quoted 5 lines

7) Provide better OSS emulation support. E.g. redirect all access to /dev/dsp into user space so it can use all the features of alsa-lib without needing aoss. (aoss does not work if the application uses dynamically linked audio driver plugins.

A dummy kernel driver just to translate syscalls to communication with a user daemon is the only possible workaround, IMO. This idea was denied once quite ago, but I don't see any other good way right now.

That is my thought as well. When I looked into the idea some time ago, I concluded that is would be a rather large project, so I did not proceed as I have other more important (for me) ALSA features.
Can a user space daemon create /dev files, so that the application calls never actually reach kernel space?
If we can create such a pipe, that can forward open/close/read/write/ioctl, that should be enough. We then have to think about shared memory to look like DMA space to the application using us.

Quoted 10 lines

My additional wishes are:

8) Improve release engineering.

9) Better organized Web pages and BTS.

10) Build standard test suite and diagnosis tools.

The words "Under staffed" comes to mind. :-)

Quoted 2 lines

Takashi

James

#4 lore raw

At Fri, 26 May 2006 12:29:11 +0100,

Quoted 12 lines · James Courtier-Dutton
Quoted 10 lines · Takashi Iwai
Quoted 5 lines

7) Provide better OSS emulation support. E.g. redirect all access to /dev/dsp into user space so it can use all the features of alsa-lib without needing aoss. (aoss does not work if the application uses dynamically linked audio driver plugins.

A dummy kernel driver just to translate syscalls to communication with a user daemon is the only possible workaround, IMO. This idea was denied once quite ago, but I don't see any other good way right now.

Quoted 5 lines

That is my thought as well. When I looked into the idea some time ago, I concluded that is would be a rather large project, so I did not proceed as I have other more important (for me) ALSA features.
Can a user space daemon create /dev files, so that the application calls never actually reach kernel space?

No, only the kernel driver can handle certain syscalls like ioctl and mmap properly. So, it must be a kernel driver that communicated with OSS apps (unless using LD_PRELOAD hack).

The driver interprets each syscall to a certain protocol communicated with a dedicated daemon, and the daemon interprets it again to the real ALSA access.

Quoted 4 lines

If we can create such a pipe, that can forward open/close/read/write/ioctl, that should be enough. We then have to think about shared memory to look like DMA space to the application using us.

mmap would be still tricky, maybe a kind of emulation via read/write.

Takashi

#5 lore raw
Quoted 38 lines · Takashi Iwai

At Fri, 26 May 2006 12:29:11 +0100,

Quoted 13 lines · James Courtier-Dutton
Quoted 11 lines · Takashi Iwai
Quoted 6 lines

7) Provide better OSS emulation support. E.g. redirect all access to /dev/dsp into user space so it can use all the features of alsa-lib without needing aoss. (aoss does not work if the application uses dynamically linked audio driver plugins.

A dummy kernel driver just to translate syscalls to communication with a user daemon is the only possible workaround, IMO. This idea was denied once quite ago, but I don't see any other good way right now.

Quoted 6 lines

That is my thought as well. When I looked into the idea some time ago, I concluded that is would be a rather large project, so I did not proceed as I have other more important (for me) ALSA features.
Can a user space daemon create /dev files, so that the application calls never actually reach kernel space?

No, only the kernel driver can handle certain syscalls like ioctl and mmap properly. So, it must be a kernel driver that communicated with OSS apps (unless using LD_PRELOAD hack).

The driver interprets each syscall to a certain protocol communicated with a dedicated daemon, and the daemon interprets it again to the real ALSA access.

Quoted 5 lines

If we can create such a pipe, that can forward open/close/read/write/ioctl, that should be enough. We then have to think about shared memory to look like DMA space to the application using us.

Quoted 5 lines

mmap would be still tricky, maybe a kind of emulation via read/write.

Takashi

For mmap, all that happens is that the application asks for a mmap address from the kernel.
If we could get the kernel to manipulate shared memory, so that the mmap address given to the application is shared with the daemon, surely that would work.
Unfortunately, this might require some kernel memory manager modifications. Shall I ask about this on the kernel mm list?

James

#6 lore raw

At Fri, 26 May 2006 17:33:39 +0100,

Quoted 43 lines · James Courtier-Dutton
Quoted 41 lines · Takashi Iwai

At Fri, 26 May 2006 12:29:11 +0100,

Quoted 13 lines · James Courtier-Dutton
Quoted 11 lines · Takashi Iwai
Quoted 6 lines

7) Provide better OSS emulation support. E.g. redirect all access to /dev/dsp into user space so it can use all the features of alsa-lib without needing aoss. (aoss does not work if the application uses dynamically linked audio driver plugins.

A dummy kernel driver just to translate syscalls to communication with a user daemon is the only possible workaround, IMO. This idea was denied once quite ago, but I don't see any other good way right now.

Quoted 6 lines

That is my thought as well. When I looked into the idea some time ago, I concluded that is would be a rather large project, so I did not proceed as I have other more important (for me) ALSA features.
Can a user space daemon create /dev files, so that the application calls never actually reach kernel space?

No, only the kernel driver can handle certain syscalls like ioctl and mmap properly. So, it must be a kernel driver that communicated with OSS apps (unless using LD_PRELOAD hack).

The driver interprets each syscall to a certain protocol communicated with a dedicated daemon, and the daemon interprets it again to the real ALSA access.

Quoted 5 lines

If we can create such a pipe, that can forward open/close/read/write/ioctl, that should be enough. We then have to think about shared memory to look like DMA space to the application using us.

mmap would be still tricky, maybe a kind of emulation via read/write.

Quoted 8 lines
Quoted 2 lines

Takashi

For mmap, all that happens is that the application asks for a mmap address from the kernel.
If we could get the kernel to manipulate shared memory, so that the mmap address given to the application is shared with the daemon, surely that would work.

The sharing of memory between the app and the daemon is easy via a simple mmap invoked from both sides. But, sharing the mmapped buffer from a sound driver between the daemon and the app over yet another driver is a tough problem, because the buffer is strictly bound to the sound card hardware.

Quoted 2 lines

Unfortunately, this might require some kernel memory manager modifications. Shall I ask about this on the kernel mm list?

I don't think it's worthy at this stage at all.
We need to consider first the basic design more deeply. For example, even if we get the mmapped buffer, it's not enough for the whole operation, especially when the period/buffer size doesn't match with whta OSS requires.

Takashi

#7 lore raw
Quoted 14 lines · Takashi Iwai
Quoted 6 lines

For mmap, all that happens is that the application asks for a mmap address from the kernel.
If we could get the kernel to manipulate shared memory, so that the mmap address given to the application is shared with the daemon, surely that would work.

The sharing of memory between the app and the daemon is easy via a simple mmap invoked from both sides. But, sharing the mmapped buffer from a sound driver between the daemon and the app over yet another driver is a tough problem, because the buffer is strictly bound to the sound card hardware.

Quoted 8 lines

We need to consider first the basic design more deeply. For example, even if we get the mmapped buffer, it's not enough for the whole operation, especially when the period/buffer size doesn't match with whta OSS requires.

Takashi

I was thinking more along the lines of User App -> OSS kernel shim -> userland daemon buffer, one buffer per user app -> alsa-lib. So, the mmap would not be a real mmap, it would be a simple matter of tricking the User app into thinking it is mmapped. It would be a double buffer really.
So, the daemon buffer would just be whatever size the OSS user app wanted, and the daemon would then pass it's contents to alsa-lib or jackd as and when needed.
All this would probably only be possible if some high res timer source (e.g. the system timer) was used to trigger the period boundaries. I think I mentioned that idea some time ago. Maybe we should just aim for that TODO item to help dmix work better at 44100Hz, and then worry about the OSS kernel shim after that.
Maybe by that time....OSS would have disappeared! :-)

James

#8 lore raw

At Fri, 26 May 2006 18:30:36 +0100,

Quoted 22 lines · James Courtier-Dutton
Quoted 20 lines · Takashi Iwai
Quoted 6 lines

For mmap, all that happens is that the application asks for a mmap address from the kernel.
If we could get the kernel to manipulate shared memory, so that the mmap address given to the application is shared with the daemon, surely that would work.

The sharing of memory between the app and the daemon is easy via a simple mmap invoked from both sides. But, sharing the mmapped buffer from a sound driver between the daemon and the app over yet another driver is a tough problem, because the buffer is strictly bound to the sound card hardware.

We need to consider first the basic design more deeply. For example, even if we get the mmapped buffer, it's not enough for the whole operation, especially when the period/buffer size doesn't match with whta OSS requires.

Quoted 8 lines
Quoted 2 lines

Takashi

I was thinking more along the lines of User App -> OSS kernel shim -> userland daemon buffer, one buffer per user app -> alsa-lib. So, the mmap would not be a real mmap, it would be a simple matter of tricking the User app into thinking it is mmapped. It would be a double buffer really.

Then it's as same as what I thought. This implementation is pretty easy. Let both side call mmap just like POSIX shm does.

Takashi

#9 lore raw
In reply to James Courtier-Dutton

Hah, finally found the thread. I knew there was something like this lingering about.

Quoted 5 lines

I was thinking more along the lines of User App -> OSS kernel shim -> userland daemon buffer, one buffer per user app -> alsa-lib. So, the mmap would not be a real mmap, it would be a simple matter of tricking the User app into thinking it is mmapped. It would be a double buffer really.

Quoted 8 lines

So, the daemon buffer would just be whatever size the OSS user app wanted, and the daemon would then pass it's contents to alsa-lib or jackd as and when needed.
All this would probably only be possible if some high res timer source (e.g. the system timer) was used to trigger the period boundaries. I think I mentioned that idea some time ago. Maybe we should just aim for that TODO item to help dmix work better at 44100Hz, and then worry about the OSS kernel shim after that.

I wonder if the kernel 'shim' should really be tied to OSS. I see another application for this: bluetooth audio. Currently, there's a kernel plugin that as far as I can tell doesn't do much more than exactly this, push data it received from one side to the other side, the actual communication is done in userspace. If we had a generic 'sound driver' below alsa that could create any card with any mixer (compare to the uinput layer!) then we could do *all* of that in userspace with standard means.

And for the OSS emulation it'd just mean re-using that existing interface and the existing oss emulation code (which moves and is changed to only apply over virtual devices), and putting all the tricky stuff into the oss daemon.

johannes

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel