Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

When AVS Sample app is playing music, it can't answer your question by using Headset. #575

Closed
wangxiaohu2016 opened this issue Mar 22, 2018 · 9 comments

Comments

@wangxiaohu2016
Copy link

Hi AMAZON guy:
I got one issue:
Prepare:
1. Rapberry Pi3 .
2. AVS SDK 1.6.0.
3. I used USB Headset as microphone input devices and playback device.
Install:
1. Install AVS SDK by using https://github.com/alexa/avs-device-sdk/wiki/Raspberry-Pi-Quick-Start-Guide-with-Script.
2. Connect my USB Headset to Raspberry.
3. Set ~/.asoundrc, let audio system to use the USB Headset as record and playback device.
Testing:
1. Let Alexa play music(Alexa, play music by iHeartRadio).
2. While it is playing music, I tried to ask alexa question.(Alexa, what't the time now),
I can't get any response of my question, but get the error log:
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': Device or resource busy.
My Question:
Is there something need me to change in audio system config file(Eg. ALSA, Openal, Pluseaudio or Portaudio) to let my Headset work well with AVS SDK?

@ENT8R
Copy link

ENT8R commented Mar 22, 2018

I encountered this issue too... I simply said "Alexa, stop" and then I could say what I want: e.g. "Alexa, what's the time"...

@celinval
Copy link
Contributor

Hi @wangxiaohu2016,

This may be related to the problem we've seen in #447. Would you mind applying the solution suggested in that issue and see if it fixes your problem?

If the #447 solution doesn't fix your problem, can you please run the sample app with DEBUG9 and attach the logs in to this issue? Can you also please add the content of your ~/.asoundrc?

Question, can you barge in while Alexa is playing your flash briefings?

Thanks

@wangxiaohu2016
Copy link
Author

wangxiaohu2016 commented Mar 23, 2018

Hi @celinval :

  1. For "This may be related to the problem we've seen in About Music playback doesn't immediately stop when a user barges-in on iHeartRadio. #447. Would you mind applying the solution suggested in that issue and see if it fixes your problem"
    I changed my code from "auto size = m_reader->read(info.data, info.size, &status); // This make thread blocking" to "auto size = m_reader->read(info.data, info.size, &status, std::chrono::milliseconds(200));" in avs-device-sdk/MediaPlayer/src/AttachmentReaderSource.cpp in line 102, but this issue is still on.
  2. Here is my log:
    Duplicate of
    avs1.6.0bargeIssueLog.zip
  3. Here is my Evn:
    pi@raspberrypi:~ $ cat .asoundrc
    pcm.!default {
    type asym
    playback.pcm {
    type plug
    slave.pcm "hw:1,0"
    }
    capture.pcm {
    type plug
    slave.pcm "hw:1,0"
    }
    }

pi@raspberrypi:~/build $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

pi@raspberrypi:~/build $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

  1. When Alexa is playing flash briefings, I try to ask question, I can see AVS changes state to listening and then thinging, but I can't get any feedback from alexa about my question.
    I think you can test it in your side by using Raspberry Pi and the USB headset, the issue is always here.

@celinval
Copy link
Contributor

Thank you @wangxiaohu2016. I was able to reproduce the issue using similar configuration to yours. I managed to fix the problem by replacing the playback device to dmix:1,0. My ~/.asoundrc looks like:

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

Can you please try that?

@ENT8R
Copy link

ENT8R commented Mar 24, 2018

Awesome! Works for me (at least)! Thank you 👍

@wangxiaohu2016
Copy link
Author

Hi @celinval
Thanks for your update, It works well by changing to dmix.

@kclchan
Copy link
Contributor

kclchan commented Apr 3, 2018

I am happy to hear that adding dmix fixes the problem. Thanks!

@kclchan kclchan closed this as completed Apr 3, 2018
@rholstrom
Copy link

I have the same issue I have figured out how to use the RPi AVS with USB conference sound bar. I can ask Alexa and she replies. I can ask her to play I heat radio and she does. But when playing the music and asking a question she stops the music but no verbal answer. I can see in the console that Alexa may be giving the answer but I do not hear it. I tell her to stop and I heart radio stops. I can then ask and will hear her answer. I tried the solution above with no success. Any additional info is greatly appreciated!

@rholstrom
Copy link

I figured this out. With the version of AVS for 4/4/2019 the file pi.sh needed to be edited with the information above before compiling the project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants