nega0 / pianobarfly Goto Github PK
View Code? Open in Web Editor NEWpandora2[mp3|m4a]
Home Page: https://github.com/nega0/pianobarfly
License: Other
pandora2[mp3|m4a]
Home Page: https://github.com/nega0/pianobarfly
License: Other
pianobarfly =========== pianobarfly is a console client for the personalized web radio pandora (http://www.pandora.com). - play and manage (create, add more music, delete, rename, ...) your stations - rate played songs and let pandora explain why they have been selected - show upcoming songs/song history - configure keybindings - last.fm scrobbling support (external application) - proxy support for listeners outside the USA - auto-rips streams to audio files The sourcecode for pianobar can be downloaded at: http://github.com/PromyLOPh/pianobar/ or, http://6xq.net/projects/pianobar/ The sourcecode for pianobarfly can be downloaded at: http://github.com/ghuntley/pianobarfly
I don't know when this issue started (maybe with Joshua's last major update) but after every song, there is a 5-10 second delay before the next song is played. I'm running pianobarfly from a high-speed wired LAN so it's not a networking issue on my end.
Sometimes it gets stuck with 2 seconds left in the song, while tagging the file. Also, sometimes it doesn't get delayed at all. I don't know what's triggering this behavior, but I've noticed it happens more consistently when I let music play for a long period of time without skipping songs. It's like the client falls asleep and needs a nudge/kick once in a while.
Anyone else experience this?
~/src/pianobarfly$ make
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress
-I src/libezxml -DENABLE_FAAD
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/main.o src/main.c
src/main.c: In function ‘BarMainGetLoginCredentials’:
src/main.c:119:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress
-I src/libezxml -DENABLE_FAAD
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/player.o src/player.c
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress
-I src/libezxml -DENABLE_FAAD
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/settings.o src/settings.c
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress
-I src/libezxml -DENABLE_FAAD
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/terminal.o src/terminal.c
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress
-I src/libezxml -DENABLE_FAAD
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui_act.o src/ui_act.c
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress
-I src/libezxml -DENABLE_FAAD
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui.o src/ui.c
src/ui.c: In function ‘BarUiStartEventCmd’:
src/ui.c:842:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
src/ui.c:853:10: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
src/ui.c:860:11: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
src/ui.c:865:10: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress
-I src/libezxml -DENABLE_FAAD
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui_readline.o src/ui_readline.c
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress
-I src/libezxml -DENABLE_FAAD
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui_dispatch.o src/ui_dispatch.c
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress
-I src/libezxml -DENABLE_FAAD
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/fly.o src/fly.c
src/fly.c:252:7: error: expected identifier or ‘(’ before ‘extension’
src/fly.c:254:7: error: expected identifier or ‘(’ before ‘extension’
make: *** [src/fly.o] Error 1
I've stopped using pandora and instead have started using Spotify instead.
I am getting the same error as Issue 19. Seeing as that one is months old I have started a new one.
Could not overwrite the audio file (18:Invalid cross-device link).
Failed to write the tag.
Everything was running smoothly until I deleted the contents of ~/music -- my audio_file_dir. After that, pianobarfly errors at the rename function in fly_id3.c
I get this error:
(i) Login... Error: Protocol incompatible. Please upgrade libpiano.
Looks like pianobar has been updated yesterday with fixes for this. See #171.
Any ideas when the updates will be applied to pianobarfly?
Thanks!
wget -Nq http://www.almostsure.com/pianobarfly/install_pianobarfly && bash ./install_pianobarfly
Used to work fine, but recently (not sure when) existing files are not being detected properly. Worse, when a recording is aborted and the partial file deleted the previously fine file is now gone.
I think a nice config option would be a way to disable audio output so it could be a dedicated ripper program instead of having to mute it. I have a temporary workaround I'm using but I am not a programmer so hopefully a real option can be put in. My temporary workaround is this.
player.c lines 227-235 and 399-406
player->audioOutDevice = NULL;
//if ((player->audioOutDevice = ao_open_live (audioOutDriver,
// &format, NULL)) == NULL) {
// /* we're not interested in the errno */
// player->aoError = 1;
// BarUiMsg (player->settings, MSG_ERR,
// "Cannot open audio device\n");
// return WAITRESS_CB_RET_ERR;
//}
I know its (maybe) not possible to download them directly as MP3, but couldn't we have it save them as m4a then convert them to mp3 after the song is done while its recording another song, and then save them to the final destination?
I need someone to confirm the "grouping" branch works for mp3s. In an ID3v2 viewer, the Channel Name should show up in the 'TIT1' tag. In iTunes, the Channel Name should show up in the "grouping" column.
See #12
It appears that dirname()
on Linux will modify the given path in place. On OS X (and probably other BSDs) it returns a char *
to the dirname, leaving the original argument untouched.
This breaks the tmp_file_path
assignment in fly_id3.c
on OS X
Looks as though previously files blanks were filled in with '_' character, now they are truncated. Example Below:
Old : Wolfgang_Gartner_-Illmerica(Extended_Mix).mp3
new: Wolfgang_Gartner-Illmerica_(Extended_Mix).mp3
I tried looking through comments and code - but I am not much of a coder. Wasn't sure if this was intentional or not.
Edit: hmm github tracker doing odd things with the text, so this issue looks like it makes no sense what so ever. It's Eating the underscores. See here: http://pastebin.com/nRJ9X87V
ehhh not sure of problem. I'll just mess with settings till i get it -
Hello there,
Could somebody please help me out with this error?
I am using Ubuntu 12.04 LTS.
I get the following error whenever pianobarfly (master branch) tries to add the id3tag to the audio file between one audio track and another:
|> "Davey Jones Locker" by "Pepper" on "Pink Crustaceans And Good Vibrations"
/!\ Error overwriting the MP4 file (18:Invalid cross-device link).
/!\ Error writing the tag to the file (Pepper/Pink_Crustaceans_And_Good_Vibrations/Pepper-Davey_Jones_Locker.m4a).
So I looked up on this error and I saw some people suggesting the use of the develop branch. I understood this happens because of /tmp folder being on a different filesystem than the audio files. My audio files are being recorded to the following path: ./mp3
This is how my config file looks like:
user = user
password = password
control_proxy = http://IP:PORT/
history = 20
audio_file_dir = ./mp3
audio_quality = high
(I am using a proxy because I am outside the US).
In order to run the develop branch I had to take the audio_quality var out of the config file, otherwise I would get "(i) Login... Network error: Timeout.".
I tried with the DEVELOP branch and I get another error, this time right after receiving the playlist and before playing the first song:
|> Station "Sublime Radio" (1135921372068795883)
(i) Receiving new playlist... Ok.
|> "Yellow Ledbetter" by "Pearl Jam" on "Rearviewmirror (Greatest Hits 1991-2003)"
Segmentation fault (core dumped)
Aditional info:
$ mount -l
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
/home/myuser/.Private on /home/myuser type ecryptfs (key)
gvfs-fuse-daemon on /home/myuser/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=myuser)
/dev/sdb1 on /media/Elements type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) [Elements]
Any help is highly apreciated. Thanks in advance.
I'm getting this error when trying to run pianobarfly:
Welcome to pianobarfly (2011.08.07)! Press ? for a list of commands.
(i) Login... libpiano: Unknown error AUTH_WEB_LOGIN_NOT_ALLOWED in com.savagebeast.radio.api.protocol.xmlrpc.RadioXmlRpcException: 192.168.162.35|1321039926458|AUTH_WEB_LOGIN_NOT_ALLOWED
I'm using the latest libpiano from here:
https://github.com/PromyLOPh/pianobar.git
Thanks in advance.
I've seen a recent workaround suggested for pandora one users in order to get the high-quality mp3 audio format (aka mp3-hifi), but for those of us that don't have a pandora one account and still want an mp3 format, how do we do that? As far as I know, pandora offers (or used to) mp3 at regular quality as well as high.
Pianobarfly wouldn't start for me today. Anyone else or is it just me?
Welcome to pianobarfly (2011.11.12)! Press ? for a list of commands.
[i] Control fifo at /home/dorphell/.config/pianobarfly/ctl opened
[i] Login... Error: Unknown.
It would be nice to be able to only rip the "loved" songs as to not fill up the local collection quickly with every song that's played.
So apparently with Pandora's latest update to their website the hack I was using to get the year and album cover is no longer working. Without going into to much detail here is what's happening. Pianobarfly get the URL to the album detail page from the play list XML response Pandora sends back about the song. This URL is then used to download the album's HTML page, which is then parsed for the year and the URL for the full album cover image. That URL is then used to download the full cover.
Yea, so I know this is quite a hack and that there must be a better method for doing it but to date I've been unable to find a better method. So now we come to why I'm opening this issue. Does anyone out there know how Pandora's standalone Adobe AIR client gets the album cover and year? Or if not that at least a better method to get the full cover image?
I am aware the play list XML response contains an artist art URL but this is typically an image of the band not the cover art. The play list XML also contains an art radio URL but this is a reduced image size (typically 130x130 pixels). The full cover image I'm talking about is typically on the order of 500x500 pixels.
With gcc 4.6.1:
src/main.c: In function ‘BarMainGetLoginCredentials’:
src/main.c:119:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
diff --git a/src/main.c b/src/main.c
index 990efca..6eecfe7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -106,6 +106,8 @@ static bool BarMainLoginUser (BarApp_t *app) {
*/
static void BarMainGetLoginCredentials (BarSettings_t *settings,
BarReadlineFds_t *input) {
+ ssize_t r = 0;
+
if (settings->username == NULL) {
char nameBuf[100];
BarUiMsg (settings, MSG_QUESTION, "Email: ");
@@ -116,7 +118,7 @@ static void BarMainGetLoginCredentials (BarSettings_t *settings,
char passBuf[100];
BarUiMsg (settings, MSG_QUESTION, "Password: ");
BarReadlineStr (passBuf, sizeof (passBuf), input, BAR_RL_NOECHO);
- write (STDIN_FILENO, "\n", 1);
+ r = write (STDIN_FILENO, "\n", 1);
settings->password = strdup (passBuf);
}
}
I didn't realize this project existed (and somehow missed it upon Google-ing) and so I manually merged the pianobarfly changes into the dev version of pianobar.
I doubt its useful to any of you guys, but just in case:
Ubuntu Install Script:
http://almostsure.com/pianobarfly/install_pianobarfly2
Patch/Code:
http://almostsure.com/pianobarfly/pianobar-to-pianobarfly.patch
http://almostsure.com/pianobarfly/fly.h
http://almostsure.com/pianobarfly/fly.c
Hopefully it is somehow useful so its not a complete waste of my time.
Feature request! It would be nice to create playlists based off of the original Pandora station the songs came from.
The comment
ID3v1 tag would make a decent place to add this information.
I'm using Mac OSX 10.7.2 and XCode 4.2.1
After compiling everything works fine, however all files get deleted on finish because they are marked as "incomplete."
if I switch src/fly.c:321 from
status = unlink(fly->audio_file_path);
to
status = 0; //unlink(fly->audio_file_path);
all the files get saved including the incomplete ones.
What can I do to fix this more correctly?
This may be the same issue as
I do get the following error message on completed files:
Error opening the temporary file (Artist/Album/01 - Song.m4a/pianobarfly-tmp.m4a) (20:Not a directory).
That would be a problem because that location is the source file and not a directory.
This is most likely due to hunner's observation:
It appears that dirname() on Linux will modify the given path in place.
On OS X (and probably other BSDs) it returns a char * to the dirname, leaving the original argument untouched.
The patch by https://github.com/mjglopez doesn't work on OSX at all.
The patch by hunner at hunner@239d2aa
makes more sense, but returns
|> DEBUG: Temporary file (Artist/Album/pianobarfly-tmp.m4a) Bus error: 10
and then exits.
I have tried repairing disk permissions, but that is not the problem.
When tracing this error I get the following sequence that leads to the Bus error:
557/0x16ad: 1924178 74 71 open_nocancel("Artist/Album/pianobarfly-tmp.m4a\0", 0x601, 0x1B6) = 10 0 557/0x16ad: 1924180 2 0 lseek(0x8, 0x0, 0x0) = 0 0 557/0x16ad: 1924184 5 2 read_nocancel(0x8, "\0", 0x1000) = 4096 0 557/0x16ad: 1924187 3 1 fstat64(0xA, 0x10A41EA18, 0x10A41EADC) = 0 0 557/0x14f6: 1023 26818182 3 kevent(0x9, 0x0, 0x0) = -1 Err#4
I'm pretty sure that the 0x601 corresponds to O_WRONLY O_CREAT O_TRUNC, but I could be wrong.
Perhaps you might consider replacing libid3tag with id3v2, a command line tool for manipulating ID3 tags. I was browsing fly_id3.c and saw that the tag writing procedure is somewhat tedious. On the other hand id3v2 seems to be pretty straightforward to use.
It seems that the new libpiano needs to be merged. I tried simply replacing the folder, that yielded
src/fly.c:1465:31: error: ‘PianoSong_t’ has no member named ‘albumDetailURL’
src/fly.c:1495:31: error: ‘PianoSong_t’ has no member named ‘albumExplorerUrl’
I'm not very good with C, but I might be of assistance if you know whats going on.
It seems i have install all the Dependencies correctly but when i try to login i get this error any suggestions?
Looks like there was another change by Pandora... I get an Unsupported audio format!
error.
I am a Pandora One subscriber and this program has been working great for me. But about a month ago I got the infamous "TLS fingerprint mismatch" error and have not been able to fix it. Here is a copy of the entire error message:
WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-wtysEC/pkcs11: No such file or directory
Welcome to pianobarfly (2013.09.15-dev)! Press ? for a list of commands.
(i) Login... Network error: TLS fingerprint mismatch.
I tried using the following to see if my config file was using the right fingerprint:
openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2
This returned a value of 2D0AFDAFA16F4B5C0A43F3CB1D4752F9535507C0 that I used in the config file but it did not fix the problem. Any help would be greatly appreciated. Thanks.
I'm a One subscriber and am using the fix from #37 , and playing a station now gives this error:
[?] Select station: 0
|> Station "Abacus Radio" (1048474741864305508)
(i) Receiving new playlist... Error: Listener not authorized.
As of 3 days ago (same config) it was working, I imagine something changed on the Pandora end.
I'm using the latest master branch, and haven't tried develop yet.
Using a temporary file to keep the downloaded stream has the following advantages:
1- File is not saved to disk if it turns out it doesn't need to be saved (e.g. not rated)
2- If destination directory is a remote host (e.g. NFS share), then no unnecessary writes are made (i.e. if the file doesn't need to be saved).
things left to do:
diff --git a/src/fly.c b/src/fly.c
index ea93929..1fb6de3 100644
--- a/src/fly.c
+++ b/src/fly.c
@@ -1122,47 +1122,80 @@ void BarFlyFinalize(void)
return;
}
-int BarFlyClose(BarFly_t* fly, BarSettings_t const* settings)
+int BarFlyCopyCompleted(BarFly_t* fly, BarSettings_t const* settings)
{
- int exit_status = 0;
- int status;
+ if (!fly) {
+ return 0;
+ }
- assert(settings != NULL);
+ fly->status = COPYING;
+ fseek(fly->temp_file, 0, SEEK_SET);
- if (fly != NULL) {
- /*
- * Close the file stream.
- */
- if (fly->audio_file != NULL) {
- fclose(fly->audio_file);
- }
+ /*
+ * Open a stream to the file.
+ */
+ int status = _BarFlyFileOpen(&fly->audio_file, fly->audio_file_path, settings);
- /*
- * Delete the file if it was not complete or not loved.
- */
- if (!fly->completed || (settings->downloadOnlyLoved && !fly->loved)) {
- fly->status = DELETING;
- status = _BarFlyFileDelete(fly, settings);
- if (status != 0) {
- exit_status = -1;
+ if (status == 0) {
+ char buf[BAR_FLY_COPY_BLOCK_SIZE];
+ memset(buf, 0, BAR_FLY_COPY_BLOCK_SIZE);
+ size_t s = 0, s2 = 0;
+
+ while (!feof(fly->temp_file)) {
+ s = fread(buf, 1, BAR_FLY_COPY_BLOCK_SIZE, fly->temp_file);
+
+ if (s != BAR_FLY_COPY_BLOCK_SIZE && !feof(fly->temp_file)) {
+ BarUiMsg(settings, MSG_INFO,
+ "Could not read temporary file (%d): %s\n",
+ errno,
+ strerror(errno));
+ break;
}
- }
- /*
- * Free the audio file name.
- */
- if (fly->audio_file_path != NULL) {
- free(fly->audio_file_path);
- }
+ s2 = fwrite(buf, 1, s, fly->audio_file);
- /*
- * Free the cover art URL.
- */
- if (fly->cover_art_url != NULL) {
- free(fly->cover_art_url);
+ if (s2 != s) {
+ BarUiMsg(settings, MSG_INFO,
+ "Could not write audio to destination %s (%d): %s\n",
+ fly->audio_file_path,
+ errno,
+ strerror(errno));
+ break;
+ }
}
}
+ fclose(fly->audio_file);
+}
+
+int BarFlyClose(BarFly_t* fly, BarSettings_t const* settings)
+{
+ if (!fly) {
+ return 0;
+ }
+
+ assert(settings != NULL);
+
+ int exit_status = 0;
+ int status;
+
+ /* closing the tmpfile() will delete it automatically */
+ fclose(fly->temp_file);
+
+ /*
+ * Free the audio file name.
+ */
+ if (fly->audio_file_path != NULL) {
+ free(fly->audio_file_path);
+ }
+
+ /*
+ * Free the cover art URL.
+ */
+ if (fly->cover_art_url != NULL) {
+ free(fly->cover_art_url);
+ }
+
return exit_status;
}
@@ -1347,22 +1380,17 @@ int BarFlyOpen(BarFly_t* fly, PianoSong_t const* song,
if (output_fly.audio_file_path == NULL) {
goto error;
}
-
+
/*
- * Open a stream to the file.
+ * Get a temporary file for download.
*/
- status = _BarFlyFileOpen(&output_fly.audio_file,
- output_fly.audio_file_path, settings);
- if (status == 0) {
- output_fly.status = RECORDING;
- } else if (status == -2) {
- output_fly.status = NOT_RECORDING_EXIST;
- output_fly.completed = true;
- } else {
- output_fly.completed = true;
+ output_fly.temp_file = tmpfile();
+ if (output_fly.temp_file == NULL) {
goto error;
}
+ output_fly.status = RECORDING;
+
/*
* All members of the BarFly_t structure were created successfully. Copy
* them from the temporary structure to the one passed in.
@@ -1420,6 +1448,10 @@ char const* BarFlyStatusGet(BarFly_t* fly)
string = "Deleting";
break;
+ case (COPYING):
+ string = "Copying";
+ break;
+
case (TAGGING):
string = "Tagging";
break;
@@ -1476,7 +1508,7 @@ int BarFlyWrite(BarFly_t* fly, void const* data, size_t data_size)
}
assert(fly->audio_file != NULL);
- status = fwrite(data, data_size, 1, fly->audio_file);
+ status = fwrite(data, data_size, 1, fly->temp_file);
if (status != 1) {
goto error;
}
diff --git a/src/fly.h b/src/fly.h
index e200512..e5551ac 100644
--- a/src/fly.h
+++ b/src/fly.h
@@ -52,6 +52,7 @@ typedef enum BarFlyStatus {
NOT_RECORDING_EXIST,
RECORDING,
DELETING,
+ COPYING,
TAGGING
} BarFlyStatus_t;
@@ -63,11 +64,16 @@ typedef enum BarFlyStatus {
*/
typedef struct BarFly {
/**
- * The stream to which the audio stream is written.
+ * The file to which the final audio stream is copied.
*/
FILE* audio_file;
/**
+ * The stream to which audio is written.
+ */
+ FILE* temp_file;
+
+ /**
* The audio file path.
*/
char* audio_file_path;
@@ -212,4 +218,13 @@ int BarFlyTag(BarFly_t* fly, BarSettings_t const* settings);
*/
int BarFlyWrite(BarFly_t* fly, void const* data, size_t data_size);
+/**
+ * Copies the temporary audio file to final destination
+ *
+ * @param fly Pointer to a BarFly_t structure.
+ * @param settings Pointer to the application settings structure.
+ * @return Upon success 0 is returned otherwise -1 is returned.
+ */
+int BarFlyCopyCompleted(BarFly_t* fly, BarSettings_t const* settings);
+
#endif /* _FLY_H */
diff --git a/src/player.c b/src/player.c
index 3c2cfdb..2ec35b1 100644
--- a/src/player.c
+++ b/src/player.c
@@ -518,8 +518,15 @@ void *BarPlayerThread (void *data) {
} while (wRet == WAITRESS_RET_PARTIAL_FILE || wRet == WAITRESS_RET_TIMEOUT
|| wRet == WAITRESS_RET_READ_ERR);
- /* If the song was played all the way through tag it. */
if (wRet == WAITRESS_RET_OK) {
+ if (!player->settings->downloadOnlyLoved ||
+ (player->settings->downloadOnlyLoved && !player->fly.loved)) {
+ BarUiMsg(player->settings, MSG_INFO, "Saving loved song.\n",
+ player->fly.audio_file_path);
+ BarFlyCopyCompleted(&player->fly, player->settings);
+ }
+
+ /* If the song was played all the way through tag it. */
BarFlyTag(&player->fly, player->settings);
}
It appears as if pianobarfly only streams 64kbps music from pandora. Would it be possible to have the client check if higher quality streams are available (which they should be for pandora one subscribers)?
On some songs, the app will display something like this and not continue to the next song:
# -00:02/04:15 * Tagging
When this happens, the application still responds to some commands (?, i), but others (n, q) cause the app to stop responding completely; it doesn't clear up after any period of time. I've not been able to work out anything specific that's causing it - sometimes it'll happen two songs in a row, other times it'll work right for hours. It's almost at 2 seconds remaining, though occasionally at 1 or 3 seconds.
$ uname -a
Darwin Adams-MacBook-Air.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
After killing with SIGINT, or quitting with q, doesn't exit gracefully:
*** glibc detected *** ./pianobarfly: double free or corruption (fasttop): 0x00000000019ef8e0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x78a56)[0x7fd702001a56]
./pianobarfly[0x40d61a]
./pianobarfly[0x4040e4]
/lib/libc.so.6(__libc_start_main+0xf5)[0x7fd701faa455]
./pianobarfly[0x404895]
======= Memory map: ========
00400000-00419000 r-xp 00000000 08:04 272955 /home/atondwal/pianobarfly
00619000-0061a000 rw-p 00019000 08:04 272955 /home/atondwal/pianobarfly
0061a000-00620000 rw-p 00000000 00:00 0
019cc000-01a2f000 rw-p 00000000 00:00 0 [heap]
7fd6f8000000-7fd6f8063000 rw-p 00000000 00:00 0
7fd6f8063000-7fd6fc000000 ---p 00000000 00:00 0
7fd6fd480000-7fd6fd495000 r-xp 00000000 08:03 132810 /usr/lib/libgcc_s.so.1
7fd6fd495000-7fd6fd694000 ---p 00015000 08:03 132810 /usr/lib/libgcc_s.so.1
7fd6fd694000-7fd6fd695000 rw-p 00014000 08:03 132810 /usr/lib/libgcc_s.so.1
7fd6fd695000-7fd6fd696000 ---p 00000000 00:00 0
7fd6fd696000-7fd6fde96000 rw-p 00000000 00:00 0
7fd6fde96000-7fd6fde9b000 r-xp 00000000 08:03 130829 /lib/libnss_dns-2.15.so
7fd6fde9b000-7fd6fe09a000 ---p 00005000 08:03 130829 /lib/libnss_dns-2.15.so
7fd6fe09a000-7fd6fe09b000 r--p 00004000 08:03 130829 /lib/libnss_dns-2.15.so
7fd6fe09b000-7fd6fe09c000 rw-p 00005000 08:03 130829 /lib/libnss_dns-2.15.so
7fd6fe09c000-7fd6fe0a8000 r-xp 00000000 08:03 130836 /lib/libnss_files-2.15.so
7fd6fe0a8000-7fd6fe2a7000 ---p 0000c000 08:03 130836 /lib/libnss_files-2.15.so
7fd6fe2a7000-7fd6fe2a8000 r--p 0000b000 08:03 130836 /lib/libnss_files-2.15.so
7fd6fe2a8000-7fd6fe2a9000 rw-p 0000c000 08:03 130836 /lib/libnss_files-2.15.so
7fd6fe2a9000-7fd6fe394000 r-xp 00000000 08:03 156362 /usr/lib/libasound.so.2.0.0
7fd6fe394000-7fd6fe594000 ---p 000eb000 08:03 156362 /usr/lib/libasound.so.2.0.0
7fd6fe594000-7fd6fe59a000 r--p 000eb000 08:03 156362 /usr/lib/libasound.so.2.0.0
7fd6fe59a000-7fd6fe59c000 rw-p 000f1000 08:03 156362 /usr/lib/libasound.so.2.0.0
7fd6fe59c000-7fd6fe5a2000 r-xp 00000000 08:03 212493 /usr/lib/ao/plugins-4/libalsa.so
7fd6fe5a2000-7fd6fe7a1000 ---p 00006000 08:03 212493 /usr/lib/ao/plugins-4/libalsa.so
7fd6fe7a1000-7fd6fe7a2000 r--p 00005000 08:03 212493 /usr/lib/ao/plugins-4/libalsa.so
7fd6fe7a2000-7fd6fe7a3000 rw-p 00006000 08:03 212493 /usr/lib/ao/plugins-4/libalsa.so
7fd6fe7a3000-7fd6fe7a5000 r-xp 00000000 08:03 212494 /usr/lib/ao/plugins-4/liboss.so
7fd6fe7a5000-7fd6fe9a4000 ---p 00002000 08:03 212494 /usr/lib/ao/plugins-4/liboss.so
7fd6fe9a4000-7fd6fe9a5000 r--p 00001000 08:03 212494 /usr/lib/ao/plugins-4/liboss.so
7fd6fe9a5000-7fd6fe9a6000 rw-p 00002000 08:03 212494 /usr/lib/ao/plugins-4/liboss.so
7fd6fe9a6000-7fd6fe9b9000 r-xp 00000000 08:03 130892 /lib/libresolv-2.15.so
7fd6fe9b9000-7fd6febb9000 ---p 00013000 08:03 130892 /lib/libresolv-2.15.so
7fd6febb9000-7fd6febba000 r--p 00013000 08:03 130892 /lib/libresolv-2.15.so
7fd6febba000-7fd6febbb000 rw-p 00014000 08:03 130892 /lib/libresolv-2.15.so
7fd6febbb000-7fd6febbd000 rw-p 00000000 00:00 0
7fd6febbd000-7fd6febd2000 r-xp 00000000 08:03 130592 /lib/libnsl-2.15.so
7fd6febd2000-7fd6fedd1000 ---p 00015000 08:03 130592 /lib/libnsl-2.15.so
7fd6fedd1000-7fd6fedd2000 r--p 00014000 08:03 130592 /lib/libnsl-2.15.so
7fd6fedd2000-7fd6fedd3000 rw-p 00015000 08:03 130592 /lib/libnsl-2.15.so
7fd6fedd3000-7fd6fedd5000 rw-p 00000000 00:00 0
7fd6fedd5000-7fd6feddb000 r-xp 00000000 08:03 158263 /usr/lib/libogg.so.0.8.0
7fd6feddb000-7fd6fefda000 ---p 00006000 08:03 158263 /usr/lib/libogg.so.0.8.0
7fd6fefda000-7fd6fefdb000 rw-p 00005000 08:03 158263 /usr/lib/libogg.so.0.8.0
7fd6fefdb000-7fd6ff007000 r-xp 00000000 08:03 165117 /usr/lib/libvorbis.so.0.4.6
7fd6ff007000-7fd6ff206000 ---p 0002c000 08:03 165117 /usr/lib/libvorbis.so.0.4.6
7fd6ff206000-7fd6ff207000 r--p 0002b000 08:03 165117 /usr/lib/libvorbis.so.0.4.6
7fd6ff207000-7fd6ff208000 rw-p 0002c000 08:03 165117 /usr/lib/libvorbis.so.0.4.6
7fd6ff208000-7fd6ff4bb000 r-xp 00000000 08:03 165121 /usr/lib/libvorbisenc.so.2.0.9
7fd6ff4bb000-7fd6ff6ba000 ---p 002b3000 08:03 165121 /usr/lib/libvorbisenc.so.2.0.9
7fd6ff6ba000-7fd6ff6d6000 r--p 002b2000 08:03 165121 /usr/lib/libvorbisenc.so.2.0.9
7fd6ff6d6000-7fd6ff6d7000 rw-p 002ce000 08:03 165121 /usr/lib/libvorbisenc.so.2.0.9
7fd6ff6d7000-7fd6ff721000 r-xp 00000000 08:03 158390 /usr/lib/libFLAC.so.8.2.0
7fd6ff721000-7fd6ff920000 ---p 0004a000 08:03 158390 /usr/lib/libFLAC.so.8.2.0
7fd6ff920000-7fd6ff922000 rw-p 00049000 08:03 158390 /usr/lib/libFLAC.so.8.2.0
7fd6ff922000-7fd6ff927000 r-xp 00000000 08:03 135205 /usr/lib/libXdmcp.so.6.0.0
7fd6ff927000-7fd6ffb26000 ---p 00005000 08:03 135205 /usr/lib/libXdmcp.so.6.0.0
7fd6ffb26000-7fd6ffb27000 r--p 00004000 08:03 135205 /usr/lib/libXdmcp.so.6.0.0
7fd6ffb27000-7fd6ffb28000 rw-p 00005000 08:03 135205 /usr/lib/libXdmcp.so.6.0.0
7fd6ffb28000-7fd6ffb2a000 r-xp 00000000 08:03 135221 /usr/lib/libXau.so.6.0.0
7fd6ffb2a000-7fd6ffd2a000 ---p 00002000 08:03 135221 /usr/lib/libXau.so.6.0.0
7fd6ffd2a000-7fd6ffd2b000 r--p 00002000 08:03 135221 /usr/lib/libXau.so.6.0.0
7fd6ffd2b000-7fd6ffd2c000 rw-p 00003000 08:03 135221 /usr/lib/libXau.so.6.0.0
7fd6ffd2c000-7fd6ffd31000 r-xp 00000000 08:03 182285 /usr/lib/libasyncns.so.0.3.1[1] 5806 abort ./pianobarfly
I've stopped using pandora and instead have started using Spotify instead.
You've renamed pianobar.1 to pianobarfly.1 in the contrib folder, but forget to change it in Makefile.
I am actively attempting to make songs that start playing as <3 be saved to a special folder, have a 5 star rating or add a comment on their id3 info.
Any words of wisdom on how to do that? I am utterly new to C programing on linux, what ide's or guides do you recomend I read? Currently I am rambo'ing with a text editor and the terminal.
In my head here is what I think I need to do:
PS: I love this code!
Edit: Misspelled favourites 4 times.
see commit atondwal/pianobarfly@ff7b9e8
Building with DYNLINK=1 is broken. This fixes:
https://raw.github.com/aljex/misc/master/pianobarfly/dynamic_build_install.diff
I don't suggest making DYNLINK=1 by default the way this patch does, it's just the way I have my copy set. The rest is good for default I think.
Unfortunately the soname still conflicts with regular pianobar so you can't have both programs installed side by side.
I'm trying to install pianobarfly on OS X and can't get it to compile correctly.
I think I have all the dependencies, except I'm not sure if I have pthreads or not, and I'm assuming my system default is UTF-8 console/locale!
I have used homebrew to install the dependencies I didn't have, like faad2 and libid3tag, but I haven't been to turn up anything on google about installing pthreads or how to tell if I have that already or not.
Anyhow, when I try to complile pianobarfly, this is what I get:
####:pianobarfly user$ make clean && make CFLAGS="-O2 -DNDEBUG -W64" && make DISABLE_FAAD=1
rm -f src/main.o src/player.o src/settings.o src/terminal.o src/ui_act.o src/ui.o\
src/ui_readline.o src/ui_dispatch.o src/fly.o src/fly_id3.o src/fly_mp4.o\
src/libpiano/crypt.o src/libpiano/piano.o src/libpiano/xml.o\
src/libwaitress/waitress.o src/libwaitress/waitress.o/test.o \
src/libezxml/ezxml.o src/libpiano/crypt.lo src/libpiano/piano.lo\
src/libpiano/xml.lo src/libwaitress/waitress.lo \
src/libezxml/ezxml.lo pianobarfly libpiano.so* libpiano.a waitress-test
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/main.o src/main.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/player.o src/player.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/settings.o src/settings.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/terminal.o src/terminal.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui_act.o src/ui_act.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui.o src/ui.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui_readline.o src/ui_readline.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui_dispatch.o src/ui_dispatch.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/fly.o src/fly.c
src/fly.c: In function ‘_BarFlyParseCoverArtURL’:
src/fly.c:733: warning: implicit declaration of function ‘strndup’
src/fly.c:734: warning: assignment makes pointer from integer without a cast
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/fly_id3.o src/fly_id3.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/fly_mp4.o src/fly_mp4.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/libpiano/crypt.o src/libpiano/crypt.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/libpiano/piano.o src/libpiano/piano.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/libpiano/xml.o src/libpiano/xml.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/libwaitress/waitress.o src/libwaitress/waitress.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-DENABLE_MAD -DENABLE_ID3TAG -c -o src/libezxml/ezxml.o src/libezxml/ezxml.c
c99 -O2 -DNDEBUG -W64 src/main.o src/player.o src/settings.o src/terminal.o src/ui_act.o\
src/ui.o src/ui_readline.o src/ui_dispatch.o src/fly.o src/fly_id3.o src/fly_mp4.o\
src/libpiano/crypt.o src/libpiano/piano.o src/libpiano/xml.o \
src/libwaitress/waitress.o src/libezxml/ezxml.o -lao -lpthread -lm \
-lfaad -lmad -lid3tag -o pianobarfly
Undefined symbols for architecture x86_64:
"_strndup", referenced from:
_BarFlyOpen in fly.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [pianobarfly] Error 1
####:pianobarfly user$
Hi,
Just got the latest from github, compiled and went perfectly but there seems to be an issue when creating the temporary file for inserting the id3 tags. I get this error:
Could not open the temporary file
To fix it, I made the following changes:
http://www.mikelopez.com/fly_id3.patch
I have noticed that the .m4a files written by PBF are not correct. my music players report errors in playback. I did the following experiment using ffmpeg to test if the files were correct. Here is an example output:
ffmpeg -i input.m4a -c:a libfdk_aac output.m4a
...output trimmed...
[aac @ 0x210a140] TYPE_FIL: Input buffer exhausted before END element found
Error while decoding stream #0:0: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2108880] stream 0, offset 0x1a6044: partial file
input.m4a: Invalid data found when processing input
the converted file actually plays correctly once ffmpeg re-encodes it. but, the original that PBF creates seems to have issues.
I also get one other error:
[aac @ 0x3e3e180] decode_band_types: Input buffer exhausted before END element found
but, most of the errors are TYPE_FIL. there are errors that show up commonly in the album art as well. I don't have good examples to post, though.
when running pianobarfly, I get the following recently:
Welcome to pianobarfly (2011.11.12)! Press ? for a list of commands.
(i) Login... Error: Protocol incompatible. Please upgrade libpiano.
Has the pandora protocol changed?
This probably doesn't effect too many people, but I bumped into it, so thought I'd share.
I'm running Linux Mint from a thumb drive. (Also Raspberry Pi with Raspbian.) I moved /tmp to tmpfs to minimize writes to flash. This breaks the creation of the ID3/MP4 tag when the song finishes because the rename() function requires that source and destination are on the same file-system. The error message is "Could not overwrite the audio file (18:Invalid cross-device link). Failed to write the tag."
This is also a problem if you want to have the files saved to a separate drive.
The simplest fix for me was to give "tmp_file_path[]" a fixed name in the destination directory, instead of using tmpnam() to generate a random filename in /tmp. I changed the following two functions.
BarFlyMp4TagWrite(...)
BarFlyID3WriteFile(...)
We had some luck installing pianobarfly on Windows the other night and wanted to share.
Beyond the base Cygwin system, you will need to install the following packages
using the Cygwin installer:
You'll also need to compile a couple of libraries from source.
wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz
tar xvf faad2-2.7.tar.gz
cd faad2-2.7
./configure --prefix=/usr && make install
We're changing the install prefix from the default /usr/local to /usr so that it will
be easier for libpiano to find the installed libraries.
wget ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz
tar xvf libmad-0.15.1b.tar.gz
cd libmad-0.15.1b
./configure --prefix=/usr
Before compiling libmad, edit the Makefile in the base directory. Remove the
-fforce-mem
flag from the CFLAGS line of the Makefile (line 129). Now, continue
with the build:
make install
We also need to create a mad.pc
file so that pkg-config will know that libmad
is installed.
Save the following as /usr/lib/pkgconfig/mad.pc
## start of mad.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: mad
Description: MPEG audio decoder
Requires:
Version: 0.15.1b
Libs: -L${libdir} -lmad
Cflags: -I${includedir}
## end of mad.pc
Now we can proceed with pianobarfly.
git clone https://github.com/ghuntley/pianobarfly.git
cd pianobarfly
nano Makefile
Change line 3 from PREFIX:=/usr/local
to PREFIX:=usr
and change line 15 from
CC=c99
to CC=cc -std=c99
make install
Run pianobarfly
, and celebrate!
Login information is saved in the file ~/.config/pianobarfly/config
. Create
the file as follows:
mkdir -p ~/.config/pianobarfly
nano ~/.config/pianobarfly/config
And type your login information:
user = [email protected]
password = wooly_mammoth
Good luck!
Would it be difficult to add an optional label with the name of the station to those we can use for filenames? It would make a lot more sense to me to sort files according to station, rather than artist or album.
Downloaded and made 2013-08-17@1700
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
Linux 3.8.0-27-generic #40-Ubuntu SMP Tue Jul 9 00:17:05 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
latest commit 21dc592
nega authored 12 days ago
|> "Otherside" by "Red Hot Chili Peppers" on "Californication"
/!\ Error opening the temporary file (./mp3/pianobarfly-QzC1LE) (2:No such file or directory).
/!\ Error writing the tag to the file (Red_Hot_Chili_Peppers/Californication/Red_Hot_Chili_Peppers-Otherside.m4a).
I get this error when building on Mac OSX 10.7 Lion:
~/pianobar$ ./pianobarfly
Welcome to pianobarfly (2011.08.07)! Press ? for a list of commands.
Segmentation fault: 11
I have found that this issue is also present in pianobar:
PromyLOPh/pianobar#138
I got it to work by adding CFLAGS="-D_DARWIN_C_SOURCE" to the make command. The new build command is thus:
make clean && make CFLAGS="-O2 -DNDEBUG -W64 -D_DARWIN_C_SOURCE"
I have 5 stations, and on each station, when I tell it to load it returns:
(i) Receiving new playlist... Error: Playlist end.
This started happening ~30 minutes ago. It seems pandora for those stations still work on the website.
(using the latest version of pianobar: 2011.12.11-dev )
Some change made in the last month or so is causing this error:
Could not overwrite the audio file (18:Invalid cross-device link).
Failed to write the tag.
I'm on the current git branch from today (2011.12.25).
I don't know if anyone else is getting this specific error but I don't have a unique audio_file_dir path. No hard or soft links in the path. I know the same path used to work fine for tagging in September.
Note that pianobarfly has no issue saving the audio file, just tagging at the end.
I suspect this is an upstream defect with rename()
in fly_id3.c. Can anyone reproduce this?
I'm using one of the common event-cmd scripts and some hotkeys to get growl feedback for song info. Originally the script used songexplain since there is no songinfo event triggered, but that generates unnecessary delays and network traffic. Instead, I added a simple songinfo event ala:
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -239,6 +239,9 @@ BarUiActCallback(BarUiActSongInfo) {
selStation->isQuickMix ?
PianoFindStationById (app->ph.stations, selSong->stationId) :
NULL);
+ BarUiStartEventCmd (&app->settings, "songinfo",
+ app->curStation, app->playlist, &app->player, app->ph.stations,
+ PIANO_RET_OK, WAITRESS_RET_OK);
}
/* print some debugging information
Sorry for submitting a diff in a comment on an issue, there's probably a much better way to do it with github directly, but I don't know how.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.