mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 05:36:24 +00:00
ALSA: ctxfi - Fix PCM device naming
PCM names for surround streams should be also fixed as well as the mixer element names. Also, a bit clean up for PCM name setup. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
6585db943a
commit
8372d4980f
3 changed files with 10 additions and 12 deletions
|
@ -72,15 +72,15 @@ static struct {
|
||||||
[FRONT] = { .create = ct_alsa_pcm_create,
|
[FRONT] = { .create = ct_alsa_pcm_create,
|
||||||
.destroy = NULL,
|
.destroy = NULL,
|
||||||
.public_name = "Front/WaveIn"},
|
.public_name = "Front/WaveIn"},
|
||||||
[REAR] = { .create = ct_alsa_pcm_create,
|
|
||||||
.destroy = NULL,
|
|
||||||
.public_name = "Rear"},
|
|
||||||
[CLFE] = { .create = ct_alsa_pcm_create,
|
|
||||||
.destroy = NULL,
|
|
||||||
.public_name = "Center/LFE"},
|
|
||||||
[SURROUND] = { .create = ct_alsa_pcm_create,
|
[SURROUND] = { .create = ct_alsa_pcm_create,
|
||||||
.destroy = NULL,
|
.destroy = NULL,
|
||||||
.public_name = "Surround"},
|
.public_name = "Surround"},
|
||||||
|
[CLFE] = { .create = ct_alsa_pcm_create,
|
||||||
|
.destroy = NULL,
|
||||||
|
.public_name = "Center/LFE"},
|
||||||
|
[SIDE] = { .create = ct_alsa_pcm_create,
|
||||||
|
.destroy = NULL,
|
||||||
|
.public_name = "Side"},
|
||||||
[IEC958] = { .create = ct_alsa_pcm_create,
|
[IEC958] = { .create = ct_alsa_pcm_create,
|
||||||
.destroy = NULL,
|
.destroy = NULL,
|
||||||
.public_name = "IEC958 Non-audio"},
|
.public_name = "IEC958 Non-audio"},
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
|
|
||||||
enum CTALSADEVS { /* Types of alsa devices */
|
enum CTALSADEVS { /* Types of alsa devices */
|
||||||
FRONT,
|
FRONT,
|
||||||
REAR,
|
|
||||||
CLFE,
|
|
||||||
SURROUND,
|
SURROUND,
|
||||||
|
CLFE,
|
||||||
|
SIDE,
|
||||||
IEC958,
|
IEC958,
|
||||||
MIXER,
|
MIXER,
|
||||||
NUM_CTALSADEVS /* This should always be the last */
|
NUM_CTALSADEVS /* This should always be the last */
|
||||||
|
|
|
@ -469,12 +469,10 @@ int ct_alsa_pcm_create(struct ct_atc *atc,
|
||||||
struct snd_pcm *pcm;
|
struct snd_pcm *pcm;
|
||||||
int err;
|
int err;
|
||||||
int playback_count, capture_count;
|
int playback_count, capture_count;
|
||||||
char name[128];
|
|
||||||
|
|
||||||
strncpy(name, device_name, sizeof(name));
|
|
||||||
playback_count = (IEC958 == device) ? 1 : 8;
|
playback_count = (IEC958 == device) ? 1 : 8;
|
||||||
capture_count = (FRONT == device) ? 1 : 0;
|
capture_count = (FRONT == device) ? 1 : 0;
|
||||||
err = snd_pcm_new(atc->card, name, device,
|
err = snd_pcm_new(atc->card, "ctxfi", device,
|
||||||
playback_count, capture_count, &pcm);
|
playback_count, capture_count, &pcm);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
printk(KERN_ERR "ctxfi: snd_pcm_new failed!! Err=%d\n", err);
|
printk(KERN_ERR "ctxfi: snd_pcm_new failed!! Err=%d\n", err);
|
||||||
|
@ -484,7 +482,7 @@ int ct_alsa_pcm_create(struct ct_atc *atc,
|
||||||
pcm->private_data = atc;
|
pcm->private_data = atc;
|
||||||
pcm->info_flags = 0;
|
pcm->info_flags = 0;
|
||||||
pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
|
pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
|
||||||
strcpy(pcm->name, device_name);
|
strlcpy(pcm->name, device_name, sizeof(pcm->name));
|
||||||
|
|
||||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &ct_pcm_playback_ops);
|
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &ct_pcm_playback_ops);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue