2017-01-01 21:19:24.770 228-287/? E/AudioHardwareTiny: pcm_open(PCM_CARD_HDMI) failed: 222 cannot open device '/dev/snd/pcmC0D1p': No such file or directory
if (out->device & AUDIO_DEVICE_OUT_ALL_SCO) {
start_bt_sco(adev);
#ifdef BT_AP_SCO // HARD CODE FIXME
out->pcm[PCM_BT] = pcm_open(PCM_BT, 0,
PCM_OUT | PCM_MONOTONIC, &pcm_config_ap_sco);
ret = create_resampler(48000,
8000,
2,
RESAMPLER_QUALITY_DEFAULT,
NULL,
&out->resampler);
if (ret != 0) {
ret = -EINVAL;
}
#endif
}
if(adev->hdmiin_state){
ALOGD("%s HDMIin state open hdmiin route",__FUNCTION__);
route_pcm_open(HDMI_IN_NORMAL_ROUTE);
}
return 0;
}
|-- external/tinyalsa/pcm.c(PCM结构体)
struct pcm {
int fd;
unsigned int flags;
int running:1;
int prepared:1;
int underruns;
unsigned int buffer_size;
unsigned int boundary;
char error[PCM_ERROR_MAX];
struct pcm_config config;
struct snd_pcm_mmap_status *mmap_status;
struct snd_pcm_mmap_control *mmap_control;
struct snd_pcm_sync_ptr *sync_ptr;
void *mmap_buffer;
unsigned int noirq_frames_per_msec;
int wait_for_avail_min;
};
struct pcm *pcm_open(unsigned int card, unsigned int device,
unsigned int flags, struct pcm_config *config)
{
struct pcm *pcm;
struct snd_pcm_info info;
struct snd_pcm_hw_params params;
struct snd_pcm_sw_params sparams;
char fn[256];
int rc;
pcm = calloc(1, sizeof(struct pcm));
if (!pcm || !config)
return &bad_pcm; /* TODO: could support default config here */
int pcm_is_ready(struct pcm *pcm)
{
return pcm->fd >= 0;
}
接入某些USB摄像头后, 扬声器没有声音
2017-01-01 21:19:24.770 228-287/? E/AudioHardwareTiny: pcm_open(PCM_CARD_HDMI) failed: 222 cannot open device '/dev/snd/pcmC0D1p': No such file or directory
if (out->device & AUDIO_DEVICE_OUT_ALL_SCO) {
start_bt_sco(adev);
#ifdef BT_AP_SCO // HARD CODE FIXME
out->pcm[PCM_BT] = pcm_open(PCM_BT, 0,
PCM_OUT | PCM_MONOTONIC, &pcm_config_ap_sco);
ret = create_resampler(48000,
8000,
2,
RESAMPLER_QUALITY_DEFAULT,
NULL,
&out->resampler);
if (ret != 0) {
ret = -EINVAL;
}
#endif
}
if(adev->hdmiin_state){
ALOGD("%s HDMIin state open hdmiin route",__FUNCTION__);
route_pcm_open(HDMI_IN_NORMAL_ROUTE);
}
return 0;
}
|-- external/tinyalsa/pcm.c(PCM结构体)
struct pcm {
int fd;
unsigned int flags;
int running:1;
int prepared:1;
int underruns;
unsigned int buffer_size;
unsigned int boundary;
char error[PCM_ERROR_MAX];
struct pcm_config config;
struct snd_pcm_mmap_status *mmap_status;
struct snd_pcm_mmap_control *mmap_control;
struct snd_pcm_sync_ptr *sync_ptr;
void *mmap_buffer;
unsigned int noirq_frames_per_msec;
int wait_for_avail_min;
};
struct pcm *pcm_open(unsigned int card, unsigned int device,
unsigned int flags, struct pcm_config *config)
{
struct pcm *pcm;
struct snd_pcm_info info;
struct snd_pcm_hw_params params;
struct snd_pcm_sw_params sparams;
char fn[256];
int rc;
pcm = calloc(1, sizeof(struct pcm));
if (!pcm || !config)
return &bad_pcm; /* TODO: could support default config here */