Skip to contentSkip to conversation

User land drivers.

DISCUSSION James Courtier-Dutton 5 participants 9 messages Aug 31, 2004 – Sep 3, 2004

lore
Share & tools
lore
#0 lore raw

I have found that there are a number of different possible sound devices, where creating a user land driver would be beneficial to using a kernel module. E.g. Bluetooth, Firewire etc.

Currently, we have:
user app(user)

    |
    V
alsa-lib(user)
    |
    V
alsa-driver(kernel)
    |
    V

hardware(kernel).

Bluetooth would prefer:
user app(user)

    |
    V
alsa-lib(user)
    |
    V
alsa-bluetooth-headset-profile(user)
    |
    V
bluetooth-driver(kernel)
    |
    V

hardware(kernel).

Would it be possible to have userland processes creating /dev/ files ? Alternatively, could we provide a new plugin method, so we can add userland PCMs, Mixer, etc.

Any ideas?

James

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#1 lore raw

At Tue, 31 Aug 2004 11:45:02 +0100,

Quoted 31 lines · James Courtier-Dutton

I have found that there are a number of different possible sound devices, where creating a user land driver would be beneficial to using a kernel module.
E.g. Bluetooth, Firewire etc.

Currently, we have:
user app(user)

     |
     V
alsa-lib(user)
     |
     V
alsa-driver(kernel)
     |
     V

hardware(kernel).

Bluetooth would prefer:
user app(user)

     |
     V
alsa-lib(user)
     |
     V
alsa-bluetooth-headset-profile(user)
     |
     V
bluetooth-driver(kernel)
     |
     V
Quoted 4 lines

hardware(kernel).

Would it be possible to have userland processes creating /dev/ files ?

Why do you need to *create* /dev?
When you access through alsa-lib, you don't need a device file.

Quoted 2 lines

Alternatively, could we provide a new plugin method, so we can add userland PCMs, Mixer, etc.

Exactly.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#2 lore raw
In reply to James Courtier-Dutton
Quoted 5 lines · On Tue, 31 Aug 2004 11:45:02 +0100 James Courtier-Dutton…

Would it be possible to have userland processes creating /dev/ files ? Alternatively, could we provide a new plugin method, so we can add userland PCMs, Mixer, etc.

Any ideas?

have a look for userspace file systems. I suppose many of the techniques can be adopted to this..

http://www.circlemud.org/~jelson/software/fusd/

for example

flo

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#3 lore raw
In reply to James Courtier-Dutton
Quoted 1 line · James Courtier-Dutton

Would it be possible to have userland processes creating /dev/ files ?

It's not necessary for the ALSA case.

Quoted 2 lines

Alternatively, could we provide a new plugin method, so we can add userland PCMs, Mixer, etc.

Yes, a new PCM i/o plugin in alsa-lib is sufficient. For mixer, we need to create an additional layer.

Actually, I'm thinking to design a loopback soundcard in kernel in conjunction with a daemon with these targets:

1) creating "virtual" hardware (PCMs, mixers, RawMIDI ports etc.)
2) redirect OSS emulation from the kernel space back to user space
3) redirect ALSA devices back to user space

Jaroslav

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

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#4 lore raw

At Fri, 3 Sep 2004 16:08:17 +0200 (CEST),

Quoted 13 lines · Jaroslav
Quoted 1 line · James Courtier-Dutton

Would it be possible to have userland processes creating /dev/ files ?

It's not necessary for the ALSA case.

Quoted 2 lines

Alternatively, could we provide a new plugin method, so we can add userland PCMs, Mixer, etc.

Yes, a new PCM i/o plugin in alsa-lib is sufficient. For mixer, we need to create an additional layer.

Quoted 6 lines

Actually, I'm thinking to design a loopback soundcard in kernel in conjunction with a daemon with these targets:

1) creating "virtual" hardware (PCMs, mixers, RawMIDI ports etc.)
2) redirect OSS emulation from the kernel space back to user space
3) redirect ALSA devices back to user space

Yes, I believe this will make it easier to develop the "hybrid" architecture like this case.

Also, we may provide a more easy-to-use interface for additional ALSA pcm plugins. The current design of plugin is bound too tightly to the ALSA lowlevel structure, and it's a pain to implement all on that at each time.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#5 lore raw
Quoted 4 lines · Takashi Iwai

Also, we may provide a more easy-to-use interface for additional ALSA pcm plugins. The current design of plugin is bound too tightly to the ALSA lowlevel structure, and it's a pain to implement all on that at each time.

I think that we should follow the kernel space here - create only helper functions which might be used in the user space driver design.

Jaroslav

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

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#6 lore raw
Quoted 9 lines · Jaroslav Kysela
Quoted 4 lines · Takashi Iwai

Also, we may provide a more easy-to-use interface for additional ALSA pcm plugins. The current design of plugin is bound too tightly to the ALSA lowlevel structure, and it's a pain to implement all on that at each time.

Quoted 4 lines

I think that we should follow the kernel space here - create only helper functions which might be used in the user space driver design.

Jaroslav

Currently, to support a new sound card in ALSA, we just write a small bit of code to talk to the hardware, and other alsa kernel modules provide all the helper functions(period_elapsed etc.), so for a user land driver(bluetooth), these helper functions should be in alsa-lib.

You mention the PCM plugin. I did not know there was already a PCM plugin api that could be used to talk to some other user land program. I just thought the PCM plugins were for sample rate conversion and simple stuff like that.

I might have to look at the docs again.

James

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#7 lore raw
Quoted 4 lines · James Courtier-Dutton

Currently, to support a new sound card in ALSA, we just write a small bit of code to talk to the hardware, and other alsa kernel modules provide all the helper functions(period_elapsed etc.), so for a user land driver(bluetooth), these helper functions should be in alsa-lib.

Exactly.

Quoted 4 lines

You mention the PCM plugin. I did not know there was already a PCM plugin api that could be used to talk to some other user land program. I just thought the PCM plugins were for sample rate conversion and simple stuff like that.

No, unfortunately, the PCM plugin interface is completely hidden inside alsa-lib. But we can add some plugins like ladspa/meter/jack plugin which can connect to other external code.

Jaroslav

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

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

#8 lore raw
In reply to Jaroslav Kysela
Quoted 5 lines · Jaroslav Kysela

Actually, I'm thinking to design a loopback soundcard in kernel in conjunction with a daemon with these targets:

1) creating "virtual" hardware (PCMs, mixers, RawMIDI ports etc.)
2) redirect OSS emulation from the kernel space back to user space
3) redirect ALSA devices back to user space

I think this is a great idea!

- D

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click