gmediarender在widora上的移植交流



  • Widora自带声卡,不做wifi音箱就是天大的浪费,这两天尝试摆弄了一下,把过程写在这里,希望能和大家一起交流一下。我用的是gmrender-resurrect版本,在widora工程目录下:
    cd package
    mkdir gmrender-resurrect
    cd gmrender-resurrect
    git clone https://github.com/hzeller/gmrender-resurrect.git
    下载代码后,要修改一下
    package\gmrender-resurrect\gmrender-resurrect\configure.ac,增加 -std=c99,否则编译会报错误C99模式错误
    if test -n "$GCC"; then
    EXTRA_GCC_DEBUG_CFLAGS="$CFLAGS"
    EXTRA_GCC_DEBUG_CXXFLAGS="$CXXFLAGS"
    CFLAGS+=" -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations -Wwrite-strings -std=c99"
    CXXFLAGS+=" -Wall -Wpointer-arith"
    fi
    在package/gmrender-resurrect/gmrender-resurrect目录下,
    执行./autogen.sh和./configure 生成Makefile文件
    回到package/gmrender-resurrect目录下建立openwrt的Makefile
    [0_1498720615351_Makefile](正在上传 100%)

    再make menuconfig,配置相关的依赖项:
    选择Multimedia > gmediarender
    选择Libraries > libupnp
    选择 Kernel modules > Sound Support > kmod-sound-core 和kmod-usb-audio
    选择> Multimedia > Select GStreamer libraries > [] Include all GStreamer1 core libraries
    选择> Multimedia > Select GStreamer good modules > [
    ] Include all GStreamer good plugins
    选择 Multimedia > <> gstreamer1-utils.
    选择 Multimedia > <
    > gst1-libav.
    选择 > Multimedia > Select GStreamer base modules and libraries > GStreamer ogg module
    保存退出,然后编译:make -j3 V=99

    这里我漏选了gst1-plugins-base,导致编译出来的固件下载到板上
    执行gmediarender -I XXX.XXX.XXX.XXX -f “mydlna” 会报错,
    mediarender: output_gstreamer.c: 503: output_gstreamer_init: Assertion `player_ != ((void *)0)' failed

    网上查了一下,说是还缺乏相关的插件,我对比了一下,可能缺少gst1-plugins-base。
    直接:
    opkg update
    opkg install gst1-plugins-base
    安装好漏的包,再去执行:gmediarender -I “yourIP” -f “yourname”
    root@Widora:/etc# gmediarender -I 192.168.0.100 -f itvtop

    gmediarender 0.0.7-git started [ gmediarender 2017-05-17_cbdfea8 (libupnp-1.6.19; glib-2.43.4; gstreamer-1.4.5) ].
    Logging switched off. Enable with --logfile=<filename> (e.g. --logfile=/dev/stdout for console)
    Ready for rendering.

    一开始不知道widora处于什么模式,手机上几个软件都找不到我的dlna设备,我试着设定widora工作在router模式下,用网线连接上级路由器,手机连到widora的wifi热点上,运行:gmediarender -I 192.168.1.1 -f itvtop

    在喜马拉雅FM和网易云音乐里可以看到我这个命名为itvtop的设备,选择itvtop,发现串口打印gmediarender 提示非法指令,退出了。
    playback free_dma_buffer
    ptri2s_config->mmap_index:0
    Illegal instruction
    不知道是否还差什么东西,感觉就剩临门一脚了,希望高手指点一下。



  • 我上传的makefile怎么看不到?只显示“[0_1498720615351_Makefile](正在上传 100%)”



  • 我把makefile贴在这里

    Copyright (C) 2013 OpenWrt.org

    This is free software, licensed under the GNU General Public License v2.

    See /LICENSE for more information.

    include $(TOPDIR)/rules.mk

    PKG_NAME:=gmediarender
    PKG_VERSION:=2017-06-28
    PKG_RELEASE=1.0

    #PKG_SOURCE_PROTO:=git
    #PKG_SOURCE_URL:=git@github.com:hzeller/gmrender-resurrect.git
    #PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
    #PKG_SOURCE_VERSION:=61f5a8fe7291995fec73956c7425fdb564e3cb9f
    #PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

    PKG_FIXUP:=autoreconf
    PKG_INSTALL=1
    PKG_REMOVE_FILES:=autogen.sh aclocal.m4

    include $(INCLUDE_DIR)/package.mk
    include $(INCLUDE_DIR)/nls.mk

    define Package/gmediarender
    SECTION:=multimedia
    CATEGORY:=Multimedia
    DEPENDS:= +gstreamer +glib2 +libupnp +libgstreamer-1.0
    TITLE:=A Headless UPnP Renderer
    endef

    define Package/gmediarender/description
    (Yeso MODE)gmediarender implements the server component that provides UPnP
    controllers a means to render media content (audio, video and images)
    from a UPnP media server.
    endef

    define Build/Prepare
    mkdir -p $(PKG_BUILD_DIR)
    $(CP) ./gmrender-resurrect/* $(PKG_BUILD_DIR)/
    endef

    CONFIGURE_ARGS+=
    --with-build-cc="$(HOSTCC)"
    --prefix="\usr"

    define Package/gmediarender/install
    $(INSTALL_DIR) $(1)/usr/sbin
    $(INSTALL_DIR) $(1)/lib
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/sbin/
    $(INSTALL_DIR) $(1)/etc/init.d
    $(CP) ../../staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libgstreamer-1.0.so.0 $(1)/lib/
    $(CP) $(PKG_BUILD_DIR)/scripts/init.d/$(PKG_NAME)er $(1)/etc/init.d/$(PKG_NAME)
    $(INSTALL_DIR) $(1)/usr/share/gmediarender/
    $(CP) $(PKG_BUILD_DIR)/data/grender-64x64.png $(1)/usr/share/gmediarender/
    $(CP) $(PKG_BUILD_DIR)/data/grender-128x128.png $(1)/usr/share/gmediarender/
    endef

    $(eval $(call BuildPackage,gmediarender))



  • 不要用gstream1.0的库,用gstream 0.10.x的版本。
    gstream 0.10的版本 在openwrt的oldpackages里面,下载后把对应的gst的模块install 上就可以了。
    gstream 1.0 就从你的工程里面 uninstall掉,就可以了。
    之前搞了大半个月,基本可以用。



  • 谢谢,我回头试一下。



  • @hejianqiang 你用的也是gmrender-resurrect这个版本吗?7688工程里只有gst1.0的库,老的好像是14.07版本上mt7620的oldpackage才有,你是手动下载那些ipk包然后一个个安装吗?



  • @郭大路 我的就是widora的sdk上面该的,可以安装上oldpackage,添加上老的gst就可以了。把所有oldpackage feed下来之后,只需要安装gst 0.1就ok了。



  • 你好!我将openwrt 14.07工程的feeds/oldpackages/multimdia目录下的gst-ffmpeg,gstreamer,gst-plugins-base,good,ugly,bad拷贝到当前工程的feeds/packages/multimedia目录下,
    并到package\feeds\packages目录下建立相应的软链接,然后make menuconfig里勾选gst0.1,这个都正常,但是问题来了,我改了gmrender-resurrect,去掉libgstreamer-1.0.so.0的依赖,但是编译时候依然只认这个库,make的时候会提示缺失这个1.0的库,不知道怎么解决。我现在在用另外一个版本的https://github.com/ademenev/gmrender-resurrect-openhome.git在试着编译。



  • @郭大路
    我没有你搞的这么复杂,至少没有搞什么软链接之类的,所有步骤如下。
    几点重申一下:
    1、15.05的版本是可以更新feeds/oldpackage目录的,更新后可以把gst 啥的从网上down下来;
    2、不要去移植gmrender-resurrect的版本,核对下版本,在openwrt_widora/feeds/packages/multimedia/gmediarender的Makefile里面。
    PKG_NAME:=gmediarender
    PKG_VERSION:=2013-12-04
    PKG_RELEASE=$(PKG_SOURCE_VERSION)

    PKG_SOURCE_PROTO:=git
    PKG_SOURCE_URL:=git@github.com:hzeller/gmrender-resurrect.git
    PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
    PKG_SOURCE_VERSION:=e2eb7852eebea95c69c79c43a1e4d5f52409930e
    PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
    编译的时候自动会GIT下来。

    DEPENDS:= +gstreamer +glib2 +libupnp 这里不是gstreamer1,改成gstreamer

    在openwrt_widora/feeds/oldpackages/multimedia下面会有个gstreamer的目录
    而之前的gstreamer1目录是在 openwrt_widora/feeds/packages/multimedia/下面;

    3、menuconfig 勾选的方式,gst所有的选项。

    #
    # Streaming
    #
    # CONFIG_PACKAGE_darkice is not set
    # CONFIG_PACKAGE_oggfwd is not set
    # CONFIG_PACKAGE_GraphicsMagick is not set
    # CONFIG_PACKAGE_GraphicsMagick-jpeg is not set
    # CONFIG_PACKAGE_crtmpserver is not set
    # CONFIG_PACKAGE_ffmpeg is not set
    # CONFIG_PACKAGE_ffprobe is not set
    # CONFIG_PACKAGE_ffserver is not set
    # CONFIG_PACKAGE_fswebcam is not set
    # CONFIG_PACKAGE_ftpd-topfield is not set
    CONFIG_PACKAGE_gmediarender=y
    # CONFIG_PACKAGE_gmediaserver is not set
    # CONFIG_PACKAGE_gphoto2 is not set
    # CONFIG_PACKAGE_gst-ffmpeg is not set
    # CONFIG_PACKAGE_gst-mod-adpcmdec is not set
    # CONFIG_PACKAGE_gst-mod-adpcmenc is not set
    # CONFIG_PACKAGE_gst-mod-aiff is not set
    CONFIG_PACKAGE_gst-mod-alsa=y
    CONFIG_PACKAGE_gst-mod-app=y
    # CONFIG_PACKAGE_gst-mod-asf is not set
    # CONFIG_PACKAGE_gst-mod-asfmux is not set
    CONFIG_PACKAGE_gst-mod-audioconvert=y
    # CONFIG_PACKAGE_gst-mod-audiofx is not set
    # CONFIG_PACKAGE_gst-mod-audioparsers is not set
    CONFIG_PACKAGE_gst-mod-audiorate=y
    CONFIG_PACKAGE_gst-mod-audioresample=y
    CONFIG_PACKAGE_gst-mod-audiotestsrc=y
    # CONFIG_PACKAGE_gst-mod-autoconvert is not set
    CONFIG_PACKAGE_gst-mod-autodetect=y
    # CONFIG_PACKAGE_gst-mod-bayer is not set
    # CONFIG_PACKAGE_gst-mod-camerabin is not set
    # CONFIG_PACKAGE_gst-mod-cdxaparse is not set
    # CONFIG_PACKAGE_gst-mod-cutter is not set
    # CONFIG_PACKAGE_gst-mod-dataurisrc is not set
    # CONFIG_PACKAGE_gst-mod-dccp is not set
    # CONFIG_PACKAGE_gst-mod-debug is not set
    # CONFIG_PACKAGE_gst-mod-debugutilsbad is not set
    CONFIG_PACKAGE_gst-mod-decodebin=y
    CONFIG_PACKAGE_gst-mod-decodebin2=y
    # CONFIG_PACKAGE_gst-mod-dtmf is not set
    # CONFIG_PACKAGE_gst-mod-dvdspu is not set
    # CONFIG_PACKAGE_gst-mod-equalizer is not set
    # CONFIG_PACKAGE_gst-mod-faad is not set
    # CONFIG_PACKAGE_gst-mod-festival is not set
    CONFIG_PACKAGE_gst-mod-flac=y
    # CONFIG_PACKAGE_gst-mod-freeze is not set
    # CONFIG_PACKAGE_gst-mod-frei0r is not set
    CONFIG_PACKAGE_gst-mod-gio=y
    # CONFIG_PACKAGE_gst-mod-h264parse is not set
    # CONFIG_PACKAGE_gst-mod-hdvparse is not set
    # CONFIG_PACKAGE_gst-mod-icydemux is not set
    CONFIG_PACKAGE_gst-mod-id3demux=y
    # CONFIG_PACKAGE_gst-mod-id3tag is not set
    # CONFIG_PACKAGE_gst-mod-interleave is not set
    # CONFIG_PACKAGE_gst-mod-isomp4 is not set
    # CONFIG_PACKAGE_gst-mod-jpegformat is not set
    # CONFIG_PACKAGE_gst-mod-lame is not set
    # CONFIG_PACKAGE_gst-mod-legacyresample is not set
    # CONFIG_PACKAGE_gst-mod-level is not set
    # CONFIG_PACKAGE_gst-mod-liveadder is not set
    CONFIG_PACKAGE_gst-mod-mad=y
    # CONFIG_PACKAGE_gst-mod-mms is not set
    # CONFIG_PACKAGE_gst-mod-mpeg2dec is not set
    # CONFIG_PACKAGE_gst-mod-mpegdemux is not set
    # CONFIG_PACKAGE_gst-mod-mpegpsmux is not set
    # CONFIG_PACKAGE_gst-mod-mpegtsmux is not set
    # CONFIG_PACKAGE_gst-mod-mpegvideoparse is not set
    # CONFIG_PACKAGE_gst-mod-multifile is not set
    # CONFIG_PACKAGE_gst-mod-multipart is not set
    # CONFIG_PACKAGE_gst-mod-mve is not set
    # CONFIG_PACKAGE_gst-mod-mxf is not set
    # CONFIG_PACKAGE_gst-mod-nsf is not set
    # CONFIG_PACKAGE_gst-mod-nuvdemux is not set
    CONFIG_PACKAGE_gst-mod-ogg=y
    # CONFIG_PACKAGE_gst-mod-ossaudio is not set
    # CONFIG_PACKAGE_gst-mod-pcapparse is not set
    CONFIG_PACKAGE_gst-mod-playbin=y
    # CONFIG_PACKAGE_gst-mod-pnm is not set
    # CONFIG_PACKAGE_gst-mod-rawparse is not set
    # CONFIG_PACKAGE_gst-mod-replaygain is not set
    # CONFIG_PACKAGE_gst-mod-rtp is not set
    # CONFIG_PACKAGE_gst-mod-rtpmux is not set
    # CONFIG_PACKAGE_gst-mod-rtsp is not set
    # CONFIG_PACKAGE_gst-mod-scaletempoplugin is not set
    # CONFIG_PACKAGE_gst-mod-sdpelem is not set
    # CONFIG_PACKAGE_gst-mod-segmentclip is not set
    # CONFIG_PACKAGE_gst-mod-siren is not set
    CONFIG_PACKAGE_gst-mod-souphttpsrc=y
    # CONFIG_PACKAGE_gst-mod-spectrum is not set
    # CONFIG_PACKAGE_gst-mod-speed is not set
    # CONFIG_PACKAGE_gst-mod-stereo is not set
    # CONFIG_PACKAGE_gst-mod-subenc is not set
    CONFIG_PACKAGE_gst-mod-tcp=y
    CONFIG_PACKAGE_gst-mod-theora=y
    # CONFIG_PACKAGE_gst-mod-tta is not set
    CONFIG_PACKAGE_gst-mod-typefindfunctions=y
    # CONFIG_PACKAGE_gst-mod-udp is not set
    # CONFIG_PACKAGE_gst-mod-videomeasure is not set
    # CONFIG_PACKAGE_gst-mod-videosignal is not set
    CONFIG_PACKAGE_gst-mod-videotestsrc=y
    # CONFIG_PACKAGE_gst-mod-vmnc is not set
    CONFIG_PACKAGE_gst-mod-volume=y
    CONFIG_PACKAGE_gst-mod-vorbis=y
    # CONFIG_PACKAGE_gst-mod-wavenc is not set
    CONFIG_PACKAGE_gst-mod-wavparse=y
    # CONFIG_PACKAGE_gst-plugins-bad is not set
    CONFIG_PACKAGE_gst-plugins-base=y
    # CONFIG_PACKAGE_gst-plugins-good is not set
    # CONFIG_PACKAGE_gst-plugins-ugly is not set
    # CONFIG_PACKAGE_gst1-libav is not set
    CONFIG_PACKAGE_gstreamer=y
    # CONFIG_PACKAGE_gstreamer-utils is not set
    # CONFIG_PACKAGE_hasciicam is not set
    # CONFIG_PACKAGE_icecast is not set
    # CONFIG_PACKAGE_imagemagick is not set
    # CONFIG_PACKAGE_imagemagick-jpeg is not set
    # CONFIG_PACKAGE_imagemagick-png is not set
    # CONFIG_PACKAGE_imagemagick-tiff is not set
    # CONFIG_PACKAGE_imagemagick-tools is not set
    # CONFIG_PACKAGE_kissdx is not set
    CONFIG_PACKAGE_libgstapp=y
    CONFIG_PACKAGE_libgstaudio=y
    CONFIG_PACKAGE_libgstcdda=y
    CONFIG_PACKAGE_libgstcheck=y
    CONFIG_PACKAGE_libgstcontroller=y
    CONFIG_PACKAGE_libgstdataprotocol=y
    CONFIG_PACKAGE_libgstfft=y
    CONFIG_PACKAGE_libgstinterfaces=y
    CONFIG_PACKAGE_libgstnet=y
    CONFIG_PACKAGE_libgstnetbuffer=y
    CONFIG_PACKAGE_libgstpbutils=y
    # CONFIG_PACKAGE_libgstphotography is not set
    CONFIG_PACKAGE_libgstreamer=y
    CONFIG_PACKAGE_libgstriff=y
    CONFIG_PACKAGE_libgstrtp=y
    CONFIG_PACKAGE_libgstrtsp=y
    CONFIG_PACKAGE_libgstsdp=y
    CONFIG_PACKAGE_libgsttag=y
    CONFIG_PACKAGE_libgstvideo=y
    CONFIG_PACKAGE_minidlna=y
    # CONFIG_PACKAGE_mjpg-streamer is not set
    # CONFIG_PACKAGE_motion is not set
    # CONFIG_PACKAGE_peercast is not set
    # CONFIG_PACKAGE_puppy is not set
    # CONFIG_PACKAGE_rygel is not set
    # CONFIG_PACKAGE_rygel-external is not set
    # CONFIG_PACKAGE_rygel-media-export is not set
    # CONFIG_PACKAGE_rygel-mpris is not set
    # CONFIG_PACKAGE_rygel-playbin is not set
    # CONFIG_PACKAGE_rygel-playbin-gst-suggested is not set
    # CONFIG_PACKAGE_rygel-tracker is not set
    # CONFIG_PACKAGE_streamripper is not set
    # CONFIG_PACKAGE_ushare is not set
    # CONFIG_PACKAGE_vips is not set
    # CONFIG_PACKAGE_xupnpd is not set
    


  • @hejianqiang 谢谢!你这是最正规的做法,我是瞎折腾,我把gmrender-resurrect的makefile里的PKG_RELEASE原来是1.0,改成0.1,编译就不报错了,编出来的wifi音箱功能测试也可以用了。再次感谢!!!!
    “PKG_RELEASE=0.1”



  • @hejianqiang 你的widora板子上dlna的暂停功能正常吗?我暂停后会不停打印下面的类似信息,然后声音一直卡着循环播放最后的一个音,而不是处于静音状态。
    ERROR [2017-08-11 01:21:04.062111 | gstreamer] state:3
    ERROR [2017-08-11 01:21:04.262628 | gstreamer] state:3
    ERROR [2017-08-11 01:21:04.463213 | gstreamer] state:3
    ERROR [2017-08-11 01:21:04.663775 | gstreamer] state:3



  • @郭大路 有这个问题,没有去解决了,产品没有量产。



  • @hejianqiang 今天编译mplayer,发现gmediarender的暂停功能居然正常了!检查了一下,和添加/etc/asound.conf文件有关,加了就正常了。
    asound.conf文件内容如下:
    pcm.!default{
    type plug
    slave.pcm "dmix"
    }



  • @郭大路 哈哈,感谢!