当前位置: 技术问答>linux和unix
linux3.1移植到s3c2416所出现声卡问题
来源: 互联网 发布时间:2017-05-02
本文导语: 问题六:声卡没有声音: 原因没有声卡驱动,WM9713声卡驱动移植(原来的内核有UDA1341声卡驱动,我们再次基础上直接修改) 首先查看内核/sound/soc/samsung/kconfig 配上WM9713 config SND_SOC_SAMSUNG_SMDK_WM9713 tristate "SoC AC97 A...
问题六:声卡没有声音:
原因没有声卡驱动,WM9713声卡驱动移植(原来的内核有UDA1341声卡驱动,我们再次基础上直接修改)
首先查看内核/sound/soc/samsung/kconfig 配上WM9713
config SND_SOC_SAMSUNG_SMDK_WM9713
tristate "SoC AC97 Audio support for SMDK with WM9713"
## depends on SND_SOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDKV210 || ##MACH_SMDKC110 || MACH_SMDKV310 || MACH_SMDKC210) #屏蔽掉
depends on SND_SOC_SAMSUNG && ARCH_S3C24XX ##add by ljf
select SND_SOC_WM9713
select SND_SAMSUNG_AC97
help
Sat Y if you want to add support for SoC audio on the SMDK.
这样在内核中“make menuconfig”里面就可以看到"SoC AC97 Audio support for SMDK with WM9713",并选中他。
接下来我们要在内核中加入这个平台驱动设备:
在“arch/arm/mach-s3c2416/”的mach-tq2416.c中添加:
//add by ljf
/*
* AC97
*/
//at plat-s3c24xx/devs.c
static int s3c2416_ac97_cfg_gpio(struct platform_device *pdev)
{
return s3c_gpio_cfgpin_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(3));//S3C_GPIO_SFN(4)
}
static struct resource s3c_ac97_resource[] = {
[0] = {
.start = S3C2440_PA_AC97,
.end = S3C2440_PA_AC97 + S3C2440_SZ_AC97 -1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_S3C244x_AC97,
.end = IRQ_S3C244x_AC97,
.flags = IORESOURCE_IRQ,
},
[2] = {
.name = "PCM out",
.start = DMACH_PCM_OUT,
.end = DMACH_PCM_OUT,
.flags = IORESOURCE_DMA,
},
[3] = {
.name = "PCM in",
.start = DMACH_PCM_IN,
.end = DMACH_PCM_IN,
.flags = IORESOURCE_DMA,
},
[4] = {
.name = "Mic in",
.start = DMACH_MIC_IN,
.end = DMACH_MIC_IN,
.flags = IORESOURCE_DMA,
},
};
static struct s3c_audio_pdata s3c_ac97_pdata = {
.cfg_gpio = s3c2416_ac97_cfg_gpio,
};
static u64 s3c_device_audio_dmamask = DMA_BIT_MASK(32);//0xffffffffUL;//will change
struct platform_device s3c_device_ac97 = {
.name = "samsung-ac97",//wm9713-codec
.id = -1,
.num_resources = ARRAY_SIZE(s3c_ac97_resource),
.resource = s3c_ac97_resource,
.dev = {
.platform_data = &s3c_ac97_pdata,
.dma_mask = &s3c_device_audio_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32)//;0xffffffffUL//will change
}
};
//add by ljf
然后在“struct platform_device *tq2416_devices[] __initdata”中加入
//add by ljf
#ifdef CONFIG_SND_SOC_SAMSUNG_SMDK_WM9713
&s3c_device_ac97,
&samsung_asoc_dma,
#endif
//add by ljf
然后编译、烧写。内核打印信息有
asoc: wm9713-hifi samsung-ac97 mapping ok
ALSA device list:
#0: SMDK WM9713
但是用qtpia自带的音乐播放器,播放出来没声音,时间进度条却有在移动,时间到了也会停止,就是没声音。
在串口终端输入指令“cat /udisk/Too.mp3 > /dev/dsp”也没听到任何声音
用madplay命令播放时会出错
[root@LILLIPUT /]# madplay /udisk/Too Close.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
Title: Too Close
Artist: Alex Clare
Album: The Lateness of the Hour (Deluxe Edition)
Year: 2011
error: frame 0: lost synchronization
mapped channel 12 to 0
换一首:
[root@LILLIPUT /]# madplay /udisk/Tulisa - Young.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
Title: Young
Artist: Tulisa
Album: We Are Young
mapped channel 12 to 0
就是没声音,不知道怎么解决。
原因没有声卡驱动,WM9713声卡驱动移植(原来的内核有UDA1341声卡驱动,我们再次基础上直接修改)
首先查看内核/sound/soc/samsung/kconfig 配上WM9713
config SND_SOC_SAMSUNG_SMDK_WM9713
tristate "SoC AC97 Audio support for SMDK with WM9713"
## depends on SND_SOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDKV210 || ##MACH_SMDKC110 || MACH_SMDKV310 || MACH_SMDKC210) #屏蔽掉
depends on SND_SOC_SAMSUNG && ARCH_S3C24XX ##add by ljf
select SND_SOC_WM9713
select SND_SAMSUNG_AC97
help
Sat Y if you want to add support for SoC audio on the SMDK.
这样在内核中“make menuconfig”里面就可以看到"SoC AC97 Audio support for SMDK with WM9713",并选中他。
接下来我们要在内核中加入这个平台驱动设备:
在“arch/arm/mach-s3c2416/”的mach-tq2416.c中添加:
//add by ljf
/*
* AC97
*/
//at plat-s3c24xx/devs.c
static int s3c2416_ac97_cfg_gpio(struct platform_device *pdev)
{
return s3c_gpio_cfgpin_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(3));//S3C_GPIO_SFN(4)
}
static struct resource s3c_ac97_resource[] = {
[0] = {
.start = S3C2440_PA_AC97,
.end = S3C2440_PA_AC97 + S3C2440_SZ_AC97 -1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_S3C244x_AC97,
.end = IRQ_S3C244x_AC97,
.flags = IORESOURCE_IRQ,
},
[2] = {
.name = "PCM out",
.start = DMACH_PCM_OUT,
.end = DMACH_PCM_OUT,
.flags = IORESOURCE_DMA,
},
[3] = {
.name = "PCM in",
.start = DMACH_PCM_IN,
.end = DMACH_PCM_IN,
.flags = IORESOURCE_DMA,
},
[4] = {
.name = "Mic in",
.start = DMACH_MIC_IN,
.end = DMACH_MIC_IN,
.flags = IORESOURCE_DMA,
},
};
static struct s3c_audio_pdata s3c_ac97_pdata = {
.cfg_gpio = s3c2416_ac97_cfg_gpio,
};
static u64 s3c_device_audio_dmamask = DMA_BIT_MASK(32);//0xffffffffUL;//will change
struct platform_device s3c_device_ac97 = {
.name = "samsung-ac97",//wm9713-codec
.id = -1,
.num_resources = ARRAY_SIZE(s3c_ac97_resource),
.resource = s3c_ac97_resource,
.dev = {
.platform_data = &s3c_ac97_pdata,
.dma_mask = &s3c_device_audio_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32)//;0xffffffffUL//will change
}
};
//add by ljf
然后在“struct platform_device *tq2416_devices[] __initdata”中加入
//add by ljf
#ifdef CONFIG_SND_SOC_SAMSUNG_SMDK_WM9713
&s3c_device_ac97,
&samsung_asoc_dma,
#endif
//add by ljf
然后编译、烧写。内核打印信息有
asoc: wm9713-hifi samsung-ac97 mapping ok
ALSA device list:
#0: SMDK WM9713
但是用qtpia自带的音乐播放器,播放出来没声音,时间进度条却有在移动,时间到了也会停止,就是没声音。
在串口终端输入指令“cat /udisk/Too.mp3 > /dev/dsp”也没听到任何声音
用madplay命令播放时会出错
[root@LILLIPUT /]# madplay /udisk/Too Close.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
Title: Too Close
Artist: Alex Clare
Album: The Lateness of the Hour (Deluxe Edition)
Year: 2011
error: frame 0: lost synchronization
mapped channel 12 to 0
换一首:
[root@LILLIPUT /]# madplay /udisk/Tulisa - Young.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
Title: Young
Artist: Tulisa
Album: We Are Young
mapped channel 12 to 0
就是没声音,不知道怎么解决。
|