Re: [Ekiga-list] Alsa device enumeration

2009-03-12 Thread Damien Sandras
Le mercredi 11 mars 2009 à 20:46 +0100, Alec Leamas a écrit :
 There are  some problems w the current code which enumerates the alsa 
 devices. I have a sketch for a patch, this is really not that 
 complicated these days, there are new library routines which support it.
 
 The problem is just what devices to show, and how. Basically, there is 
 two kind of devices: the classic devices which we partly see today, and 
 several new devices such as pulse, hdmi, and several surround*. They 
 exist for both capture and playback. The list for my box is below. The 
 basic ideas are stolen from Skype. The important thing is the left 
 column, the right is just internal stuff (hey, use a fixed font to see 
 this...). 
 
 Any thoughts out there about this list?
 

I would clean it and remove entries with hw only. Because that's
complex. What is Surround40 capture ?

-- 
 _ Damien Sandras
(o-  
//\Ekiga Softphone : http://www.ekiga.org/
v_/_   Be IP   : http://www.beip.be/
   FOSDEM  : http://www.fosdem.org/
   SIP Phone   : sip:dsand...@ekiga.net
   

___
ekiga-list mailing list
ekiga-list@gnome.org
http://mail.gnome.org/mailman/listinfo/ekiga-list

Re: [Ekiga-list] Alsa device enumeration

2009-03-12 Thread Alec Leamas

Damien Sandras wrote:

Le mercredi 11 mars 2009 à 20:46 +0100, Alec Leamas a écrit :
  
There are  some problems w the current code which enumerates the alsa 
devices. I have a sketch for a patch, this is really not that 
complicated these days, there are new library routines which support it.


The problem is just what devices to show, and how. Basically, there is 
two kind of devices: the classic devices which we partly see today, and 
several new devices such as pulse, hdmi, and several surround*. They 
exist for both capture and playback. The list for my box is below. The 
basic ideas are stolen from Skype. The important thing is the left 
column, the right is just internal stuff (hey, use a fixed font to see 
this...). 


Any thoughts out there about this list?




I would clean it and remove entries with hw only. Because that's
complex. What is Surround40 capture ?
  
Surround capture is in my eyes complete nonsense. It's reported, though. 
I totally agree that it should not be visible to users.


The hw discussion is complex. Actually, there are documents on the alsa 
site which boils down to that using hw:/plughw: is deprecated, they 
recommend front, surround* etc. But for capture, it just makes no 
sense. And, more important, if you have more than one card there is no 
way to e. g., direct sound to device front at the usb headset. Which 
device front actually refers to is a part of fthe alsa configuration 
(normally the default device). So, to direct sound to a specific card 
you must either mess with the alsa configuration, or use the 
hw:/plughw:. This is my current understanding.  I know there are people 
who knows more which is reading this...


My basic impression is that the alsa device addressing schema is  a bit 
hard to handle, especially with more than one card. And although it's 
not that common that users have more than one card in their box, USB and 
bluetooth headsets are important use cases involving more than one card 
from the alsa perpective.


It's also important to sort out the different roles in device 
management. The ultimate goal in my eyes is to create a new UI focused 
on making it much easier to setup the sound system.  The major task is 
really up to the UI code here. My basic view is that the driver should 
provide a reasonably complete list of devices with as much information 
as possible.  This does not preclude hiding nonsense like surround 
capture, But the finer tricks should be done by the UI, and we should be 
careful not to hide to much in the driver. The UI has other options than 
to just take the list from the driver and place in a select box IMHO.


The plughw/hw is indeed complex. But to my understanding, it's really 
the only way to fix the basic task Send sound to and get capture from 
the USB headset/main box/bluetooth headset.  Of course, we could handle 
this by reconfiguring alsa. But since devices comes and goes away, and 
then comes back with a new number (sigh...)  this is not that easy. 
Maybe the complexity of hw/plughw could be handled by a new UI?


--alec
___
ekiga-list mailing list
ekiga-list@gnome.org
http://mail.gnome.org/mailman/listinfo/ekiga-list

Re: [Ekiga-list] Alsa device enumeration

2009-03-12 Thread Damien Sandras
Le jeudi 12 mars 2009 à 20:41 +0100, Alec Leamas a écrit :
 Damien Sandras wrote:
  Le mercredi 11 mars 2009 à 20:46 +0100, Alec Leamas a écrit :

  There are  some problems w the current code which enumerates the alsa 
  devices. I have a sketch for a patch, this is really not that 
  complicated these days, there are new library routines which support it.
 
  The problem is just what devices to show, and how. Basically, there is 
  two kind of devices: the classic devices which we partly see today, and 
  several new devices such as pulse, hdmi, and several surround*. They 
  exist for both capture and playback. The list for my box is below. The 
  basic ideas are stolen from Skype. The important thing is the left 
  column, the right is just internal stuff (hey, use a fixed font to see 
  this...). 
 
  Any thoughts out there about this list?
 
  
 
  I would clean it and remove entries with hw only. Because that's
  complex. What is Surround40 capture ?

 Surround capture is in my eyes complete nonsense. It's reported, though. 
 I totally agree that it should not be visible to users.
 
 The hw discussion is complex. Actually, there are documents on the alsa 
 site which boils down to that using hw:/plughw: is deprecated, they 
 recommend front, surround* etc. But for capture, it just makes no 
 sense. And, more important, if you have more than one card there is no 
 way to e. g., direct sound to device front at the usb headset. Which 
 device front actually refers to is a part of fthe alsa configuration 
 (normally the default device). So, to direct sound to a specific card 
 you must either mess with the alsa configuration, or use the 
 hw:/plughw:. This is my current understanding.  I know there are people 
 who knows more which is reading this...
 
 My basic impression is that the alsa device addressing schema is  a bit 
 hard to handle, especially with more than one card. And although it's 
 not that common that users have more than one card in their box, USB and 
 bluetooth headsets are important use cases involving more than one card 
 from the alsa perpective.
 
 It's also important to sort out the different roles in device 
 management. The ultimate goal in my eyes is to create a new UI focused 
 on making it much easier to setup the sound system.  The major task is 
 really up to the UI code here. My basic view is that the driver should 
 provide a reasonably complete list of devices with as much information 
 as possible.  This does not preclude hiding nonsense like surround 
 capture, But the finer tricks should be done by the UI, and we should be 
 careful not to hide to much in the driver. The UI has other options than 
 to just take the list from the driver and place in a select box IMHO.
 
 The plughw/hw is indeed complex. But to my understanding, it's really 
 the only way to fix the basic task Send sound to and get capture from 
 the USB headset/main box/bluetooth headset.  Of course, we could handle 
 this by reconfiguring alsa. But since devices comes and goes away, and 
 then comes back with a new number (sigh...)  this is not that easy. 
 Maybe the complexity of hw/plughw could be handled by a new UI?

I'm not sure. How can we know surround is non sense? How can we know
other similar non sense entries... To my eyes, Alsa is really purely
broken :-/
-- 
 _ Damien Sandras
(o-  
//\Ekiga Softphone : http://www.ekiga.org/
v_/_   Be IP   : http://www.beip.be/
   FOSDEM  : http://www.fosdem.org/
   SIP Phone   : sip:dsand...@ekiga.net
   

___
ekiga-list mailing list
ekiga-list@gnome.org
http://mail.gnome.org/mailman/listinfo/ekiga-list

Re: [Ekiga-list] Alsa device enumeration

2009-03-12 Thread Derek Smithies

Hi,

On Thu, 12 Mar 2009, Damien Sandras wrote:


I'm not sure. How can we know surround is non sense? How can we know
other similar non sense entries... To my eyes, Alsa is really purely
broken :-/


Very broken.
Alsa stands for advanced linux sound architecture - which is misleading.

Alsa rhymes with, and sounds very much like, the word ulcer.

=

Sound cards - my colleagues and I did a count of the typical number.
On a PC prior to 2000, (or so) the motherboard had a deficient onboard 
sound system, and you had to install a proper sound card.


On the more recent PCs, (and laptops) the onboard sound is fine.

However, the user will plugin in USB headsets (which are represented by 
alsa) as a sound card.


Thus, we have to consider a PC as containing 2 sound cards:
  1 that is always there
  1 that comes and goes while the application is running.

=

The labelling is deficient.

I have a machine here that has two sound cards.
 1 on the motherboard, 3x3.5mm sockets, mic, speaker, line in
(yes, 3 sockets.. only one is output)


 1 ES1371 (ensoniq)  4x3.5mm sockets, mic, speker, linein, lineout

Ok, now remember this description of 7x3.5mm sockets.

How does alsa report this as ?
output of aplay -l

 List of PLAYBACK Hardware Devices 
card 0: AudioPCI [Ensoniq AudioPCI], device 0: ES1371/1 [ES1371 DAC2/ADC]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AudioPCI [Ensoniq AudioPCI], device 1: ES1371/2 [ES1371 DAC1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: AudioPCI_1 [Ensoniq AudioPCI], device 0: ES1371/1 [ES1371 
DAC2/ADC]

  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: AudioPCI_1 [Ensoniq AudioPCI], device 1: ES1371/2 [ES1371 DAC1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0



output of aplay -L

front:CARD=AudioPCI,DEV=0
Ensoniq AudioPCI, ES1371 DAC2/ADC
Front speakers
surround40:CARD=AudioPCI,DEV=0
Ensoniq AudioPCI, ES1371 DAC2/ADC
4.0 Surround output to Front and Rear speakers
iec958:CARD=AudioPCI,DEV=0
Ensoniq AudioPCI, ES1371 DAC2/ADC
IEC958 (S/PDIF) Digital Audio Output
null
Discard all samples (playback) or generate zero samples (capture)
front:CARD=AudioPCI_1,DEV=0
Ensoniq AudioPCI, ES1371 DAC2/ADC
Front speakers
surround40:CARD=AudioPCI_1,DEV=0
Ensoniq AudioPCI, ES1371 DAC2/ADC
4.0 Surround output to Front and Rear speakers
iec958:CARD=AudioPCI_1,DEV=0
Ensoniq AudioPCI, ES1371 DAC2/ADC
IEC958 (S/PDIF) Digital Audio Output

=
Here is the problem:
 we need to turn the above two lists into something meaningful for the 
user.


both cards on this machine are reported as having two play subdevices. Yet 
only one is available.


Which card is which?
  Which card is the motherboard, and which card is in the PCI socket?

 One of the tasks of the alsa code has to be to work out what the physical 
location of each card is, and report it accordingly.


Now, this is just one example of the brokenness of alsa.
Every application that uses alsa has to enumerate sound cards, work out 
their physical location, work out when new cards (usb headsets etc) are 
plugged in...
 Isn't that what libraries are for - so that common code goes in the 
library, and applications share the output of the common code???



Derek.
--
Derek Smithies Ph.D.
IndraNet Technologies Ltd.
Email: de...@indranet.co.nz
ph +64 3 365 6485
Web: http://www.indranet-technologies.com/
___
ekiga-list mailing list
ekiga-list@gnome.org
http://mail.gnome.org/mailman/listinfo/ekiga-list


Re: [Ekiga-list] Alsa device enumeration

2009-03-12 Thread Alec Leamas

Damien Sandras wrote:

[ cut]

I'm not sure. How can we know surround is non sense? How can we know
other similar non sense entries... To my eyes, Alsa is really purely
broken :-/
  
I didn't mean that surround is nonsense, no way. I just mean that 
surround capture/record/input makes no sense. 6  microphones, or what? 
One important aspect is that this new list contains new entries which 
are definitely meaningful including the pulse device.


I have the same impression as you of the alsa naming scheme, But we have 
to live with t (?) I'll make Yet Another List.

___
ekiga-list mailing list
ekiga-list@gnome.org
http://mail.gnome.org/mailman/listinfo/ekiga-list