DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd May 2020
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default sndioctl only as root

According to the 6.7 upgrade faq:

Quote:
regular users must use the sndioctl(1) utility in place of mixerctl(1) to adjust the volume
And man 8 mixerctl:
Quote:
Common controls should be adjusted at runtime using sndioctl (1), which is intended for every day use and requires no superuser privileges.
But when I run:
Quote:
sndioctl output.level=0.5
I get:
Quote:
Default: can't open control device
and have to run the command using doas.

I've read both the sndioctl and mixerctl man pages and have no idea where to go from here. Any assistance will be appreciated.

Thanks
Reply With Quote
  #2   (View Single Post)  
Old 22nd May 2020
victorvas victorvas is offline
Real Name: Victor
Linux
 
Join Date: May 2019
Posts: 148
Default

Add yourself to staff and operator groups.
Reply With Quote
  #3   (View Single Post)  
Old 22nd May 2020
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

I was already in staff. I added myself to operator and everything works fine.
Thanks very much.
Reply With Quote
  #4   (View Single Post)  
Old 22nd May 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

I don't need the operator group to use sndioctl(1). How have you provisioned sndiod(8)? Non-default? Disabled?

sndioctl(1) will use the default sndio(7) device exposed by sndiod(8) unless overridden by -f device or setting the $AUDIODEVICE environment variable.
Reply With Quote
  #5   (View Single Post)  
Old 22nd May 2020
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

jggimi - I wouldn't even begin to know how to provision sndiod, altho I would appreciate a hint.
I will say that I spent most of yesterday working with mpd and ncmpcpp trying to convince it that there really was a ~/Music directory and it did contain files. But all i touched were those 2 config files. Is it possible I messed something up there?

I think I found it. In ~/.mpdconf in the audio output section for sndio I changed mixer_type from hardware to software. Now it works running mpv but not with ncmpcpp (I guess because ncmpcpp has it's own way of adjusting volume).

Last edited by stanl; 22nd May 2020 at 05:01 PM. Reason: additional details
Reply With Quote
  #6   (View Single Post)  
Old 22nd May 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Audio applications that use the sndio(7) library don't need access to audio hardware (/dev/audio0, /dev/audio1, ...). By default, OpenBSD runs the sndiod(8) sound server (with no provisioning options) in order to serve this hardware to these audio applications. Device names used in sndio(7) are not device files found in /dev, and so are not managed by user/group. With a default configuraiton, sndiod(8) will automatically "own" all your audio devices and dole them out to sndio applications when requested.

There are exceptions. 1) Non-default configurations of sndiod or sndiod not running, and 2) two different users attempting to use the same audio device at the same time.

If the default audio device is requested by an application, the sndio(7) library will first attempt to connect with snd/0, the first device managed by sndiod(8). If the device is not available through sndiod(8), the library will then try to connect to the raw audio device -- rsnd/0. This will then translate into access to the appropriate device special file such as /dev/audio0. These device special files are owner:group root:_sndiop, and have no world access, so I'm not clear why adding your userid to the operator group made a difference. I could guess that there was a reboot, under the assumption that sndiod was not running or the audio device was in use by another userid.

If you have multiple users trying to use the same device, you must share sndio(7) cookies as noted in the AUTHENTICATION section of the sndio(7) man page.

You can check your sndiod(8) provisioning with $ grep sndiod /etc/rc.conf*. The default is without options, so a default configuration would be an empty sndiod_flags= field. You can check to see if sndiod(8) is running with $ pgrep -lf sndiod.
Reply With Quote
  #7   (View Single Post)  
Old 22nd May 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Of course. You must have been using sndio(7) from two users: stanl, and root. If root used it first, that would lock stanl out.
Reply With Quote
  #8   (View Single Post)  
Old 22nd May 2020
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

Thanks, jggimi. A person could learn a lot just reading your posts,
Reply With Quote
  #9   (View Single Post)  
Old 22nd May 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Nah. I just spent several days in the last two weeks recording vinyl to aac/m4a, and that required experimenting with sndiod(8), sndio(7) device names, aucat(1), sndioctl(1) and mixerctl(8), and Audacity.
Reply With Quote
Old 22nd May 2020
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 314
Default

Quote:
Originally Posted by jggimi View Post
Of course. You must have been using sndio(7) from two users: stanl, and root. If root used it first, that would lock stanl out.
Heh, that happenend to me with /dev/drm0. I kept wondering for a while why I had lost graphics hardware acceleration until I figured it out.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
root on ZFS gkontos FreeBSD Installation and Upgrading 12 18th December 2009 09:43 AM
ZFS root and linproc 7.2-RC1 wnsi FreeBSD Installation and Upgrading 0 20th April 2009 06:54 PM
ssh root Nk2Network OpenBSD Security 22 8th April 2009 06:59 PM
NTOP as root sniper007 FreeBSD Security 0 27th January 2009 07:42 PM
Wheel Can't su root MetalHead OpenBSD General 2 22nd November 2008 12:44 AM


All times are GMT. The time now is 09:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick