iizukanao / picam

Audio/video recorder for Raspberry Pi with language agnostic API
GNU Lesser General Public License v2.1
490 stars 78 forks source link

i2s mic Issue: 'Cannot Set Access Type' error #71

Open czarina opened 7 years ago

czarina commented 7 years ago

Hi,

Thanks for the wonderful work. I'm testing out pi-cam with my Pi Zero, Pi camera, and an i2s MEMS mic. I have some issues with my i2s mic. Specifically, I get the error: 'error: cannot set access type (Invalid argument)'

I have the following ALSA device:

pi@raspberrypi:~/picam $ arecord -l **** List of CAPTURE Hardware Devices **** card 1: memsmic [mems-mic], device 0: bcm2835-i2s-ics43432-hifi ics43432-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0

I try picam:

$ sudo ./picam --alsadev mic_mono --verbose video_width=1280 video_height=720 video_fps=30.000000 fr_q16=1966080 video_pts_step=3000 video_gop_size=30 video_rotation=0 video_hflip=0 video_vflip=0 video_bitrate=2000000 video_avc_profile=constrained_baseline video_avc_level=3.1 video_qp_min=-1 video_qp_max=-1 video_qp_initial=-1 video_slice_dquant=-1 alsa_dev=mic_mono audio_channels=1 audio_sample_rate=48000 audio_bitrate=40000 audio_volume_multiply=1.000000 is_hlsout_enabled=0 is_hls_encryption_enabled=0 hls_encryption_key_uri=stream.key hls_encryption_key=0x75b0a81de17487c88a47507a7e1fdf73 hls_encryption_iv=0x000102030405060708090a0b0c0d0e0f hls_output_dir=/run/shm/video rtsp_enabled=0 rtsp_video_control_path=/tmp/node_rtsp_rtmp_videoControl rtsp_audio_control_path=/tmp/node_rtsp_rtmp_audioControl rtsp_video_data_path=/tmp/node_rtsp_rtmp_videoData rtsp_audio_data_path=/tmp/node_rtsp_rtmp_audioData tcp_enabled=0 tcp_output_dest= auto_exposure_enabled=0 auto_exposure_threshold=5.000000 is_vfr_enabled=0 white_balance=auto exposure_control=auto awb_red_gain=0.000000 awb_blue_gain=0.000000 metering=average manual_exposure_compensation=0 exposure_compensation=0.000000 manual_exposure_aperture=0 exposure_aperture=0 manual_exposure_shutter_speed=0 exposure_shutter_speed=0 manual_exposure_sensitivity=0 exposure_sensitivity=0 roi_left=0.000000 roi_top=0.000000 roi_width=1.000000 roi_height=1.000000 min_fps=-1.000000 max_fps=-1.000000 is_timestamp_enabled=0 timestamp_format=%a %b %d %l:%M:%S %p timestamp_layout=15 timestamp_horizontal_margin=10 timestamp_vertical_margin=10 is_timestamp_abs_pos_enabled=0 timestamp_pos_x=0 timestamp_pos_y=0 timestamp_text_align=1 timestamp_font_name=FreeMono:style=Bold timestamp_font_file= timestamp_font_face_index=(null) timestamp_font_points=14.000000 timestamp_font_dpi=96 timestamp_color=ffffff timestamp_stroke_color=000000 timestamp_stroke_width=1 timestamp_letter_spacing=0 is_preview_enabled=0 is_previewrect_enabled=0 preview_x=0 preview_y=0 preview_width=0 preview_height=0 preview_opacity=255 blank_background_color=0x0 is_audio_preview_enabled=0 audio_preview_dev=plughw:0,0 record_buffer_keyframes=5 state_dir=state hooks_dir=hooks configuring devices exposure control: auto setting exposure: eMetering: 0 xEVCompensation: 0 nApertureFNumber: 0 bAutoAperture: 0 nShutterSpeedMsec: 0 bAutoShutterSpeed: 1 nSensitivity: 0 bAutoSensitivity: 1 Set video_encode state to idle Enable port buffers for camera 71 Enable port buffers for video_encode 200 Enable port buffers for video_encode 201 Set camera state to executing Set video_encode state to executing opening ALSA device for capture: mic_mono final audio_channels: 1 sample_rate: 48000 nb_samples: 1024 sample_fmt: 1 audio_codec_ctx->channel_layout: 4 av_frame->channel_layout: 4 audio_codec_ctx->channels: 1 av_frame->channels: 0 allocated 2048 bytes for audio samples audio_pts_step_base: 1920 error: cannot set access type (Invalid argument)

My ALSA config looks as follows. You can see that I am using the mmap_emul plugin, which should cause mmap to be enabled, right? Then why am I getting 'cannot set access type' error?

`pcm.!default { type hw card 0 }

ctl.!default { type hw card 0 } pcm.mic_hw{ type hw card memsmic channels 2 format S32_LE } pcm.mic_mm{ type mmap_emul slave.pcm mic_hw } pcm.mic_sv{ type softvol slave.pcm mic_mm control { name "Boost Capture Volume" card memsmic } min_dB -3.0 max_dB 50.0 } pcm.mic_mono{ type multi slaves.a.pcm mic_sv slaves.a.channels 2 bindings.0.slave a bindings.0.channel 0 }

`

czarina commented 7 years ago

@iizukanao Hello, would you please let me know if you have a chance to review this issue? I would really appreciate it.

dariondol commented 7 years ago

try --alsadev hw:1,1

simspace-dev commented 5 years ago

@czarina did you ever successfully resolve this issue?