[alsa-devel] On mixer controls naming
Hi,
I'm trying to write a new driver for a virtual sound card. It isn't actually a sound card, but only a software solution to control volume and bass of an external device (using SPI and GPIO). So it only has a mixer (no pcm or capture subdevices).
I could successfully configure two controls "Master Playback Switch" and "Master Playback Volume". Alsamixer shows them correctly under "Playback" view (and very nicely it joined them together to form a single composite control "Master")
The other control I've named "Tone Control - Bass", as indicated in writing-an-alsa-driver.pdf. But alsamixer shows it under both "Playback" and "Capture" views.
How can I restrict this latter control to just playback?
R. Lemos wrote:
The other control I've named "Tone Control - Bass", as indicated in writing-an-alsa-driver.pdf. But alsamixer shows it under both "Playback" and "Capture" views.
How can I restrict this latter control to just playback?
For a control to be classified as a playback control, its name must have one of the suffixes " Playback Enum", " Playback Switch", " Playback Route", or " Playback Volume".
Regards, Clemens
Unfortunately it doesn't work for Tone Control.
I've tried the following (after each alternative is the output of amixer):
===== "Master Playback Bass" ===== Simple mixer control 'Master Playback Bass',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 255 Mono: 0 [0%] ===== "Master Playback Tone" ===== Simple mixer control 'Master Playback Tone',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 255 Mono: 0 [0%] ===== "Playback Tone - Bass" ===== Simple mixer control 'Playback Tone - Bass',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 255 Mono: 0 [0%] ===== "Playback Tone Control - Bass" ===== Simple mixer control 'Playback Tone Control - Bass',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 255 Mono: 0 [0%] ===== "Playback Tone Control" ===== Simple mixer control 'Playback Tone Control',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 255 Mono: 0 [0%] ===== "Tone Control - Bass" ===== Simple mixer control 'Bass',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 255 Mono: 123 [48%] ===== "Tone Control Playback - Bass" ===== Simple mixer control 'Tone Control Playback - Bass',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 255 Mono: 0 [0%] ===== "Tone Playback Control - Bass" ===== Simple mixer control 'Tone Playback Control - Bass',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 255 Mono: 0 [0%]
In each tested alternative capture channel shows up as mono (instead of the expected behavior of showing nothing at all, as below). Each control label also reverted to the full control name. Personally I prefer the "Tone Control - Bass" alternative, which neatly shows up as just "Bass". It would be perfect, were not the availability of a capture channel for this control.
Note: previous amixer output elided to remove the the following common working part for the "Master Playback Volume" and "Master Playback Switch":
Simple mixer control 'Master',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 255 Mono: Playback 194 [76%] [on]
On Mon, Jan 13, 2014 at 9:12 AM, Clemens Ladisch clemens@ladisch.de wrote:
R. Lemos wrote:
The other control I've named "Tone Control - Bass", as indicated in writing-an-alsa-driver.pdf. But alsamixer shows it under both "Playback" and "Capture" views.
How can I restrict this latter control to just playback?
For a control to be classified as a playback control, its name must have one of the suffixes " Playback Enum", " Playback Switch", " Playback Route", or " Playback Volume".
Regards, Clemens
R. Lemos wrote:
On Mon, Jan 13, 2014 at 9:12 AM, Clemens Ladisch clemens@ladisch.de wrote:
For a control to be classified as a playback control, its name must have one of the suffixes " Playback Enum", " Playback Switch", " Playback Route", or " Playback Volume".
Unfortunately it doesn't work for Tone Control.
Simple mixer control 'Master Playback Bass',0 Simple mixer control 'Master Playback Tone',0 Simple mixer control 'Playback Tone - Bass',0 Simple mixer control 'Playback Tone Control - Bass',0 ...
"Suffix" means "at the end". Try "Tone Control Bass Playback Volume".
Regards, Clemens
I'll stick to "Bass Playback Volume" (shows up as "Bass", only playback channel).
Thank you for your support.
On Mon, Jan 13, 2014 at 4:49 PM, Clemens Ladisch clemens@ladisch.de wrote:
R. Lemos wrote:
On Mon, Jan 13, 2014 at 9:12 AM, Clemens Ladisch clemens@ladisch.de wrote:
For a control to be classified as a playback control, its name must have one of the suffixes " Playback Enum", " Playback Switch", " Playback Route", or " Playback Volume".
Unfortunately it doesn't work for Tone Control.
Simple mixer control 'Master Playback Bass',0 Simple mixer control 'Master Playback Tone',0 Simple mixer control 'Playback Tone - Bass',0 Simple mixer control 'Playback Tone Control - Bass',0 ...
"Suffix" means "at the end". Try "Tone Control Bass Playback Volume".
Regards, Clemens
participants (2)
-
Clemens Ladisch
-
R. Lemos