Skip to contentSkip to conversation

PCM extra attributes

DISCUSSION Vinod Koul 3 participants 4 messages Jul 24, 2013 – Jul 25, 2013

lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

Hey Takashi,

We were looking to find the substream index in the userspace for the device opened (in case we support multiple substreams and mix them). Since we also wanted to have some specific alsa controls for each substream the problem of not knowing substream in usermode make stuff interesting!

I was pointed to an old RFC of yours [1] and it fits my needs. I can get the substream index using this and program the alsa controls.

Now reading the archive looks like it was note merged. Would be okay to do so for above case. I can resurrect the patchset if you would like...

Thanks
~Vinod

[1]: http://mailman.alsa-project.org/pipermail/alsa-devel/2009-June/018651.html

#1 lore raw
Quoted 3 lines

We were looking to find the substream index in the userspace for the device opened (in case we support multiple substreams and mix them).

http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m___info.html

snd_pcm_info_get_subdevice() - Get subdevice from a PCM info container

snd_pcm_info_get_subdevice_name() - Get subdevice name from a PCM info container

snd_pcm_info_get_subdevice_count() - Get subdevices count from a PCM info container

snd_pcm_info_get_subdevice_avail() - Get avail subdevices count from a PCM info container

snd_pcm_info_set_subdevice - Set wanted subdevice inside a PCM info container

Quoted 5 lines

Since we also wanted to have some specific alsa controls for each substream the problem of not knowing substream in usermode make stuff interesting!

The subdevices of a device need to same format , rate , channels, period and buffer constraints

http://git.alsa-project.org/?p=alsa-tools.git;a=tree;f=hwmixvolume

#2 lore raw
In reply to Vinod Koul
Quoted 6 lines · Vinod Koul

Hey Takashi,

We were looking to find the substream index in the userspace for the device opened (in case we support multiple substreams and mix them). Since we also wanted to have some specific alsa controls for each substream the problem of not knowing substream in usermode make stuff interesting!

The substream/subdevice index is in the snd_pcm_info field, so you can correlate the PCM with the controls from the control API.

snd_pcm_info_get_subdevice()

Jaroslav

Signature · 3 lines
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.
author
#3 lore raw
Quoted 8 lines · Jaroslav Kysela
Quoted 6 lines · Vinod Koul

Hey Takashi,

We were looking to find the substream index in the userspace for the device opened (in case we support multiple substreams and mix them). Since we also wanted to have some specific alsa controls for each substream the problem of not knowing substream in usermode make stuff interesting!

Quoted 4 lines

The substream/subdevice index is in the snd_pcm_info field, so you can correlate the PCM with the controls from the control API.

snd_pcm_info_get_subdevice()

This looks intresting, Thanks Jarsolav and Raymond.

If I get snd_pcm_info after the stream has been created I should see the subdevice and thus use alsa controls corrorsponding.

Let me test this, it should work

~Vinod