806 |
{ |
{ |
807 |
switch (mode) { |
switch (mode) { |
808 |
case RME96_CLOCKMODE_SLAVE: |
case RME96_CLOCKMODE_SLAVE: |
809 |
|
/* AutoSync */ |
810 |
rme96->wcreg &= ~RME96_WCR_MASTER; |
rme96->wcreg &= ~RME96_WCR_MASTER; |
811 |
rme96->areg &= ~RME96_AR_WSEL; |
rme96->areg &= ~RME96_AR_WSEL; |
812 |
break; |
break; |
813 |
case RME96_CLOCKMODE_MASTER: |
case RME96_CLOCKMODE_MASTER: |
814 |
|
/* Internal */ |
815 |
rme96->wcreg |= RME96_WCR_MASTER; |
rme96->wcreg |= RME96_WCR_MASTER; |
816 |
rme96->areg &= ~RME96_AR_WSEL; |
rme96->areg &= ~RME96_AR_WSEL; |
817 |
break; |
break; |
1320 |
snd_pcm_set_sync(substream); |
snd_pcm_set_sync(substream); |
1321 |
|
|
1322 |
runtime->hw = snd_rme96_capture_adat_info; |
runtime->hw = snd_rme96_capture_adat_info; |
1323 |
if (snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG) { |
if (snd_rme96_getinputtype(rme96) == RME96_INPUT_ANALOG) { |
1324 |
/* makes no sense to use analog input. Note that analog |
/* makes no sense to use analog input. Note that analog |
1325 |
expension cards AEB4/8-I are RME96_INPUT_INTERNAL */ |
expension cards AEB4/8-I are RME96_INPUT_INTERNAL */ |
1326 |
return -EIO; |
return -EIO; |
1864 |
snd_iprintf(buffer, " sample format: 16 bit\n"); |
snd_iprintf(buffer, " sample format: 16 bit\n"); |
1865 |
} |
} |
1866 |
if (rme96->areg & RME96_AR_WSEL) { |
if (rme96->areg & RME96_AR_WSEL) { |
1867 |
snd_iprintf(buffer, " clock mode: word clock\n"); |
snd_iprintf(buffer, " sample clock source: word clock\n"); |
1868 |
} else if (rme96->wcreg & RME96_WCR_MASTER) { |
} else if (rme96->wcreg & RME96_WCR_MASTER) { |
1869 |
snd_iprintf(buffer, " clock mode: master\n"); |
snd_iprintf(buffer, " sample clock source: internal\n"); |
1870 |
} else if (snd_rme96_getinputtype(rme96) == RME96_INPUT_ANALOG) { |
} else if (snd_rme96_getinputtype(rme96) == RME96_INPUT_ANALOG) { |
1871 |
snd_iprintf(buffer, " clock mode: slave (master anyway due to analog input setting)\n"); |
snd_iprintf(buffer, " sample clock source: autosync (internal anyway due to analog input setting)\n"); |
1872 |
} else if (snd_rme96_capture_getrate(rme96, &n) < 0) { |
} else if (snd_rme96_capture_getrate(rme96, &n) < 0) { |
1873 |
snd_iprintf(buffer, " clock mode: slave (master anyway due to no valid signal)\n"); |
snd_iprintf(buffer, " sample clock source: autosync (internal anyway due to no valid signal)\n"); |
1874 |
} else { |
} else { |
1875 |
snd_iprintf(buffer, " clock mode: slave\n"); |
snd_iprintf(buffer, " sample clock source: autosync\n"); |
1876 |
} |
} |
1877 |
if (rme96->wcreg & RME96_WCR_PRO) { |
if (rme96->wcreg & RME96_WCR_PRO) { |
1878 |
snd_iprintf(buffer, " format: AES/EBU (professional)\n"); |
snd_iprintf(buffer, " format: AES/EBU (professional)\n"); |
2097 |
static int |
static int |
2098 |
snd_rme96_info_clockmode_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) |
snd_rme96_info_clockmode_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) |
2099 |
{ |
{ |
2100 |
static char *texts[3] = { "Slave", "Master", "Wordclock" }; |
static char *texts[3] = { "AutoSync", "Internal", "Word" }; |
2101 |
|
|
2102 |
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
2103 |
uinfo->count = 1; |
uinfo->count = 1; |
2420 |
}, |
}, |
2421 |
{ |
{ |
2422 |
.iface = SNDRV_CTL_ELEM_IFACE_PCM, |
.iface = SNDRV_CTL_ELEM_IFACE_PCM, |
2423 |
.name = "Clock Mode", |
.name = "Sample Clock Source", |
2424 |
.info = snd_rme96_info_clockmode_control, |
.info = snd_rme96_info_clockmode_control, |
2425 |
.get = snd_rme96_get_clockmode_control, |
.get = snd_rme96_get_clockmode_control, |
2426 |
.put = snd_rme96_put_clockmode_control |
.put = snd_rme96_put_clockmode_control |