9front - general discussion about 9front
 help / color / mirror / Atom feed
* Audio in Lenovo T400
@ 2015-10-11 19:28 ghi
  2015-10-11 20:42 ` [9front] " cinap_lenrek
  0 siblings, 1 reply; 5+ messages in thread
From: ghi @ 2015-10-11 19:28 UTC (permalink / raw)
  To: 9front

Hi,
I've bought Lenovo Thinkpad T400 to run 9front on it. The only pice of 
hardware that is not working right now is audio device. I've tested it 
with play(1) and some ogg file and I can hear no sound. Master in 
/dev/volume is set to 100 so i believe that i should hear something.

Now I have several questions regarding this problem.

1. Where are audio devices drivers stored? I believe that in 
/sys/src/9/pc but I'm not fully certain.

2. How I can test audio card to be sure that this is a driver problem.

3. Which file use as a template for new audio driver? And how to setup 
driver development envirmoent(can i load drivers into kernel without 
restarting machine? how to test and compile the driver?)

BR
ghi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Audio in Lenovo T400
  2015-10-11 19:28 Audio in Lenovo T400 ghi
@ 2015-10-11 20:42 ` cinap_lenrek
  2015-10-12 20:02   ` ghi
  0 siblings, 1 reply; 5+ messages in thread
From: cinap_lenrek @ 2015-10-11 20:42 UTC (permalink / raw)
  To: 9front

> 1. Where are audio devices drivers stored? I believe that in 
> /sys/src/9/pc but I'm not fully certain.

intel hd audio driver source is /sys/src/9/pc/audiohda.c, which
gets called by by /sys/src/9/port/devaudio.c

> 2. How I can test audio card to be sure that this is a driver problem.

you probably just need to set the right output pin in /dev/audioctl

> 3. Which file use as a template for new audio driver? And how to setup 
> driver development envirmoent(can i load drivers into kernel without 
> restarting machine? how to test and compile the driver?)

you can pick any /sys/src/9/pc/audio*.c as a template. the plan9
kernel does not have loadable kernel drivers. kernel drivers are
build into the kernel and require a new kernel to be build
and a reboot after a change them to test. vga drivers and usb
drivers are just normal userspace programs tho. so not all driver
development requires a kernel driver.

i have a bunch of plan9 machines running, so for driver development,
i just netboot the machine with the hardware with my development
kernel.

plan9 kernel is quite simple, you should have no problem figuring
it out by looking at the other drivers. the kernel you build is
build from a configuration file, /sys/src/9/pc/9pcf is build from
/sys/src/9/pc/pcf for example. this file contains the list of
drivers that get build into it. there are two types of kernel
drivers:

dev: which export a Dev structure with function pointers to
implement a (kernel) fileserver, they are all named dev*.c.

link: which just export a <nameofdriver>link() function
that gets called early on boot. the audio and ethernet drivers are
of this kind. they do not implement the device fileservice directly
but just register themselfs in ther link function with a dev.

you build a kernel with mk. mk 'CONF=confname' to build a kernel
of a specific configuration. gives you 9confname kernel image.

--
cinap


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Audio in Lenovo T400
  2015-10-11 20:42 ` [9front] " cinap_lenrek
@ 2015-10-12 20:02   ` ghi
  0 siblings, 0 replies; 5+ messages in thread
From: ghi @ 2015-10-12 20:02 UTC (permalink / raw)
  To: cinap_lenrek; +Cc: 9front

> plan9 kernel is quite simple, you should have no problem figuring
> it out by looking at the other drivers. the kernel you build is
> build from a configuration file, /sys/src/9/pc/9pcf is build from
> /sys/src/9/pc/pcf for example. this file contains the list of
> drivers that get build into it. there are two types of kernel
> drivers:
>
> dev: which export a Dev structure with function pointers to
> implement a (kernel) fileserver, they are all named dev*.c.
>
> link: which just export a <nameofdriver>link() function
> that gets called early on boot. the audio and ethernet drivers are
> of this kind. they do not implement the device fileservice directly
> but just register themselfs in ther link function with a dev.
>
> you build a kernel with mk. mk 'CONF=confname' to build a kernel
> of a specific configuration. gives you 9confname kernel image.
Thank you for explaining that. The Plan 9 has again charmed me with it's 
simplicity.

BR
ghi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Audio in Lenovo T400
  2015-10-11 20:10 sl
@ 2015-10-12  7:31 ` ghi
  0 siblings, 0 replies; 5+ messages in thread
From: ghi @ 2015-10-12  7:31 UTC (permalink / raw)
  To: 9front

> So, on this machine, pin 22 was chosen as the default. This should
> be the lineout (headphone) port. For this machine, it looks like you
> want pin 26 for the internal speaker. You can set the pin like this:
>
> 	% echo pin 26 >/dev/audioctl
It works. Thank you.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9front] Audio in Lenovo T400
@ 2015-10-11 20:10 sl
  2015-10-12  7:31 ` ghi
  0 siblings, 1 reply; 5+ messages in thread
From: sl @ 2015-10-11 20:10 UTC (permalink / raw)
  To: 9front

> I've bought Lenovo Thinkpad T400 to run 9front on it. The only pice of 
> hardware that is not working right now is audio device. I've tested it 
> with play(1) and some ogg file and I can hear no sound. Master in 
> /dev/volume is set to 100 so i believe that i should hear something.
> 
> Now I have several questions regarding this problem.

First, let's establish that your audio card is recognized by the
kernel. Can you run sysinfo -p and let us know the URL that is
returned by the command?

It looks like we already have sysinfo for two different models of
ThinkPad T400, one of which claims to have:

	Intel Corporation 486486 82801IB/IR/IH (ICH9 Family) HD Audio Controller


From the sysinfo:

	% cat '#'A/audiostat
	bufsize   1024 buffered      0
	codec 0 pin 22 inpin 29
	aout 16 c1d
	aout 17 c1d
	aout 18 211
	beep 19 70000c
	ain 20 100d1b ← pin 29, pin 23
	ain 21 100d1b ← pin 24
	pin 22 out jack ext front hpout green ← aout 16, aout 17
	pin 23 in nothing sep rear micin pink
	pin 24 in jack ext front micin pink
	pin 25 out nothing ext N/A other ? ← aout 16, aout 17
	pin 26 out fix int N/A speaker ? eapd ← aout 16, aout 17
	pin 27 out nothing ext N/A other ? eapd ← aout 16, aout 17
	pin 28 out nothing ext N/A other ? ← aout 18
	pin 29 in fix int N/A micin ?
	beep 30 f00000
	outpath aout 16 → pin 22
	outamp aout 16
	inpath pin 29 → ain 20
	inamp ain 20


So, on this machine, pin 22 was chosen as the default. This should
be the lineout (headphone) port. For this machine, it looks like you
want pin 26 for the internal speaker. You can set the pin like this:

	% echo pin 26 >/dev/audioctl


and then verify it like this:

	% cat /dev/audiostat


If this works, you can add it to /cfg/$sysname/termrc or whatever
other method you prefer to configure the correct pin at boot time.

sl


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-12 20:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-11 19:28 Audio in Lenovo T400 ghi
2015-10-11 20:42 ` [9front] " cinap_lenrek
2015-10-12 20:02   ` ghi
2015-10-11 20:10 sl
2015-10-12  7:31 ` ghi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).