Re: [Alsa-devel] plughw or hw?

2001-12-17 Thread Paul Davis

I think that it's nonsense to force average users to study the
alsa driver architecture and learn a format of the configuration
file (they just don't know about the existence of such file) to

average users have 1 sound card. default will work for them.

perform such trivial task as to point the right sound card to
be used! 

trivial? clearly, you are working entirely in a world filled with
consumer-style devices and consumer-style applications. in such a
situation, perhaps, just perhaps, pointing to the right sound card
is trivial. but in general, this is not a trivial task. does the
user want to share access to the soundcard with other application?
does the user want to use *part* of an existing multichannel card for
your application? does the user want to use a soundcard whose sample
rate is controlled by an external device, and cannot be set by the
application? and so on and so forth ... you cannot infer what the
possible PCM devices are in general from looking at the installed
hardware. 

there will be other programmers who will write good, simple
configuration tools to create and edit ~/.asoundrc. why are you trying
to sidestep their work by using a hack like plughw:N,0 ?

--p

___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel



Re: [Alsa-devel] plughw or hw?

2001-12-17 Thread Jozef Kosoru

 I think that it's nonsense to force average users to study the
 alsa driver architecture and learn a format of the configuration
 file (they just don't know about the existence of such file) to
 
 average users have 1 sound card. default will work for them.

NO! I mean average user from a programmer point of view. This don't
necessary mean, that user has an average machine
Let's imagine a classical situation where user has a cheap
on-board sound card and another card in a PCI slot.
My application is the sound processor, so user wants to use
'better' sound card. Is this really such non-trivial task?
Have you ever used/seen some good audio application in MacOS
or M$ Win world? Each application from this category has
a config dialog for these things. ...or do you think that
musicians have to be programmers or administrators?

 
 perform such trivial task as to point the right sound card to
 be used! 
 
 trivial? clearly, you are working entirely in a world filled with
 consumer-style devices and consumer-style applications. in such a
 situation, perhaps, just perhaps, pointing to the right sound card
 is trivial. but in general, this is not a trivial task. does the
 user want to share access to the soundcard with other application?
 does the user want to use *part* of an existing multichannel card 
for
 your application? does the user want to use a soundcard whose sample
 rate is controlled by an external device, and cannot be set by the
 application? and so on and so forth ... you cannot infer what the
 possible PCM devices are in general from looking at the installed
 hardware. 
 
this is just the theory...

 there will be other programmers who will write good, simple
 configuration tools to create and edit ~/.asoundrc.

Don't be ridiculous! When? ..and part of what such tool will be?
Gnome? KDE? ...or you mean 'good' console tool? Do you ever know
what is it 'GUI' application?

 why are you trying
 to sidestep their work by using a hack like plughw:N,0 ?

..so what I have to do? 'default'?, or user has to type
correct 'magic world' to the line edit? How does user would
know WHAT he has to type if he wants to use second sound card
in this particular application!?
   
 
 --p
 


P. S. V. P. U.
http://www.pobox.sk/



___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel



Re: [Alsa-devel] plughw or hw?

2001-12-16 Thread Paul Davis

What is a difference between an ASCII identifier plughw:0,0
and hw:0,0? And what the output of 'aplay -L' means?

a hw device is totally constrained by the hardware characteristics
of the underlying audio interface. if the device has 26 channels, then
it must be used with 26 channels; if it only supports interleaved
access, it must be used with interleaved access; if it doesn't support
16 bit output, you can't use it with 16 bit output.

a plug device is unconstrained by all this. you can ask for any
configuration you want, and ALSA will provide it for you.

a plughw device is a slightly specialized version of a plug
device, differing only in that the underlying PCM device being
accessed is of type hw. it has the same freedom as a plug device
in all other ways.

as a programmer, you do not need to worry about any of this. honest.

I just want to know a number of installed sound cards
and number of subdevices for every card and I'd like
to have a possibility to open the right card and a subdevice
according user's choice. I think that ALSA-0.5 interface was
much better in these things...

well, most of us disagree with you, and some of us, rather vigorously.

in ALSA 0.9, you do not attempt to scan all cards and pick
one. this is something that cannot be done reliably or usefully in
many situations.

you allow the user to specify the *name* of a PCM device they wish to
use. these names correspond to entries in their ~/.asoundrc file, and
may contain configurations that your program can't even imagine. 

case in point: my machine has (sometimes): 2 Hammerfall cards, 1
Trident 4D-NX card, 1 Tropez+. The tropez audio playback is currently
broken, so i never use it for that (but it has a decent wavetable
synth and 2 MIDI ports); the hammerfall outputs are semi-permanently
wired to my mixer and the the inputs of everything are up on a patch
bay. occasionally, i run both hammerfalls as a single PCM device at
96kHz, more often as two separate devices.

you will not be able to write a user friendly configuration program
for my system. you can't do it in general, because the ALSA plug
layer offers a totally flexible layer that allows an audio interface
to appear to have any characteristics that you want.

instead, just let your program take it from a user that when they tell
it to use the ALSA PCM device foo that they know what they're
doing. if the user does not specify a name, use default and it will
work 99.8% of the time. the current setup of the default device is a
plughw device using the first audio interface. it will work with any
sample rate, any sample format, any type of access (interleaved,
noninterleaved, read/write or mmap).

--p






___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel



Re: [Alsa-devel] plughw or hw?

2001-12-16 Thread Vladimir Dergachev



On Sun, 16 Dec 2001, Paul Davis wrote:

 What is a difference between an ASCII identifier plughw:0,0
 and hw:0,0? And what the output of 'aplay -L' means?
 
 a hw device is totally constrained by the hardware characteristics
 of the underlying audio interface. if the device has 26 channels, then
 it must be used with 26 channels; if it only supports interleaved
 access, it must be used with interleaved access; if it doesn't support
 16 bit output, you can't use it with 16 bit output.
 
 a plug device is unconstrained by all this. you can ask for any
 configuration you want, and ALSA will provide it for you.
 
 a plughw device is a slightly specialized version of a plug
 device, differing only in that the underlying PCM device being
 accessed is of type hw. it has the same freedom as a plug device
 in all other ways.
 
 as a programmer, you do not need to worry about any of this. honest.
 
 I just want to know a number of installed sound cards
 and number of subdevices for every card and I'd like
 to have a possibility to open the right card and a subdevice
 according user's choice. I think that ALSA-0.5 interface was
 much better in these things...
 
 well, most of us disagree with you, and some of us, rather vigorously.
 
 in ALSA 0.9, you do not attempt to scan all cards and pick
 one. this is something that cannot be done reliably or usefully in
 many situations.
 
 you allow the user to specify the *name* of a PCM device they wish to
 use. these names correspond to entries in their ~/.asoundrc file, and
 may contain configurations that your program can't even imagine. 
 
 case in point: my machine has (sometimes): 2 Hammerfall cards, 1
 Trident 4D-NX card, 1 Tropez+. The tropez audio playback is currently
 broken, so i never use it for that (but it has a decent wavetable
 synth and 2 MIDI ports); the hammerfall outputs are semi-permanently
 wired to my mixer and the the inputs of everything are up on a patch
 bay. occasionally, i run both hammerfalls as a single PCM device at
 96kHz, more often as two separate devices.
 
 you will not be able to write a user friendly configuration program
 for my system. you can't do it in general, because the ALSA plug
 layer offers a totally flexible layer that allows an audio interface
 to appear to have any characteristics that you want.
 
 instead, just let your program take it from a user that when they tell
 it to use the ALSA PCM device foo that they know what they're
 doing. if the user does not specify a name, use default and it will
 work 99.8% of the time. the current setup of the default device is a
 plughw device using the first audio interface. it will work with any
 sample rate, any sample format, any type of access (interleaved,
 noninterleaved, read/write or mmap).


Interesting - and explains why I am having a hard time learning to use the
alsa library.

Could you explain to me how to do the following: the user has a TV capture
card with audio-out that is plugged in into one of the sound cards
installed in the system. I need to ask user which card and which input
s/he plugged the TV audio into. How do I do that ? (Preferably without the
user messing around with configuration files or entering names from
keyboard).

  thanks !

Vladimir Dergachev

 
 --p
 
 
 
 
 
 
 ___
 Alsa-devel mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/alsa-devel
 


___
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel