Arrandale/Ironlake support in current.

2014-06-10 Thread Johan Svensson

Hi.

I've been trying to get my laptop working (it is), but it generates alot 
of heat. I've read that thinkpad x201i is working good with apmd -C. And 
the fan is throttling down to a lower speed. So i read about the 
difference regarding x201 and x201i and noticed that the x201 model has 
turbo boost, could that be the thing that generates all this heat?


is the Arrandale/ironlake supported on openbsd yet?

This was the last i heard about that topic:
http://comments.gmane.org/gmane.os.openbsd.misc/209482


--Johan Svensson



Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-05 Thread Johan Svensson

On 06/05/14 00:53, STeve Andre' wrote:

On 06/04/14 17:08, Johan Svensson wrote:
I'm trying to migrate from Linux to Openbsd on my laptop (thinkpad 
x201).


The first problem that i came across was that the Cpu fanspeed was 
running constantly at 3500RPM.
After the acpithinkpad.c patch from jcs (and i modified to make it 
work on the openbsd-current(link: 
http://exclude.se/patch/jcs_mod_by_js.diff)


Another thing that i noticed is that the battery lifetime is really bad.
In Linux i get around ~5,5 hours.
In OpenBSD i get around 2 hours.

when i ran : sysctl hw.sensors | grep -i consumption.
the output of the cpu was 6W.

in Linux it's around 1,5W.

with: apmd -C and apmd -L it's the same.
dmesg: http://exclude.se/openbsd/dmesg.txt

Is there anyway to fix this?

Regards
Johan Svensson



Take a look at hw.setperf in sysctl.  I think you are running at the
maximum cpu speed?  On my 2.8GHz W500 I can run at 800, 1600,
2133 and 2801.  800MHz makes a huge difference.  You have to
try different values for setperf to see what happens.  sysctl will
also tell you the speed in hw.cpuspeed.

--STeve Andre'

This my output from sysctl and apm when running on the lowest clockspeed:
# sysctl hw | grep -iE cpuspeed|setperf|fan|consumption
hw.sensors.acpithinkpad0.fan0=1959 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=1199
hw.setperf=0
# apm
Battery state: high, 70% remaining, 111 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (1199 MHz)


This is the output when i use apm -H:
# sysctl hw | grep -iE cpuspeed|setperf|fan|consumption
hw.sensors.acpithinkpad0.fan0=1972 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=2666
hw.setperf=100
# apm
Battery state: high, 68% remaining, 107 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (2666 MHz)

The energy consumption is the same which is odd.

--Johan



Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-05 Thread Johan Svensson

On 2014-06-05 11:09, David Coppa wrote:

On Thu, Jun 5, 2014 at 10:53 AM, Johan Svensson open...@exclude.se wrote:


This my output from sysctl and apm when running on the lowest clockspeed:
# sysctl hw | grep -iE cpuspeed|setperf|fan|consumption
hw.sensors.acpithinkpad0.fan0=1959 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=1199
hw.setperf=0
# apm
Battery state: high, 70% remaining, 111 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (1199 MHz)


This is the output when i use apm -H:
# sysctl hw | grep -iE cpuspeed|setperf|fan|consumption
hw.sensors.acpithinkpad0.fan0=1972 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=2666
hw.setperf=100
# apm
Battery state: high, 68% remaining, 107 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (2666 MHz)

The energy consumption is the same which is odd.

Are you running with the latest bios (1.40-1.15) from Lenovo?

Yes it is the latest bios.


Hmmm.  Smells like a bug, to me.  But by changing hw.setperf your
self you should be able to go to other speeds(?).  And of course, the
real test is to see if you get longer life at setperf 0.

--STeve Andre'

# sysctl hw | grep -iE cpuspeed|setperf|fan|consumption  apm
hw.sensors.acpithinkpad0.fan0=1965 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=1199
hw.setperf=0
Battery state: high, 57% remaining, 91 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (1199 MHz)
#

It seems like that's the same output. If the processor throttles down it 
should also consume less energy, but it says 6W all the time though.




Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-05 Thread Johan Svensson

On 2014-06-05 20:43, Mike Larkin wrote:

On Thu, Jun 05, 2014 at 10:53:38AM +0200, Johan Svensson wrote:

On 06/05/14 00:53, STeve Andre' wrote:

On 06/04/14 17:08, Johan Svensson wrote:

I'm trying to migrate from Linux to Openbsd on my laptop
(thinkpad x201).

The first problem that i came across was that the Cpu fanspeed
was running constantly at 3500RPM.
After the acpithinkpad.c patch from jcs (and i modified to make
it work on the openbsd-current(link:
http://exclude.se/patch/jcs_mod_by_js.diff)

Another thing that i noticed is that the battery lifetime is really bad.
In Linux i get around ~5,5 hours.
In OpenBSD i get around 2 hours.

when i ran : sysctl hw.sensors | grep -i consumption.
the output of the cpu was 6W.

in Linux it's around 1,5W.

with: apmd -C and apmd -L it's the same.
dmesg: http://exclude.se/openbsd/dmesg.txt

Is there anyway to fix this?

Regards
Johan Svensson



Take a look at hw.setperf in sysctl.  I think you are running at the
maximum cpu speed?  On my 2.8GHz W500 I can run at 800, 1600,
2133 and 2801.  800MHz makes a huge difference.  You have to
try different values for setperf to see what happens.  sysctl will
also tell you the speed in hw.cpuspeed.

--STeve Andre'

This my output from sysctl and apm when running on the lowest clockspeed:
# sysctl hw | grep -iE cpuspeed|setperf|fan|consumption
hw.sensors.acpithinkpad0.fan0=1959 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=1199
hw.setperf=0
# apm
Battery state: high, 70% remaining, 111 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (1199 MHz)


This is the output when i use apm -H:
# sysctl hw | grep -iE cpuspeed|setperf|fan|consumption
hw.sensors.acpithinkpad0.fan0=1972 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=2666
hw.setperf=100
# apm
Battery state: high, 68% remaining, 107 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (2666 MHz)

The energy consumption is the same which is odd.

--Johan


This may be a bug in itherm(4), I'll take a look.


Tell me if you find something, i'll gladly help if I could do something.

/J



CPU power consumption on thinkpad x201 on openbsd current

2014-06-04 Thread Johan Svensson

I'm trying to migrate from Linux to Openbsd on my laptop (thinkpad x201).

The first problem that i came across was that the Cpu fanspeed was 
running constantly at 3500RPM.
After the acpithinkpad.c patch from jcs (and i modified to make it work 
on the openbsd-current(link: http://exclude.se/patch/jcs_mod_by_js.diff)


Another thing that i noticed is that the battery lifetime is really bad.
In Linux i get around ~5,5 hours.
In OpenBSD i get around 2 hours.

when i ran : sysctl hw.sensors | grep -i consumption.
the output of the cpu was 6W.

in Linux it's around 1,5W.

with: apmd -C and apmd -L it's the same.
dmesg: http://exclude.se/openbsd/dmesg.txt

Is there anyway to fix this?

Regards
Johan Svensson



Change default audiodevice in OpenBSD-current

2014-06-03 Thread Johan Svensson
I am trying to change my default output device from my builtin soundcard 
to an usb soundcard which is an output only device. I have tried:


# audioctl -f /dev/audio1
audioctl: /dev/audio1: Device not configured

I think there should be some controller that you configuring the audio 
device. But i manually tried to change the symlinks in the dev directory:

# ls -la * | grep -E mixer|audio
lrwxr-xr-x  1 root   wheel6 Jun  3 16:58 audio - audio1
crw-rw-rw-  1 root   wheel  42, 128 Jun  3 17:01 audio0
crw-rw-rw-  1 root   wheel  42, 129 May 28 19:07 audio1
crw-rw-rw-  1 root   wheel  42, 130 May 28 19:07 audio2
lrwxr-xr-x  1 root   wheel9 Jun  3 16:58 audioctl - audioctl1
crw-rw-rw-  1 root   wheel  42, 192 May 28 19:07 audioctl0
crw-rw-rw-  1 root   wheel  42, 193 May 28 19:07 audioctl1
crw-rw-rw-  1 root   wheel  42, 194 May 28 19:07 audioctl2
lrwxr-xr-x  1 root   wheel6 Jun  3 16:58 mixer - mixer1
crw-rw-rw-  1 root   wheel  42,  16 May 28 19:07 mixer0
crw-rw-rw-  1 root   wheel  42,  17 May 28 19:07 mixer1
crw-rw-rw-  1 root   wheel  42,  18 May 28 19:07 mixer2

But it is still defaulting to my builtin soundcard. How can i change the 
default sounddevice from audio0 to audio1?


/Regards
Johan Svensson

DMESG:
dmesg | grep audio
audio0 at azalia0
audio0 at azalia0
audio0 at azalia0
audio0 at azalia0
uaudio0 at uhub2 port 1 configuration 1 interface 1 NuForce, Inc. 
NuForce \M-5DAC 2 rev 1.10/0.01 addr 3

uaudio0: ignored setting with type 8193 format
uaudio0: audio rev 1.00, 2 mixer controls
audio1 at uaudio0



Re: Change default audiodevice in OpenBSD-current

2014-06-03 Thread Johan Svensson

On 06/03/14 18:22, Remco wrote:

Johan Svensson wrote:


I am trying to change my default output device from my builtin soundcard
to an usb soundcard which is an output only device. I have tried:

# audioctl -f /dev/audio1
audioctl: /dev/audio1: Device not configured


It seems this device does not exist from the kernel's point of view.
(there's also /dev/audioctl1, but using that probably doesn't make a
difference)


I think there should be some controller that you configuring the audio
device. But i manually tried to change the symlinks in the dev directory:
# ls -la * | grep -E mixer|audio
lrwxr-xr-x  1 root   wheel6 Jun  3 16:58 audio - audio1
crw-rw-rw-  1 root   wheel  42, 128 Jun  3 17:01 audio0
crw-rw-rw-  1 root   wheel  42, 129 May 28 19:07 audio1
crw-rw-rw-  1 root   wheel  42, 130 May 28 19:07 audio2
lrwxr-xr-x  1 root   wheel9 Jun  3 16:58 audioctl - audioctl1
crw-rw-rw-  1 root   wheel  42, 192 May 28 19:07 audioctl0
crw-rw-rw-  1 root   wheel  42, 193 May 28 19:07 audioctl1
crw-rw-rw-  1 root   wheel  42, 194 May 28 19:07 audioctl2
lrwxr-xr-x  1 root   wheel6 Jun  3 16:58 mixer - mixer1
crw-rw-rw-  1 root   wheel  42,  16 May 28 19:07 mixer0
crw-rw-rw-  1 root   wheel  42,  17 May 28 19:07 mixer1
crw-rw-rw-  1 root   wheel  42,  18 May 28 19:07 mixer2

But it is still defaulting to my builtin soundcard. How can i change the
default sounddevice from audio0 to audio1?


I think using sndiod(1) is the answer, in the most simplistic form,
something like this in your rc.conf.local(8) should suffice:
sndiod_flags=-f rsnd/0 -s onboard -f rsnd/1 -s default

This should make your audio0 device available as snd/0.onboard and your
audio1 device as the default sound device. (Both should be available as
snd/0 and snd/1 respectively as well IIRC).


/Regards
Johan Svensson

DMESG:
dmesg | grep audio
audio0 at azalia0
audio0 at azalia0
audio0 at azalia0
audio0 at azalia0
uaudio0 at uhub2 port 1 configuration 1 interface 1 NuForce, Inc.
NuForce \M-5DAC 2 rev 1.10/0.01 addr 3
uaudio0: ignored setting with type 8193 format

If I'm correct format 8193 (== 0x2001) means IEC1937 AC-3.
This is an encoded format. AFAICT the uaudio driver only supports plain PCM
formats. (unencoded audio samples)

Do you know if your device only supports AC-3 inputs or can it also handle
PCM signals ?

(running 'lsusb -v', from the usbutils package, on the device should give a
good clue what your device supports)


uaudio0: audio rev 1.00, 2 mixer controls
audio1 at uaudio0

I can successfully run this command:
if i use audioctl1 instead of audio1 it works, i dont know why tho.

# audioctl -f /dev/audioctl1
name=USB audio
version=
config=uaudio
encodings=slinear_le:16:2:1,slinear_le:24:3:1
properties=independent
full_duplex=0
fullduplex=0
blocksize=8816
hiwat=7
lowat=5
output_muted=0
monitor_gain=0
mode=
play.rate=44100
play.channels=2
play.precision=16
play.bps=2
play.msb=1
play.encoding=slinear_le
play.gain=127
play.balance=32
play.port=0x0
play.avail_ports=0x0
play.seek=0
play.samples=0
play.eof=0
play.pause=0
play.error=0
play.waiting=0
play.open=0
play.active=0
play.buffer_size=65536
play.block_size=8816
play.errors=0
record.rate=44100
record.channels=2
record.precision=16
record.bps=2
record.msb=1
record.encoding=slinear_le
record.gain=127
record.balance=32
record.port=0x0
record.avail_ports=0x0
record.seek=0
record.samples=0
record.eof=0
record.pause=0
record.error=0
record.waiting=0
record.open=0
record.active=0
record.buffer_size=65536
record.block_size=8816
record.errors=0

here is the output from the device in lsusb:

Bus 000 Device 003: ID 1852:db96 GYROCOM CC Co., LTD
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x1852 GYROCOM CC Co., LTD
  idProduct  0xdb96
  bcdDevice0.01
  iManufacturer   1 NuForce, Inc.
  iProduct2 NuForce µDAC 2
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength  251
bNumInterfaces  3
bConfigurationValue 1
iConfiguration  0
bmAttributes 0x80
  (Bus Powered)
MaxPower  500mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 3 Human Interface Device
  bInterfaceSubClass  0 No Subclass
  bInterfaceProtocol  0 None
  iInterface  0
HID Device Descriptor:
  bLength 9
  bDescriptorType33
  bcdHID   1.00
  bCountryCode

Re: Change default audiodevice in OpenBSD-current

2014-06-03 Thread Johan Svensson

On 06/03/14 18:22, Remco wrote:

Johan Svensson wrote:


I am trying to change my default output device from my builtin soundcard
to an usb soundcard which is an output only device. I have tried:

# audioctl -f /dev/audio1
audioctl: /dev/audio1: Device not configured


It seems this device does not exist from the kernel's point of view.
(there's also /dev/audioctl1, but using that probably doesn't make a
difference)


I think there should be some controller that you configuring the audio
device. But i manually tried to change the symlinks in the dev directory:
# ls -la * | grep -E mixer|audio
lrwxr-xr-x  1 root   wheel6 Jun  3 16:58 audio - audio1
crw-rw-rw-  1 root   wheel  42, 128 Jun  3 17:01 audio0
crw-rw-rw-  1 root   wheel  42, 129 May 28 19:07 audio1
crw-rw-rw-  1 root   wheel  42, 130 May 28 19:07 audio2
lrwxr-xr-x  1 root   wheel9 Jun  3 16:58 audioctl - audioctl1
crw-rw-rw-  1 root   wheel  42, 192 May 28 19:07 audioctl0
crw-rw-rw-  1 root   wheel  42, 193 May 28 19:07 audioctl1
crw-rw-rw-  1 root   wheel  42, 194 May 28 19:07 audioctl2
lrwxr-xr-x  1 root   wheel6 Jun  3 16:58 mixer - mixer1
crw-rw-rw-  1 root   wheel  42,  16 May 28 19:07 mixer0
crw-rw-rw-  1 root   wheel  42,  17 May 28 19:07 mixer1
crw-rw-rw-  1 root   wheel  42,  18 May 28 19:07 mixer2

But it is still defaulting to my builtin soundcard. How can i change the
default sounddevice from audio0 to audio1?


I think using sndiod(1) is the answer, in the most simplistic form,
something like this in your rc.conf.local(8) should suffice:
sndiod_flags=-f rsnd/0 -s onboard -f rsnd/1 -s default

This should make your audio0 device available as snd/0.onboard and your
audio1 device as the default sound device. (Both should be available as
snd/0 and snd/1 respectively as well IIRC).


/Regards
Johan Svensson

DMESG:
dmesg | grep audio
audio0 at azalia0
audio0 at azalia0
audio0 at azalia0
audio0 at azalia0
uaudio0 at uhub2 port 1 configuration 1 interface 1 NuForce, Inc.
NuForce \M-5DAC 2 rev 1.10/0.01 addr 3
uaudio0: ignored setting with type 8193 format

If I'm correct format 8193 (== 0x2001) means IEC1937 AC-3.
This is an encoded format. AFAICT the uaudio driver only supports plain PCM
formats. (unencoded audio samples)

Do you know if your device only supports AC-3 inputs or can it also handle
PCM signals ?

(running 'lsusb -v', from the usbutils package, on the device should give a
good clue what your device supports)


uaudio0: audio rev 1.00, 2 mixer controls
audio1 at uaudio0
I have updated my rc.conf.local line with sndiod_flags=-f rsnd/0 -s 
onboard -f rsnd/1 -s default

but the default output device is still builtin sounddevice.



Re: Change default audiodevice in OpenBSD-current

2014-06-03 Thread Johan Svensson

On 06/03/14 19:33, Alexandre Ratchov wrote:

On Tue, Jun 03, 2014 at 07:25:25PM +0200, Alexandre Ratchov wrote:

sndiod_flags=-f rsnd/1 -f rsnd/0

This will kind of exchange the first two devices. I.e. this
exposes snd/0 as sub-device of rsnd/1 and snd/1 as sub-device
of rsnd/0.


If device renumbering seems confusing/ugly, another option would be
to keep the kernel order:

sndiod_flags=-f rsnd/0 -f rsnd/1

then export AUDIODEVICE=snd/1 in your ~/.profile or equivalent

-- Alexandre

grep sndiod /etc/rc.conf.local
#sndiod_flags=-f rsnd/0 -s onboard -f rsnd/1 -s default
sndiod_flags=-f rsnd/1 -f rsnd/0
#sndiod_flags=-f rsnd/0 -f rsnd/1

I've tried all three of the settings, the first and the last defaults to 
builtin soundcard. But if I use the second configuration setting this 
shows up in dmesg:


ehci0: Error opening low/full speed isoc endpoint.
A low/full speed device is attached to a USB2 hub, and transaction 
translations are not yet supported.

Reattach the device to the root hub instead.
uaudio_chan_open: error creating pipe: err=INVAL endpt=0x03


I dont know if that helps.

//Johan



Re: Change default audiodevice in OpenBSD-current

2014-06-03 Thread Johan Svensson

On 06/03/14 20:08, Alexandre Ratchov wrote:

On Tue, Jun 03, 2014 at 07:59:49PM +0200, Johan Svensson wrote:

On 06/03/14 19:33, Alexandre Ratchov wrote:

On Tue, Jun 03, 2014 at 07:25:25PM +0200, Alexandre Ratchov wrote:

sndiod_flags=-f rsnd/1 -f rsnd/0

This will kind of exchange the first two devices. I.e. this
exposes snd/0 as sub-device of rsnd/1 and snd/1 as sub-device
of rsnd/0.


If device renumbering seems confusing/ugly, another option would be
to keep the kernel order:

sndiod_flags=-f rsnd/0 -f rsnd/1

then export AUDIODEVICE=snd/1 in your ~/.profile or equivalent

-- Alexandre

grep sndiod /etc/rc.conf.local
#sndiod_flags=-f rsnd/0 -s onboard -f rsnd/1 -s default
sndiod_flags=-f rsnd/1 -f rsnd/0
#sndiod_flags=-f rsnd/0 -f rsnd/1

I've tried all three of the settings, the first and the last defaults to
builtin soundcard. But if I use the second configuration setting this shows
up in dmesg:

ehci0: Error opening low/full speed isoc endpoint.
A low/full speed device is attached to a USB2 hub, and transaction
translations are not yet supported.
Reattach the device to the root hub instead.
uaudio_chan_open: error creating pipe: err=INVAL endpt=0x03


the usb stack is incomplete and doesn't support rate matching hubs
yet; sorry your sound card can't work on this machine yet.

recently discussed here:

http://comments.gmane.org/gmane.os.openbsd.misc/212991

-- Alexandre

Okey, that explains it. Thanks for your help.

/Johan