Re: Browser access to file system on new install OpenBSD missing.

2022-07-11 Thread Björn Gohla


Brian Durant  writes:

> I have a problem with both Firefox and Chromium being unable to access
> the file system using the "open" dialog. The dialog appears, but no
> files or directories appear regardless of path. Things function
[...]

This sounds like an unveil(2) issue. Only white-listed paths are
accessible, they are configured in /etc/firefox/unveil.* .

~/Downloads should be enabled by default though.

Read /usr/local/share/doc/pkg-readmes/firefox for all the details.



using mdnsd as resolver

2021-08-14 Thread Björn Gohla
hi all,

i'm trying to use openmdns to find my network printer. it shows up
(sporadically) when i run

$ mdnsctl browse -r

and i can obtain the address using

$ mdnsctl lookup EPSON892A3E.local

but how do i integrate the mdns daemon into resolv.conf? the man pages
certainly don't mention how to do it.

i would expect gethostbyname(3) to be able to resolve EPSON892A3E.local
.

--
cheers,
björn



Re: kitty termcap entry

2021-07-03 Thread Björn Gohla


Stuart Henderson writes:

> On 2021-06-20, Björn Gohla  wrote:
>>
>> hi all,
>>
>> i have the following problem with the kitty terminal emulator:
>>
>> 
>> 15:43:39 bgohla@titanic ~ $ doas pkg_add hello
>> doas (bgo...@titanic.my.domain) password: 
>> failed termcap lookup on xterm-kitty at 
>> /usr/libdata/perl5/OpenBSD/ProgressMeter/Term.pm line 113.
>> 15:44:02 bgohla@titanic ~ $ echo $TERM
>> xterm-kitty
>> 15:44:17 bgohla@titanic ~ $
>> 
>>
>> it seems the problem is that there is no entry for xterm-kitty in
>> /etc/termcap. the above pkg_add invocation works when i set TERM=xterm .
>>
>> i suppose one could just add a termcap entry that redirects to
>> xterm.
>>
>> would this be a patch in the kitty port, or does this require a change
>> to the base system?
>>
>> --
>> cheers,
>> björn
>>
>>
>
> It would require a change in the base system, /usr/share/misc/termcap is
> a system file and isn't something that can be modified from a port.
> Additionally it will get overwritten when the OS is updated.
>
> Software that uses terminfo will work with kitty as it sets TERMINFO in
> the environment pointing at its own special file; that's not possible
> with termcap.

So given that there doesn't seem to be a stable way to extend the
termcap database from a port, shouldn't it be depracated?



Re: kitty termcap entry

2021-06-20 Thread Björn Gohla


Karl Pettersson writes:

> Hi
>
> Have you tried this (specifically the last part about generating a termcap
> description and appending to the termcap database)?
>
> https://sw.kovidgoyal.net/kitty/faq.html?highlight=termcap#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-when-sshing-into-a-different-computer

[...]

nice. this works.

but i was rather wondering what i can do so this happens automatically
when the port is installed.

--
cheers,
björn



kitty termcap entry

2021-06-20 Thread Björn Gohla


hi all,

i have the following problem with the kitty terminal emulator:


15:43:39 bgohla@titanic ~ $ doas pkg_add hello
doas (bgo...@titanic.my.domain) password: 
failed termcap lookup on xterm-kitty at 
/usr/libdata/perl5/OpenBSD/ProgressMeter/Term.pm line 113.
15:44:02 bgohla@titanic ~ $ echo $TERM
xterm-kitty
15:44:17 bgohla@titanic ~ $


it seems the problem is that there is no entry for xterm-kitty in
/etc/termcap. the above pkg_add invocation works when i set TERM=xterm .

i suppose one could just add a termcap entry that redirects to
xterm.

would this be a patch in the kitty port, or does this require a change
to the base system?

--
cheers,
björn



libedit history size required

2021-04-15 Thread Björn Gohla


hi all,

i came across this little problem when using the edit library
(https://github.com/openbsd/src/tree/master/lib/libedit): when using the
history facility one needs to explicitly set a size, e.g., 

history(hist, , H_SETSIZE, 100);

otherwise history will not work. the man page history(3) makes no
mention of this fact. this leads me to three questions:

0. is this an oversight or by design?
1. shouldn't this requirement be documented?
2. shouldn't there be a reasonable default?

if the answers to 1. or 2. are yes, i'd be willing to send patches.

--
cheers,
björn



pkg_add fails: 6.9 no such directory

2021-04-15 Thread Björn Gohla


hi all,

i'm on 6.9 current. installing any package (example below) fails since there is
apparently no 6.9 release directory. what am i doin wrong?

thanks for any hints.

---

titanic# pkg_add gbc
https://cdn.openbsd.org/pub/OpenBSD/6.9/packages/amd64/: no such dir
Can't find gbc
titanic# uname  -a
OpenBSD titanic.my.domain 6.9 GENERIC.MP#457 amd64
titanic# curl https://cdn.openbsd.org/pub/OpenBSD/
[...]
../
06-Jan-2019 18:35   -
6.4/
29-Oct-2018 10:29   -
6.5/
11-Aug-2019 08:18   -
6.6/
23-Oct-2019 10:54   -
6.7/
18-May-2020 08:55   -
6.8/
07-Feb-2021 18:58   -
Changelogs/
15-Apr-2021 11:32   -
[...]
titanic#



Re: plugging head phones does not mute speaker

2021-01-27 Thread Björn Gohla


Maurice McCarthy writes:

> Sndiod is to be the default method of controliing audio.
> Run sndiod and see what sndioctl says.
>
> doas rcctl enable sndiod
> doas rcctl start sndiod
> doas sndioctl
[...]

thanks. this does not solve the problem unfortunately.

--
cheers,
björn



plugging head phones does not mute speaker

2021-01-19 Thread Björn Gohla


hi all,

i have this embarrassing little problem: when i play music and plug in
head phones, the built in speakers are not muted, even though mixerctl
says so. the headphones do work correctly.

i get this output whith the head phones plugged:

inputs.dac-2:3=80,80
inputs.dac-0:1=80,80
record.adc-0:1_mute=off
record.adc-0:1=124,124
record.adc-2:3_mute=off
record.adc-2:3=124,124
record.adc-4:5_mute=off
record.adc-4:5=124,124
inputs.mic=85,85
outputs.spkr_source=dac-2:3
outputs.spkr_mute=on
outputs.spkr_eapd=on
inputs.mic2=85,85
outputs.mic2_dir=input-vr80
outputs.hp_source=dac-0:1
outputs.hp_mute=off
outputs.hp_boost=off
outputs.hp_eapd=on
record.adc-4:5_source=mic2
record.adc-2:3_source=mic2,mic
record.adc-0:1_source=mic
outputs.mic2_sense=unplugged
outputs.hp_sense=plugged
outputs.spkr_muters=hp
outputs.master=80,80
outputs.master.mute=off
outputs.master.slaves=dac-2:3,dac-0:1,spkr,hp
record.volume=124,124
record.volume.mute=off
record.volume.slaves=adc-0:1,adc-2:3,adc-4:5
record.enable=sysctl

doing a `mixerctl -t outputs.spkr_mute` separately toggles the variable,
but has no audible effect, the speaker stays active either way.

`mixerctl -t outputs.master.mute` (or pressing the built in mute button)
does work, but obviously mutes the speaker as well as the headphones.

dmesg says:

azalia0 at pci0 dev 31 function 3 "Intel 100 Series HD Audio" rev 0x21: msi
azalia0: codecs: Realtek ALC236, Intel/0x2809, using Realtek ALC236
audio0 at azalia0

the machine is a lenovo ideapad 500S.

the device used to work correctly with linux.

i'm running 6.8 GENERIC.MP#277 amd64.

did i misconfigure anything, or could this be a bug?

thanks in advance for any hints.

--
cheers,
björn



Re: Getting wifi bitrate

2021-01-04 Thread Björn Gohla


Tilo Stritzky writes:

> On 31/12/20 16:13  Björn Gohla wrote:
>> Stefan Sperling writes:
>> > What problem are you trying to solve?
>>
>> I just want to show the network activity in my desktop status line.
>
> You might want to take a look a netstat -w / -W.
[...]

Thanks. That's nice. But as far as I can see none of the counters tracks
just transmitted packets, right?

--
cheers,
björn



Re: Getting wifi bitrate

2021-01-01 Thread Björn Gohla


[...]
>> I just want to show the network activity in my desktop status line.
>
> Understood, fair enough.
> The chosen Tx rate is not a very reliable indicator of actual throughput
> but it can serve as a wifi link quality indicator to some extent.

>From ifconfig.c I gather that

(nr->nr_rates[nr->nr_nrates - 1] & IEEE80211_RATE_VAL) / 2

is the current nominal rate in Mb/s, is that correct?

Curiously, what I observe with the RTL8192EU is that after associating,
that value starts at 1 and as transmissions are made, moves to 54 in
increasing steps, and then stays there. I guess that corroborates your
point about incorrect information being returned by the device.

Unfortunately I don't have another wifi adapter to test with.

Anyway, thanks for your help, I'll give it a rest now.

--
Cheers,
Björn



Re: Getting wifi bitrate

2020-12-31 Thread Björn Gohla


Stefan Sperling writes:

> On Thu, Dec 31, 2020 at 02:28:35PM +0000, Björn Gohla wrote:
>> Hi all,
[...]
>> So how do I get the it? Am I looking in the wrong place, or does the
>> driver just not expose this information?
>
> Rate/MCS + channel width + some other parameters map to a Tx bitrate:
> https://en.wikipedia.org/wiki/IEEE_802.11n-2009#Data_rates
>
> This Tx bitrate will vary on a per-frame basis, though. And actual user data
> throughput is always below this, due to protocol overhead, re-transmissions,
> interference, other traffic on the same channel, and so on.

Right, so by using the values in that table one could extract a nominal
Tx rate, but not the actual one (much less the Rx); correct?

>> The interface is a "Realtek Wireless N Nano USB Adapter" in case that is
>> relevant.
>
> OpenBSD realtek wifi drivers only support 11g mode at present.
> So on such hardware the kernel and ifconfig never report "MCS23".
> MCS are only reported for 11n/ac modes.

I did notice that it says so in the caveats in urtwn(4), strange.

> In 11g mode the per-frame Tx rate is displayed by ifconfig in Mbit/s.
> However, some realtek devices (like the 8192CU) perform Tx rate-adjustment
> in firmware and do not even expose the chosen Tx data rate to the driver.
> In that case ifconfig always displays 54M which is usually incorrect.

ifconfig says this:
urtwn0: flags=808843 mtu 1500
 lladdr 54:2a:a2:4c:0e:b5
 index 8 priority 4 llprio 3
 groups: wlan egress
 media: IEEE802.11 autoselect (OFDM54 mode 11g)
 status: active
 ieee80211: join "451UnavailableForLegalReasons " chan 11 bssid 
b0:bb:e5:13:7b:d4 -72dBm wpakey wpaprotos wpa2 wpaakms psk wpaciphers ccmp 
wpagroupcipher tkip
 inet 192.168.1.182 netmask 0xff00 broadcast 192.168.1.255

I suppose the "media" line is what you're referring to here, right?

dmesg says:
urtwn0 at uhub0 port 2 configuration 1 interface 0 "Realtek Wireless N Nano USB 
Adapter" rev 2.10/2.00 addr 2
urtwn0: MAC/BB RTL8192EU, RF 6052 2T2R, address 54:2a:a2:4c:0e:b5

the device looks similar to the one you mentioned, so maybe that's
what's going on here.

> What problem are you trying to solve?

I just want to show the network activity in my desktop status line.

--
Cheers,
Björn



Getting wifi bitrate

2020-12-31 Thread Björn Gohla
Hi all,

I have a small question: I want to get the current rate of actually
transmitted (and received) bits for my wifi adaptor. I thought this
fragment from ifconfig does what I want
(https://github.com/openbsd/src/blob/3a44e88910781e836bd51a8b6b068379abc67a1b/sbin/ifconfig/ifconfig.c#L2783):

if ((nr->nr_flags & (IEEE80211_NODEREQ_AP)) == 0) {
  if (nr->nr_flags & IEEE80211_NODEREQ_VHT) {
printf("VHT-MCS%d/%dSS", nr->nr_txmcs, nr->nr_vht_ss);
  } else if (nr->nr_flags & IEEE80211_NODEREQ_HT) {
printf("HT-MCS%d ", nr->nr_txmcs);
  } else if (nr->nr_nrates) {
printf("%uM ",
   (nr->nr_rates[nr->nr_txrate] & IEEE80211_RATE_VAL)
   / 2);
  }
} else if (nr->nr_max_rxrate) {
  printf("%uM HT ", nr->nr_max_rxrate);
 } else if (nr->nr_rxmcs[0] != 0) {
  for (i = IEEE80211_HT_NUM_MCS - 1;
   i >= 0; i--) {
if (nr->nr_rxmcs[i / 8] & (1 << (i / 10)))
  break;
  }
  printf("HT-MCS%d ", i);
 } else if (nr->nr_nrates) {
  printf("%uM ",
 (nr->nr_rates[nr->nr_nrates - 1] &
  IEEE80211_RATE_VAL) / 2);
 }

But when I paste that into my application code and run it I get
"HT-MCS23". My best understanding is that this refers to some definition
of modulation coding schemes, i.e., not the bitrate I'm looking for.

So how do I get the it? Am I looking in the wrong place, or does the
driver just not expose this information?

The interface is a "Realtek Wireless N Nano USB Adapter" in case that is
relevant.

Cheers and a happy new year,
Björn



xterm dies

2020-12-27 Thread Björn Gohla
Hi All,

Since updating to snapshot a few days ago I've been having problems with
xterm randomly dying. I was able to capture this on another terminal:

16:51:12 bgohla@titanic[1] ~ $ xterm: Error 50, errno 35: Resource
temporarily unavailable
Reason: in_put: select() failed
16:51:12 bgohla@titanic[1] ~ $ man select
[1]+  Exit 50 xterm sh
17:54:42 bgohla@titanic ~ $

This is very annoying (I even had to start this email over because of
it).

There don't seem to be any recent changes to xterm, so I'm out of
ideas where to look for the source of the error.

Any ideas what one can do in this situation? Would another sysupgrade -s
help?

Cheers,
Björn



development best practices

2020-11-28 Thread björn gohla
hi all,

i'm fairly new to openbsd. and i've run into the following problem,
where i want to hack a project (most recently trying to fix a possible
issue with i3status), but building the from the git source
tree fails.

now, in the specific case, i'm trying to build a version that,
also exists in ports, so we know it can be built on openbsd; and i
presume the various patches included with the port are what makes it
work.

i could of course try to apply those patches and fix my issue. but then
when i submit a PR upstream i'd have to remove them again. that seems
cumbersome, expecially if done repeatedly.

so what is the best practice in this situation? should i just upstream
the ports patches?

thanks.

--
cheers,
björn