Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
05dfdfdb
Commit
05dfdfdb
authored
Apr 28, 2009
by
Daniel Kahn Gillmor
Committed by
Max Kellermann
Apr 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alsa_mixer: add mixer_index option
This allows you to select controls with duplicate names.
parent
70d322b2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
2 deletions
+16
-2
NEWS
NEWS
+2
-0
mpd.conf.5
doc/mpd.conf.5
+6
-0
mpdconf.example
doc/mpdconf.example
+1
-0
alsa_mixer.c
src/mixer/alsa_mixer.c
+7
-2
No files found.
NEWS
View file @
05dfdfdb
...
@@ -50,6 +50,8 @@ ver 0.15 (200?/??/??)
...
@@ -50,6 +50,8 @@ ver 0.15 (200?/??/??)
* mixers:
* mixers:
- rewritten mixer code to support multiple mixers
- rewritten mixer code to support multiple mixers
- new pulseaudio mixer
- new pulseaudio mixer
- alsa: new mixer_index option supports choosing between multiple
identically-named controls on a device.
* Add audio archive extraction support:
* Add audio archive extraction support:
- bzip2
- bzip2
- iso9660
- iso9660
...
...
doc/mpd.conf.5
View file @
05dfdfdb
...
@@ -293,6 +293,12 @@ This specifies which mixer control to use (sometimes referred to as the
...
@@ -293,6 +293,12 @@ This specifies which mixer control to use (sometimes referred to as the
"device"). Examples of mixer controls are PCM, Line1, Master, etc. An example
"device"). Examples of mixer controls are PCM, Line1, Master, etc. An example
for OSS is "Pcm", and an example for alsa is "PCM".
for OSS is "Pcm", and an example for alsa is "PCM".
.TP
.TP
.B mixer_index <mixer index>
A number identifying the index of the named mixer control. This is
probably only useful if your alsa device has more than one
identically\-named mixer control. The default is "0". (Use "amixer
scontrols" to see the list of controls with their indexes)
.TP
.B use_mmap <yes or no>
.B use_mmap <yes or no>
Setting this allows you to use memory-mapped I/O. Certain hardware setups may
Setting this allows you to use memory-mapped I/O. Certain hardware setups may
benefit from this, but most do not. Most users do not need to set this. The
benefit from this, but most do not. Most users do not need to set this. The
...
...
doc/mpdconf.example
View file @
05dfdfdb
...
@@ -181,6 +181,7 @@ input {
...
@@ -181,6 +181,7 @@ input {
# format "44100:16:2" # optional
# format "44100:16:2" # optional
# mixer_device "default" # optional
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
#}
#}
#
#
# An example of an OSS output:
# An example of an OSS output:
...
...
src/mixer/alsa_mixer.c
View file @
05dfdfdb
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#define VOLUME_MIXER_ALSA_DEFAULT "default"
#define VOLUME_MIXER_ALSA_DEFAULT "default"
#define VOLUME_MIXER_ALSA_CONTROL_DEFAULT "PCM"
#define VOLUME_MIXER_ALSA_CONTROL_DEFAULT "PCM"
#define VOLUME_MIXER_ALSA_INDEX_DEFAULT 0
struct
alsa_mixer
{
struct
alsa_mixer
{
/** the base mixer class */
/** the base mixer class */
...
@@ -32,6 +33,7 @@ struct alsa_mixer {
...
@@ -32,6 +33,7 @@ struct alsa_mixer {
const
char
*
device
;
const
char
*
device
;
const
char
*
control
;
const
char
*
control
;
unsigned
int
index
;
snd_mixer_t
*
handle
;
snd_mixer_t
*
handle
;
snd_mixer_elem_t
*
elem
;
snd_mixer_elem_t
*
elem
;
...
@@ -51,6 +53,8 @@ alsa_mixer_init(const struct config_param *param)
...
@@ -51,6 +53,8 @@ alsa_mixer_init(const struct config_param *param)
VOLUME_MIXER_ALSA_DEFAULT
);
VOLUME_MIXER_ALSA_DEFAULT
);
am
->
control
=
config_get_block_string
(
param
,
"mixer_control"
,
am
->
control
=
config_get_block_string
(
param
,
"mixer_control"
,
VOLUME_MIXER_ALSA_CONTROL_DEFAULT
);
VOLUME_MIXER_ALSA_CONTROL_DEFAULT
);
am
->
index
=
config_get_block_unsigned
(
param
,
"mixer_index"
,
VOLUME_MIXER_ALSA_INDEX_DEFAULT
);
return
&
am
->
base
;
return
&
am
->
base
;
}
}
...
@@ -117,8 +121,9 @@ alsa_mixer_open(struct mixer *data)
...
@@ -117,8 +121,9 @@ alsa_mixer_open(struct mixer *data)
while
(
elem
)
{
while
(
elem
)
{
if
(
snd_mixer_elem_get_type
(
elem
)
==
SND_MIXER_ELEM_SIMPLE
)
{
if
(
snd_mixer_elem_get_type
(
elem
)
==
SND_MIXER_ELEM_SIMPLE
)
{
if
(
strcasecmp
(
am
->
control
,
if
((
strcasecmp
(
am
->
control
,
snd_mixer_selem_get_name
(
elem
))
==
0
)
{
snd_mixer_selem_get_name
(
elem
))
==
0
)
&&
(
am
->
index
==
snd_mixer_selem_get_index
(
elem
)))
{
break
;
break
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment