Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
b0d992e2
Commit
b0d992e2
authored
Nov 26, 2003
by
Jaroslav Kysela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA CVS update - Takashi Iwai <tiwai@suse.de>
ALSA<-OSS emulation added fallback device selection for OSS mixer.
parent
79844cee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
sound/core/oss/mixer_oss.c
sound/core/oss/mixer_oss.c
+15
-8
No files found.
sound/core/oss/mixer_oss.c
View file @
b0d992e2
...
...
@@ -872,7 +872,12 @@ static void mixer_slot_clear(snd_mixer_oss_slot_t *rslot)
rslot
->
number
=
idx
;
}
static
int
snd_mixer_oss_build_input
(
snd_mixer_oss_t
*
mixer
,
struct
snd_mixer_oss_assign_table
*
ptr
,
int
ptr_allocated
)
/*
* build an OSS mixer element.
* ptr_allocated means the entry is dynamically allocated (change via proc file).
* when replace_old = 1, the old entry is replaced with the new one.
*/
static
int
snd_mixer_oss_build_input
(
snd_mixer_oss_t
*
mixer
,
struct
snd_mixer_oss_assign_table
*
ptr
,
int
ptr_allocated
,
int
replace_old
)
{
struct
slot
slot
;
struct
slot
*
pslot
;
...
...
@@ -880,6 +885,10 @@ static int snd_mixer_oss_build_input(snd_mixer_oss_t *mixer, struct snd_mixer_os
snd_mixer_oss_slot_t
*
rslot
;
char
str
[
64
];
/* check if already assigned */
if
(
mixer
->
slots
[
ptr
->
oss_id
].
get_volume
&&
!
replace_old
)
return
0
;
memset
(
&
slot
,
0
,
sizeof
(
slot
));
if
(
snd_mixer_oss_build_test
(
mixer
,
&
slot
,
ptr
->
name
,
ptr
->
index
,
SNDRV_MIXER_OSS_ITEM_GLOBAL
))
...
...
@@ -1084,7 +1093,7 @@ static void snd_mixer_oss_proc_write(snd_info_entry_t *entry,
goto
__unlock
;
}
tbl
->
index
=
idx
;
if
(
snd_mixer_oss_build_input
(
mixer
,
tbl
,
1
)
<=
0
)
{
if
(
snd_mixer_oss_build_input
(
mixer
,
tbl
,
1
,
1
)
<=
0
)
{
kfree
(
tbl
->
name
);
kfree
(
tbl
);
}
...
...
@@ -1127,9 +1136,11 @@ static void snd_mixer_oss_build(snd_mixer_oss_t *mixer)
{
static
struct
snd_mixer_oss_assign_table
table
[]
=
{
{
SOUND_MIXER_VOLUME
,
"Master"
,
0
},
{
SOUND_MIXER_VOLUME
,
"Front"
,
0
},
/* fallback */
{
SOUND_MIXER_BASS
,
"Tone Control - Bass"
,
0
},
{
SOUND_MIXER_TREBLE
,
"Tone Control - Treble"
,
0
},
{
SOUND_MIXER_SYNTH
,
"Synth"
,
0
},
{
SOUND_MIXER_SYNTH
,
"FM"
,
0
},
/* fallback */
{
SOUND_MIXER_PCM
,
"PCM"
,
0
},
{
SOUND_MIXER_SPEAKER
,
"PC Speaker"
,
0
},
{
SOUND_MIXER_LINE
,
"Line"
,
0
},
...
...
@@ -1137,6 +1148,7 @@ static void snd_mixer_oss_build(snd_mixer_oss_t *mixer)
{
SOUND_MIXER_CD
,
"CD"
,
0
},
{
SOUND_MIXER_IMIX
,
"Monitor Mix"
,
0
},
{
SOUND_MIXER_ALTPCM
,
"PCM"
,
1
},
{
SOUND_MIXER_ALTPCM
,
"Wave"
,
0
},
/* fallback */
{
SOUND_MIXER_RECLEV
,
"-- nothing --"
,
0
},
{
SOUND_MIXER_IGAIN
,
"Capture"
,
0
},
{
SOUND_MIXER_OGAIN
,
"Playback"
,
0
},
...
...
@@ -1152,15 +1164,10 @@ static void snd_mixer_oss_build(snd_mixer_oss_t *mixer)
{
SOUND_MIXER_RADIO
,
"Radio"
,
0
},
{
SOUND_MIXER_MONITOR
,
"Monitor"
,
0
}
};
static
struct
snd_mixer_oss_assign_table
fm_table
=
{
SOUND_MIXER_SYNTH
,
"FM"
,
0
};
unsigned
int
idx
;
for
(
idx
=
0
;
idx
<
sizeof
(
table
)
/
sizeof
(
struct
snd_mixer_oss_assign_table
);
idx
++
)
snd_mixer_oss_build_input
(
mixer
,
&
table
[
idx
],
0
);
if
(
mixer
->
slots
[
SOUND_MIXER_SYNTH
].
get_volume
==
NULL
)
snd_mixer_oss_build_input
(
mixer
,
&
fm_table
,
0
);
snd_mixer_oss_build_input
(
mixer
,
&
table
[
idx
],
0
,
0
);
if
(
mixer
->
mask_recsrc
)
{
mixer
->
get_recsrc
=
snd_mixer_oss_get_recsrc2
;
mixer
->
put_recsrc
=
snd_mixer_oss_put_recsrc2
;
...
...
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