TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Streaming to Android with audio

Tue Apr 28, 2015 8:35 am

I'm trying to find some way to make a stream with little delay and audio included, to an Android device. But I've just not been able to. Does anyone have a good idea on how to do this? (I did search, here and everywhere).

Results so far:
  • mjpeg-streamer
    Immediate output, works on every device, but no audio.
  • ffmpeg
    Immediate output to flash (-f flv) via RTMP, audio works, but no Android compatibility. No combination of -f mpegts or -f mp4 seems to work.
  • v4l-server
    There's a few small v4l2-projects which do streaming, but I've not been able to do sound with them.
  • VLC
    Haven't tried it yet, not sure how it will do differently than ffmpeg, any ideas?
  • RaspiMJPEG
    Love this, but I'm unable to find a way to stream the recording, or include audio.
I know there's a billion streaming threads, but still I think this is a new (or unsolved) requirement, anyone able to shed some light on it?

RpiName
Posts: 707
Joined: Sat Jul 06, 2013 3:14 am

Re: Streaming to Android with audio

Tue Apr 28, 2015 9:06 am

TarjeiB wrote:I'm trying to find some way to make a stream with little delay and audio included, to an Android device. But I've just not been able to. Does anyone have a good idea on how to do this? (I did search, here and everywhere).
UV4L:

For Audio/Video streaming, with no configuration, no delay, from any browser: http://www.linux-projects.org/modules/s ... e&artid=18
Main page: http://www.linux-projects.org/modules/news/
Installation on Raspbian: http://www.linux-projects.org/modules/s ... e&artid=14

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: Streaming to Android with audio

Tue Apr 28, 2015 3:32 pm

Thank you most kindly! I'll try UV4L.

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: Streaming to Android with audio

Tue Apr 28, 2015 5:45 pm

For the Raspberry Pi 2 only, the WebRTC extension for the Streaming Server is also available:
Doesn't work on the Raspberry Pi 1 for some reason :(

RpiName
Posts: 707
Joined: Sat Jul 06, 2013 3:14 am

Re: Streaming to Android with audio

Tue Apr 28, 2015 6:15 pm

TarjeiB wrote:
For the Raspberry Pi 2 only, the WebRTC extension for the Streaming Server is also available:
Doesn't work on the Raspberry Pi 1 for some reason :(
Yes, as stated above, the "old" Rpi1 is not supported (you did not mention which version of Rpi you have).

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: Streaming to Android with audio

Tue Apr 28, 2015 8:45 pm

Nonetheless, I went out and got a Raspberry Pi 2, and tried this - and it looks like a great project! However, still no dice - it is not detecting my microphones, and I can't find any way of configuring them nor seeing anything about audio in the logs.

The server starts up just fine, I can get the webrtc video stream, but there's no audio.

Code: Select all

uv4l -f --auto-video_nr --sched-rr --driver raspicam --encoding mjpeg --enable-server=required --server-option --enable-webrtc-audio=yes
<notice> [core] Trying driver 'raspicam' from built-in drivers...
<warning> [core] Driver 'raspicam' not found
<notice> [core] Trying driver 'raspicam' from external plug-in's...
<notice> [driver] Dual Raspicam Video4Linux2 Driver v1.9.27 built Feb 21 2015
<notice> [driver] Selected format: 1920x1080, encoding: mjpeg, JPEG Video Capture
<notice> [driver] Framerate max. 30 fps
<notice> [driver] ROI: 0, 0, 1, 1
<notice> [core] Device detected!
<notice> [core] Trying to load the the Streaming Server plug-in...
<notice> [server] HTTP Streaming & WebRTC Signalling Server v1.1.18 built on Apr 22 2015
<notice> [core] Streaming Server loaded!
<warning> [core] Cannot create /dev/video0 because file already exists
<notice> [core] Registering device node /dev/video1
<notice> [server] Web Streaming Server listening on port 8080
<notice> [server] WebRTC, Signalling Server and STUN Server extensions successfully loaded
<notice> [core] Extension module detected!
WARNING: no real random source present!
There's no indication of anything happening when I press the mute/unmute button.

There are definitely sound recorders present:

Code: Select all

arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Pro [VF0400 Live! Cam Notebook Pro], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
I've also tried with the PS4 EyeToy camera microphone, and both are confirmed working in ffmpeg.
I've also tried loading the OSS compatibility modules but no change.

Is there any way to configure the audio devices, or if impossible, what are the criteria for it to find a recording device?

RpiName
Posts: 707
Joined: Sat Jul 06, 2013 3:14 am

Re: Streaming to Android with audio

Tue Apr 28, 2015 8:50 pm

TarjeiB wrote: Is there any way to configure the audio devices, or if impossible, what are the criteria for it to find a recording device?
Yes, if not already installed, try to install pulseaudio. Otherwise check your pulseaudio conf.

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: Streaming to Android with audio

Wed Apr 29, 2015 9:01 am

So, many many hours of pulseaudio later, no luck. I guess this may be the wrong thread for this, but since it's pulseaudio only it seems I am stuck again:

Code: Select all

arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: CameraB304061 [USB Camera-B3.04.06.1], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code: Select all

 arecord -L
default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=CameraB304061
    USB Camera-B3.04.06.1, USB Audio
    Default Audio Device
front:CARD=CameraB304061,DEV=0
    USB Camera-B3.04.06.1, USB Audio
    Front speakers
surround40:CARD=CameraB304061,DEV=0
    USB Camera-B3.04.06.1, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=CameraB304061,DEV=0
    USB Camera-B3.04.06.1, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CameraB304061,DEV=0
    USB Camera-B3.04.06.1, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CameraB304061,DEV=0
    USB Camera-B3.04.06.1, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CameraB304061,DEV=0
    USB Camera-B3.04.06.1, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CameraB304061,DEV=0
    USB Camera-B3.04.06.1, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
These commands give wav files with output in them:

Code: Select all

arecord -c 4 -f S16_LE -r 16000 -d 5 -Dhw:1,0 test.wav
arecord -d 5 -Dplughw:1,0 test.wav
This command (which goes to pulseaudio) gives a completely flat file:

Code: Select all

arecord -d 5 test.wav

PulseAudio server recognises the mic and seems to load it just fine:

Code: Select all

sudo pulseaudio -v
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 2.0
I: [pulseaudio] main.c: Page size is 4096 bytes
I: [pulseaudio] main.c: Machine ID is eae5fe1648c5902fa7c038f954e1edbf.
I: [pulseaudio] main.c: Using runtime directory /root/.pulse/eae5fe1648c5902fa7c038f954e1edbf-runtime.
I: [pulseaudio] main.c: Using state directory /root/.pulse.
I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-2.0/modules.
I: [pulseaudio] main.c: Running in system mode: no
I: [pulseaudio] main.c: Fresh high-resolution timers available! Bon appetit!
I: [pulseaudio] cpu-arm.c: CPU flags: V6 V7 VFP EDSP NEON VFPV3
I: [pulseaudio] svolume_arm.c: Initialising ARM optimized volume functions.
I: [pulseaudio] module-device-restore.c: Successfully opened database file '/root/.pulse/eae5fe1648c5902fa7c038f954e1edbf-device-volumes'.
I: [pulseaudio] module.c: Loaded "module-device-restore" (index: #0; argument: "").
I: [pulseaudio] module-stream-restore.c: Successfully opened database file '/root/.pulse/eae5fe1648c5902fa7c038f954e1edbf-stream-volumes'.
I: [pulseaudio] module.c: Loaded "module-stream-restore" (index: #1; argument: "").
I: [pulseaudio] module-card-restore.c: Successfully opened database file '/root/.pulse/eae5fe1648c5902fa7c038f954e1edbf-card-database'.
I: [pulseaudio] module.c: Loaded "module-card-restore" (index: #2; argument: "").
I: [pulseaudio] module.c: Loaded "module-augment-properties" (index: #3; argument: "").
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device front:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device front:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device front:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device front:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device front:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround40:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround40:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround40:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround40:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround40:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround41:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround41:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround41:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround41:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround41:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround50:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround50:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround50:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround50:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround50:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround51:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround51:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround51:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround51:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround51:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround71:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround71:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround71:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround71:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device surround71:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device iec958:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device iec958:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device iec958:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device iec958:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC1D0p' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device iec958:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM a52:1
I: [pulseaudio] alsa-util.c: Error opening PCM device a52:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM dca:1
I: [pulseaudio] alsa-util.c: Error opening PCM device dca:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM dca:1
I: [pulseaudio] alsa-util.c: Error opening PCM device dca:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM dca:1
I: [pulseaudio] alsa-util.c: Error opening PCM device dca:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM dca:1
I: [pulseaudio] alsa-util.c: Error opening PCM device dca:1: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM dca:1
I: [pulseaudio] alsa-util.c: Error opening PCM device dca:1: No such file or directory
I: [pulseaudio] (alsa-lib)conf.c: Unknown parameters 1
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM hdmi:1
I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:1: Invalid argument
I: [pulseaudio] (alsa-lib)conf.c: Unknown parameters 1
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM hdmi:1
I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:1: Invalid argument
I: [pulseaudio] (alsa-lib)conf.c: Unknown parameters 1
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM hdmi:1
I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:1: Invalid argument
I: [pulseaudio] (alsa-lib)conf.c: Unknown parameters 1
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM hdmi:1
I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:1: Invalid argument
I: [pulseaudio] (alsa-lib)conf.c: Unknown parameters 1
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM hdmi:1
I: [pulseaudio] alsa-util.c: Error opening PCM device hdmi:1: Invalid argument
I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:hw:1: Invalid argument
I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:front:1: Invalid argument
I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:hw:1: Invalid argument
I: [pulseaudio] alsa-util.c: Device hw:1 doesn't support 44100 Hz, changed to 16000 Hz.
I: [pulseaudio] alsa-util.c: Failed to set hardware parameters on plug:iec958:1: Invalid argument
I: [pulseaudio] card.c: Created 0 "alsa_card.usb-OmniVision_Technologies__Inc._USB_Camera-B3.04.06.1-01-CameraB304061"
I: [pulseaudio] alsa-util.c: cannot disable ALSA period wakeups
I: [pulseaudio] alsa-util.c: Device hw:1 doesn't support 44100 Hz, changed to 16000 Hz.
I: [pulseaudio] alsa-util.c: ALSA period wakeups were not disabled
I: [pulseaudio] alsa-source.c: Successfully opened device hw:1.
I: [pulseaudio] alsa-source.c: Selected mapping 'Analog 4-channel Input' (analog-4-channel-input).
I: [pulseaudio] alsa-source.c: Successfully enabled mmap() mode.
I: [pulseaudio] alsa-source.c: Successfully enabled timer-based scheduling mode.
I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:1'
I: [pulseaudio] source.c: Created source 0 "alsa_input.usb-OmniVision_Technologies__Inc._USB_Camera-B3.04.06.1-01-CameraB304061.analog-4-channel-input" with sample spec s16le 4ch 16000Hz and channel map aux0,aux1,aux2,aux3
I: [pulseaudio] source.c:     alsa.resolution_bits = "16"
I: [pulseaudio] source.c:     device.api = "alsa"
I: [pulseaudio] source.c:     device.class = "sound"
I: [pulseaudio] source.c:     alsa.class = "generic"
I: [pulseaudio] source.c:     alsa.subclass = "generic-mix"
I: [pulseaudio] source.c:     alsa.name = "USB Audio"
I: [pulseaudio] source.c:     alsa.id = "USB Audio"
I: [pulseaudio] source.c:     alsa.subdevice = "0"
I: [pulseaudio] source.c:     alsa.subdevice_name = "subdevice #0"
I: [pulseaudio] source.c:     alsa.device = "0"
I: [pulseaudio] source.c:     alsa.card = "1"
I: [pulseaudio] source.c:     alsa.card_name = "USB Camera-B3.04.06.1"
I: [pulseaudio] source.c:     alsa.long_card_name = "OmniVision Technologies, Inc. USB Camera-B3.04.06.1 at usb-bcm2708_usb-1.5.1, h"
I: [pulseaudio] source.c:     alsa.driver_name = "snd_usb_audio"
I: [pulseaudio] source.c:     device.bus_path = "platform-bcm2708_usb-usb-0:1.5.1:1.1"
I: [pulseaudio] source.c:     sysfs.path = "/devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5.1/1-1.5.1:1.1/sound/card1"
I: [pulseaudio] source.c:     udev.id = "usb-OmniVision_Technologies__Inc._USB_Camera-B3.04.06.1-01-CameraB304061"
I: [pulseaudio] source.c:     device.bus = "usb"
I: [pulseaudio] source.c:     device.vendor.id = "1415"
I: [pulseaudio] source.c:     device.vendor.name = "Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc."
I: [pulseaudio] source.c:     device.product.id = "2000"
I: [pulseaudio] source.c:     device.product.name = "Sony Playstation Eye"
I: [pulseaudio] source.c:     device.serial = "OmniVision_Technologies__Inc._USB_Camera-B3.04.06.1"
I: [pulseaudio] source.c:     device.string = "hw:1"
I: [pulseaudio] source.c:     device.buffering.buffer_size = "256000"
I: [pulseaudio] source.c:     device.buffering.fragment_size = "128000"
I: [pulseaudio] source.c:     device.access_mode = "mmap+timer"
I: [pulseaudio] source.c:     device.profile.name = "analog-4-channel-input"
I: [pulseaudio] source.c:     device.profile.description = "Analog 4-channel Input"
I: [pulseaudio] source.c:     device.description = "Sony Playstation Eye Analog 4-channel Input"
I: [pulseaudio] source.c:     alsa.mixer_name = "USB Mixer"
I: [pulseaudio] source.c:     alsa.components = "USB1415:2000"
I: [pulseaudio] source.c:     module-udev-detect.discovered = "1"
I: [pulseaudio] source.c:     device.icon_name = "audio-card-usb"
I: [pulseaudio] alsa-source.c: Using 2.0 fragments of size 128000 bytes (1000.00ms), buffer size is 256000 bytes (2000.00ms)
I: [pulseaudio] alsa-source.c: Time scheduling watermark is 27.62ms
I: [alsa-source] core-util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5.
I: [pulseaudio] module.c: Loaded "module-alsa-card" (index: #4; argument: "device_id="1" name="usb-OmniVision_Technologies__Inc._USB_Camera-B3.04.06.1-01-CameraB304061" card_name="alsa_card.usb-OmniVision_Technologies__Inc._USB_Camera-B3.04.06.1-01-CameraB304061" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes card_properties="module-udev-detect.discovered=1"").
I: [alsa-source] alsa-source.c: Starting capture.
I: [pulseaudio] module-udev-detect.c: Card /devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5.1/1-1.5.1:1.1/sound/card1 (alsa_card.usb-OmniVision_Technologies__Inc._USB_Camera-B3.04.06.1-01-CameraB304061) module loaded.

........

I: [pulseaudio] main.c: Daemon startup complete.
pacmd reports it's not muted either... I'm stumped :(

RpiName
Posts: 707
Joined: Sat Jul 06, 2013 3:14 am

Re: Streaming to Android with audio

Wed Apr 29, 2015 10:24 am

Strange. It's worth to also try without pulseaudio (if you never did it, as it is not necessary) and check chrome://webrtc-internals/ to make sure you really get no audio streams.

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: Streaming to Android with audio

Thu Apr 30, 2015 8:02 pm

Thanks for the tip, that cleared up some things. I have an audio stream, but it contains nothing.
I also went and got a new mic to see if it's the semi-bugged PS3-mic that wasn't working, but no dice.
arecord works and makes a nice little sound file with the default input device, but the webrtc stream is completely flat.

Is there no way to configure or debug this from the application? I can't find any log or output or possible configurations on the webrtc audio.

RpiName
Posts: 707
Joined: Sat Jul 06, 2013 3:14 am

Re: Streaming to Android with audio

Thu Apr 30, 2015 8:31 pm

TarjeiB wrote:Thanks for the tip, that cleared up some things. I have an audio stream, but it contains nothing. Is there no way to configure or debug this from the application?
Could you clarify "contains nothing"? Can you paste the logs from chrome and a screenshot of the audio trends while streaming? Then again please double, triple check that you have your card unmuted while streaming with UV4L. Use alsamixer to verify that. The fact that you don't see any warnings or errors in the application log and do get an audio stream on chrome makes me really think this has something to do with your environment.

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: Streaming to Android with audio

Fri May 01, 2015 11:11 am

RpiName wrote: Could you clarify "contains nothing"? Can you paste the logs from chrome and a screenshot of the audio trends while streaming? Then again please double, triple check that you have your card unmuted while streaming with UV4L. Use alsamixer to verify that. The fact that you don't see any warnings or errors in the application log and do get an audio stream on chrome makes me really think this has something to do with your environment.

Code: Select all

alsamixer -V capture -c 1
alsamixer.png
alsamixer.png (12.22 KiB) Viewed 3215 times

Code: Select all

alsamixer -V capture
alsamixer_pulse.png
alsamixer_pulse.png (12.73 KiB) Viewed 3215 times

Code: Select all

arecord -Dhw:1,0 -d 5 -f S16_LE -r 24000 hw1_0.wav
hw1_0.zip
(20.6 KiB) Downloaded 38 times
To be continued.... (max attachments)

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: Streaming to Android with audio

Fri May 01, 2015 11:22 am

Code: Select all

arecord -d 5 -f S16_LE -r 24000 pulse3.wav
pulse3.zip
(41.75 KiB) Downloaded 40 times
So, the mic is unmuted and gives nice audio through both alsa directly and through PA.

Here's how it looks in Chrome:
webrtc_internals_dump.zip
(13.37 KiB) Downloaded 53 times
Image

But no audio icon on the tab with the webRTC-stream, nor any audio through the speakers. Is it picking up some other stream than the "default" input device? (hw:1,0)

RpiName
Posts: 707
Joined: Sat Jul 06, 2013 3:14 am

Re: Streaming to Android with audio

Sat May 02, 2015 11:37 am

For the record, the problem has been solved (for this particular microphone) by installing pulse audio and forcing it to use these capture parameters in system.pa:

Code: Select all

load-module module-alsa-source device=hw:1 format=s16le channels=1 rate=24000

Return to “Camera board”