Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
c94fa4c
Documentation
arch
block
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
aoa
arm
core
drivers
i2c
isa
mips
oss
parisc
pci
ac97
ali5451
au88x0
ca0106
cs46xx
cs5535audio
echoaudio
emu10k1
Makefile
emu10k1.c
emu10k1_callback.c
emu10k1_main.c
emu10k1_patch.c
emu10k1_synth.c
emu10k1_synth_local.h
emu10k1x.c
emufx.c
emumixer.c
emumpu401.c
emupcm.c
emuproc.c
io.c
irq.c
memory.c
p16v.c
p16v.h
p17v.h
timer.c
tina2.h
voice.c
hda
ice1712
korg1212
mixart
nm256
oxygen
pcxhr
riptide
rme9652
trident
vx222
ymfpci
Kconfig
Makefile
ad1889.c
ad1889.h
als300.c
als4000.c
atiixp.c
atiixp_modem.c
azt3328.c
azt3328.h
bt87x.c
cmipci.c
cs4281.c
cs5530.c
ens1370.c
ens1371.c
es1938.c
es1968.c
fm801.c
intel8x0.c
intel8x0m.c
maestro3.c
rme32.c
rme96.c
sis7019.c
sis7019.h
sonicvibes.c
via82xx.c
via82xx_modem.c
pcmcia
ppc
sh
soc
sparc
spi
synth
usb
Kconfig
Makefile
ac97_bus.c
last.c
sound_core.c
sound_firmware.c
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
sound
/
pci
/
emu10k1
/
emu10k1_synth.c
Copy path
Blame
Blame
Latest commit
History
History
123 lines (102 loc) · 3.17 KB
Breadcrumbs
linux
/
sound
/
pci
/
emu10k1
/
emu10k1_synth.c
Top
File metadata and controls
Code
Blame
123 lines (102 loc) · 3.17 KB
Raw
/* * Copyright (C) 2000 Takashi Iwai <tiwai@suse.de> * * Routines for control of EMU10K1 WaveTable synth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "emu10k1_synth_local.h" #include <linux/init.h> MODULE_AUTHOR("Takashi Iwai"); MODULE_DESCRIPTION("Routines for control of EMU10K1 WaveTable synth"); MODULE_LICENSE("GPL"); /* * create a new hardware dependent device for Emu10k1 */ static int snd_emu10k1_synth_new_device(struct snd_seq_device *dev) { struct snd_emux *emux; struct snd_emu10k1 *hw; struct snd_emu10k1_synth_arg *arg; unsigned long flags; arg = SNDRV_SEQ_DEVICE_ARGPTR(dev); if (arg == NULL) return -EINVAL; if (arg->seq_ports <= 0) return 0; /* nothing */ if (arg->max_voices < 1) arg->max_voices = 1; else if (arg->max_voices > 64) arg->max_voices = 64; if (snd_emux_new(&emux) < 0) return -ENOMEM; snd_emu10k1_ops_setup(emux); hw = arg->hwptr; emux->hw = hw; emux->max_voices = arg->max_voices; emux->num_ports = arg->seq_ports; emux->pitch_shift = -501; emux->memhdr = hw->memhdr; /* maximum two ports */ emux->midi_ports = arg->seq_ports < 2 ? arg->seq_ports : 2; /* audigy has two external midis */ emux->midi_devidx = hw->audigy ? 2 : 1; emux->linear_panning = 0; emux->hwdep_idx = 2; /* FIXED */ if (snd_emux_register(emux, dev->card, arg->index, "Emu10k1") < 0) { snd_emux_free(emux); return -ENOMEM; } spin_lock_irqsave(&hw->voice_lock, flags); hw->synth = emux; hw->get_synth_voice = snd_emu10k1_synth_get_voice; spin_unlock_irqrestore(&hw->voice_lock, flags); dev->driver_data = emux; return 0; } static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev) { struct snd_emux *emux; struct snd_emu10k1 *hw; unsigned long flags; if (dev->driver_data == NULL) return 0; /* not registered actually */ emux = dev->driver_data; hw = emux->hw; spin_lock_irqsave(&hw->voice_lock, flags); hw->synth = NULL; hw->get_synth_voice = NULL; spin_unlock_irqrestore(&hw->voice_lock, flags); snd_emux_free(emux); return 0; } /* * INIT part */ static int __init alsa_emu10k1_synth_init(void) { static struct snd_seq_dev_ops ops = { snd_emu10k1_synth_new_device, snd_emu10k1_synth_delete_device, }; return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, &ops, sizeof(struct snd_emu10k1_synth_arg)); } static void __exit alsa_emu10k1_synth_exit(void) { snd_seq_device_unregister_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH); } module_init(alsa_emu10k1_synth_init) module_exit(alsa_emu10k1_synth_exit)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
You can’t perform that action at this time.