Re: headphone volume levels cannot be manipulated by mixerctl

2019-04-28 Thread Christian Weisgerber
On 2019-04-27, Christian Weisgerber  wrote:

> It is my theoretical understanding that USB audio gadgets typically
> come with a uhid(4) device, as does yours above, and you would use
> usbhidctl(1) to list and manipulate the available controls.

No, that is wrong.

Looking over uaudio.c, I now see that mixer controls are an inherent
part of the USB audio spec and that the driver automatically provides
them.

So the correct answer is this: If your USB audio gadget attaches
as audioN, use "mixerctl -f /dev/mixerN" to access the corresponding
controls.  If you don't specify a device, mixerctl uses /dev/mixer,
which by default is a symlink to /dev/mixer0.  You can point this
symlink to a different unit.  Alternatively, you can set MIXERDEVICE
in the enironment.

(Personally, I have only used USB audio dongles to add an S/PDIF
output to machines that lacked one, so the mixer didn't really come
up.)

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: headphone volume levels cannot be manipulated by mixerctl

2019-04-28 Thread Alexandre Ratchov
On Sat, Apr 27, 2019 at 10:10:07AM -0500, joshua stein wrote:
> On Sat, 27 Apr 2019 at 14:20:32 -, Christian Weisgerber wrote:
> > However, as in this example, I think you will only get a few generic
> > controls.
> > 
> > It is my theoretical understanding that USB audio gadgets typically
> > come with a uhid(4) device, as does yours above, and you would use
> > usbhidctl(1) to list and manipulate the available controls.
> > 
> > In practice, I only get some variant of
> > 
> > usbhidctl: USB_GET_REPORT (probably not supported by device): Input/output 
> > error
> > 
> > when I try this.  So either I'm mistaken or there is a problem
> > somewhere.
> 
> Some devices just don't supply hardware volume controls, so it must 
> be done in software on the sending device.
> 
> With sndiod, you can use aucatctl to change the software volume 
> per-application (or the master volume).
> 
> It's all kind of complicated though.  If you plug in a new USB audio 
> device like this, you have to restart sndiod and pass in a new 
> device name, then use aucatctl to adjust the volume.  But if you 
> unplug the USB device, you have to restart sndiod again to use the 
> default audio device and use mixerctl instead.

Here's a small aucatctl-like program to control sndiod volume in X:

http://caoua.org/alex/obsd/xvolkeys-1.0.tar.gz

In the .xinitrc or .xsession add:

xvolkeys -D

Then, use Ctrl-Alt-Plus and Ctrl-Alt-Minus to increment and decrement
sndiod master volume.



Re: headphone volume levels cannot be manipulated by mixerctl

2019-04-27 Thread joshua stein
On Sat, 27 Apr 2019 at 14:20:32 -, Christian Weisgerber wrote:
> However, as in this example, I think you will only get a few generic
> controls.
> 
> It is my theoretical understanding that USB audio gadgets typically
> come with a uhid(4) device, as does yours above, and you would use
> usbhidctl(1) to list and manipulate the available controls.
> 
> In practice, I only get some variant of
> 
> usbhidctl: USB_GET_REPORT (probably not supported by device): Input/output 
> error
> 
> when I try this.  So either I'm mistaken or there is a problem
> somewhere.

Some devices just don't supply hardware volume controls, so it must 
be done in software on the sending device.

With sndiod, you can use aucatctl to change the software volume 
per-application (or the master volume).

It's all kind of complicated though.  If you plug in a new USB audio 
device like this, you have to restart sndiod and pass in a new 
device name, then use aucatctl to adjust the volume.  But if you 
unplug the USB device, you have to restart sndiod again to use the 
default audio device and use mixerctl instead.



Re: headphone volume levels cannot be manipulated by mixerctl

2019-04-27 Thread Christian Weisgerber
On 2019-04-27, Levente  wrote:

> The headphone in question is the Platronics RIG 500 HD, which connects 
> through the USB port (instead of 3.5mm jacks).

> mixerctl output is provided below along with dmesg.

Your headphones, which are really a USB audio adapter with attached
headphones, are a separate audio device.  Here are the relevant
parts from your dmesg:

> audio0 at azalia0
> ppb0 at pci0 dev 28 function 0 "Intel 6 Series PCIE" rev 0xb4: msi
> pci1 at ppb0 bus 2

That's the built-in azalia(4) audio of the laptop that supplies the
speakers and the headphone jack.

> uaudio0 at uhub3 port 2 configuration 1 interface 1 "Plantronics Plantronics 
> HD1" rev 2.00/1.14 addr 3
> uaudio0: class v1, full-speed, sync, channels: 2 play, 2 rec, 9 ctls
> audio1 at uaudio0
> uhidev0 at uhub3 port 2 configuration 1 interface 3 "Plantronics Plantronics 
> HD1" rev 2.00/1.14 addr 3
> uhidev0: iclass 3/0, 1 report id
> uhid0 at uhidev0 reportid 1: input=15, output=15, feature=0

And these are your uaudio(4) headphones.

By default, mixerctl accesses /dev/mixer -> /dev/mixer0, which is
the built-in audio.  You can access the mixer associated with your
USB headphones by choosing the appropriate device:

$ mixerctl -f /dev/mixer1 
outputs.play=0,0
outputs.play_loud=on
outputs.play_mute=off
record.enable=sysctl

However, as in this example, I think you will only get a few generic
controls.

It is my theoretical understanding that USB audio gadgets typically
come with a uhid(4) device, as does yours above, and you would use
usbhidctl(1) to list and manipulate the available controls.

In practice, I only get some variant of

usbhidctl: USB_GET_REPORT (probably not supported by device): Input/output error

when I try this.  So either I'm mistaken or there is a problem
somewhere.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: headphone volume levels cannot be manipulated by mixerctl

2019-04-27 Thread Marc Espie
If you want to be read, configure your email to send normal messages.

All I see is "Signed data", and I'm not necessarily going to open attachments
to see what you're saying on a public mailing-list.



headphone volume levels cannot be manipulated by mixerctl

2019-04-27 Thread Levente


signature.asc
Description: OpenPGP digital signature