Commit Graph

21 Commits

Author SHA1 Message Date
Brandon Skari
bcc68e6973 Try to open /dev/mem before calling rpitx
mailbox.c tries to open /dev/mem and calls exit if it doesn't have
permission, which will forcefully exit the Python runtime. Try to open
it and throwing an exception if it fails before umping into C to give
users a chance to recover.

Also, because avconv is writing to a pipe, having the read end of the
pipe unexpectedly close breaks the terminal. I kept having to run
`reset` to get it back.
2017-05-15 15:35:51 -06:00
Brandon Skari
b85ece8df6 Remove dependency on libsndfile
Wav files include the length of the data in the file header. libsndfile
expects this length to be there and be sane. Unfortunately, when piping
data from avconv, this length is dummied out because the full length is
not known yet, so libsndfile can't be used to process a pipe data
stream. This removes the libsndfile dependency and replaces the used
functions with hand written ones.
2017-05-15 15:11:09 -06:00
Brandon Skari
8f25432e4f Start processing data from pipe
ffmpeg is being weird. Wave files start with a header consisting of the
text "RIFF", followed by 4 bytes for the length of the data chunk. But
because we're streaming to a pipe, that value isn't known yet, so it
just fills in 0xFFFFFFFF. libsndfile apparently doesn't like this and
quits with the message "Error in WAV file. No 'data' chunk marker." I
think I might need to drop libsndfile and manually process the data.
2017-05-10 17:47:28 -06:00
Brandon Skari
6dfb5ba5b0 Ignore stdout from subprocess; add debug logging 2017-05-04 13:52:03 -06:00
Brandon Skari
87cac9d4f6 Extract and convert audio using ffmpeg or avconv 2017-05-04 12:11:56 -06:00
Brandon Skari
5d31e1ea07 Fix Python 3 2017-04-28 16:49:44 -06:00
Brandon Skari
2c0bf1b33a Fix Python interface 2017-04-28 15:03:25 -06:00
Brandon Skari
80948442f1 Python 3 support 2016-02-28 16:14:24 -07:00
Brandon Skari
fadb0acbc4 Ignore certain signals 2016-02-28 16:14:24 -07:00
Brandon Skari
64ca1afd85 Fix parsing memory addresses 2016-02-28 16:14:24 -07:00
Brandon Skari
8092e79732 Test fix please ignore 2016-02-28 16:14:24 -07:00
Brandon Skari
16b844f636 Return NULL on error to throw an exception 2016-02-28 16:14:24 -07:00
Brandon Skari
001770505c Use long for address base 2016-02-28 16:14:24 -07:00
Brandon Skari
3912027f52 Hide Python imports from ipython 2016-02-28 16:14:24 -07:00
Brandon Skari
96ecd96724 Fix detection of EOF 2016-02-28 16:14:24 -07:00
Brandon Skari
53e63a3536 Add rpitx top level module 2016-02-28 16:14:24 -07:00
Brandon Skari
1a0ee1921f Throw exceptions on errors 2016-02-28 16:14:24 -07:00
Brandon Skari
19a1aa2578 Add support for broadcasting other sound files 2016-02-28 16:14:24 -07:00
Brandon Skari
4634b2ffd2 Get broadcasting of already formatted files working 2016-02-28 16:14:24 -07:00
Brandon Skari
96db9cb3dc Add callback for processing FM files 2016-02-28 16:14:23 -07:00
Brandon Skari
bc6b95bfa0 Python interface is compiling 2016-02-28 16:14:23 -07:00