Skip to contentSkip to conversation

devices/subdevices, hw:/plughw:

DISCUSSION Florian Bomers 3 participants 4 messages Sep 20, 2002 – Sep 21, 2002

lore
Share & tools
lore
#0 lore raw

(I initially posted this to alsa-user without answers. Hope to get more lucky here...)

Hi,

sorry for those general questions, but I wasn't able to find anything on the archives or in the ALSA documentation.

What is the meaning of devices vs. subdevices ? What is an example where a device would have several subdevices, as opposed to the card having several devices ? I want to display a list of available "ports" where the user can send the audio generated by the program. If a device has several subdevices, would I include them in the list, or just list the devices for each card ?

My program successfully lists the cards with their devices and subdevices for
hw: (i.e. snd_ctl_open("hw:0") ). However, this does not work for the plughw:
way, although from what I understood, I want to use plughw: (as it is supposed to support automatic sample rate conversion). How do I iterate all available
plughw: "cards", devices, and subdevices? Or can I assume that if hw:0,0 exists, that plughw:0,0 is the same card/device - and I just can't iterate available plughw:'s directly ?

Thanks!
Florian

Signature · 10 lines
Florian Bomers
Java Sound
Java Software/Sun Microsystems, Inc.
http://java.sun.com/products/java-media/sound/


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
#1 lore raw
Quoted 11 lines · Florian Bomers

(I initially posted this to alsa-user without answers. Hope to get more lucky here...)

Hi,

sorry for those general questions, but I wasn't able to find anything on the archives or in the ALSA documentation.

What is the meaning of devices vs. subdevices ? What is an example where a device would have several subdevices, as opposed to the card having several devices ?

A card is a device. The available pcm channels are sub devices.

Quoted 4 lines

I want to display a list of available "ports" where the user can send the audio generated by the program. If a device has several subdevices, would I include them in the list, or just list the devices for each card ?

You should include the sub devices.

Quoted 4 lines

My program successfully lists the cards with their devices and subdevices for
hw: (i.e. snd_ctl_open("hw:0") ). However, this does not work for the plughw:
way, although from what I understood, I want to use plughw: (as it is supposed to support automatic sample rate conversion). How do I iterate all available plughw: "cards", devices, and subdevices? Or can I assume that if hw:0,0 exists, that plughw:0,0 is the same card/device - and I just can't iterate available plughw:'s directly ?

yes plughw:0,0 is the same as hw:0,0 but with automatic sample rate conversion.

Quoted 4 lines

Thanks!
Florian

Signature · 17 lines
Patrick Shirkey - Boost Hardware Ltd.
For the discerning hardware connoisseur
Http://www.boosthardware.com
Http://www.boosthardware.com/LAU/guide/
========================================

"Um...symbol_get and symbol_put... They're
kindof like does anyone remember like get_symbol
and put_symbol I think we used to have..."
- Rusty Russell in his talk on the module subsystem



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
#2 lore raw

Thanks that explains.
Florian

Quoted 51 lines · Patrick Shirkey
Quoted 11 lines · Florian Bomers

(I initially posted this to alsa-user without answers. Hope to get more lucky here...)

Hi,

sorry for those general questions, but I wasn't able to find anything on the archives or in the ALSA documentation.

What is the meaning of devices vs. subdevices ? What is an example where a device would have several subdevices, as opposed to the card having several devices ?

A card is a device. The available pcm channels are sub devices.

Quoted 4 lines

I want to display a list of available "ports" where the user can send the audio generated by the program. If a device has several subdevices, would I include them in the list, or just list the devices for each card ?

You should include the sub devices.

Quoted 8 lines

My program successfully lists the cards with their devices and subdevices for
hw: (i.e. snd_ctl_open("hw:0") ). However, this does not work for the plughw:
way, although from what I understood, I want to use plughw: (as it is supposed to support automatic sample rate conversion). How do I iterate all available
plughw: "cards", devices, and subdevices? Or can I assume that if hw:0,0 exists, that plughw:0,0 is the same card/device - and I just can't iterate available plughw:'s directly ?

yes plughw:0,0 is the same as hw:0,0 but with automatic sample rate conversion.

Quoted 4 lines

Thanks!
Florian

--
Patrick Shirkey - Boost Hardware Ltd. For the discerning hardware connoisseur Http://www.boosthardware.com Http://www.boosthardware.com/LAU/guide/
========================================

"Um...symbol_get and symbol_put... They're kindof like does anyone remember like get_symbol and put_symbol I think we used to have..."
- Rusty Russell in his talk on the module subsystem

Signature · 10 lines
Florian Bomers
Java Sound
Java Software/Sun Microsystems, Inc.
http://java.sun.com/products/java-media/sound/


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
#3 lore raw
In reply to Patrick Shirkey
Quoted 6 lines · Patrick Shirkey
Quoted 5 lines · Florian Bomers

(I initially posted this to alsa-user without answers. Hope to get more lucky here...)

Hi,

Quoted 8 lines
Quoted 6 lines

sorry for those general questions, but I wasn't able to find anything on the archives or in the ALSA documentation.

What is the meaning of devices vs. subdevices ? What is an example where a device would have several subdevices, as opposed to the card having several devices ?

A card is a device. The available pcm channels are sub devices.

Not really. A card can have several PCM devices. Each PCM device can have 1-N PCM subdevices (where N is not limited). Note that each subdevices should have same parameters. Mostly, subdevices are used for cards allowing multi-open (hardware sample mixing).

Quoted 2 lines

yes plughw:0,0 is the same as hw:0,0 but with automatic sample rate conversion.

Right.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf