Hello,
I intend to develop an audio application for my embedded linux system.
My objectives are multi-track playback + record. (support for file
formats like wav, mp3, etc.)
Can anyone suggest if there is a library with a clean API that I can use?
Any suggestions are welcome.
- Regards, pj
Hello there!
I am trying to write a real time pitch shifter using C++.
The pitch shifter uses resampling and WSOLA for time-scaling.
I have written a jack client that already works using C, but I would like
to try using zita-resampler as the resampler library for my program.
That is why I am rewriting my program using C++ (it would also be a
learning experience for me).
I looked to Rui's synthv1 and zita-ajbridge for example of writing jack
client using C++.
The problem I am having relates to Jack MIDI.
My program keeps having a segfault when it is trying to read from the MIDI
buffer,
specifically when it tries to dereference the buffer pointer inside the
event structure.
jack_midi_event_get(&in_event, midi_buf, event_index);
if ((*(in_event.buffer) & 0xf0) == 0x90) // Segfault happens here, on
boolean mask operation
{
_note = *(in_event.buffer + 1);
}
So I tried to print the buffer's content but it also segfaults.
std::cout << std::hex << static_cast<unsigned int> (*(in_event.buffer)) <<
std::endl;
My understanding that in_event.buffer is a pointer-to-char,
so that *(in_event.buffer) should be an unsigned char.
I don't understand where I am doing wrong,
I would be very grateful if someone could point out my error.
Oh, my computer is Archlinux 64 bit using jack2-git 20120718.
I have put up a git repo of the code on
https://github.com/shanipribadi/pitch-segfault.git
Thanks.
Shani Pribadi
Hi,
I'm the author of a free VST called Digits that has a Linux port.
Recently, I put out a new version that has a full editor GUI, but was
unable to get the GUI to work on Linux because VSTGUI 4 doesn't appear
to have a Linux port.
What do you think the best strategy (fastest, least code changes)
would be to deliver a GUI for Linux users? I see on the JUCETICE site
that there's a VSTGUI 3.0 port, and the old 2.2 VSTGUI that comes with
the VST SDK has at least some Linux support (IIRC). I don't use any
advanced features (just dials, labels, and sliders). Are either of
these good options, and which would be best?
Input from somebody experienced with this would be great.
-Louis
I've been stumped for a while as to why my Tascam US-122 box stopped
working as a writeable midi port.
Using Debian Wheezy, everything was working up to a few weeks ago. MIDI
input still works and there's nothing suspicious in the /var/logs.
But...
nick@arial:~$ aplaymidi -l
Port Client name Port name
14:0 Midi Through Midi Through Port-0
20:0 TASCAM US-X2Y TASCAM US-X2Y MIDI 1
24:0 USB MIDI keyboard USB MIDI keyboard MIDI 1
nick@arial:~$ aplaymidi -p 20:0 Desktop/076903b_.mid
Cannot connect to port 20:0 - Input/output error
nick@arial:~$ uname -a
Linux arial 3.2.0-4-686-pae #1 SMP Debian 3.2.32-1 i686 GNU/Linux
Using older kernels doesn't help. Connecting e.g. rosegarden to the
TASCAM US-122 in qjackctl fails silently (the link is not made in the
connections window and nothing is printed on the console). Can't see
any module loading issues.
Is anybody else seeing this behaviour? I'd submit a bug report but
really can't figure out exactly what isn't working :(
nick@arial:~$ lsmod
Module Size Used by
snd_usb_audio 71309 0
snd_hrtimer 12540 0
snd_seq_dummy 12455 0
snd_usb_usx2y 22748 2
snd_usbmidi_lib 18844 2 snd_usb_audio,snd_usb_usx2y
snd_seq_midi 12744 0
snd_seq_midi_event 13124 1 snd_seq_midi
snd_rawmidi 18376 2 snd_seq_midi,snd_usbmidi_lib
...
usbcore 104470 8
ehci_hcd,uhci_hcd,uas,usb_storage,snd_usb_audio,snd_usbmidi_lib,snd_usb_usx2y
usb_common 12338 1 usbcore
Nick/.
We are proud to announce the release of guitarix2-0.24.3.
Guitarix is a modular mono tube amplifier simulation for jack, with
additional mono/stereo effect racks which can be filled with in-build
effect plug-ins as well as with external LADSPA plug-ins.
Presets can be stored for single effects and complete rack settings.
All UI controllers could connected over jack midi via MIDI learn with
your external MIDI controllers.
Guitarix works on LINUX, FreeBSD, and MAC OSX
Installer (binary) package for MAC OSX is available here:
http://sourceforge.net/projects/guitarix/files/OSX/
This release comes with the following changes:
* fix new unsaved banks return no valid iter (GTK warning)
* add new nice dark-style rc-file
Guitarix is licensed under the GPL
Please refer to our project page for more information:
http://guitarix.sourceforge.net/
download site:
http://sourceforge.net/projects/guitarix/files
have fun
guitarix development team
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
linuxaudio.org will be down this Sunday, November 18, from 11:00 to
12:00 EST because our hosting provider is maintaining the storage system.
sorry for the inconvenience,
robin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBAgAGBQJQorDIAAoJEKCQvOAs9X8EzXwP/RWzKQdCIrOnn0P1G68PmjZK
NEkICVmYnuu/ul3C9gtsu/vXkeBrF2+kPo6KQRr2jhT2491UVCHZhnABRPBTbKU3
Yy4wRvk9AM1tHUdhEsOTWu3tyBvN03Crn6RAotpDw+1LBfHHQcjabRxQsYEBAglB
YMpSzxHvGrHU7b8yYQlpSQ4Ysro1lYHxzebY02qjpaU4nX49LtdkxSltL4AxXYSi
pO9RTrUVGfuwRCoMASmdDtcJxc2XepYs2UayDGst+aqikjYNm0VGL8m84HkBIbgs
ulhQOL8/XZyqTgsryr5uZ5pWQ+1ZBiOpkITXd0LaS3G8kcIvLTncuJsLxaPiWeZn
6eo5dIPIh+ttZOBYqWMJhY7YpgPEqakKHD+Ahkfzzo7oTreylt0Xk4HQZ+Wj+vtF
We3G/skhgcugtqHpF+o4AILCsmiSwYv51LRyq+y5gaOVYkjTFRx1p4v7sGQAzVVX
Bgn7tufO8FREGYctuCsXxaqLGwXV/aY2fXEDebk0lZxBBCut8aYcvgsQ79BU8udT
+H/CeSbmeS3QsbptdFsLrFSpPcD+x4Tumq/tfWEBOmw7uXhsp2weC2K6o/wOKmFg
W5mZ1nppGjp0qJtkHwP8Fo9iux0YLDCgL40FItrFSD1pOnACq292taylTpf3veCI
xWcGTyNEySpTHk3h1Djf
=Bydq
-----END PGP SIGNATURE-----
Dominique Michel:
>> That sounds simple. I'll try that.
>> You can also define your own keyboard configuration by editing
>> bin/keybindings.conf.
>> There are no functions available to show a section exclusively yet
>> though, but I'll
>> add it.
>
> I will be very interested by that. Radium is a great program, but it
> scale very badly on my 4:3 screen. The main problem for me is to be
> able to read the fonts, they look too small. If I make the font
> bigger,
> the radium window goes over the screen boundaries, and overlap on the
> next screen of the wm. So, I use a lot Ctrl-Alt-+ and Ctrl-Alt-- for
> now.
>
I don't quite understand what you do... Is Ctl-Alt-- and Ctrl-Alt-+ a
way
to access Keypad+ and Keypad-? (To change editor font size)
(You can also use F5/F6 to change font size)
Also, when you talk about the window going over the screen boundaries
when
changing font size, is it the system font size you are changing then?
(You
can set the system font size in ~/.radium/config). Because the window
size
should not increase if you change the editor font size.
You can also press Left Ctrl + m to automatically fit all tracks in the
visible area. Left Ctrl + m makes radium use two characters for
note names instead of three. Left Ctrl + t changes the note names into
a
visual representation instead of text.
> If I compare radium with another music editor I liked very much (back
> to my time with the Amiga), Music-X, the different parts of the
> program was on different superposed screens in the same window. I
> don't like tabs, they just eat vertical space. Bindings are better,
> or
> a small button somewhere in a corner.
>
> To have separated windows can be an alternative, but they are
> less efficient than key bindings.
>
I agree about that. I think the main problem is horizontal space, so
possible having one key that changes between only showing the editor
or only showing the mixer would work. Turning on/off the instrument
window
isn't that important.
Radium is an open source music editor with a novel interface.
It's inspired by trackers, but has fewer limitations and uses graphics
to show musical data.
Screenshot:
===========
http://dl.dropbox.com/u/4814054/radium-1.9.1.png
Source code:
============
http://dl.dropbox.com/u/4814054/radium-1.9.1.tar.gz
64 bit binary:
===============
http://dl.dropbox.com/u/4814054/radium-1.9.1_linux64.tar.gz
(Requires GNU libc 2.14 or newer. It should work with Ubuntu 12,
Fedora 17 or Mint 13)
Homepage:
=========
http://users.notam02.no/~kjetism/radium/
(It's not quite updated, I can't seem to login to the web server right
now.)
Source code repository:
=======================
https://github.com/kmatheussen/radium
Most important changes 0.67.1 -> 1.9.1:
=======================================
* Audio.
* A quick-to-use modular mixer. Jack ports can be inserted anywhere.
* VST plugins and instruments (native, not via wine)
* LADSPA
* Fluidsynth instrument
* 20 STK instruments. (Physical modelling)
* Sampler instrument (soundfiles, xi instruments, soundfonts)
* Multiband compressor
(http://users.notam02.no/~kjetism/radium/pictures/screenshot-multiband.png)
* Built-in filters and equalizers.
* Simple arpeggiator
* Drunk input velocity
* Various GUI improvements
* Pitch expand made available in the menues.
* Tapiir plugin
* Zita reverb plugin
* Demo song
* Reconfigured keybindings
* Various bug fixes
Acknowledgment:
===============
Full list: http://users.notam02.no/~kjetism/radium/development.php
Especially thanks to Yann Orlarey for Faust, Julius O. Smith III for
the Faust filter and compressor code and more, Romain Michon for the
Faust
STK instruments, Fons Adriaensen for the amazing Zita reverb sound
(and Julius O. Smith III for the Faust implemention of it),
and Rui Nuno Capela for QTractor. (Plugin GUI code are based on code
taken from QTractor.)
On 11.11.2012 12:00, Florian Paul Schmidt wrote:
> On 11/11/2012 11:43 AM, Kjetil Matheussen wrote:
>> On 11.11.2012 11:38, Florian Paul Schmidt wrote:
>>> Illegal instruction (core dumped)
>>
>> Does your cpu have sse instructions?
>> (Hmm, I guess all 64 bit cpus have that)
>>
>> I'll download ubuntu lts and install it in virtualbox. I tried the
>> non-lts
>> version of ubuntu 12, and that worked, but lts seems to use an
>> older version of Qt, and perhaps have other differences as well.
>>
> Ah, here we go. I was just being stupid:
>
Thank you!
It seems like floorf crashes on your machine. (although I'm not
entirely sure the line number is correct since it was compiled with
-O3)
Which CPU do you have?
And why does this happen?
Radium is compiled with "-O3 -mtune=generic -msse"
Shouldn't that make it run on all CPUs that have sse instructions?
> fps@olive:~/local/opt/radium64_dist$ gdb bin/radium bin/core
> GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
> Copyright (C) 2012 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show
> copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> For bug reporting instructions, please see:
> <http://bugs.launchpad.net/gdb-linaro/>...
> Reading symbols from
> /home/fps/local/opt/radium64_dist/bin/radium...done.
> [New LWP 13663]
> [New LWP 13666]
> [New LWP 13665]
> [New LWP 13667]
>
> warning: Can't read pathname for load map: Input/output error.
>
> warning: Could not load shared library symbols for 43 libraries, e.g.
> ./libgio-2.0.so.
> Use the "info sharedlibrary" command to see the complete listing.
> Do you need "set solib-search-path" or "set sysroot"?
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library
> "/lib/x86_64-linux-gnu/libthread_db.so.1".
> Core was generated by `./radium'.
> Program terminated with signal 4, Illegal instruction.
> #0 floorf (__x=<optimized out>) at
> /usr/include/bits/mathinline.h:228
> 228 /usr/include/bits/mathinline.h: No such file or directory.
> (gdb) bt
> #0 floorf (__x=<optimized out>) at
> /usr/include/bits/mathinline.h:228
> #1 Zita_dsp::instanceInit (this=0x7f8012d6c010, samplingFreq=48000,
> samplingFreq@entry=<error reading variable: Could not find type
> for DW_OP_GNU_const_type>) at audio/zita_rev.cpp:292
> #2 0x00000000004b007e in init (samplingFreq=<error reading variable:
> Could not find type for DW_OP_GNU_const_type>,
> this=<optimized out>) at audio/zita_rev.cpp:393
> #3 create_effect_plugin_data
> (plugin_type=plugin_type@entry=0x863ea0, plugin=plugin@entry=0x0,
> samplerate=48000,
> blocksize=blocksize@entry=1024) at audio/zita_rev.cpp:1073
> #4 0x00000000004b2ac0 in create_zita_rev_plugin () at
> audio/zita_rev.cpp:1239
> #5 0x0000000000563263 in PR_init_plugin_types () at
> audio/SoundPluginRegistry.cpp:267
> #6 0x0000000000568649 in MIXER_start () at audio/Mixer.cpp:472
> #7 0x000000000042de7d in InitProgram () at common/control.c:97
> #8 0x000000000045cd18 in radium_main (arg=arg@entry=0x7f803e60c52c
> "") at Qt/Qt_Main.cpp:389
> #9 0x000000000049e86f in init_radium (arg=0x7f803e60c52c "",
> gkf=0x7f803e546aa0) at api/api_common.c:61
> #10 0x000000000049e3cf in _wrap_init_radium (self=<optimized out>,
> args=<optimized out>) at api/radium_wrap.c:572
> #11 0x00000035a5edd0e1 in ?? ()
> #12 0x00007f8000000000 in ?? ()
> #13 0x0000000000000000 in ?? ()
> (gdb) thread apply all bt
>
> Thread 4 (Thread 0x7f8032509700 (LWP 13667)):
> #0 sem_timedwait () at
> ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S:102
> #1 0x00007f803dd4ebd2 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #2 0x00007f803dd3d6c9 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #3 0x00007f803dd3c217 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #4 0x0000000000568ce6 in Mixer::RT_thread (this=0x12a68d0) at
> audio/Mixer.cpp:385
> #5 0x0000000000568dd9 in Mixer::RT_rjack_thread (arg=<optimized
> out>) at audio/Mixer.cpp:424
> #6 0x00007f803dd3ac47 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #7 0x00007f803dd4e1b0 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #8 0x00007f803e261e9a in start_thread (arg=0x7f8032509700) at
> pthread_create.c:308
> #9 0x00007f803cf25cbd in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
> #10 0x0000000000000000 in ?? ()
>
> Thread 3 (Thread 0x7f8032621700 (LWP 13665)):
> #0 pthread_cond_wait@@GLIBC_2.3.2 () at
> ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
> #1 0x00007f803dd4f804 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #2 0x00007f803dd4adb1 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #3 0x00007f803dd4e1b0 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #4 0x00007f803e261e9a in start_thread (arg=0x7f8032621700) at
> pthread_create.c:308
> #5 0x00007f803cf25cbd in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
> #6 0x0000000000000000 in ?? ()
>
> Thread 2 (Thread 0x7f80325a0700 (LWP 13666)):
> #0 0x00007f803e268d2d in read () at
> ../sysdeps/unix/syscall-template.S:82
> #1 0x00007f803dd4ffba in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #2 0x00007f803dd52966 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #3 0x00007f803dd4e1b0 in ?? () from
> /usr/lib/x86_64-linux-gnu/libjack.so.0
> #4 0x00007f803e261e9a in start_thread (arg=0x7f80325a0700) at
> pthread_create.c:308
> #5 0x00007f803cf25cbd in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
> #6 0x0000000000000000 in ?? ()
>
> Thread 1 (Thread 0x7f803e648840 (LWP 13663)):
> #0 floorf (__x=<optimized out>) at
> /usr/include/bits/mathinline.h:228
> #1 Zita_dsp::instanceInit (this=0x7f8012d6c010, samplingFreq=48000,
> samplingFreq@entry=<error reading variable: Could not find type
> for DW_OP_GNU_const_type>) at audio/zita_rev.cpp:292
> #2 0x00000000004b007e in init (samplingFreq=<error reading variable:
> Could not find type for DW_OP_GNU_const_type>,
> this=<optimized out>) at audio/zita_rev.cpp:393
> #3 create_effect_plugin_data
> (plugin_type=plugin_type@entry=0x863ea0, plugin=plugin@entry=0x0,
> samplerate=48000,
> blocksize=blocksize@entry=1024) at audio/zita_rev.cpp:1073
> #4 0x00000000004b2ac0 in create_zita_rev_plugin () at
> audio/zita_rev.cpp:1239
> #5 0x0000000000563263 in PR_init_plugin_types () at
> audio/SoundPluginRegistry.cpp:267
> #6 0x0000000000568649 in MIXER_start () at audio/Mixer.cpp:472
> #7 0x000000000042de7d in InitProgram () at common/control.c:97
> #8 0x000000000045cd18 in radium_main (arg=arg@entry=0x7f803e60c52c
> "") at Qt/Qt_Main.cpp:389
> #9 0x000000000049e86f in init_radium (arg=0x7f803e60c52c "",
> gkf=0x7f803e546aa0) at api/api_common.c:61
> #10 0x000000000049e3cf in _wrap_init_radium (self=<optimized out>,
> args=<optimized out>) at api/radium_wrap.c:572
> #11 0x00000035a5edd0e1 in ?? ()
> #12 0x00007f8000000000 in ?? ()
> #13 0x0000000000000000 in ?? ()
> (gdb)
Hello all,
I'm working on a little app utilizing 'lasound' and I've got bassically
what I want. However, somewhere there is a fault. Editing a random
variable causes a segmentation fault. I've tried gdb but except it
telling me where the application crashed (which I already knew) I did
not get anything useful out of it. To minimize my own potential errors I
have here below the example script from where I started (though I have
removed some unnecessary stuff) and commented out the 'long *outvl' and
'*outvl = -1'. Uncommenting, compile, and run this and I get a
segmentation fault.
The original script is available at the following link:
http://stackoverflow.com/questions/7657624/get-master-sound-volume-in-c-in-…
Can someone tell me where this is going wrong?
Thanks in advance, Maarten
#include <unistd.h>
#include <fcntl.h>
#include <alsa/asoundlib.h>
/*
Drawbacks. Sets volume on both channels but gets volume on one. Can be
easily adapted.
*/
int audio_volume(long* outvol)
{
snd_mixer_t* handle;
snd_mixer_elem_t* elem;
snd_mixer_selem_id_t* sid;
static const char* mix_name = "Fake";
static const char* card = "default";
static int mix_index = 0;
// long *outvl;
// *outvl = -1;
int ret = 0;
long pmin, pmax;
snd_mixer_selem_id_alloca(&sid);
//sets simple-mixer index and name
snd_mixer_selem_id_set_index(sid, mix_index);
snd_mixer_selem_id_set_name(sid, mix_name);
if ((snd_mixer_open(&handle, 0)) < 0)
return -1;
if ((snd_mixer_attach(handle, card)) < 0) {
snd_mixer_close(handle);
return -2;
}
if ((snd_mixer_selem_register(handle, NULL, NULL)) < 0) {
snd_mixer_close(handle);
return -3;
}
ret = snd_mixer_load(handle);
if (ret < 0) {
snd_mixer_close(handle);
return -4;
}
elem = snd_mixer_find_selem(handle, sid);
if (!elem) {
snd_mixer_close(handle);
return -5;
}
long minv, maxv;
snd_mixer_selem_get_playback_volume_range (elem, &minv, &maxv);
fprintf(stderr, "Volume range <%i,%i>\n", minv, maxv);
if(snd_mixer_selem_get_playback_volume(elem, 0, outvol) < 0) {
snd_mixer_close(handle);
return -6;
}
fprintf(stderr, "Get volume %i with status %i\n", *outvol, ret);
/* make the value bound to 100 */
*outvol -= minv;
maxv -= minv;
minv = 0;
*outvol = 100 * (*outvol) / maxv; // make the value bound from 0
to 100
snd_mixer_close(handle);
return 0;
}
int main(void)
{
long vol = -1;
printf("Ret %i\n", audio_volume(&vol));
return 0;
}