schedule obsolete OSS drivers for removal
Subsystems (2)
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to David LangQuoted 3 lines · David Lang
I was under the (apparently mistaken) impression that you couldn't DMA from userspace (something to do with the possibility that the userspace memory pages could be swapped out in the middle of the DMA)
Drivers can choose to support this two different ways. One is to have a buffer of kernel memory mapped into user space and shared with the hardware (this is how OSS did it), the other is to use the 2.6 get_user_pages API to get the physical address of a set of pages and lock them down so they don't wander off during DMA.
Both have advantages for different uses.
Alan
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to John RiggQuoted 3 lines · John Rigg
Yes, but the CPU has plenty of other work to do. The sound cards that would be worst affected by this are the big RME cards (non-interleaved) and multiple ice1712 cards (non-interleaved blocks of interleaved data),
ice1712 uses normal interleaving. There are no "non-interleaved blocks".
Quoted 3 lines
which AFAIK are the only cards capable of handling serious professional audio. This could represent 48 or more channels of 96kHz audio, which doesn't leave a lot of spare CPU capacity for running X, for example.
This is true only if you run the system at full 100% load before the conversions. But in real life you cannot do this anyway. You have to use a CPU that has lot of spare power. Otherwise anything unpredictable will make things to fail.
Best regards,
Hannu
-----
Hannu Savolainen ([email protected])
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages) OH2GLH QTH: Karkkila, Finland LOC: KP20CM
Re: Re: [OT] ALSA userspace API complexity
In reply to John RiggQuoted 3 lines · John Rigg
Yes, but the CPU has plenty of other work to do. The sound cards that would be worst affected by this are the big RME cards (non-interleaved) and multiple ice1712 cards (non-interleaved blocks of interleaved data),
ice1712 uses normal interleaving. There are no "non-interleaved blocks".
Quoted 3 lines
which AFAIK are the only cards capable of handling serious professional audio. This could represent 48 or more channels of 96kHz audio, which doesn't leave a lot of spare CPU capacity for running X, for example.
This is true only if you run the system at full 100% load before the conversions. But in real life you cannot do this anyway. You have to use a CPU that has lot of spare power. Otherwise anything unpredictable will make things to fail.
Best regards,
Hannu
-----
Hannu Savolainen ([email protected])
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages) OH2GLH QTH: Karkkila, Finland LOC: KP20CM
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Re: Re: [OT] ALSA userspace API complexity
In reply to John RiggQuoted 7 lines · John Rigg
Quoted 2 lines · David Lang
does the CPU touch the data for these, or do you DMA directly from userspace (i.e. "zero-copy")?
The cards I mentioned use DMA. RME actually advertises that some of their cards can handle 52 channels with zero CPU load. Their onboard DSPs can also do routing and mixing, again without touching the CPU.
Of course I should also mention that the sound cards deal with PCM audio samples in integer format, but audio apps like jackd and its clients use floating point, so in practice the CPU is still processing audio data much of the time.
John
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to John RiggQuoted 7 lines · John Rigg
Quoted 2 lines · David Lang
does the CPU touch the data for these, or do you DMA directly from userspace (i.e. "zero-copy")?
The cards I mentioned use DMA. RME actually advertises that some of their cards can handle 52 channels with zero CPU load. Their onboard DSPs can also do routing and mixing, again without touching the CPU.
Of course I should also mention that the sound cards deal with PCM audio samples in integer format, but audio apps like jackd and its clients use floating point, so in practice the CPU is still processing audio data much of the time.
John
Re: Re: [OT] ALSA userspace API complexity
In reply to David LangQuoted 5 lines · David Lang
Quoted 3 lines · John Rigg
Quoted 2 lines
does the CPU touch the data for these, or do you DMA directly from userspace (i.e. "zero-copy")?
Quoted 7 lines
Quoted 3 lines
The cards I mentioned use DMA. RME actually advertises that some of their cards can handle 52 channels with zero CPU load. Their onboard DSPs can also do routing and mixing, again without touching the CPU.
I was under the (apparently mistaken) impression that you couldn't DMA from userspace (something to do with the possibility that the userspace memory pages could be swapped out in the middle of the DMA)
Hmm. Maybe I've been paying too much attention to card vendors' sales talk :)
John
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to David LangQuoted 5 lines · David Lang
Quoted 3 lines · John Rigg
Quoted 2 lines
does the CPU touch the data for these, or do you DMA directly from userspace (i.e. "zero-copy")?
Quoted 7 lines
Quoted 3 lines
The cards I mentioned use DMA. RME actually advertises that some of their cards can handle 52 channels with zero CPU load. Their onboard DSPs can also do routing and mixing, again without touching the CPU.
I was under the (apparently mistaken) impression that you couldn't DMA from userspace (something to do with the possibility that the userspace memory pages could be swapped out in the middle of the DMA)
Hmm. Maybe I've been paying too much attention to card vendors' sales talk :)
John
Re: Re: [OT] ALSA userspace API complexity
In reply to Hannu SavolainenQuoted 6 lines · Hannu Savolainen
Quoted 3 lines · John Rigg
Yes, but the CPU has plenty of other work to do. The sound cards that would be worst affected by this are the big RME cards (non-interleaved) and multiple ice1712 cards (non-interleaved blocks of interleaved data),
ice1712 uses normal interleaving. There are no "non-interleaved blocks".
With two ice1712 cards I had to patch jackd for MMAP_COMPLEX support to make them work together. My understanding was that the individual cards use interleaved data, but when several are combined the resulting blocks of data are not interleaved together. I realise the usual way of dealing with this is to use the alsa route plugin with ttable to interleave them, but I couldn't get it to work with these cards.
John
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to Hannu SavolainenQuoted 6 lines · Hannu Savolainen
Quoted 3 lines · John Rigg
Yes, but the CPU has plenty of other work to do. The sound cards that would be worst affected by this are the big RME cards (non-interleaved) and multiple ice1712 cards (non-interleaved blocks of interleaved data),
ice1712 uses normal interleaving. There are no "non-interleaved blocks".
With two ice1712 cards I had to patch jackd for MMAP_COMPLEX support to make them work together. My understanding was that the individual cards use interleaved data, but when several are combined the resulting blocks of data are not interleaved together. I realise the usual way of dealing with this is to use the alsa route plugin with ttable to interleave them, but I couldn't get it to work with these cards.
John
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to Alan CoxQuoted 5 lines · Alan Cox
Quoted 3 lines · David Lang
I was under the (apparently mistaken) impression that you couldn't DMA from userspace (something to do with the possibility that the userspace memory pages could be swapped out in the middle of the DMA)
Quoted 7 lines
Drivers can choose to support this two different ways. One is to have a buffer of kernel memory mapped into user space and shared with the hardware (this is how OSS did it), the other is to use the 2.6
get_user_pagesAPI to get the physical address of a set of pages and lock them down so they don't wander off during DMA.Both have advantages for different uses.
ALSA would appear to use the first method (get_user_pages does not appear in the source), presumably because new ALSA versions still support 2.4 (and 2.2, maybe even 2.0).
Lee
Re: Re: [OT] ALSA userspace API complexity
In reply to Alan CoxQuoted 5 lines · Alan Cox
Quoted 3 lines · David Lang
I was under the (apparently mistaken) impression that you couldn't DMA from userspace (something to do with the possibility that the userspace memory pages could be swapped out in the middle of the DMA)
Quoted 7 lines
Drivers can choose to support this two different ways. One is to have a buffer of kernel memory mapped into user space and shared with the hardware (this is how OSS did it), the other is to use the 2.6
get_user_pagesAPI to get the physical address of a set of pages and lock them down so they don't wander off during DMA.Both have advantages for different uses.
ALSA would appear to use the first method (get_user_pages does not appear in the source), presumably because new ALSA versions still support 2.4 (and 2.2, maybe even 2.0).
Lee
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to John RiggQuoted 8 lines · John Rigg
Quoted 6 lines · Hannu Savolainen
Quoted 3 lines · John Rigg
Yes, but the CPU has plenty of other work to do. The sound cards that would be worst affected by this are the big RME cards (non-interleaved) and multiple ice1712 cards (non-interleaved blocks of interleaved data),
ice1712 uses normal interleaving. There are no "non-interleaved blocks".
Quoted 7 lines
With two ice1712 cards I had to patch jackd for
MMAP_COMPLEXsupport to make them work together. My understanding was that the individual cards use interleaved data, but when several are combined the resulting blocks of data are not interleaved together. I realise the usual way of dealing with this is to use the alsa route plugin with ttable to interleave them, but I couldn't get it to work with these cards.
Right. If you use two cards then both of them have independently interleaved blocks. However if this kind of mapping belongs to the lowest level audio API or not is yet another API feature to argue about. Higher level libraries like Jack could do this themselves.
Best regards,
Hannu
-----
Hannu Savolainen ([email protected])
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages) OH2GLH QTH: Karkkila, Finland LOC: KP20CM
Re: Re: [OT] ALSA userspace API complexity
In reply to John RiggQuoted 8 lines · John Rigg
Quoted 6 lines · Hannu Savolainen
Quoted 3 lines · John Rigg
Yes, but the CPU has plenty of other work to do. The sound cards that would be worst affected by this are the big RME cards (non-interleaved) and multiple ice1712 cards (non-interleaved blocks of interleaved data),
ice1712 uses normal interleaving. There are no "non-interleaved blocks".
Quoted 7 lines
With two ice1712 cards I had to patch jackd for
MMAP_COMPLEXsupport to make them work together. My understanding was that the individual cards use interleaved data, but when several are combined the resulting blocks of data are not interleaved together. I realise the usual way of dealing with this is to use the alsa route plugin with ttable to interleave them, but I couldn't get it to work with these cards.
Right. If you use two cards then both of them have independently interleaved blocks. However if this kind of mapping belongs to the lowest level audio API or not is yet another API feature to argue about. Higher level libraries like Jack could do this themselves.
Best regards,
Hannu
-----
Hannu Savolainen ([email protected])
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages) OH2GLH QTH: Karkkila, Finland LOC: KP20CM
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Re: [OT] ALSA userspace API complexity
In reply to jerome lacosteHi.
Quoted 18 lines
Quoted 9 lines
Same as when Renault introduced the keyless system in the Laguna in 2001 (some call it the Laguna II) - it's basically a card you stick into a slot in the console which enables you to just press a button to start the car instead of turning a key and it also contained memory about your chair settings, mirrors and volume/sound settings of the radio.
Now, is this a highly complex piece of software running there to do those things?
Quoted 7 lines
Regardless of how what someone believes - a few months later someone was out driving and all of a sudden the car started speeding up and since there was no key you couldn't turn the car off and the breaks weren't strong enough to slow the car down and running at roughly 200kph he managed to YANK the card out of the slot before it could be slowed down and the ignition turned off - the guy was lucky to be alive.
Quoted 4 lines
I think you are mixing 2 stories. According to my sources, the driver of a Renault Vel Satis reported a similar issue and got stuck at around 190kmph during an hour in October 2004. In March 2005, the driver of a Laguna reported that he got stuck at 90 kmph for 40km.
Hm.
Quoted 9 lines
Quoted 7 lines
It turns out that it was a combination of a bug in the keyless system AND the cruise control that made this happen - two bugs that in themselves wouldn't have triggered but at the right speed, and when everything matched things went haywire, so no, no matter how tight you write specifications or papers you can't get everything bugfree, even in such a simple system as a keycard for your car. Note that one of the bugs WAS in the keycard.
Quoted 6 lines
To my knowledge, none of the reported issues have yet been identified as coming from the car. I searched again before posting and found no reference to that issue.
I would be happy to know where you found this information. At least to know if the constructors are hidding something.
Timeframe of the Laguna incident is roughly correct to my memory. It was reported in the Swedish newspapers. I'll try searching for it and see what I come up with, even though it's totally OT.
// Stefan
Re: [OT] ALSA userspace API complexity
In reply to Hannu SavolainenQuoted 11 lines · Hannu Savolainen
Quoted 9 lines · Lee Revell
Quoted 7 lines · Hannu Savolainen
We have not received any single bug report that is caused by the concept of kernel mixing.
Kernel mixing is not rocket science. All you need to do is picking a sample from the output buffers of each of the applications, sum them together (with some volume scaling) and feed the result to the physical
device.
Quoted 5 lines
Quoted 3 lines
Hey, interesting, this is exactly what dmix does in userspace. And we have not seen any bug reports caused by the concept of userspace mixing (just implementation bugs like any piece of software).
Having dmix working in user space doesn't prove that kernel level mixing is evil. This was the original topic.
Overloading interrupt handlers with extra things is evil (and I bet you're mixing samples in the interrupt handler). Even the network stack uses interrupts only for DMA management and not for any extra operations.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
Re: [OT] ALSA userspace API complexity
In reply to Hannu SavolainenQuoted 8 lines · Hannu Savolainen
What happens if some system load peak delays the application by 20 ms? The result is complete failure. What is the ALSA (API) feature OSS doesn't have that makes it able to predict what kind of output the application should have fed to the device during the (about) 20 ms period of silence?
The fact is that there is nothing the audio subsystem can do to recover the situation. For this very simple reason the OSS API lacks everything that would be necessary to cope with this kind of problems.
Applications should be notified that something is broken. If you have a professional environment, you really need to know, if the output survived all scheduling peaks and the audio data are delivered from/to I/O in time.
Also, in the standard consumer environment is good to know that the system have some trouble to deliver data in time (motivating developers of core Linux kernel code or subsystems, or motivating app programers to set the correct scheduling parameters) to fix remaining problems.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to Hannu SavolainenQuoted 28 lines · Hannu Savolainen
Quoted 6 lines
Quoted 1 line
From the end user perspective, don't you think that having an opportunity
to change the API entry point from one to multiple (user space library - preferred, direct kernel space - last resort) is more flexible for developers and users? Please, consider this question without any flames line which API is better and what's better for audio subsystem architects and what's better for your commercial work.
It's too late to discuss about this. This decision could have been made in 1992-1993 before large number of applications were already written. Unfortunately the whole issue was raised just recently.
There has been definitions for routines like
osslib_open(), etc insoundcard.hfor years. Also the libOSSlib.so library contains such routines. If an OSS application is compiled without -DOSSLIB then they are defined as open, etc. Unfortunately this version ofsoundcard.hwas not accepted by the kernel OSS maintainers so the stock Linux version doesn't have these definitions.If you like to get OSS apps to go through this library API you can do the following:
- Get the latest
soundcard.hfrom our OSS package to be included in the stock kernel.
- Do the same for libOSSlib (sources shipped with OSS).
- Tell all OSS developers to change all OSS system calls to use theirosslib_counterparts. And to recompile against the latestsoundcard.hwith -DOSSLIB. Make sure all distributions have done the changes before that.
Quoted 2 lines
Then you can include a libOSSlib.o library in ALSA with all the OSS emulation stuf inside.
You should do the clear statement that the direct using of syscalls is not recommented for application developers. Unfortunately at this time, I admit, it would be very difficult to change the existing applications.
I can only suggest to OSS including the commercial version:
1) create a osslib package under GPL and probably also under BSD licence
2) notify developers in your documentation that every syscall has own function in osslib and that using syscalls directly is not recommended
In this way, your library will go to all Linux distributions and OSS app developers will have quite confirmed the right direction from you.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
Re: Re: [OT] ALSA userspace API complexity
In reply to Hannu SavolainenQuoted 28 lines · Hannu Savolainen
Quoted 6 lines
Quoted 1 line
From the end user perspective, don't you think that having an opportunity
to change the API entry point from one to multiple (user space library - preferred, direct kernel space - last resort) is more flexible for developers and users? Please, consider this question without any flames line which API is better and what's better for audio subsystem architects and what's better for your commercial work.
It's too late to discuss about this. This decision could have been made in 1992-1993 before large number of applications were already written. Unfortunately the whole issue was raised just recently.
There has been definitions for routines like
osslib_open(), etc insoundcard.hfor years. Also the libOSSlib.so library contains such routines. If an OSS application is compiled without -DOSSLIB then they are defined as open, etc. Unfortunately this version ofsoundcard.hwas not accepted by the kernel OSS maintainers so the stock Linux version doesn't have these definitions.If you like to get OSS apps to go through this library API you can do the following:
- Get the latest
soundcard.hfrom our OSS package to be included in the stock kernel.
- Do the same for libOSSlib (sources shipped with OSS).
- Tell all OSS developers to change all OSS system calls to use theirosslib_counterparts. And to recompile against the latestsoundcard.hwith -DOSSLIB. Make sure all distributions have done the changes before that.
Quoted 2 lines
Then you can include a libOSSlib.o library in ALSA with all the OSS emulation stuf inside.
You should do the clear statement that the direct using of syscalls is not recommented for application developers. Unfortunately at this time, I admit, it would be very difficult to change the existing applications.
I can only suggest to OSS including the commercial version:
1) create a osslib package under GPL and probably also under BSD licence
2) notify developers in your documentation that every syscall has own function in osslib and that using syscalls directly is not recommended
In this way, your library will go to all Linux distributions and OSS app developers will have quite confirmed the right direction from you.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Re: [OT] ALSA userspace API complexity
In reply to Jaroslav KyselaQuoted 3 lines · Jaroslav Kysela
Overloading interrupt handlers with extra things is evil (and I bet you're mixing samples in the interrupt handler). Even the network stack uses interrupts only for DMA management and not for any extra operations.
You mean it's evil because nobody else is doing it? Then it must be evil or rather voodoo.
Best regards,
Hannu
-----
Hannu Savolainen ([email protected])
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages) OH2GLH QTH: Karkkila, Finland LOC: KP20CM
Re: [OT] ALSA userspace API complexity
In reply to Jaroslav KyselaQuoted 10 lines · Jaroslav Kysela
Quoted 3 lines · Hannu Savolainen
The fact is that there is nothing the audio subsystem can do to recover the situation. For this very simple reason the OSS API lacks everything that would be necessary to cope with this kind of problems.
Applications should be notified that something is broken. If you have a professional environment, you really need to know, if the output survived all scheduling peaks and the audio data are delivered from/to I/O in time.
This is exactly how OSS API works. The application can check if there were any errors so far. It can do it after finishing the playback or whenever it likes. It can then show a dialog box saying that playback/recording was not 100% error free. Alternatively it can show error counters on the status line. Or most applications just don't care.
Best regards,
Hannu
-----
Hannu Savolainen ([email protected])
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages) OH2GLH QTH: Karkkila, Finland LOC: KP20CM
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to Jaroslav KyselaQuoted 7 lines · Jaroslav Kysela
Quoted 3 lines
Then you can include a libOSSlib.o library in ALSA with all the OSS emulation stuf inside.
You should do the clear statement that the direct using of syscalls is not recommented for application developers. Unfortunately at this time, I admit, it would be very difficult to change the existing applications.
Sorry. That breaks backward compatibility with systems that don't have libOSSlib (all current and past Linux distros, all BSD variants, everything but systems with our official OSS package installed). Such statement can be added in 2010 but provided that all Linux distros and other environments having OSS compatible implementations add the osslib_* routines within this year.
Best regards,
Hannu
-----
Hannu Savolainen ([email protected])
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages) OH2GLH QTH: Karkkila, Finland LOC: KP20CM
Re: Re: [OT] ALSA userspace API complexity
In reply to Jaroslav KyselaQuoted 7 lines · Jaroslav Kysela
Quoted 3 lines
Then you can include a libOSSlib.o library in ALSA with all the OSS emulation stuf inside.
You should do the clear statement that the direct using of syscalls is not recommented for application developers. Unfortunately at this time, I admit, it would be very difficult to change the existing applications.
Sorry. That breaks backward compatibility with systems that don't have libOSSlib (all current and past Linux distros, all BSD variants, everything but systems with our official OSS package installed). Such statement can be added in 2010 but provided that all Linux distros and other environments having OSS compatible implementations add the osslib_* routines within this year.
Best regards,
Hannu
-----
Hannu Savolainen ([email protected])
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages) OH2GLH QTH: Karkkila, Finland LOC: KP20CM
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Re: [OT] ALSA userspace API complexity
In reply to Hannu SavolainenQuoted 7 lines · Hannu Savolainen
Quoted 3 lines · Jaroslav Kysela
Overloading interrupt handlers with extra things is evil (and I bet you're mixing samples in the interrupt handler). Even the network stack uses interrupts only for DMA management and not for any extra operations.
You mean it's evil because nobody else is doing it? Then it must be evil or rather voodoo.
No, I mean that it's quite obvious bad design, because you might increase interrupt latencies for other drivers.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to Hannu SavolainenQuoted 10 lines · Hannu Savolainen
Quoted 7 lines · Jaroslav Kysela
Quoted 3 lines
Then you can include a libOSSlib.o library in ALSA with all the OSS emulation stuf inside.
You should do the clear statement that the direct using of syscalls is not recommented for application developers. Unfortunately at this time, I admit, it would be very difficult to change the existing applications.
Quoted 6 lines
Sorry. That breaks backward compatibility with systems that don't have libOSSlib (all current and past Linux distros, all BSD variants, everything but systems with our official OSS package installed). Such statement can be added in 2010 but provided that all Linux distros and other environments having OSS compatible implementations add the osslib_* routines within this year.
I meant that you can originate to move the OSS entry point to somewhere else (library) and try to persuade developers to use library than direct calls.
Of course, we cannot change current applications, but we can start the movement now. I just ask you to do it now. Nothing else. It will be a slow process but it should be started now.
Also, I don't think that it will break something. The application developers can use your code in their applications directly when the distribution does not have the OSS access library package.
Note that your words clearly states your attitude to change something.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
Re: Re: [OT] ALSA userspace API complexity
In reply to Hannu SavolainenQuoted 10 lines · Hannu Savolainen
Quoted 7 lines · Jaroslav Kysela
Quoted 3 lines
Then you can include a libOSSlib.o library in ALSA with all the OSS emulation stuf inside.
You should do the clear statement that the direct using of syscalls is not recommented for application developers. Unfortunately at this time, I admit, it would be very difficult to change the existing applications.
Quoted 6 lines
Sorry. That breaks backward compatibility with systems that don't have libOSSlib (all current and past Linux distros, all BSD variants, everything but systems with our official OSS package installed). Such statement can be added in 2010 but provided that all Linux distros and other environments having OSS compatible implementations add the osslib_* routines within this year.
I meant that you can originate to move the OSS entry point to somewhere else (library) and try to persuade developers to use library than direct calls.
Of course, we cannot change current applications, but we can start the movement now. I just ask you to do it now. Nothing else. It will be a slow process but it should be started now.
Also, I don't think that it will break something. The application developers can use your code in their applications directly when the distribution does not have the OSS access library package.
Note that your words clearly states your attitude to change something.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Re: [OT] ALSA userspace API complexity
In reply to Jaroslav KyselaQuoted 2 lines · Jaroslav Kysela
No, I mean that it's quite obvious bad design, because you might increase interrupt latencies for other drivers.
Maybe if running with all interrupts disabled.
The "mixing" time for one interrupt has been measured and it was smaller than the resolution of the measurement method (1 usec). It is indeed a serious risk to the system.
Best regards,
Hannu
-----
Hannu Savolainen ([email protected])
http://www.opensound.com (Open Sound System (OSS))
http://www.compusonic.fi (Finnish OSS pages) OH2GLH QTH: Karkkila, Finland LOC: KP20CM
Re: [Alsa-devel] Re: [OT] ALSA userspace API complexity
In reply to Jaroslav KyselaDnia 10-01-2006 o 15:17:21 Jaroslav Kysela <[email protected]> napisa³:
Quoted 25 lines · Hannu Savolainen
Quoted 12 lines · Jaroslav Kysela
Quoted 6 lines
Quoted 4 lines
Then you can include a libOSSlib.o library in ALSA with all the OSS emulation stuf inside.
You should do the clear statement that the direct using of syscalls
is not
Quoted 2 lines
recommented for application developers. Unfortunately at this time, I admit, it would be very difficult to change the existing applications.
Quoted 7 lines
Sorry. That breaks backward compatibility with systems that don't have libOSSlib (all current and past Linux distros, all BSD variants, everything but systems with our official OSS package installed). Such statement can be added in 2010 but provided that all Linux distros and other environments having OSS compatible implementations add the osslib_*
routines within this year.I meant that you can originate to move the OSS entry point to somewhere else (library) and try to persuade developers to use library than direct calls.
Quoted 8 lines
Of course, we cannot change current applications, but we can start the movement now. I just ask you to do it now. Nothing else. It will be a slow
process but it should be started now.Also, I don't think that it will break something. The application developers can use your code in their applications directly when the distribution does not have the OSS access library package.
Doing every call through some lib even if it's only a wrapper leading to kernel syscall doesn't look very interesting.
Some people need statically lined apps and minimum usable distro without bloated libs. What about Unix device abstraction?
Are we going the current Windows way?
Anyway Windows is stearing to the microkernel approach (approaching Vista) and it looks that we are going to the current Windows model while MS developers
are going far away. Hurd looks nice but it is not good enough now. But the idea is good and needs more people to improve it.
So we could have Unix device approach with drivers running as separate processes
not in kernel space. With proper kernel scheduling and being non-swappable we could get good security, stability and additionally enough simple
from app point of view approach. Going through libs we are going through
all the LD_PRELOAD and LD_LIBRARY_PATH and linker security hell.
Kernel approach looks good enough for me now. But it is not so secure of course.
So we need some process->kernel-device->driver RT/non-swappable/correctly scheduled process IPC so we can do it the other way. IMHO that's the future if we don't want drivers in the kernel.
Best regards
--
Adam Tla³ka mailto:[email protected] ^v^ ^v^ ^v^
System & Network Administration Group ~~~~~~
Computer Center, Gdañsk University of Technology, Poland
PGP public key: finger [email protected]
Re: Re: [OT] ALSA userspace API complexity
In reply to Jaroslav KyselaQuoted 24 lines · Dnia 10-01-2006 o 15:17:21 Jaroslav Kysela <[email protected]> napisał:
Quoted 11 lines · Hannu Savolainen
Quoted 5 lines · Jaroslav Kysela
Quoted 3 lines
Then you can include a libOSSlib.o library in ALSA with all the OSS emulation stuf inside.
You should do the clear statement that the direct using of syscalls
is not
Quoted 2 lines
recommented for application developers. Unfortunately at this time, I admit, it would be very difficult to change the existing applications.
Quoted 6 lines
Sorry. That breaks backward compatibility with systems that don't have libOSSlib (all current and past Linux distros, all BSD variants, everything but systems with our official OSS package installed). Such statement can be added in 2010 but provided that all Linux distros and other environments having OSS compatible implementations add the osslib_* routines within this year.
I meant that you can originate to move the OSS entry point to somewhere else (library) and try to persuade developers to use library than direct calls.
Quoted 7 lines
Of course, we cannot change current applications, but we can start the movement now. I just ask you to do it now. Nothing else. It will be a slow process but it should be started now.
Also, I don't think that it will break something. The application developers can use your code in their applications directly when the distribution does not have the OSS access library package.
Doing every call through some lib even if it's only a wrapper leading to kernel syscall doesn't look very interesting.
Some people need statically lined apps and minimum usable distro without bloated libs. What about Unix device abstraction?
Are we going the current Windows way?
Anyway Windows is stearing to the microkernel approach (approaching Vista) and it looks that we are going to the current Windows model while MS developers are going far away. Hurd looks nice but it is not good enough now. But the idea is good and needs more people to improve it.
So we could have Unix device approach with drivers running as separate processes not in kernel space. With proper kernel scheduling and being non-swappable we could get good security, stability and additionally enough simple from app point of view approach. Going through libs we are going through all the LD_PRELOAD and LD_LIBRARY_PATH and linker security hell.
Kernel approach looks good enough for me now. But it is not so secure of course. So we need some process->kernel-device->driver RT/non-swappable/correctly scheduled process IPC so we can do it the other way. IMHO that's the future if we don't want drivers in the kernel.
Best regards
--
Adam Tlałka mailto:[email protected] ^v^ ^v^ ^v^
System & Network Administration Group ~~~~~~
Computer Center, Gdańsk University of Technology, Poland
PGP public key: finger [email protected]
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
Re: [OT] ALSA userspace API complexity
In reply to Jaroslav KyselaQuoted 9 lines · Jaroslav Kysela
Quoted 7 lines · Hannu Savolainen
Quoted 5 lines · Jaroslav Kysela
Overloading interrupt handlers with extra things is evil (and I bet you're
mixing samples in the interrupt handler). Even the network stack uses
interrupts only for DMA management and not for any extra operations.
Quoted 6 lines
Quoted 2 lines
You mean it's evil because nobody else is doing it? Then it must be evil or rather voodoo.
No, I mean that it's quite obvious bad design, because you might increase
interrupt latencies for other drivers.
"Becasue you might" is a bad argument. Either you do or you don't. My guess is that you don't
becase the amount of data to be handled is absymally small. (Come one 48kBaud is not much...)
And BTW. good luck trying to convince the /dev/random gang that it isn't good for performance
what they are doing on the IRQ path...
Marcin Dalecki