Code Monkey home page Code Monkey logo

mpradio-py's People

Contributors

davidm42 avatar morrolinux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpradio-py's Issues

Should I use mpradio-py or mpradio?

If I only want to be able to send audio over bluetooth from my phone, then transmit that audio over FM radio, should I use this newer python version or stick with the legacy version? Also, which Raspbian version would you recommend? Thanks.

No sounds played from radio on latest version

I have no idea what's going wrong here. What I have done:

  1. Installed the premade ISO from the old mpradio - this worked fine.
  2. Ran apt upgrade on that install - it broke so I reinstalled.
  3. Clean install with latest Raspbian and mpradio-py - install.sh runs fine, can connect via bluetooth but no FM output.

Here's the results of service mpradio status to start us off:

root@raspberrypi:~# service mpradio status
● mpradio.service - Morrolinux Pirate Radio
   Loaded: loaded (/etc/systemd/system/mpradio.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-04-22 19:50:01 ACST; 5min ago
  Process: 446 ExecStart=/bin/bash -l -c /home/pi/mpradio.py (code=exited, status=127)
 Main PID: 446 (code=exited, status=127)
Apr 22 19:49:56 raspberrypi systemd[1]: Started Morrolinux Pirate Radio.
Apr 22 19:50:01 raspberrypi bash[446]: /etc/profile: line 4: id: command not found
Apr 22 19:50:01 raspberrypi bash[446]: /etc/profile: line 4: [: : integer expression expected
Apr 22 19:50:01 raspberrypi bash[446]: /bin/bash: /home/pi/mpradio.py: No such file or directory
Apr 22 19:50:01 raspberrypi systemd[1]: mpradio.service: Main process exited, code=exited, status=127/n/a
Apr 22 19:50:01 raspberrypi systemd[1]: mpradio.service: Unit entered failed state.
Apr 22 19:50:01 raspberrypi systemd[1]: mpradio.service: Failed with result 'exit-code'.

Then if I run service mpradio restart:

root@raspberrypi:~# service mpradio status
● mpradio.service - Morrolinux Pirate Radio
   Loaded: loaded (/etc/systemd/system/mpradio.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-04-22 19:55:53 ACST; 2s ago
 Main PID: 569 ((bash))
   CGroup: /system.slice/mpradio.service
           └─569 (bash)
Apr 22 19:55:53 raspberrypi systemd[1]: Started Morrolinux Pirate Radio.

Even with mpradio.service running, the radio does not work. I decided to run sudo ln -sF /home/pi/mpradio-py/src/mpradio.py /home/pi/mpradio.py. This fixed the symlink. Now when I view the status of mpradio I see this:

root@raspberrypi:~# service mpradio status
● mpradio.service - Morrolinux Pirate Radio
   Loaded: loaded (/etc/systemd/system/mpradio.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-04-22 20:14:24 ACST; 9min ago
 Main PID: 452 (python3)
   CGroup: /system.slice/mpradio.service
           ├─452 python3 /home/pi/mpradio.py
           ├─528 sox -t raw -G -b 16 -e signed -c 2 -r 44100 - -t wav - treble -6
           ├─532 sudo /usr/local/bin/pi_fm_adv --freq 95.1 --ctl /tmp/rds_ctl --audio -
           └─540 /usr/local/bin/pi_fm_adv --freq 95.1 --ctl /tmp/rds_ctl --audio -
Apr 22 20:14:24 raspberrypi systemd[1]: Started Morrolinux Pirate Radio.
Apr 22 20:14:29 raspberrypi bash[452]: /etc/profile: line 4: id: command not found
Apr 22 20:14:29 raspberrypi bash[452]: /etc/profile: line 4: [: : integer expression expected
Apr 22 20:14:35 raspberrypi sudo[532]:       pi : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/bin/pi_fm_adv --freq 95.1 --ctl /tmp/rds_ctl --audio -
Apr 22 20:14:35 raspberrypi sudo[532]: pam_unix(sudo:session): session opened for user root by (uid=0)

However, upon tuning to 95.1 FM, I can only hear silence. While this is an improvement on the static from before I fixed the symlink, this is not good. I am now lead to believe that while the bluetooth is working, as is pi_fm_adv, there is no connection between the two.

I'm happy to provide files and run diagnostic commands. Thanks.

Latest rPI OS issue

Hi,

Did anyone try this on a recent rPI image?

pi@mpradio:~/mpradio/install $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@mpradio:~/mpradio/install $
pi@mpradio:~/mpradio/install $ sudo bash install.sh
ln: failed to create symbolic link '/home/pi/mpradio.py': File exists
Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-dbus is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-gobject is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package bluealsa is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-gobject' has no installation candidate
E: Unable to locate package python-gobject-2
E: Package 'python-dbus' has no installation candidate
E: Package 'bluealsa' has no installation candidate
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libavcodec-dev is already the newest version (8:4.3.6-0+deb11u1+rpt5).
libavdevice-dev is already the newest version (8:4.3.6-0+deb11u1+rpt5).
libavfilter-dev is already the newest version (8:4.3.6-0+deb11u1+rpt5).
libavformat-dev is already the newest version (8:4.3.6-0+deb11u1+rpt5).
libavutil-dev is already the newest version (8:4.3.6-0+deb11u1+rpt5).
libswresample-dev is already the newest version (8:4.3.6-0+deb11u1+rpt5).
libswscale-dev is already the newest version (8:4.3.6-0+deb11u1+rpt5).
The following package was automatically installed and is no longer required:
  libfuse2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pybluez in /usr/local/lib/python3.9/dist-packages (0.23)
Requirement already satisfied: psutil in /usr/lib/python3/dist-packages (5.8.0)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting av==6
  Using cached av-6.0.0.tar.gz (2.0 MB)
Building wheels for collected packages: av
  Building wheel for av (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rp5wowbe/av_a69a13ed543d43c09b463d727ade1354/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rp5wowbe/av_a69a13ed543d43c09b463d727ade1354/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-oigk2tvq
       cwd: /tmp/pip-install-rp5wowbe/av_a69a13ed543d43c09b463d727ade1354/
  Complete output (157 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv6l-3.9
  creating build/lib.linux-armv6l-3.9/av
  copying av/__main__.py -> build/lib.linux-armv6l-3.9/av
  copying av/deprecation.py -> build/lib.linux-armv6l-3.9/av
  copying av/__init__.py -> build/lib.linux-armv6l-3.9/av
  creating build/lib.linux-armv6l-3.9/av/video
  copying av/video/__init__.py -> build/lib.linux-armv6l-3.9/av/video
  creating build/lib.linux-armv6l-3.9/av/filter
  copying av/filter/__init__.py -> build/lib.linux-armv6l-3.9/av/filter
  creating build/lib.linux-armv6l-3.9/av/audio
  copying av/audio/__init__.py -> build/lib.linux-armv6l-3.9/av/audio
  creating build/lib.linux-armv6l-3.9/av/data
  copying av/data/__init__.py -> build/lib.linux-armv6l-3.9/av/data
  creating build/lib.linux-armv6l-3.9/av/codec
  copying av/codec/__init__.py -> build/lib.linux-armv6l-3.9/av/codec
  creating build/lib.linux-armv6l-3.9/av/subtitles
  copying av/subtitles/__init__.py -> build/lib.linux-armv6l-3.9/av/subtitles
  creating build/lib.linux-armv6l-3.9/av/container
  copying av/container/__init__.py -> build/lib.linux-armv6l-3.9/av/container
  running build_ext
  running config
  writing build/temp.linux-armv6l-3.9/include/pyav/config.h
  running cythonize
  building 'av.enums' extension
  creating build/temp.linux-armv6l-3.9/src
  creating build/temp.linux-armv6l-3.9/src/av
  arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/arm-linux-gnueabihf -Ibuild/temp.linux-armv6l-3.9/include -I/usr/include/python3.9 -I/usr/include/python3.9 -Ibuild/temp.linux-armv6l-3.9/include -c src/av/enums.c -o build/temp.linux-armv6l-3.9/src/av/enums.o
  src/av/enums.c: In function ‘__Pyx_modinit_type_init_code’:
  src/av/enums.c:8716:33: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
   8716 |   __pyx_type_2av_5enums_EnumType.tp_print = 0;
        |                                 ^
  src/av/enums.c:8725:33: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
   8725 |   __pyx_type_2av_5enums_EnumItem.tp_print = 0;
        |                                 ^
  src/av/enums.c:8733:33: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
   8733 |   __pyx_type_2av_5enums_EnumFlag.tp_print = 0;
        |                                 ^
  src/av/enums.c:8740:61: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
   8740 |   __pyx_type_2av_5enums___pyx_scope_struct___get_multi_flags.tp_print = 0;
        |                                                             ^
  src/av/enums.c:8746:53: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
   8746 |   __pyx_type_2av_5enums___pyx_scope_struct_1_genexpr.tp_print = 0;
        |                                                     ^
  src/av/enums.c: In function ‘__Pyx_ParseOptionalKeywords’:
  src/av/enums.c:10085:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10085:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10085:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10085:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10085:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10085:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10101:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10101:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10101:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10101:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10101:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  src/av/enums.c:10101:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:97,
                   from src/av/enums.c:34:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for av
  Running setup.py clean for av
Failed to build av
Installing collected packages: av
    Running setup.py install for av ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rp5wowbe/av_a69a13ed543d43c09b463d727ade1354/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rp5wowbe/av_a69a13ed543d43c09b463d727ade1354/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-w0n0maue/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/av
         cwd: /tmp/pip-install-rp5wowbe/av_a69a13ed543d43c09b463d727ade1354/
    Complete output (157 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv6l-3.9
    creating build/lib.linux-armv6l-3.9/av
    copying av/__main__.py -> build/lib.linux-armv6l-3.9/av
    copying av/deprecation.py -> build/lib.linux-armv6l-3.9/av
    copying av/__init__.py -> build/lib.linux-armv6l-3.9/av
    creating build/lib.linux-armv6l-3.9/av/video
    copying av/video/__init__.py -> build/lib.linux-armv6l-3.9/av/video
    creating build/lib.linux-armv6l-3.9/av/filter
    copying av/filter/__init__.py -> build/lib.linux-armv6l-3.9/av/filter
    creating build/lib.linux-armv6l-3.9/av/audio
    copying av/audio/__init__.py -> build/lib.linux-armv6l-3.9/av/audio
    creating build/lib.linux-armv6l-3.9/av/data
    copying av/data/__init__.py -> build/lib.linux-armv6l-3.9/av/data
    creating build/lib.linux-armv6l-3.9/av/codec
    copying av/codec/__init__.py -> build/lib.linux-armv6l-3.9/av/codec
    creating build/lib.linux-armv6l-3.9/av/subtitles
    copying av/subtitles/__init__.py -> build/lib.linux-armv6l-3.9/av/subtitles
    creating build/lib.linux-armv6l-3.9/av/container
    copying av/container/__init__.py -> build/lib.linux-armv6l-3.9/av/container
    running build_ext
    running config
    writing build/temp.linux-armv6l-3.9/include/pyav/config.h
    running cythonize
    building 'av.enums' extension
    creating build/temp.linux-armv6l-3.9/src
    creating build/temp.linux-armv6l-3.9/src/av
    arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ibuild/temp.linux-armv6l-3.9/include -I/usr/include/arm-linux-gnueabihf -I/usr/include/python3.9 -Iinclude -I/usr/include/python3.9 -Ibuild/temp.linux-armv6l-3.9/include -c src/av/enums.c -o build/temp.linux-armv6l-3.9/src/av/enums.o
    src/av/enums.c: In function ‘__Pyx_modinit_type_init_code’:
    src/av/enums.c:8716:33: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8716 |   __pyx_type_2av_5enums_EnumType.tp_print = 0;
          |                                 ^
    src/av/enums.c:8725:33: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8725 |   __pyx_type_2av_5enums_EnumItem.tp_print = 0;
          |                                 ^
    src/av/enums.c:8733:33: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8733 |   __pyx_type_2av_5enums_EnumFlag.tp_print = 0;
          |                                 ^
    src/av/enums.c:8740:61: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8740 |   __pyx_type_2av_5enums___pyx_scope_struct___get_multi_flags.tp_print = 0;
          |                                                             ^
    src/av/enums.c:8746:53: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8746 |   __pyx_type_2av_5enums___pyx_scope_struct_1_genexpr.tp_print = 0;
          |                                                     ^
    src/av/enums.c: In function ‘__Pyx_ParseOptionalKeywords’:
    src/av/enums.c:10085:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10085:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10085:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10085:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10085:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10085:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    10085 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10101:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10101:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10101:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10101:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10101:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    src/av/enums.c:10101:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    10101 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from src/av/enums.c:34:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rp5wowbe/av_a69a13ed543d43c09b463d727ade1354/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rp5wowbe/av_a69a13ed543d43c09b463d727ade1354/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-w0n0maue/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/av Check the logs for full command output.

Songs are in slow motion

Just done a fresh install on a Raspberry Pi 3 and threw a few .mp3's into /pirateradio. The songs seem to be in really slow motion.

Here's the log from service mpradio status

● mpradio.service - Morrolinux Pirate Radio
   Loaded: loaded (/etc/systemd/system/mpradio.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-05-31 23:57:53 BST; 4s ago
 Main PID: 1147 (sudo)
    Tasks: 14 (limit: 2062)
   CGroup: /system.slice/mpradio.service
           ├─1147 sudo -E chrt -f 99 /home/pi/mpradio.py
           ├─1158 python3 /home/pi/mpradio.py
           ├─1161 sox -t raw -G -b 16 -e signed -c 2 -r 44100 - -t wav - compand 0.3,1 6:-70,-60,-20 -5 -90 0.2 treble -6
           ├─1162 sudo pi_fm_adv --freq 88.0 --ctl /tmp/rds_ctl --audio -
           └─1172 pi_fm_adv --freq 88.0 --ctl /tmp/rds_ctl --audio -

May 31 23:57:55 mpradio bash[1147]: broadcasting on FM 88.0
May 31 23:57:55 mpradio bash[1147]: storage_player playing: /pirateradio/my-song.mp3
May 31 23:57:55 mpradio sudo[1162]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/bin/pi_fm_adv --freq 88.0 --ctl /tmp/rds_ctl --audio -
May 31 23:57:55 mpradio sudo[1162]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 31 23:57:55 mpradio bash[1147]: Estimating duration from bitrate, this may be inaccurate
May 31 23:57:55 mpradio bash[1147]: Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
May 31 23:57:55 mpradio bash[1147]: Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
May 31 23:57:55 mpradio bash[1147]: Encoder did not produce proper pts, making some up.

The mpradio.service fails at start

immagine

Honestly, I have no idea on how this works. Or, at least, it is not really user-friendly. I rebooted my pi with an USB plugged in as you say, but after that the service doesn't work anymore. I have connected a wire to GPIO 4 in order to stream via FM, though it simply doesn't work. I have no idea what to do, I don't even know how to disinstall this thing. I admit I'm really ignorant in this matter, so I ask you a bit of help.

error when starting ./mpradio.py missing 'psutil'

i have this error when starting ./mpradio.py

fresh installed 2019-04-08-raspbian-stretch-full and updated.

Failed building wheel for av
Running setup.py clean for av
Failed to build av
Installing collected packages: av, psutil
Running setup.py install for av ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, toke nize;file='/tmp/pip-build-olob6law/av/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-qfj505wj-record/install-record.tx t --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.5
creating build/lib.linux-armv7l-3.5/av
copying av/main.py -> build/lib.linux-armv7l-3.5/av
copying av/datasets.py -> build/lib.linux-armv7l-3.5/av
copying av/init.py -> build/lib.linux-armv7l-3.5/av
copying av/deprecation.py -> build/lib.linux-armv7l-3.5/av
creating build/lib.linux-armv7l-3.5/av/codec
copying av/codec/init.py -> build/lib.linux-armv7l-3.5/av/codec
creating build/lib.linux-armv7l-3.5/av/subtitles
copying av/subtitles/init.py -> build/lib.linux-armv7l-3.5/av/subtitles
creating build/lib.linux-armv7l-3.5/av/container
copying av/container/init.py -> build/lib.linux-armv7l-3.5/av/container
creating build/lib.linux-armv7l-3.5/av/audio
copying av/audio/init.py -> build/lib.linux-armv7l-3.5/av/audio
creating build/lib.linux-armv7l-3.5/av/video
copying av/video/init.py -> build/lib.linux-armv7l-3.5/av/video
creating build/lib.linux-armv7l-3.5/av/data
copying av/data/init.py -> build/lib.linux-armv7l-3.5/av/data
creating build/lib.linux-armv7l-3.5/av/filter
copying av/filter/init.py -> build/lib.linux-armv7l-3.5/av/filter
running build_ext
running config
Could not find libavformat with pkg-config.
Could not find libavcodec with pkg-config.
Could not find libavdevice with pkg-config.
Could not find libavutil with pkg-config.
Could not find libavfilter with pkg-config.
Could not find libswscale with pkg-config.
Could not find libswresample with pkg-config.

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip- build-8smjkpmb/av/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.r ead().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" ins tall --record /tmp/pip-y9o2qt2c-record/install-record.txt --single-version-exter nally-managed --compile" failed with error code 1 in /tmp/pip-build-8smjkpmb/av/
Failed to enable unit: Refusing to operate on linked unit file dbus-org.bluez.se rvice
Synchronizing state of bluetooth.service with SysV service script with /lib/syst emd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable bluetooth
fatal: destination path 'PiFmAdv' already exists and is not an empty directory.
rm -f *.o
gcc -Wall -Wno-multichar -std=gnu99 -c -g -O1 -march=armv7-a -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -DRASPI=2 rds.c
gcc -Wall -Wno-multichar -std=gnu99 -c -g -O1 -march=armv7-a -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -DRASPI=2 waveforms.c
gcc -Wall -Wno-multichar -std=gnu99 -c -g -O1 -march=armv7-a -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -DRASPI=2 -c -o pi_fm_adv.o pi_fm_adv. c
gcc -Wall -Wno-multichar -std=gnu99 -c -g -O1 -march=armv7-a -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -DRASPI=2 fm_mpx.c
gcc -Wall -Wno-multichar -std=gnu99 -c -g -O1 -march=armv7-a -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -DRASPI=2 control_pipe.c
gcc -Wall -Wno-multichar -std=gnu99 -c -g -O1 -march=armv7-a -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -DRASPI=2 mailbox.c
gcc -o pi_fm_adv rds.o waveforms.o mailbox.o pi_fm_adv.o fm_mpx.o control_pipe.o -lm -lsndfile

then it restarts after installation

after running ./mpradio.pi

pi@raspberrypi:~ $ cd mpradio/src
pi@raspberrypi:~/mpradio/src $ ./mpradio.py
Traceback (most recent call last):
File "./mpradio.py", line 12, in
from storage_player import StoragePlayer
File "/home/pi/mpradio/src/storage_player.py", line 10, in
import psutil
ImportError: No module named 'psutil'

tried fresh installating 3 times, not working.
Im using RPI 3 b+ with 8gb memcard.

Bluetooth connection issue

Raspberry 3b+
Fresh raspbian stretch lite image

After pairing a bluetooth device the audio (local playback/mp3) get stuck (looping/skipping the current playback) and does not switch over to the BT stream.
The device got paired as far as i can see?

I need to add that i changed the simple-agent service to restart since it fail to run after boot.
That should be in the syslog aswell.

syslog
https://gist.github.com/Iocere/7b48696a85fad8c2e4522a7a3f2be4b5

bluetooth_dev
[Sun Apr 21 22:55:42 BST 2019]: Other action add

daemon.log
https://gist.github.com/Iocere/95f3027169ea0a041729884b1697d03e

Edit: Sometimes is working after a few tries of pairing or waiting for a bit. Not sure.

Looks like its happening when the raspberry does not get any audio after connecting via BT. After starting some media in the android it picked the sound up and stopped getting stuck on the local media audio.

Static between songs

Hi,
I ran across this project a couple days ago. I love it! Very feature rich and easy to setup compared to any other setup out there.
I installed the most recent Raspbian minimal on a Raspberry PI 0 W and updated it. I installed using GIT and it fired right up and worked as expected. Great job there!
One thing I did notice, when switching tracks either manually or when it goes to the next track, there is a second of static as it stops transmitting. Is that normal or am I missing something?
I do like the fact there is a skip/power down button. Would it be possible to implement more buttons and possibly a OLED or LCD display on the PI? Or maybe even a menu system that shows over the RDS also? Last thought, how about an "RDS" file named the same as the audio file, that pipes through the rds control to display lyrics or other information about the audio file?
I would interested to hear your thoughts on this?

Thank you,
Ron Fancella

The radio plays music at a low speed

OK, so I think I've ruined something here. In a nutshell, I couldn't pair my Android 10 device with my Raspberry Pi 3 (Raspbian Buster) so I tried following this guide while the radio was still on, I rebooted the Raspberry and then I ended up having the radio play at a low speed (I think it's something like 0.50x) my playlist, plus adding a little white noise on the background (a really annoying whistle).
I tried uninstalling pi-bluetooth and installing it again (this time without blueman) from the Raspberry Pi, I rebooted my pi and the radio was still playing at a low speed, then I tried reinstalling mpradio and the problem is still here, but this time when I try to check service status it gives me a different error.
This is the error:
immagine

Android App doesn't seemingly work at all

Hi there. I downloaded the Android app to go with my Raspberry Pi Zero W with mpradio-py installed on it. mpradio-py is working great, but the android app is basically useless. The currently playing feature doesn't work seemingly at all, and the pause and play controls don't work either. Clicking on the settings tab causes the app to soft crash and occasionally hard crash. Could you possibly make this app open source? I'm sure the app isn't at the top of your priorities but I've worked with android apps before and I could possibly help make the app better. Absolutely love the mpradio-py project. I'm on a Google Pixel 3 running Android 11 unrooted. My Pi Zero is running the latest version of Raspbian with all updates and just mpradio and a driver for my screen included. Thanks!

Unable to run on boot

I've just installed this today, to mess around with. But it doesn't start when the Pi boots. (Pi Zero W to be specific, running a light version of Raspbian Buster)

This is what I get when viewing the status of the service:

● mpradio.service - Morrolinux Pirate Radio
   Loaded: loaded (/etc/systemd/system/mpradio.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-08-12 16:43:25 MDT; 32s ago
  Process: 440 ExecStart=/bin/bash -l -c /home/pi/mpradio.py (code=exited, status=1/FAILURE)
 Main PID: 440 (code=exited, status=1/FAILURE)

Aug 12 16:43:24 raspberrypi bash[440]: /etc/profile: line 4: id: command not found
Aug 12 16:43:24 raspberrypi bash[440]: /etc/profile: line 4: [: : integer expression expected
Aug 12 16:43:25 raspberrypi bash[440]: Traceback (most recent call last):
Aug 12 16:43:25 raspberrypi bash[440]:   File "/home/pi/mpradio.py", line 8, in <module>
Aug 12 16:43:25 raspberrypi bash[440]:     from bluetooth_remote import BtRemote
Aug 12 16:43:25 raspberrypi bash[440]:   File "/home/pi/mpradio/src/bluetooth_remote.py", line 2, in <module>
Aug 12 16:43:25 raspberrypi bash[440]:     import bluetooth
Aug 12 16:43:25 raspberrypi bash[440]: ModuleNotFoundError: No module named 'bluetooth'
Aug 12 16:43:25 raspberrypi systemd[1]: mpradio.service: Main process exited, code=exited, status=1/FAILURE
Aug 12 16:43:25 raspberrypi systemd[1]: mpradio.service: Failed with result 'exit-code'.

Any idea to what's going on?

The radio stops playing after an uncertain amount of time

Yesterday I left home during the evening and when I got home the radio was still on, but it only streamed a white noise, "bzzzzz". I checked the service status and it was OK, still active, so I tried stopping the service and starting it again. It worked, and the radio started to stream my playlist again.
But it doesn't end here, because then I went to sleep and when I woke up this morning I noticed the radio was still streaming white noise only ("bzzz"), so I stopped the service and I started it again and the radio started to stream my playlist again.
It seems that the radio stops streaming my playlist after a lot of time, let's say 4-5 hours or more. Is it normal? I thought it should stream my playlist on loop forever.

Stuttering every ~20 seconds on Pi B+ and Pi 3

There are stuttering issues with the Pi B+, every 20 ish seconds it loops back about half a second of audio. I will test on a Pi 3 and see whether it is simply low specs. The Pi 3 was on max overclock. Still occurs with the Pi 3, i have tested the pi_fm_adv program separately with no issues, and playing local files also works fine. I have also disabled wifi on the board. Any way I can debug this? Not sure which log file to look at, or if this would be logged at all.

RPi 3 GPIO 5 has a pull-up resistor, constantly firing "poweroff"

With a clean install of Raspbian Buster for the Rasperry Pi 3 mpradio works just out of the box but whenever I connect a bluetooth devices it receives a "poweroff" command and shuts down.
I don't know why it receives it only after a bluetooth connection, but I logged around and found out that at line 140 of https://github.com/morrolinux/mpradio-py/blob/master/src/gpio_remote.py it was receiving an input from GPIO, self.remote_msg contained
{'command': ['system', 'poweroff'], 'source': 'gpio'}
Also when starting mpradio.py it gave me this warning:
/home/pi/mpradio/src/gpio_remote.py:36: RuntimeWarning: A physical pull up resistor is fitted on this channel! GPIO.setup(5, GPIO.IN, pull_up_down=GPIO.PUD_UP)
I think it's because GPIO5 in Pi 3 is always HIGH so it constantly triggers, maybe? I tried using GPIO6 but I get this error instead:
Exception in thread Thread-7: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/home/pi/mpradio/src/gpio_remote.py", line 36, in __run GPIO.setup(6, GPIO.IN, pull_up_down=GPIO.PUD_UP) ValueError: The channel sent is invalid on a Raspberry Pi
Although this lets me play both FM and bluethoot just fine

Streaming from bluetooth (alsa pcm/bluez issues)

Hey there,
I installed this as per the instructions on a Raspberry Pi B+ running the latest raspbian 10 release, and I have been having issues with the Bluetooth streaming from my phone. I followed all the install instructions and checked the logs and found some useful tidbits that may help in debugging.

command: ./mpradio.py
https://pastebin.com/r9P1irsf

command: sudo systemctl status bluealsa.service
https://pastebin.com/sdSRigpM

command: cat /var/log/bluetooth_dev
[Wed Dec 30 20:53:04 GMT 2020]: Start Bluetooth played connection

I'm able to broadcast to fm using the test sound and the mp3 files in /pirateradio/. I'm familiar with cmd so please let me know if there's any other info I can provide

Any help would be greatly appreciated!

Usb stick and controlls

Good afternoon!
Thank you so much for Mpradio-py! But I have some problems.

  1. I use Raspberry PI 3 B+. After installation, I succesful connect to the device via bluetooth, but unfortunately the music was not broadcast on FM.
    But, if I connect a USB stick with a configuration file, everything is OK (Except for the companion application, it does not allow doing anything). I want to use my PI in the car, so I want to minimize the size, so how can i make it works without usb stick?
  2. My push-button control does not work (GPIO-connected on pin 5 [BCM 3]).

I guess that GPIO and application problems are same

Please, tell me where to look for an error

P.S. Sorry for my English

bluetooth app and audio passthrough to fm doesnt work

Hello I am having issues with Bluetooth not passing the audio to the pi (zero w).
I can connect to pi's Bluetooth but the app doesn't work.
I'm tring to passthrough my phones audio but it doesn't work.
The usb stick works perfectly and it is trasmitting music from the usb stick.
Is there any way to fix this?

Android app keeps crashing

Hello,
I installed the app on my Android 9 device. It asks for storage permissions and then crashes.
I know you mentioned it can crash (since it's the pre-alpha build), but I'm just interested if you released a newer version or something.
Thanks in advance!

Possible Memory Leak?

I can leave the program running for about an hour or so, before the system completely hangs and I have to pull the plug. Once it hangs the audio just stutters at the same part over and over again. When I checked htop, I found my swap completely full and my memory usuage was pretty much all used up. Most of the memory is used by the python script.
Screenshot_20190813-194750_JuiceSSH

When recently rebooted, it takes about a third of the memory.
Screenshot_20190813-195748_JuiceSSH

Currently the only solution that I would have is having a crontab reboot the system every hour or so.

Error in storage player

Upon mpradio start:

mpradio main PID is: 859
broadcasting on FM 88.0
storage_player playing: /pirateradio/sounds/bt-connect.wav
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/mpradio/src/storage_player.py", line 86, in __run
self.play(song) # blocking
File "/home/pi/mpradio/src/storage_player.py", line 134, in play
time_unit = input_container.size/int(input_container.duration/1000000)
ZeroDivisionError: division by zero

using this as workaround:

    try:		
        time_unit = input_container.size/int(input_container.duration/1000000)
    except ZeroDivisionError:
        time_unit = 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.