snipsco / snips-issues

Feel free to share your bugs with us.
14 stars 5 forks source link

Can't get audio playback on ReSpeaker 6 microphone array to work #152

Closed HakanL closed 5 years ago

HakanL commented 5 years ago

I've spent way too much time trying to get this to work. I have the ReSpeaker RPi hat with circular 6 microphone array and speaker output. I can record audio fine, but I was only able to play back mono wav-files with aplay, but sam test speaker would not output anything. I finally figured it out and thought I'd share it here as I have been searching everywhere for a solution. I found this little bit of detail on the ReSpeaker Wiki page (http://wiki.seeedstudio.com/ReSpeaker_6-Mic_Circular_Array_kit_for_Raspberry_Pi/):

playback output channels must fill with 8 same channels data or 4 same stereo channels data, or else the speaker or headphone will output nothing possibly.

So what I ended up doing was creating an asound.conf that up-mixes the audio, and now everything is working!

pcm.!default {
    type asym
    playback.pcm "chn8dup"
    capture.pcm {
        type plug
        slave.pcm "hw:1,0"
    }
}

pcm.card {
    type plug
    slave.pcm "hw:1,0"
    slave.channels 8
}

# upmixing - duplicate stereo data to all 8 channels
pcm.chn8dup {
    type route
    slave.pcm "card"
    slave.channels 8
    ttable {
        0.0 1
        1.1 1
        0.2 1
        1.3 1
        0.4 1
        1.5 1
        0.6 1
        1.7 1
    }
}
cpoisson commented 5 years ago

Thanks for sharing.

This issue seems related to the respeaker 6 mics array HW/Driver. As it is based on spi communication with 2 codecs, the driver may have some issues to elegantly stream the audio to them.

I have encountered other issues with the recording channels, some of them were blank or randomly noised.

The best would be to share this tips on the forum for the community.

I'm closing this one.

techkidprabu commented 5 years ago

Hi HakanL, Am using ur config file, able to hear in speakers. But microphone is not recording. Please help me

HakanL commented 5 years ago

Am using ur config file, able to hear in speakers. But microphone is not recording. Please help me

Hard to say what's causing that, but as someone pointed out, it may be better for you to post this on the forums instead.