* open sound device from asound.conf
@ 2010-07-23 9:12 Peter Lukac
2010-07-23 9:26 ` Sebastian H.
0 siblings, 1 reply; 5+ messages in thread
From: Peter Lukac @ 2010-07-23 9:12 UTC (permalink / raw)
To: alsa-devel
hello all
maybe trivial question...
I want open sound device from /etc/asound.conf with API
snd_pcm_open() but unsuccessfull. As name i'm used:
"plughw:0,0"
"plughw:0,1"
"plughw:0,2"
"plughw:1,0"
"plughw:1,1"
"plughw:1,2"
...
i'm try alternative name with "hw:X,Y"
"hw:0,0"
"hw:0,1"
...
but in this method i'm open only HW device.
I'm get follow error:
ALSA lib pcm_hw.c:1429:(_snd_pcm_hw_open) Invalid value for card
how can i open my "virtual" device in asound.conf
here is asound.conf:
pcm.!default {
type plug
slave.pcm "output"
}
pcm.output {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
channels 2
rate 44100
format S16_LE
}
}
pcm.dsp0 {
type plug
slave.pcm "output"
}
...exists some universal method how can i open all HW device and "virtual"
devices?
thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: open sound device from asound.conf
2010-07-23 9:12 open sound device from asound.conf Peter Lukac
@ 2010-07-23 9:26 ` Sebastian H.
2010-07-23 9:43 ` Peter Lukac
0 siblings, 1 reply; 5+ messages in thread
From: Sebastian H. @ 2010-07-23 9:26 UTC (permalink / raw)
To: Peter Lukac; +Cc: alsa-devel
Am 23.07.2010 11:12, schrieb Peter Lukac:
> hello all
> maybe trivial question...
>
> I want open sound device from /etc/asound.conf with API
> snd_pcm_open() but unsuccessfull. As name i'm used:
>
> "plughw:0,0"
> "plughw:0,1"
> "plughw:0,2"
> "plughw:1,0"
> "plughw:1,1"
> "plughw:1,2"
> ...
> i'm try alternative name with "hw:X,Y"
> "hw:0,0"
> "hw:0,1"
> ...
> but in this method i'm open only HW device.
> I'm get follow error:
> ALSA lib pcm_hw.c:1429:(_snd_pcm_hw_open) Invalid value for card
>
> how can i open my "virtual" device in asound.conf
>
> here is asound.conf:
>
>
> pcm.!default {
> type plug
> slave.pcm "output"
> }
>
> pcm.output {
> type dmix
> ipc_key 1024
> slave {
> pcm "hw:0,0"
> channels 2
> rate 44100
> format S16_LE
> }
> }
>
> pcm.dsp0 {
> type plug
> slave.pcm "output"
> }
>
> ...exists some universal method how can i open all HW device and "virtual"
> devices?
Did you try to open "default", "output" or "dsp0" since these are the
names of your pcm defines?
Cheers,
Sebastian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: open sound device from asound.conf
2010-07-23 9:26 ` Sebastian H.
@ 2010-07-23 9:43 ` Peter Lukac
2010-07-23 10:12 ` Sebastian H.
0 siblings, 1 reply; 5+ messages in thread
From: Peter Lukac @ 2010-07-23 9:43 UTC (permalink / raw)
To: alsa-devel
> Am 23.07.2010 11:12, schrieb Peter Lukac:
> > hello all
> > maybe trivial question...
> >
> > I want open sound device from /etc/asound.conf with API
> > snd_pcm_open() but unsuccessfull. As name i'm used:
> >
> > "plughw:0,0"
> > "plughw:0,1"
> > "plughw:0,2"
> > "plughw:1,0"
> > "plughw:1,1"
> > "plughw:1,2"
> > ...
> > i'm try alternative name with "hw:X,Y"
> > "hw:0,0"
> > "hw:0,1"
> > ...
> > but in this method i'm open only HW device.
> > I'm get follow error:
> > ALSA lib pcm_hw.c:1429:(_snd_pcm_hw_open) Invalid value for card
> >
> > how can i open my "virtual" device in asound.conf
> >
> > here is asound.conf:
> >
> >
> > pcm.!default {
> > type plug
> > slave.pcm "output"
> > }
> >
> > pcm.output {
> > type dmix
> > ipc_key 1024
> > slave {
> > pcm "hw:0,0"
> > channels 2
> > rate 44100
> > format S16_LE
> > }
> > }
> >
> > pcm.dsp0 {
> > type plug
> > slave.pcm "output"
> > }
> >
> > ...exists some universal method how can i open all HW device and
> > "virtual" devices?
>
> Did you try to open "default", "output" or "dsp0" since these are the
> names of your pcm defines?
thanks for reply...
Yes it works..(device is open) but i don't want open device with "hard coded"
name because this name can be changed..I want to use iterations
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: open sound device from asound.conf
2010-07-23 9:43 ` Peter Lukac
@ 2010-07-23 10:12 ` Sebastian H.
2010-07-23 11:30 ` Raymond Yau
0 siblings, 1 reply; 5+ messages in thread
From: Sebastian H. @ 2010-07-23 10:12 UTC (permalink / raw)
To: alsa-devel
>>> I want open sound device from /etc/asound.conf with API
>>> snd_pcm_open() but unsuccessfull. As name i'm used:
>>
>> Did you try to open "default", "output" or "dsp0" since these are the
>> names of your pcm defines?
>
> thanks for reply...
> Yes it works..(device is open) but i don't want open device with "hard coded"
> name because this name can be changed..I want to use iterations
I'm just a user but I guess you would have to parse the pcm subsection
of the Alsa configuration tree with the snd_config_* functions.
http://www.alsa-project.org/alsa-doc/alsa-lib/group___config.html
Sebastian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: open sound device from asound.conf
2010-07-23 10:12 ` Sebastian H.
@ 2010-07-23 11:30 ` Raymond Yau
0 siblings, 0 replies; 5+ messages in thread
From: Raymond Yau @ 2010-07-23 11:30 UTC (permalink / raw)
To: ALSA Development Mailing List
2010/7/23 Sebastian H. <vand2@gmx.de>
> >>> I want open sound device from /etc/asound.conf with API
> >>> snd_pcm_open() but unsuccessfull. As name i'm used:
> >>
> >> Did you try to open "default", "output" or "dsp0" since these are the
> >> names of your pcm defines?
> >
> > thanks for reply...
> > Yes it works..(device is open) but i don't want open device with "hard
> coded"
> > name because this name can be changed..I want to use iterations
>
> I'm just a user but I guess you would have to parse the pcm subsection
> of the Alsa configuration tree with the snd_config_* functions.
>
> http://www.alsa-project.org/alsa-doc/alsa-lib/group___config.html
>
> Sebastian
>
>
Use namehint , but your asoundrc must have correct syntax since the parser
is unable to know any spelling mistake
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4298
/usr/share/alsa/alsa.conf
# show all name hints also for definitions without hint {} section
defaults.namehint.showall off <---- on
# show just basic name hints
defaults.namehint.basic on
# show extended name hints
defaults.namehint.extended off <---- on
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-07-23 11:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-23 9:12 open sound device from asound.conf Peter Lukac
2010-07-23 9:26 ` Sebastian H.
2010-07-23 9:43 ` Peter Lukac
2010-07-23 10:12 ` Sebastian H.
2010-07-23 11:30 ` Raymond Yau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.