Commit 6a4dad1d authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA update

  - intel8x0 - added NVidia NForce2 Audio PCI ID
  - USB driver - clenaups in the disconnect routine
  - added ALSA-Configuration.txt and ControlNames.txt documents
parent 6a2d19ce
This diff is collapsed.
This document describes standard names of mixer controls.
Syntax: SOURCE [DIRECTION] FUNCTION
DIRECTION:
<nothing> (both directions)
Playback
Capture
Bypass Playback
Bypass Capture
FUNCTION:
Switch (on/off switch)
Volume
Route (route control, hardware specific)
SOURCE:
Master
Master Mono
Hardware Master
Headphone
PC Speaker
Phone
Phone Input
Phone Output
Synth
FM
Mic
Line
CD
Video
Zoom Video
Aux
PCM
PCM Front
PCM Rear
PCM Pan
Loopback
Analog Loopback (D/A -> A/D loopback)
Digital Loopback (playback -> capture loopback - without analog path)
Mono
Mono Output
Multi
ADC
Wave
Music
I2S
IEC958
Exceptions:
[Digital] Capture Source
[Digital] Capture Switch (aka input gain switch)
[Digital] Capture Volume (aka input gain volume)
[Digital] Playback Switch (aka output gain switch)
[Digital] Playback Volume (aka output gain volume)
Tone Control - Switch
Tone Control - Bass
Tone Control - Treble
3D Control - Switch
3D Control - Center
3D Control - Depth
3D Control - Wide
3D Control - Space
3D Control - Level
Mic Boost [(?dB)]
PCM interface:
Sample Clock Source { "Word", "Internal", "AutoSync" }
Clock Sync Status { "Lock", "Sync", "No Lock" }
External Rate /* external capture rate */
Capture Rate /* capture rate taken from external source */
IEC958 (S/PDIF) interface:
IEC958 [...] [Playback|Capture] Switch /* turn on/off the IEC958 interface */
IEC958 [...] [Playback|Capture] Volume /* digital volume control */
IEC958 [...] [Playback|Capture] Default /* default or global value - read/write */
IEC958 [...] [Playback|Capture] Mask /* consumer and professional mask */
IEC958 [...] [Playback|Capture] Con Mask /* consumer mask */
IEC958 [...] [Playback|Capture] Pro Mask /* professional mask */
IEC958 [...] [Playback|Capture] PCM Stream /* the settings assigned to a PCM stream */
/* include/version.h. Generated automatically by configure. */ /* include/version.h. Generated automatically by configure. */
#define CONFIG_SND_VERSION "0.9.0rc6" #define CONFIG_SND_VERSION "0.9.0rc6"
#define CONFIG_SND_DATE " (Mon Dec 16 14:23:15 2002 UTC)" #define CONFIG_SND_DATE " (Tue Dec 17 19:01:13 2002 UTC)"
...@@ -53,6 +53,7 @@ MODULE_DEVICES("{{Intel,82801AA-ICH}," ...@@ -53,6 +53,7 @@ MODULE_DEVICES("{{Intel,82801AA-ICH},"
"{Intel,MX440}," "{Intel,MX440},"
"{SiS,SI7012}," "{SiS,SI7012},"
"{NVidia,NForce Audio}," "{NVidia,NForce Audio},"
"{NVidia,NForce2 Audio},"
"{AMD,AMD768}," "{AMD,AMD768},"
"{AMD,AMD8111}," "{AMD,AMD8111},"
"{ALI,M5455}}"); "{ALI,M5455}}");
...@@ -127,6 +128,9 @@ MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0},{0x330},{0x300}},dialog ...@@ -127,6 +128,9 @@ MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0},{0x330},{0x300}},dialog
#ifndef PCI_DEVICE_ID_NVIDIA_MCP_AUDIO #ifndef PCI_DEVICE_ID_NVIDIA_MCP_AUDIO
#define PCI_DEVICE_ID_NVIDIA_MCP_AUDIO 0x01b1 #define PCI_DEVICE_ID_NVIDIA_MCP_AUDIO 0x01b1
#endif #endif
#ifndef PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO
#define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO 0x006a
#endif
enum { DEVICE_INTEL, DEVICE_INTEL_ICH4, DEVICE_SIS, DEVICE_ALI }; enum { DEVICE_INTEL, DEVICE_INTEL_ICH4, DEVICE_SIS, DEVICE_ALI };
...@@ -383,6 +387,7 @@ static struct pci_device_id snd_intel8x0_ids[] __devinitdata = { ...@@ -383,6 +387,7 @@ static struct pci_device_id snd_intel8x0_ids[] __devinitdata = {
{ 0x8086, 0x7195, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 440MX */ { 0x8086, 0x7195, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 440MX */
{ 0x1039, 0x7012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_SIS }, /* SI7012 */ { 0x1039, 0x7012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_SIS }, /* SI7012 */
{ 0x10de, 0x01b1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* NFORCE */ { 0x10de, 0x01b1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* NFORCE */
{ 0x10de, 0x006a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* NFORCE2 */
{ 0x1022, 0x746d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD8111 */ { 0x1022, 0x746d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD8111 */
{ 0x1022, 0x7445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD768 */ { 0x1022, 0x7445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD768 */
{ 0x10b9, 0x5455, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALI }, /* Ali5455 */ { 0x10b9, 0x5455, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALI }, /* Ali5455 */
...@@ -2298,6 +2303,7 @@ static struct shortname_table { ...@@ -2298,6 +2303,7 @@ static struct shortname_table {
{ PCI_DEVICE_ID_INTEL_ICH4, "Intel 82801DB-ICH4" }, { PCI_DEVICE_ID_INTEL_ICH4, "Intel 82801DB-ICH4" },
{ PCI_DEVICE_ID_SI_7012, "SiS SI7012" }, { PCI_DEVICE_ID_SI_7012, "SiS SI7012" },
{ PCI_DEVICE_ID_NVIDIA_MCP_AUDIO, "NVidia NForce" }, { PCI_DEVICE_ID_NVIDIA_MCP_AUDIO, "NVidia NForce" },
{ PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO, "NVidia NForce2" },
{ 0x746d, "AMD AMD8111" }, { 0x746d, "AMD AMD8111" },
{ 0x7445, "AMD AMD768" }, { 0x7445, "AMD AMD768" },
{ 0x5455, "ALi M5455" }, { 0x5455, "ALi M5455" },
......
...@@ -526,7 +526,11 @@ static struct snd_urb_ops audio_urb_ops[2] = { ...@@ -526,7 +526,11 @@ static struct snd_urb_ops audio_urb_ops[2] = {
/* /*
* complete callback from data urb * complete callback from data urb
*/ */
#ifndef OLD_USB
static void snd_complete_urb(struct urb *urb, struct pt_regs *regs) static void snd_complete_urb(struct urb *urb, struct pt_regs *regs)
#else
static void snd_complete_urb(struct urb *urb)
#endif
{ {
snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context;
snd_usb_substream_t *subs = ctx->subs; snd_usb_substream_t *subs = ctx->subs;
...@@ -551,7 +555,11 @@ static void snd_complete_urb(struct urb *urb, struct pt_regs *regs) ...@@ -551,7 +555,11 @@ static void snd_complete_urb(struct urb *urb, struct pt_regs *regs)
/* /*
* complete callback from sync urb * complete callback from sync urb
*/ */
#ifndef OLD_USB
static void snd_complete_sync_urb(struct urb *urb, struct pt_regs *regs) static void snd_complete_sync_urb(struct urb *urb, struct pt_regs *regs)
#else
static void snd_complete_sync_urb(struct urb *urb)
#endif
{ {
snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context;
snd_usb_substream_t *subs = ctx->subs; snd_usb_substream_t *subs = ctx->subs;
...@@ -583,6 +591,9 @@ static int deactivate_urbs(snd_usb_substream_t *subs) ...@@ -583,6 +591,9 @@ static int deactivate_urbs(snd_usb_substream_t *subs)
subs->running = 0; subs->running = 0;
if (subs->stream->chip->shutdown) /* to be sure... */
return 0;
#ifndef SND_USB_ASYNC_UNLINK #ifndef SND_USB_ASYNC_UNLINK
if (in_interrupt()) if (in_interrupt())
return 0; return 0;
...@@ -870,7 +881,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *run ...@@ -870,7 +881,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *run
u->urb->transfer_flags = URB_ISO_ASAP | UNLINK_FLAGS; u->urb->transfer_flags = URB_ISO_ASAP | UNLINK_FLAGS;
u->urb->number_of_packets = u->packets; u->urb->number_of_packets = u->packets;
u->urb->context = u; u->urb->context = u;
u->urb->complete = snd_complete_urb; u->urb->complete = (usb_complete_t)snd_complete_urb;
} }
if (subs->syncpipe) { if (subs->syncpipe) {
...@@ -892,7 +903,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *run ...@@ -892,7 +903,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *run
u->urb->transfer_flags = URB_ISO_ASAP | UNLINK_FLAGS; u->urb->transfer_flags = URB_ISO_ASAP | UNLINK_FLAGS;
u->urb->number_of_packets = u->packets; u->urb->number_of_packets = u->packets;
u->urb->context = u; u->urb->context = u;
u->urb->complete = snd_complete_sync_urb; u->urb->complete = (usb_complete_t)snd_complete_sync_urb;
} }
} }
return 0; return 0;
...@@ -2253,9 +2264,6 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) ...@@ -2253,9 +2264,6 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
snd_usb_audio_t *chip; snd_usb_audio_t *chip;
snd_card_t *card; snd_card_t *card;
struct list_head *p; struct list_head *p;
snd_usb_stream_t *as;
snd_usb_substream_t *subs;
int idx;
if (ptr == (void *)-1) if (ptr == (void *)-1)
return; return;
...@@ -2265,22 +2273,21 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) ...@@ -2265,22 +2273,21 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
down(&register_mutex); down(&register_mutex);
chip->shutdown = 1; chip->shutdown = 1;
chip->num_interfaces--; chip->num_interfaces--;
if (chip->num_interfaces <= 0) if (chip->num_interfaces <= 0) {
snd_card_disconnect(card); snd_card_disconnect(card);
/* release the pcm resources */
list_for_each(p, &chip->pcm_list) { list_for_each(p, &chip->pcm_list) {
snd_usb_stream_t *as;
int idx;
as = list_entry(p, snd_usb_stream_t, list); as = list_entry(p, snd_usb_stream_t, list);
for (idx = 0; idx < 2; idx++) { for (idx = 0; idx < 2; idx++) {
snd_usb_substream_t *subs;
subs = &as->substream[idx]; subs = &as->substream[idx];
if (!subs->num_formats) if (!subs->num_formats)
continue; continue;
release_substream_urbs(subs); release_substream_urbs(subs);
if (subs->interface >= 0) {
usb_set_interface(subs->dev, subs->interface, 0);
subs->interface = -1;
} }
} }
}
if (chip->num_interfaces <= 0) {
up(&register_mutex); up(&register_mutex);
snd_card_free_in_thread(card); snd_card_free_in_thread(card);
} else { } else {
......
...@@ -172,7 +172,11 @@ static void snd_usbmidi_input_packet(snd_usb_midi_in_endpoint_t* ep, ...@@ -172,7 +172,11 @@ static void snd_usbmidi_input_packet(snd_usb_midi_in_endpoint_t* ep,
/* /*
* Processes the data read from the device. * Processes the data read from the device.
*/ */
#ifndef OLD_USB
static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs) static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs)
#else
static void snd_usbmidi_in_urb_complete(struct urb* urb)
#endif
{ {
snd_usb_midi_in_endpoint_t* ep = snd_magic_cast(snd_usb_midi_in_endpoint_t, urb->context, return); snd_usb_midi_in_endpoint_t* ep = snd_magic_cast(snd_usb_midi_in_endpoint_t, urb->context, return);
...@@ -197,7 +201,11 @@ static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs) ...@@ -197,7 +201,11 @@ static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs)
/* /*
* Converts the data read from a Midiman device to standard USB MIDI packets. * Converts the data read from a Midiman device to standard USB MIDI packets.
*/ */
#ifndef OLD_USB
static void snd_usbmidi_in_midiman_complete(struct urb* urb, struct pt_regs *regs) static void snd_usbmidi_in_midiman_complete(struct urb* urb, struct pt_regs *regs)
#else
static void snd_usbmidi_in_midiman_complete(struct urb* urb)
#endif
{ {
if (urb->status == 0) { if (urb->status == 0) {
uint8_t* buffer = (uint8_t*)urb->transfer_buffer; uint8_t* buffer = (uint8_t*)urb->transfer_buffer;
...@@ -223,10 +231,18 @@ static void snd_usbmidi_in_midiman_complete(struct urb* urb, struct pt_regs *reg ...@@ -223,10 +231,18 @@ static void snd_usbmidi_in_midiman_complete(struct urb* urb, struct pt_regs *reg
} }
} }
} }
#ifndef OLD_USB
snd_usbmidi_in_urb_complete(urb, regs); snd_usbmidi_in_urb_complete(urb, regs);
#else
snd_usbmidi_in_urb_complete(urb);
#endif
} }
#ifndef OLD_USB
static void snd_usbmidi_out_urb_complete(struct urb* urb, struct pt_regs *regs) static void snd_usbmidi_out_urb_complete(struct urb* urb, struct pt_regs *regs)
#else
static void snd_usbmidi_out_urb_complete(struct urb* urb)
#endif
{ {
snd_usb_midi_out_endpoint_t* ep = snd_magic_cast(snd_usb_midi_out_endpoint_t, urb->context, return); snd_usb_midi_out_endpoint_t* ep = snd_magic_cast(snd_usb_midi_out_endpoint_t, urb->context, return);
...@@ -451,8 +467,10 @@ static void snd_usbmidi_output_trigger(snd_rawmidi_substream_t* substream, int u ...@@ -451,8 +467,10 @@ static void snd_usbmidi_output_trigger(snd_rawmidi_substream_t* substream, int u
usbmidi_out_port_t* port = (usbmidi_out_port_t*)substream->runtime->private_data; usbmidi_out_port_t* port = (usbmidi_out_port_t*)substream->runtime->private_data;
port->active = up; port->active = up;
if (up) if (up) {
if (! port->ep->umidi->chip->shutdown) /* to be sure... */
tasklet_hi_schedule(&port->ep->tasklet); tasklet_hi_schedule(&port->ep->tasklet);
}
} }
static int snd_usbmidi_input_open(snd_rawmidi_substream_t* substream) static int snd_usbmidi_input_open(snd_rawmidi_substream_t* substream)
...@@ -489,6 +507,7 @@ static void snd_usbmidi_in_endpoint_delete(snd_usb_midi_in_endpoint_t* ep) ...@@ -489,6 +507,7 @@ static void snd_usbmidi_in_endpoint_delete(snd_usb_midi_in_endpoint_t* ep)
{ {
if (ep->urb) { if (ep->urb) {
if (ep->urb->transfer_buffer) { if (ep->urb->transfer_buffer) {
if (! ep->umidi->chip->shutdown) /* to be sure */
usb_unlink_urb(ep->urb); usb_unlink_urb(ep->urb);
kfree(ep->urb->transfer_buffer); kfree(ep->urb->transfer_buffer);
} }
...@@ -587,10 +606,12 @@ static int snd_usbmidi_in_endpoint_create(snd_usb_midi_t* umidi, ...@@ -587,10 +606,12 @@ static int snd_usbmidi_in_endpoint_create(snd_usb_midi_t* umidi,
} }
if (int_epd) if (int_epd)
usb_fill_int_urb(ep->urb, umidi->chip->dev, pipe, buffer, length, usb_fill_int_urb(ep->urb, umidi->chip->dev, pipe, buffer, length,
snd_usbmidi_in_urb_complete, ep, int_epd->bInterval); (usb_complete_t)snd_usbmidi_in_urb_complete,
ep, int_epd->bInterval);
else else
usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, length, usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, length,
snd_usbmidi_in_urb_complete, ep); (usb_complete_t)snd_usbmidi_in_urb_complete,
ep);
rep->in = ep; rep->in = ep;
return 0; return 0;
...@@ -615,6 +636,7 @@ static void snd_usbmidi_out_endpoint_delete(snd_usb_midi_out_endpoint_t* ep) ...@@ -615,6 +636,7 @@ static void snd_usbmidi_out_endpoint_delete(snd_usb_midi_out_endpoint_t* ep)
tasklet_kill(&ep->tasklet); tasklet_kill(&ep->tasklet);
if (ep->urb) { if (ep->urb) {
if (ep->urb->transfer_buffer) { if (ep->urb->transfer_buffer) {
if (! ep->umidi->chip->shutdown) /* to be sure */
usb_unlink_urb(ep->urb); usb_unlink_urb(ep->urb);
kfree(ep->urb->transfer_buffer); kfree(ep->urb->transfer_buffer);
} }
...@@ -654,7 +676,8 @@ static int snd_usbmidi_out_endpoint_create(snd_usb_midi_t* umidi, ...@@ -654,7 +676,8 @@ static int snd_usbmidi_out_endpoint_create(snd_usb_midi_t* umidi,
return -ENOMEM; return -ENOMEM;
} }
usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer,
ep->max_transfer, snd_usbmidi_out_urb_complete, ep); ep->max_transfer,
(usb_complete_t)snd_usbmidi_out_urb_complete, ep);
spin_lock_init(&ep->buffer_lock); spin_lock_init(&ep->buffer_lock);
tasklet_init(&ep->tasklet, snd_usbmidi_out_tasklet, (unsigned long)ep); tasklet_init(&ep->tasklet, snd_usbmidi_out_tasklet, (unsigned long)ep);
...@@ -944,7 +967,7 @@ static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi, ...@@ -944,7 +967,7 @@ static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi,
err = snd_usbmidi_in_endpoint_create(umidi, &ep_info, &umidi->endpoints[0]); err = snd_usbmidi_in_endpoint_create(umidi, &ep_info, &umidi->endpoints[0]);
if (err < 0) if (err < 0)
return err; return err;
umidi->endpoints[0].in->urb->complete = snd_usbmidi_in_midiman_complete; umidi->endpoints[0].in->urb->complete = (usb_complete_t)snd_usbmidi_in_midiman_complete;
if (endpoint->out_cables > 0x0001) { if (endpoint->out_cables > 0x0001) {
ep_info.epnum = get_endpoint(hostif, 4)->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; ep_info.epnum = get_endpoint(hostif, 4)->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment