* How to access vendor specific AC97 codec register ?
@ 2006-04-20 15:05 alasinski
2006-04-20 15:20 ` Takashi Iwai
2006-04-20 15:27 ` Lee Revell
0 siblings, 2 replies; 15+ messages in thread
From: alasinski @ 2006-04-20 15:05 UTC (permalink / raw)
To: alsa-devel
Hi,
I need to do IO specific operation from UCB1400 on Snapper Arm board. This
has to be done from C code as it is part of a larger project. All what I
need is to be able to read and write content of the few vendor specific AC97
codec registers: 0x5A,0x5C. I'm not interested with any other ALSA
functionality.
I have ALSA installed and running with simple programs that can successfully
open controller with snd_ctl_open () and list available control elements.
This is basically J.C.Georgas sample I found. I can read content of all AC97
registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That assures me
that all driver and lib parts are working. All what I need is to write a
simple piece of code ....
However, I spent 2 days reading through ALSA back and forth and I find this
task very daunting to say at least. For one things I was not able to find an
architecture document explaining how parts of ALSA work, to be able to find
some sort of direction. There are samples dedicated to solving some of a
problems, unfortunately not my problem. Man pages and reference are only
little more then code browsing. Tutorials explain in brief what I don't need
to know. In summary: typical situation when you are tasked with something
that is off main stream.
I have an inkling that I should prepare UCB1400.conf file to define control
elements that map to the registers (how ?). Then I should be able to
snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
around: something like making ioctl() call on a driver directly w/o
libasound. I'm in lost.
I will appreciate any suggestions and helpful hints
cheers
-al
a l a s i n s k i @ r o g e r s . c o m
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: How to access vendor specific AC97 codec register ?
2006-04-20 15:05 How to access vendor specific AC97 codec register ? alasinski
@ 2006-04-20 15:20 ` Takashi Iwai
2006-04-20 15:34 ` alasinski
2006-04-20 15:27 ` Lee Revell
1 sibling, 1 reply; 15+ messages in thread
From: Takashi Iwai @ 2006-04-20 15:20 UTC (permalink / raw)
To: alasinski; +Cc: alsa-devel
At Thu, 20 Apr 2006 11:05:38 -0400,
alasinski wrote:
>
> Hi,
>
> I need to do IO specific operation from UCB1400 on Snapper Arm board. This
> has to be done from C code as it is part of a larger project. All what I
> need is to be able to read and write content of the few vendor specific AC97
> codec registers: 0x5A,0x5C. I'm not interested with any other ALSA
> functionality.
>
> I have ALSA installed and running with simple programs that can successfully
> open controller with snd_ctl_open () and list available control elements.
> This is basically J.C.Georgas sample I found. I can read content of all AC97
> registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That assures me
> that all driver and lib parts are working. All what I need is to write a
> simple piece of code ....
>
> However, I spent 2 days reading through ALSA back and forth and I find this
> task very daunting to say at least. For one things I was not able to find an
> architecture document explaining how parts of ALSA work, to be able to find
> some sort of direction. There are samples dedicated to solving some of a
> problems, unfortunately not my problem. Man pages and reference are only
> little more then code browsing. Tutorials explain in brief what I don't need
> to know. In summary: typical situation when you are tasked with something
> that is off main stream.
>
> I have an inkling that I should prepare UCB1400.conf file to define control
> elements that map to the registers (how ?). Then I should be able to
> snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
> around: something like making ioctl() call on a driver directly w/o
> libasound. I'm in lost.
You have to implement an accessor (e.g. via ALSA control API) to the
certain ac97 registers in the driver. There is no generic interface
allowing you to access the all ac97 registers.
(The proc file is an exception. It's provided only for debugging
purpose.)
Takashi
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: How to access vendor specific AC97 codec register ?
2006-04-20 15:05 How to access vendor specific AC97 codec register ? alasinski
2006-04-20 15:20 ` Takashi Iwai
@ 2006-04-20 15:27 ` Lee Revell
2006-04-20 15:48 ` How to access vendor specific AC97 codec register? alasinski
1 sibling, 1 reply; 15+ messages in thread
From: Lee Revell @ 2006-04-20 15:27 UTC (permalink / raw)
To: alasinski; +Cc: alsa-devel
On Thu, 2006-04-20 at 11:05 -0400, alasinski wrote:
> I need to do IO specific operation from UCB1400 on Snapper Arm board.
> This has to be done from C code as it is part of a larger project. All
> what I need is to be able to read and write content of the few vendor
> specific AC97 codec registers: 0x5A,0x5C. I'm not interested with any
> other ALSA functionality.
Did you read the "Writing an ALSA driver" document? It sounds like you
just want simple mixer controls (change the value of the codec register
when user toggles a mixer control)? Look at any existing ALSA driver
for an example.
Lee
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: How to access vendor specific AC97 codec register ?
2006-04-20 15:20 ` Takashi Iwai
@ 2006-04-20 15:34 ` alasinski
2006-04-20 15:58 ` Takashi Iwai
0 siblings, 1 reply; 15+ messages in thread
From: alasinski @ 2006-04-20 15:34 UTC (permalink / raw)
To: alsa-devel
Thx Takashi,
since I'm not being well frased in ALSA terminology I need some guidance:
- what "accessor" is ?
- Is it part of the driver or asoundlib ?
- what ALSA files, calls are involved ?
- where can I find some explanation on it ?
- do you have a sample that implements other (similar ?) accessor ?
cheers
-al
"Takashi Iwai" <tiwai@suse.de> wrote in message
news:s5hbquwb7f0.wl%tiwai@suse.de...
> At Thu, 20 Apr 2006 11:05:38 -0400,
> alasinski wrote:
>>
>> Hi,
>>
>> I need to do IO specific operation from UCB1400 on Snapper Arm board.
>> This
>> has to be done from C code as it is part of a larger project. All what I
>> need is to be able to read and write content of the few vendor specific
>> AC97
>> codec registers: 0x5A,0x5C. I'm not interested with any other ALSA
>> functionality.
>>
>> I have ALSA installed and running with simple programs that can
>> successfully
>> open controller with snd_ctl_open () and list available control elements.
>> This is basically J.C.Georgas sample I found. I can read content of all
>> AC97
>> registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That assures
>> me
>> that all driver and lib parts are working. All what I need is to write a
>> simple piece of code ....
>>
>> However, I spent 2 days reading through ALSA back and forth and I find
>> this
>> task very daunting to say at least. For one things I was not able to find
>> an
>> architecture document explaining how parts of ALSA work, to be able to
>> find
>> some sort of direction. There are samples dedicated to solving some of a
>> problems, unfortunately not my problem. Man pages and reference are only
>> little more then code browsing. Tutorials explain in brief what I don't
>> need
>> to know. In summary: typical situation when you are tasked with something
>> that is off main stream.
>>
>> I have an inkling that I should prepare UCB1400.conf file to define
>> control
>> elements that map to the registers (how ?). Then I should be able to
>> snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
>> around: something like making ioctl() call on a driver directly w/o
>> libasound. I'm in lost.
>
> You have to implement an accessor (e.g. via ALSA control API) to the
> certain ac97 registers in the driver. There is no generic interface
> allowing you to access the all ac97 registers.
> (The proc file is an exception. It's provided only for debugging
> purpose.)
>
>
> Takashi
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: How to access vendor specific AC97 codec register?
2006-04-20 15:27 ` Lee Revell
@ 2006-04-20 15:48 ` alasinski
2006-04-20 16:13 ` Liam Girdwood
0 siblings, 1 reply; 15+ messages in thread
From: alasinski @ 2006-04-20 15:48 UTC (permalink / raw)
To: alsa-devel
Thx Lee,
I have looked at pxa2xx-ac97.c driver. It provides generic functions to
read/write any ac97 register: pxa2xx_ac97_read/write that are made available
to generic ac97_codec with snd_ac97_bus() call. My problem is I don't know
how to invoke those functions with proper arguments from application level.
It all goes through the generic concept of element I suppose. I fail to
correlate element value with a particular register I want. So far I'm lead
to believe that there is no need to change a driver, perhaps only do
configuration on asoundlib.
Do you see the way how to do it ?
cheers
-al
"Lee Revell" <rlrevell@joe-job.com> wrote in message
news:1145546855.3008.0.camel@mindpipe...
> On Thu, 2006-04-20 at 11:05 -0400, alasinski wrote:
>> I need to do IO specific operation from UCB1400 on Snapper Arm board.
>> This has to be done from C code as it is part of a larger project. All
>> what I need is to be able to read and write content of the few vendor
>> specific AC97 codec registers: 0x5A,0x5C. I'm not interested with any
>> other ALSA functionality.
>
> Did you read the "Writing an ALSA driver" document? It sounds like you
> just want simple mixer controls (change the value of the codec register
> when user toggles a mixer control)? Look at any existing ALSA driver
> for an example.
>
> Lee
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: How to access vendor specific AC97 codec register ?
2006-04-20 15:34 ` alasinski
@ 2006-04-20 15:58 ` Takashi Iwai
2006-04-20 16:15 ` alasinski
0 siblings, 1 reply; 15+ messages in thread
From: Takashi Iwai @ 2006-04-20 15:58 UTC (permalink / raw)
To: alasinski; +Cc: alsa-devel
At Thu, 20 Apr 2006 11:34:22 -0400,
alasinski wrote:
>
> Thx Takashi,
>
> since I'm not being well frased in ALSA terminology I need some guidance:
> - what "accessor" is ?
I meant in a general sense. The method to access to the hardware.
> - Is it part of the driver or asoundlib ?
As written, in driver.
> - what ALSA files, calls are involved ?
Depends on your hardware.
> - where can I find some explanation on it ?
In the source code.
> - do you have a sample that implements other (similar ?) accessor ?
It should be just like other mixer elements accessing to ac97
registers.
Takashi
> cheers
> -al
>
> "Takashi Iwai" <tiwai@suse.de> wrote in message
> news:s5hbquwb7f0.wl%tiwai@suse.de...
> > At Thu, 20 Apr 2006 11:05:38 -0400,
> > alasinski wrote:
> >>
> >> Hi,
> >>
> >> I need to do IO specific operation from UCB1400 on Snapper Arm board.
> >> This
> >> has to be done from C code as it is part of a larger project. All what I
> >> need is to be able to read and write content of the few vendor specific
> >> AC97
> >> codec registers: 0x5A,0x5C. I'm not interested with any other ALSA
> >> functionality.
> >>
> >> I have ALSA installed and running with simple programs that can
> >> successfully
> >> open controller with snd_ctl_open () and list available control elements.
> >> This is basically J.C.Georgas sample I found. I can read content of all
> >> AC97
> >> registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That assures
> >> me
> >> that all driver and lib parts are working. All what I need is to write a
> >> simple piece of code ....
> >>
> >> However, I spent 2 days reading through ALSA back and forth and I find
> >> this
> >> task very daunting to say at least. For one things I was not able to find
> >> an
> >> architecture document explaining how parts of ALSA work, to be able to
> >> find
> >> some sort of direction. There are samples dedicated to solving some of a
> >> problems, unfortunately not my problem. Man pages and reference are only
> >> little more then code browsing. Tutorials explain in brief what I don't
> >> need
> >> to know. In summary: typical situation when you are tasked with something
> >> that is off main stream.
> >>
> >> I have an inkling that I should prepare UCB1400.conf file to define
> >> control
> >> elements that map to the registers (how ?). Then I should be able to
> >> snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
> >> around: something like making ioctl() call on a driver directly w/o
> >> libasound. I'm in lost.
> >
> > You have to implement an accessor (e.g. via ALSA control API) to the
> > certain ac97 registers in the driver. There is no generic interface
> > allowing you to access the all ac97 registers.
> > (The proc file is an exception. It's provided only for debugging
> > purpose.)
> >
> >
> > Takashi
> >
> >
> > -------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job
> > easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
>
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
>
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: How to access vendor specific AC97 codec register?
2006-04-20 15:48 ` How to access vendor specific AC97 codec register? alasinski
@ 2006-04-20 16:13 ` Liam Girdwood
2006-04-20 16:19 ` Takashi Iwai
2006-04-20 16:37 ` Re: How to access vendor specific AC97 codecregister? alasinski
0 siblings, 2 replies; 15+ messages in thread
From: Liam Girdwood @ 2006-04-20 16:13 UTC (permalink / raw)
To: alasinski; +Cc: alsa-devel
On Thu, 2006-04-20 at 11:48 -0400, alasinski wrote:
> Thx Lee,
>
> I have looked at pxa2xx-ac97.c driver. It provides generic functions to
> read/write any ac97 register: pxa2xx_ac97_read/write that are made available
> to generic ac97_codec with snd_ac97_bus() call. My problem is I don't know
> how to invoke those functions with proper arguments from application level.
You will only be able to access these functions from an ad-hoc AC97
driver. Please see the UCB14xx touch driver for implementation details.
Alternatively, you could always export the vendor specific registers
using sysfs. That way your user space program could read and write to
the codec registers exported. I've done this with the codec GPIO status
register (0x54) for the WM97xx touch drivers.
HTH
Liam
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: How to access vendor specific AC97 codec register ?
2006-04-20 15:58 ` Takashi Iwai
@ 2006-04-20 16:15 ` alasinski
0 siblings, 0 replies; 15+ messages in thread
From: alasinski @ 2006-04-20 16:15 UTC (permalink / raw)
To: alsa-devel
Thx Takashi,
In my case I'm using pxa2xx-ac97 driver by N.Pitre. It has
pxa2xx_ac97_write(ac97, reg, val) function that can write to any register
reg value val. This function is being registered with generic
pci/ac97/ac97_codec layer that implements ac97 spec. ac97_codec presents it
in all in unified way to the client with the concept of elements. This is
where I'm loosing on my tracing through the code and things becoming boor.
I'm led to believe that driver is generic enough to handle any register call
if I can find a way to request it. Does this picture make sense ?
cheers
-al
"Takashi Iwai" <tiwai@suse.de> wrote in message
news:s5h64l4b5nh.wl%tiwai@suse.de...
> At Thu, 20 Apr 2006 11:34:22 -0400,
> alasinski wrote:
>>
>> Thx Takashi,
>>
>> since I'm not being well frased in ALSA terminology I need some guidance:
>> - what "accessor" is ?
>
> I meant in a general sense. The method to access to the hardware.
>
>> - Is it part of the driver or asoundlib ?
>
> As written, in driver.
>
>> - what ALSA files, calls are involved ?
>
> Depends on your hardware.
>
>> - where can I find some explanation on it ?
>
> In the source code.
>
>> - do you have a sample that implements other (similar ?) accessor ?
>
> It should be just like other mixer elements accessing to ac97
> registers.
>
>
> Takashi
>
>
>> cheers
>> -al
>>
>> "Takashi Iwai" <tiwai@suse.de> wrote in message
>> news:s5hbquwb7f0.wl%tiwai@suse.de...
>> > At Thu, 20 Apr 2006 11:05:38 -0400,
>> > alasinski wrote:
>> >>
>> >> Hi,
>> >>
>> >> I need to do IO specific operation from UCB1400 on Snapper Arm board.
>> >> This
>> >> has to be done from C code as it is part of a larger project. All what
>> >> I
>> >> need is to be able to read and write content of the few vendor
>> >> specific
>> >> AC97
>> >> codec registers: 0x5A,0x5C. I'm not interested with any other ALSA
>> >> functionality.
>> >>
>> >> I have ALSA installed and running with simple programs that can
>> >> successfully
>> >> open controller with snd_ctl_open () and list available control
>> >> elements.
>> >> This is basically J.C.Georgas sample I found. I can read content of
>> >> all
>> >> AC97
>> >> registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That
>> >> assures
>> >> me
>> >> that all driver and lib parts are working. All what I need is to write
>> >> a
>> >> simple piece of code ....
>> >>
>> >> However, I spent 2 days reading through ALSA back and forth and I find
>> >> this
>> >> task very daunting to say at least. For one things I was not able to
>> >> find
>> >> an
>> >> architecture document explaining how parts of ALSA work, to be able to
>> >> find
>> >> some sort of direction. There are samples dedicated to solving some of
>> >> a
>> >> problems, unfortunately not my problem. Man pages and reference are
>> >> only
>> >> little more then code browsing. Tutorials explain in brief what I
>> >> don't
>> >> need
>> >> to know. In summary: typical situation when you are tasked with
>> >> something
>> >> that is off main stream.
>> >>
>> >> I have an inkling that I should prepare UCB1400.conf file to define
>> >> control
>> >> elements that map to the registers (how ?). Then I should be able to
>> >> snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
>> >> around: something like making ioctl() call on a driver directly w/o
>> >> libasound. I'm in lost.
>> >
>> > You have to implement an accessor (e.g. via ALSA control API) to the
>> > certain ac97 registers in the driver. There is no generic interface
>> > allowing you to access the all ac97 registers.
>> > (The proc file is an exception. It's provided only for debugging
>> > purpose.)
>> >
>> >
>> > Takashi
>> >
>> >
>> > -------------------------------------------------------
>> > Using Tomcat but need to do more? Need to support web services,
>> > security?
>> > Get stuff done quickly with pre-integrated technology to make your job
>> > easier
>> > Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> > Geronimo
>> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>
>>
>>
>>
>>
>> -------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/alsa-devel
>>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: How to access vendor specific AC97 codec register?
2006-04-20 16:13 ` Liam Girdwood
@ 2006-04-20 16:19 ` Takashi Iwai
2006-04-20 16:37 ` Liam Girdwood
2006-04-20 16:37 ` Re: How to access vendor specific AC97 codecregister? alasinski
1 sibling, 1 reply; 15+ messages in thread
From: Takashi Iwai @ 2006-04-20 16:19 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alasinski, alsa-devel
At Thu, 20 Apr 2006 17:13:47 +0100,
Liam Girdwood wrote:
>
> Alternatively, you could always export the vendor specific registers
> using sysfs. That way your user space program could read and write to
> the codec registers exported. I've done this with the codec GPIO status
> register (0x54) for the WM97xx touch drivers.
Well, I don't think sysfs as an API is a good idea although you can
use it as a simple workaround...
Takashi
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: How to access vendor specific AC97 codec register?
2006-04-20 16:19 ` Takashi Iwai
@ 2006-04-20 16:37 ` Liam Girdwood
0 siblings, 0 replies; 15+ messages in thread
From: Liam Girdwood @ 2006-04-20 16:37 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alasinski, alsa-devel
On Thu, 2006-04-20 at 18:19 +0200, Takashi Iwai wrote:
> At Thu, 20 Apr 2006 17:13:47 +0100,
> Liam Girdwood wrote:
> >
> > Alternatively, you could always export the vendor specific registers
> > using sysfs. That way your user space program could read and write to
> > the codec registers exported. I've done this with the codec GPIO status
> > register (0x54) for the WM97xx touch drivers.
>
> Well, I don't think sysfs as an API is a good idea although you can
> use it as a simple workaround...
>
Agreed, I really only use it for testing. Although, a standard AC97 gpio
API would be nice (if anyone has the time to add one).
Liam
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: How to access vendor specific AC97 codecregister?
2006-04-20 16:13 ` Liam Girdwood
2006-04-20 16:19 ` Takashi Iwai
@ 2006-04-20 16:37 ` alasinski
2006-04-20 16:57 ` Liam Girdwood
1 sibling, 1 reply; 15+ messages in thread
From: alasinski @ 2006-04-20 16:37 UTC (permalink / raw)
To: alsa-devel
Thx Liam,
> You will only be able to access these functions from an ad-hoc AC97
> driver. Please see the UCB14xx touch driver for implementation details.
- where I can find it ?
> Alternatively, you could always export the vendor specific registers
> using sysfs. That way your user space program could read and write to
> the codec registers exported. I've done this with the codec GPIO status
> register (0x54) for the WM97xx touch drivers.
How to go about using sysfs() to access to registers ? It provides info on
file system equivalent to /proc/filesystems content I'm told. I know of one
way to do it: I can map registers into user space with open("/dev/mem",...)
followed by mmap (...). Then I'm a king and can read/write to any of them.
This is actually my fallback plan if ALSA proves to be to difficult (which
start looking right now). Interacting with registers directly from a user
program is not a recommended way: first timing become an issue, secondly I'm
afraid of unexpected interaction with a driver that is already loaded,
thirdly there is an initialization stuff that needs to be done on UCB1400 as
part of generic AC97 "bring to life" that I would rather delegate to ALSA
driver rather then go over it all myself.
> I've done this with the codec GPIO status register (0x54) for the WM97xx
> touch drivers.
Did you handled AC97 initialization yourself, or you relied on other driver
(exp: ALSA) ?
cheers
-al
"Liam Girdwood" <liam.girdwood@wolfsonmicro.com> wrote in message
news:1145549628.25762.4.camel@localhost.localdomain...
> On Thu, 2006-04-20 at 11:48 -0400, alasinski wrote:
>> Thx Lee,
>>
>> I have looked at pxa2xx-ac97.c driver. It provides generic functions to
>> read/write any ac97 register: pxa2xx_ac97_read/write that are made
>> available
>> to generic ac97_codec with snd_ac97_bus() call. My problem is I don't
>> know
>> how to invoke those functions with proper arguments from application
>> level.
>
> You will only be able to access these functions from an ad-hoc AC97
> driver. Please see the UCB14xx touch driver for implementation details.
>
> Alternatively, you could always export the vendor specific registers
> using sysfs. That way your user space program could read and write to
> the codec registers exported. I've done this with the codec GPIO status
> register (0x54) for the WM97xx touch drivers.
>
> HTH
>
> Liam
>
>
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: Re: How to access vendor specific AC97 codecregister?
2006-04-20 16:37 ` Re: How to access vendor specific AC97 codecregister? alasinski
@ 2006-04-20 16:57 ` Liam Girdwood
2006-04-20 17:40 ` Re: Re: How to access vendor specific AC97codecregister? alasinski
0 siblings, 1 reply; 15+ messages in thread
From: Liam Girdwood @ 2006-04-20 16:57 UTC (permalink / raw)
To: alasinski; +Cc: alsa-devel
On Thu, 2006-04-20 at 12:37 -0400, alasinski wrote:
> Thx Liam,
>
> > You will only be able to access these functions from an ad-hoc AC97
> > driver. Please see the UCB14xx touch driver for implementation details.
> - where I can find it ?
Please use Google.
>
> > Alternatively, you could always export the vendor specific registers
> > using sysfs. That way your user space program could read and write to
> > the codec registers exported. I've done this with the codec GPIO status
> > register (0x54) for the WM97xx touch drivers.
As Takashi said this is really not a standard way to do this. Your
probably better of writing your own driver to handle your codec GPIO
needs.
> How to go about using sysfs() to access to registers ? It provides info on
> file system equivalent to /proc/filesystems content I'm told. I know of one
> way to do it: I can map registers into user space with open("/dev/mem",...)
> followed by mmap (...). Then I'm a king and can read/write to any of them.
This wont work for AC97 codec registers as they are not part of the host
memory map and are accessed via the hosts AC97 controller.
> > I've done this with the codec GPIO status register (0x54) for the WM97xx
> > touch drivers.
> Did you handled AC97 initialization yourself, or you relied on other driver
> (exp: ALSA) ?
>
I used the standard Alsa AC97 codec driver and every thing works fine
for me.
Liam
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: Re: How to access vendor specific AC97codecregister?
2006-04-20 16:57 ` Liam Girdwood
@ 2006-04-20 17:40 ` alasinski
2006-04-20 18:14 ` Liam Girdwood
0 siblings, 1 reply; 15+ messages in thread
From: alasinski @ 2006-04-20 17:40 UTC (permalink / raw)
To: alsa-devel
Liam Girdwood wrote:
>> > You will only be able to access these functions from an ad-hoc AC97
>> > driver. Please see the UCB14xx touch driver for implementation details.
>> - where I can find it ?
>
> Please use Google.
Your Google must be better then mine. But I don't give up, I'm still
looking. For sure UCB14xx leads nowhere. Little hint could go long way.
>> How to go about using sysfs() to access to registers ? It provides info
>> on
>> file system equivalent to /proc/filesystems content I'm told. I know of
>> one
>> way to do it: I can map registers into user space with
>> open("/dev/mem",...)
>> followed by mmap (...). Then I'm a king and can read/write to any of
>> them.
>
> This wont work for AC97 codec registers as they are not part of the host
> memory map and are accessed via the hosts AC97 controller.
It should. What I intended to do is make same calls as pxa2xx_ac97_read. It
talks to memory mapped AC97 codec registers to obtain content of UCB1400
registers. They appear to be mapped 1 to 1 with gsr_bit toggled as a
handshake protocol.
Is sysfs() going to be more helpfull ?
cheers
-al
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: Re: Re: How to access vendor specific AC97codecregister?
2006-04-20 17:40 ` Re: Re: How to access vendor specific AC97codecregister? alasinski
@ 2006-04-20 18:14 ` Liam Girdwood
2006-04-20 18:54 ` Re: Re: Re: How to access vendor specificAC97codecregister? alasinski
0 siblings, 1 reply; 15+ messages in thread
From: Liam Girdwood @ 2006-04-20 18:14 UTC (permalink / raw)
To: alasinski; +Cc: alsa-devel
On Thu, 2006-04-20 at 13:40 -0400, alasinski wrote:
> Liam Girdwood wrote:
>
> >> > You will only be able to access these functions from an ad-hoc AC97
> >> > driver. Please see the UCB14xx touch driver for implementation details.
> >> - where I can find it ?
> >
> > Please use Google.
> Your Google must be better then mine. But I don't give up, I'm still
> looking. For sure UCB14xx leads nowhere. Little hint could go long way.
>
Google for "linux ucb touchscreen driver"
Also look in drivers/mfd/
> >
> > This wont work for AC97 codec registers as they are not part of the host
> > memory map and are accessed via the hosts AC97 controller.
> It should. What I intended to do is make same calls as pxa2xx_ac97_read. It
> talks to memory mapped AC97 codec registers to obtain content of UCB1400
> registers. They appear to be mapped 1 to 1 with gsr_bit toggled as a
> handshake protocol.
>
I'm afraid it's not a simple as that (only register 0x54 can work this
way - see pxa manual on AC97 slot 12). You still have to check and clear
the command and status done bits in GSR. You will also have to manage
access with the audio driver as only one read/write can take place at a
time over the AC97 link. I'm not sure how your going to use your mmap
vm_ops to do all this.
> Is sysfs() going to be more helpfull ?
>
It depends on what your trying to do.
Liam
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: Re: Re: How to access vendor specificAC97codecregister?
2006-04-20 18:14 ` Liam Girdwood
@ 2006-04-20 18:54 ` alasinski
0 siblings, 0 replies; 15+ messages in thread
From: alasinski @ 2006-04-20 18:54 UTC (permalink / raw)
To: alsa-devel
>> Your Google must be better then mine. But I don't give up, I'm still
>> looking. For sure UCB14xx leads nowhere. Little hint could go long way.
> Google for "linux ucb touchscreen driver"
> Also look in drivers/mfd/
OK, I have: drivers/mfd/ucb1x00*.* I will look at those. Thx
>> > This wont work for AC97 codec registers as they are not part of the
>> > host
>> > memory map and are accessed via the hosts AC97 controller.
>> It should. What I intended to do is make same calls as pxa2xx_ac97_read.
>> It
>> talks to memory mapped AC97 codec registers to obtain content of UCB1400
>> registers. They appear to be mapped 1 to 1 with gsr_bit toggled as a
>> handshake protocol.
>>
> I'm afraid it's not a simple as that (only register 0x54 can work this
> way - see pxa manual on AC97 slot 12). You still have to check and clear
> the command and status done bits in GSR. You will also have to manage
> access with the audio driver as only one read/write can take place at a
> time over the AC97 link. I'm not sure how your going to use your mmap
> vm_ops to do all this.
I'm not sure either. If pxa2xx_ac97_read() can do it (remenber /proc/...regs
where all registers are listed?), why applying same strategy in a user code
would fail ? At that point I will just cobble some code and let it try. As
far interference with existing ALSA it may be tricky. I will find out a hard
way, I'm afraid. Will keep you posted. Thx.
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2006-04-20 18:54 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-20 15:05 How to access vendor specific AC97 codec register ? alasinski
2006-04-20 15:20 ` Takashi Iwai
2006-04-20 15:34 ` alasinski
2006-04-20 15:58 ` Takashi Iwai
2006-04-20 16:15 ` alasinski
2006-04-20 15:27 ` Lee Revell
2006-04-20 15:48 ` How to access vendor specific AC97 codec register? alasinski
2006-04-20 16:13 ` Liam Girdwood
2006-04-20 16:19 ` Takashi Iwai
2006-04-20 16:37 ` Liam Girdwood
2006-04-20 16:37 ` Re: How to access vendor specific AC97 codecregister? alasinski
2006-04-20 16:57 ` Liam Girdwood
2006-04-20 17:40 ` Re: Re: How to access vendor specific AC97codecregister? alasinski
2006-04-20 18:14 ` Liam Girdwood
2006-04-20 18:54 ` Re: Re: Re: How to access vendor specificAC97codecregister? alasinski
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.