Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26367
b: refs/heads/master
c: 43dff98
h: refs/heads/master
i:
  26365: 3b7ccdf
  26363: 5102bf7
  26359: a604d9b
  26351: 6d6fbe5
  26335: 3dafcdb
  26303: 144c379
  26239: 5489bd0
  26111: ef1a864
v: v3
  • Loading branch information
Shaun Pereira authored and David S. Miller committed Apr 30, 2006
1 parent a30cfd8 commit a2574cb
Show file tree
Hide file tree
Showing 80 changed files with 332 additions and 759 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d262424b07582a3aa3afa85af645bd436a94a39
refs/heads/master: 43dff98b022ded593e73c3784bac03bc9fc7ec55
81 changes: 27 additions & 54 deletions trunk/Documentation/sound/alsa/Audiophile-Usb.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Guide to using M-Audio Audiophile USB with ALSA and Jack v1.3
Guide to using M-Audio Audiophile USB with ALSA and Jack v1.2
========================================================

Thibault Le Meur <Thibault.LeMeur@supelec.fr>
Expand All @@ -22,16 +22,16 @@ The device has 4 audio interfaces, and 2 MIDI ports:
* Midi In (Mi)
* Midi Out (Mo)

The internal DAC/ADC has the following characteristics:
The internal DAC/ADC has the following caracteristics:
* sample depth of 16 or 24 bits
* sample rate from 8kHz to 96kHz
* Two ports can't use different sample depths at the same time. Moreover, the
* Two ports can't use different sample depths at the same time.Moreover, the
Audiophile USB documentation gives the following Warning: "Please exit any
audio application running before switching between bit depths"

Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be
activated at the same time depending on the audio mode selected:
* 16-bit/48kHz ==> 4 channels in/4 channels out
* 16-bit/48kHz ==> 4 channels in/ 4 channels out
- Ai+Ao+Di+Do
* 24-bit/48kHz ==> 4 channels in/2 channels out,
or 2 channels in/4 channels out
Expand All @@ -41,8 +41,8 @@ activated at the same time depending on the audio mode selected:

Important facts about the Digital interface:
--------------------------------------------
* The Do port additionally supports surround-encoded AC-3 and DTS passthrough,
though I haven't tested it under Linux
* The Do port additionnaly supports surround-encoded AC-3 and DTS passthrough,
though I haven't tested it under linux
- Note that in this setup only the Do interface can be enabled
* Apart from recording an audio digital stream, enabling the Di port is a way
to synchronize the device to an external sample clock
Expand All @@ -60,23 +60,24 @@ synchronization error (for instance sound played at an odd sample rate)
The Audiophile USB MIDI ports will be automatically supported once the
following modules have been loaded:
* snd-usb-audio
* snd-seq
* snd-seq-midi

No additional setting is required.
No additionnal setting is required.

2.2 - Audio ports
-----------------

Audio functions of the Audiophile USB device are handled by the snd-usb-audio
module. This module can work in a default mode (without any device-specific
parameter), or in an "advanced" mode with the device-specific parameter called
parameter), or in an advanced mode with the device-specific parameter called
"device_setup".

2.2.1 - Default Alsa driver mode

The default behavior of the snd-usb-audio driver is to parse the device
The default behaviour of the snd-usb-audio driver is to parse the device
capabilities at startup and enable all functions inside the device (including
all ports at any supported sample rates and sample depths). This approach
all ports at any sample rates and any sample depths supported). This approach
has the advantage to let the driver easily switch from sample rates/depths
automatically according to the need of the application claiming the device.

Expand Down Expand Up @@ -113,9 +114,9 @@ gain).
For people having this problem, the snd-usb-audio module has a new module
parameter called "device_setup".

2.2.2.1 - Initializing the working mode of the Audiophile USB
2.2.2.1 - Initializing the working mode of the Audiohile USB

As far as the Audiophile USB device is concerned, this value let the user
As far as the Audiohile USB device is concerned, this value let the user
specify:
* the sample depth
* the sample rate
Expand Down Expand Up @@ -173,20 +174,20 @@ The parameter can be given:

IMPORTANT NOTE WHEN SWITCHING CONFIGURATION:
-------------------------------------------
* You may need to _first_ initialize the module with the correct device_setup
* You may need to _first_ intialize the module with the correct device_setup
parameter and _only_after_ turn on the Audiophile USB device
* This is especially true when switching the sample depth:
- first turn off the device
- de-register the snd-usb-audio module (modprobe -r)
- change the device_setup parameter by changing the device_setup
option in /etc/modprobe.conf
- first trun off the device
- de-register the snd-usb-audio module
- change the device_setup parameter (by either manually reprobing the module
or changing modprobe.conf)
- turn on the device

2.2.2.3 - Audiophile USB's device_setup structure

If you want to understand the device_setup magic numbers for the Audiophile
USB, you need some very basic understanding of binary computation. However,
this is not required to use the parameter and you may skip this section.
this is not required to use the parameter and you may skip thi section.

The device_setup is one byte long and its structure is the following:

Expand Down Expand Up @@ -230,11 +231,11 @@ Caution:

2.2.3 - USB implementation details for this device

You may safely skip this section if you're not interested in driver
You may safely skip this section if you're not interrested in driver
development.

This section describes some internal aspects of the device and summarize the
data I got by usb-snooping the windows and Linux drivers.
This section describes some internals aspect of the device and summarize the
data I got by usb-snooping the windows and linux drivers.

The M-Audio Audiophile USB has 7 USB Interfaces:
a "USB interface":
Expand Down Expand Up @@ -276,9 +277,9 @@ Here is a short description of the AltSettings capabilities:
- 16-bit depth, 8-48kHz sample mode
- Synch playback (Do), audio format type III IEC1937_AC-3

In order to ensure a correct initialization of the device, the driver
In order to ensure a correct intialization of the device, the driver
_must_know_ how the device will be used:
* if DTS is chosen, only Interface 2 with AltSet nb.6 must be
* if DTS is choosen, only Interface 2 with AltSet nb.6 must be
registered
* if 96KHz only AltSets nb.1 of each interface must be selected
* if samples are using 24bits/48KHz then AltSet 2 must me used if
Expand All @@ -289,7 +290,7 @@ _must_know_ how the device will be used:
is not connected

When device_setup is given as a parameter to the snd-usb-audio module, the
parse_audio_endpoints function uses a quirk called
parse_audio_enpoint function uses a quirk called
"audiophile_skip_setting_quirk" in order to prevent AltSettings not
corresponding to device_setup from being registered in the driver.

Expand All @@ -316,8 +317,9 @@ However you may see the following warning message:
using the "default" ALSA device. This is less efficient than it could be.
Consider using a hardware device instead rather than using the plug layer."


3.2 - Patching alsa to use direct pcm device
--------------------------------------------
-------------------------------------------
A patch for Jack by Andreas Steinmetz adds support for Big Endian devices.
However it has not been included in the CVS tree.

Expand All @@ -329,32 +331,3 @@ After having applied the patch you can run jackd with the following command
line:
% jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1

3.2 - Getting 2 input and/or output interfaces in Jack
------------------------------------------------------

As you can see, starting the Jack server this way will only enable 1 stereo
input (Di or Ai) and 1 stereo output (Ao or Do).

This is due to the following restrictions:
* Jack can only open one capture device and one playback device at a time
* The Audiophile USB is seen as 2 (or three) Alsa devices: hw:1,0, hw:1,1
(and optionally hw:1,2)
If you want to get Ai+Di and/or Ao+Do support with Jack, you would need to
combine the Alsa devices into one logical "complex" device.

If you want to give it a try, I recommend reading the information from
this page: http://www.sound-man.co.uk/linuxaudio/ice1712multi.html
It is related to another device (ice1712) but can be adapted to suit
the Audiophile USB.

Enabling multiple Audiophile USB interfaces for Jackd will certainly require:
* patching Jack with the previously mentioned "Big Endian" patch
* patching Jackd with the MMAP_COMPLEX patch (see the ice1712 page)
* patching the alsa-lib/src/pcm/pcm_multi.c file (see the ice1712 page)
* define a multi device (combination of hw:1,0 and hw:1,1) in your .asoundrc
file
* start jackd with this device

I had no success in testing this for now, but this may be due to my OS
configuration. If you have any success with this kind of setup, please
drop me an email.
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@
}

/* PCI IDs */
static struct pci_device_id snd_mychip_ids[] __devinitdata = {
static struct pci_device_id snd_mychip_ids[] = {
{ PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
....
Expand Down Expand Up @@ -1565,7 +1565,7 @@
<informalexample>
<programlisting>
<![CDATA[
static struct pci_device_id snd_mychip_ids[] __devinitdata = {
static struct pci_device_id snd_mychip_ids[] = {
{ PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
....
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/sparc64/mm/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <linux/percpu.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/preempt.h>

#include <asm/pgtable.h>
#include <asm/pgalloc.h>
Expand All @@ -25,8 +24,6 @@ void flush_tlb_pending(void)
{
struct mmu_gather *mp = &__get_cpu_var(mmu_gathers);

preempt_disable();

if (mp->tlb_nr) {
flush_tsb_user(mp);

Expand All @@ -41,8 +38,6 @@ void flush_tlb_pending(void)
}
mp->tlb_nr = 0;
}

preempt_enable();
}

void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t orig)
Expand Down
38 changes: 10 additions & 28 deletions trunk/drivers/char/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,32 +860,9 @@ static void k_slock(struct vc_data *vc, unsigned char value, char up_flag, struc
}

/* by default, 300ms interval for combination release */
static unsigned brl_timeout = 300;
MODULE_PARM_DESC(brl_timeout, "Braille keys release delay in ms (0 for commit on first key release)");
module_param(brl_timeout, uint, 0644);

static unsigned brl_nbchords = 1;
MODULE_PARM_DESC(brl_nbchords, "Number of chords that produce a braille pattern (0 for dead chords)");
module_param(brl_nbchords, uint, 0644);

static void k_brlcommit(struct vc_data *vc, unsigned int pattern, char up_flag, struct pt_regs *regs)
{
static unsigned long chords;
static unsigned committed;

if (!brl_nbchords)
k_deadunicode(vc, BRL_UC_ROW | pattern, up_flag, regs);
else {
committed |= pattern;
chords++;
if (chords == brl_nbchords) {
k_unicode(vc, BRL_UC_ROW | committed, up_flag, regs);
chords = 0;
committed = 0;
}
}
}

static long brl_timeout = 300;
MODULE_PARM_DESC(brl_timeout, "Braille keys release delay in ms (0 for combination on first release, < 0 for dead characters)");
module_param(brl_timeout, long, 0644);
static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
{
static unsigned pressed,committing;
Expand All @@ -905,6 +882,11 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct
if (value > 8)
return;

if (brl_timeout < 0) {
k_deadunicode(vc, BRL_UC_ROW | (1 << (value - 1)), up_flag, regs);
return;
}

if (up_flag) {
if (brl_timeout) {
if (!committing ||
Expand All @@ -915,13 +897,13 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct
pressed &= ~(1 << (value - 1));
if (!pressed) {
if (committing) {
k_brlcommit(vc, committing, 0, regs);
k_unicode(vc, BRL_UC_ROW | committing, 0, regs);
committing = 0;
}
}
} else {
if (committing) {
k_brlcommit(vc, committing, 0, regs);
k_unicode(vc, BRL_UC_ROW | committing, 0, regs);
committing = 0;
}
pressed &= ~(1 << (value - 1));
Expand Down
21 changes: 0 additions & 21 deletions trunk/drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,27 +403,6 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd,
case EVIOCGID:
if (copy_to_user(p, &dev->id, sizeof(struct input_id)))
return -EFAULT;
return 0;

case EVIOCGREP:
if (!test_bit(EV_REP, dev->evbit))
return -ENOSYS;
if (put_user(dev->rep[REP_DELAY], ip))
return -EFAULT;
if (put_user(dev->rep[REP_PERIOD], ip + 1))
return -EFAULT;
return 0;

case EVIOCSREP:
if (!test_bit(EV_REP, dev->evbit))
return -ENOSYS;
if (get_user(u, ip))
return -EFAULT;
if (get_user(v, ip + 1))
return -EFAULT;

input_event(dev, EV_REP, REP_DELAY, u);
input_event(dev, EV_REP, REP_PERIOD, v);

return 0;

Expand Down
11 changes: 4 additions & 7 deletions trunk/drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
if (code > SND_MAX || !test_bit(code, dev->sndbit))
return;

if (!!test_bit(code, dev->snd) != !!value)
change_bit(code, dev->snd);

if (dev->event) dev->event(dev, type, code, value);

break;
Expand Down Expand Up @@ -289,19 +286,19 @@ static struct input_device_id *input_match_device(struct input_device_id *id, st
for (; id->flags || id->driver_info; id++) {

if (id->flags & INPUT_DEVICE_ID_MATCH_BUS)
if (id->bustype != dev->id.bustype)
if (id->id.bustype != dev->id.bustype)
continue;

if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR)
if (id->vendor != dev->id.vendor)
if (id->id.vendor != dev->id.vendor)
continue;

if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT)
if (id->product != dev->id.product)
if (id->id.product != dev->id.product)
continue;

if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION)
if (id->version != dev->id.version)
if (id->id.version != dev->id.version)
continue;

MATCH_BIT(evbit, EV_MAX);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/input/keyboard/spitzkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ static unsigned char spitzkbd_keycode[NR_SCANCODES] = {
KEY_LEFTCTRL, KEY_1, KEY_3, KEY_5, KEY_6, KEY_7, KEY_9, KEY_0, KEY_BACKSPACE, SPITZ_KEY_EXOK, SPITZ_KEY_EXCANCEL, 0, 0, 0, 0, 0, /* 1-16 */
0, KEY_2, KEY_4, KEY_R, KEY_Y, KEY_8, KEY_I, KEY_O, KEY_P, SPITZ_KEY_EXJOGDOWN, SPITZ_KEY_EXJOGUP, 0, 0, 0, 0, 0, /* 17-32 */
KEY_TAB, KEY_Q, KEY_E, KEY_T, KEY_G, KEY_U, KEY_J, KEY_K, 0, 0, 0, 0, 0, 0, 0, 0, /* 33-48 */
SPITZ_KEY_ADDRESS, KEY_W, KEY_S, KEY_F, KEY_V, KEY_H, KEY_M, KEY_L, 0, KEY_RIGHTSHIFT, 0, 0, 0, 0, 0, 0, /* 49-64 */
SPITZ_KEY_CALENDER, KEY_A, KEY_D, KEY_C, KEY_B, KEY_N, KEY_DOT, 0, KEY_ENTER, KEY_LEFTSHIFT, 0, 0, 0, 0, 0, 0, /* 65-80 */
SPITZ_KEY_CALENDER, KEY_W, KEY_S, KEY_F, KEY_V, KEY_H, KEY_M, KEY_L, 0, KEY_RIGHTSHIFT, 0, 0, 0, 0, 0, 0, /* 49-64 */
SPITZ_KEY_ADDRESS, KEY_A, KEY_D, KEY_C, KEY_B, KEY_N, KEY_DOT, 0, KEY_ENTER, KEY_LEFTSHIFT, 0, 0, 0, 0, 0, 0, /* 65-80 */
SPITZ_KEY_MAIL, KEY_Z, KEY_X, KEY_MINUS, KEY_SPACE, KEY_COMMA, 0, KEY_UP, 0, 0, SPITZ_KEY_FN, 0, 0, 0, 0, 0, /* 81-96 */
KEY_SYSRQ, SPITZ_KEY_JAP1, SPITZ_KEY_JAP2, SPITZ_KEY_CANCEL, SPITZ_KEY_OK, SPITZ_KEY_MENU, KEY_LEFT, KEY_DOWN, KEY_RIGHT, 0, 0, 0, 0, 0, 0, 0 /* 97-112 */
};
Expand Down
Loading

0 comments on commit a2574cb

Please sign in to comment.