* spdif-trough and snd_ctl_elem_*
@ 2002-07-13 15:19 joy
2002-07-17 12:25 ` Takashi Iwai
0 siblings, 1 reply; 5+ messages in thread
From: joy @ 2002-07-13 15:19 UTC (permalink / raw)
To: alsa-devel
hi,
i actually want to set spdif-trough automagically from inside an application
when its needed but it seems there are differences from hardware to
hardware or/and changes in the alsa-lib-api, but im not sure.
i have an old-code fragment which dosn't work for me (ens1371).
it does not work also on the SB Live Player 5.1.
...
snd_ctl_elem_value_alloca(&ctl);
snd_ctl_elem_value_set_interface(ctl, SND_CTL_ELEM_IFACE_PCM);
snd_ctl_elem_value_set_device(ctl, snd_pcm_info_get_device(info));
snd_ctl_elem_value_set_subdevice(ctl, snd_pcm_info_get_subdevice(info));
snd_ctl_elem_value_set_name(ctl,SND_CTL_NAME_IEC958("", PLAYBACK, PCM_STREAM));
snd_ctl_elem_value_set_iec958(ctl, &spdif);
...
snd_ctl_elem_write(ctl_handler, ctl);
i got always "file or directory not found"-error with this and it's no
wonder cause i have no pcm-iface like above.
i changed now iface to SND_CTL_ELEM_IFACE_MIXER and _set_name to:
snd_ctl_elem_value_set_name(ctl,SND_CTL_NAME_IEC958("", PLAYBACK, SWITCH));
it seems to work for me but im not sure if its work on the sbLive. the
switch or whatever on the sblive is called 'IEC958 Optical Raw'.
are the switches different from hadware/mixer to hardware or im wrong?
and if yes is there an 'easy way' to get the default
spdif-through-switch?
any enlightment in this appreciated.
--
thanx and regards
____-
joy
________/\---------%%%___________-----------
webcast every sunday 2000 cest at pingfm.org
pgp key at: x-hkp://wwwkeys.de.pgp.net
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: spdif-trough and snd_ctl_elem_*
2002-07-13 15:19 spdif-trough and snd_ctl_elem_* joy
@ 2002-07-17 12:25 ` Takashi Iwai
2002-07-17 22:31 ` joy
0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2002-07-17 12:25 UTC (permalink / raw)
To: joy; +Cc: alsa-devel
At Sat, 13 Jul 2002 17:19:36 +0200,
joy wrote:
>
> hi,
>
> i actually want to set spdif-trough automagically from inside an application
> when its needed but it seems there are differences from hardware to
> hardware or/and changes in the alsa-lib-api, but im not sure.
>
> i have an old-code fragment which dosn't work for me (ens1371).
> it does not work also on the SB Live Player 5.1.
>
> ...
> snd_ctl_elem_value_alloca(&ctl);
> snd_ctl_elem_value_set_interface(ctl, SND_CTL_ELEM_IFACE_PCM);
> snd_ctl_elem_value_set_device(ctl, snd_pcm_info_get_device(info));
> snd_ctl_elem_value_set_subdevice(ctl, snd_pcm_info_get_subdevice(info));
> snd_ctl_elem_value_set_name(ctl,SND_CTL_NAME_IEC958("", PLAYBACK, PCM_STREAM));
> snd_ctl_elem_value_set_iec958(ctl, &spdif);
> ...
> snd_ctl_elem_write(ctl_handler, ctl);
>
> i got always "file or directory not found"-error with this and it's no
> wonder cause i have no pcm-iface like above.
the implementation of controls for iec958 is fairly dependent on each
card. some card needs more initialization and some not. it's true
that this might be confusing if you want to access such switches
_directly_.
on alsa, instead of tweaking these lowlevel stuffs, you can use an
abstraction pcm layer.
typically, the pcm "iec958" (or "spdif" equivalently) does all such a
job. the iec958 pcm accepts arguments which represent status bytes.
iec958:AES0=0xXXXX,AES1=0xXXXX,AES2=0xXXXX,AES3=0xXXXX
whether it's raw data, on which sample rate, etc. are determined by
these bytes. (please check the specification document for details.)
you can pass this string as a pcm name of snd_pcm_open(),
snd_pcm_open(&pcm, "iec958:....", SND_PCM_STREAM_PLAYBACK, 0);
how the iec958 pcm works on each card is defined in the card config
file found under /usr/share/alsa/cards. for example, emu10k1 toggles
some control switches as you found and passes the status bytes.
well, it seems that ens1371 has still no configuration for iec958.
so, the right way is to add this stuff...
Takashi
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: spdif-trough and snd_ctl_elem_*
2002-07-17 12:25 ` Takashi Iwai
@ 2002-07-17 22:31 ` joy
2002-07-19 18:03 ` Takashi Iwai
0 siblings, 1 reply; 5+ messages in thread
From: joy @ 2002-07-17 22:31 UTC (permalink / raw)
To: alsa-devel
On Wed, Jul 17, 2002 at 02:25:58PM +0200, Takashi Iwai wrote:
> the implementation of controls for iec958 is fairly dependent on each
> card. some card needs more initialization and some not. it's true
> that this might be confusing if you want to access such switches
> _directly_.
>
> on alsa, instead of tweaking these lowlevel stuffs, you can use an
> abstraction pcm layer.
> typically, the pcm "iec958" (or "spdif" equivalently) does all such a
> job. the iec958 pcm accepts arguments which represent status bytes.
>
> iec958:AES0=0xXXXX,AES1=0xXXXX,AES2=0xXXXX,AES3=0xXXXX
>
thanx for your reply, i will give it a try, but this kind of init
needs some more rewrite i have expected and i have currently no
iec958-capable-device to do real tests, so users have to wait bit ;)
> well, it seems that ens1371 has still no configuration for iec958.
> so, the right way is to add this stuff...
?
should i add it? will you add it? on which device is the iec958
running on the ens1371? i guess its hw:0,0
--
regards
____-
joy
________/\---------%%%___________-----------
webcast every sunday 2000 cest at pingfm.org
pgp key at: x-hkp://wwwkeys.de.pgp.net
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: spdif-trough and snd_ctl_elem_*
2002-07-17 22:31 ` joy
@ 2002-07-19 18:03 ` Takashi Iwai
2002-07-20 7:11 ` Jaroslav Kysela
0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2002-07-19 18:03 UTC (permalink / raw)
To: joy; +Cc: alsa-devel
At Thu, 18 Jul 2002 00:31:16 +0200,
joy wrote:
>
> > well, it seems that ens1371 has still no configuration for iec958.
> > so, the right way is to add this stuff...
> ?
> should i add it? will you add it? on which device is the iec958
> running on the ens1371? i guess its hw:0,0
yes. there is a switch "IEC958 Playback Switch", and we need to turn
it on in pcm hook. but i don't see any raw playback switch nor iec958
status configuration, so i have no idea how to turn to the pass-thru
mode.
Jaroslav, do you have any clue?
Takashi
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: spdif-trough and snd_ctl_elem_*
2002-07-19 18:03 ` Takashi Iwai
@ 2002-07-20 7:11 ` Jaroslav Kysela
0 siblings, 0 replies; 5+ messages in thread
From: Jaroslav Kysela @ 2002-07-20 7:11 UTC (permalink / raw)
To: Takashi Iwai; +Cc: joy, alsa-devel@lists.sourceforge.net
On Fri, 19 Jul 2002, Takashi Iwai wrote:
> At Thu, 18 Jul 2002 00:31:16 +0200,
> joy wrote:
> >
> > > well, it seems that ens1371 has still no configuration for iec958.
> > > so, the right way is to add this stuff...
> > ?
> > should i add it? will you add it? on which device is the iec958
> > running on the ens1371? i guess its hw:0,0
>
> yes. there is a switch "IEC958 Playback Switch", and we need to turn
> it on in pcm hook. but i don't see any raw playback switch nor iec958
> status configuration, so i have no idea how to turn to the pass-thru
> mode.
>
> Jaroslav, do you have any clue?
I have no information, if the ES1371 chip can configure bits in the IEC958
stream. Maybe, all bits are hardcoded.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-07-20 7:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-13 15:19 spdif-trough and snd_ctl_elem_* joy
2002-07-17 12:25 ` Takashi Iwai
2002-07-17 22:31 ` joy
2002-07-19 18:03 ` Takashi Iwai
2002-07-20 7:11 ` Jaroslav Kysela
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.