[Alsa-user] regarding dmix plugin

2017-05-07 Thread remu kelly
Hi,


Is it possible to have another plugin to place after dmix plugin.:-

input -> some plugin -> dmix plugin -> one more plugin -> hw


Regards,
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Alsa-user] Using a USB serial device as a MIDI source

2017-05-07 Thread Bill Purvis
I'm currently working on an Arduino-based project which generates MIDI 
output.
Under Linux it appears as a /dev/ttyUSB?. How can I persuade ALSA to 
treat it as a MIDI
source (and possibly destination).

Bill

-- 
++
| Bill Purvis|
| email: b...@billp.org  |
++


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Alsa-user] regarding rate plugin

2017-05-07 Thread remu kelly
Hi ,

I am trying to create a new "rate_converter". for start i am trying to
create a empty converter, but facing below error:
---
Playing WAVE '/home/Test.wav' : Signed 16 bit Little Endian, Rate 48000 Hz,
Stereo
aplay: set_params:1297: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 48000
PERIOD_TIME: (21333 21334)
PERIOD_SIZE: NONE
PERIOD_BYTES: (4092 4100)
PERIODS: (3 5)
BUFFER_TIME: (85333 85334)
BUFFER_SIZE: 4096
BUFFER_BYTES: 16384
TICK_TIME: ALL
---

The asound conf is something like below(here 'rateconvtest' is the
converter created by me):-
---
pcm.sl1 {
type hw
card 0
device 0
}
pcm_slave.sl2 {
pcm sl1
rate 96000
}
pcm.rchg {
type rate
slave sl2
converter "rateconvtest"
}
-

command used is "aplay -vD rchg /home/Test.wav".

the code of the rate converter i have created is like this:-


#include 
#include 
#include 

static snd_pcm_uframes_t input_frames(void *obj, snd_pcm_uframes_t frames) {
printf("\nrate in frame callback %d\n", frames);
return frames ;
}

static snd_pcm_uframes_t output_frames(void *obj, snd_pcm_uframes_t frames)
{
printf("\nrate out frame callback %d\n", frames );
return (snd_pcm_uframes_t)(frames * 2);
}

static void pcm_src_free(void *obj) {
}

static int pcm_src_init(void *obj, snd_pcm_rate_info_t *info) {
printf("\n rate init rate in = %d rate out = %d\n", info->in.rate,
info->out.rate);
return 0;
}

static int pcm_src_adjust_pitch(void *obj, snd_pcm_rate_info_t *info) {
printf("\n rate pitch rate = %d\n", info->in.rate);
return 0;
}

static void pcm_src_reset(void *obj) {
printf("\n rate reset \n");
}

static void pcm_src_convert_s16(void *obj, int16_t *dst, unsigned int
dst_frames, const int16_t *src, unsigned int src_frames) {

unsigned int count = src_frames;

printf("\n rate in s16 convert srcfrm = %d dst frm = %d \n",
src_frames, dst_frames);
memcpy(dst, src, count );
memcpy(dst + count, src, count );
}

static void pcm_src_close(void *obj) {
 printf("\n rate close success\n");
}

#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
static int get_supported_rates(void *obj, unsigned int *rate_min, unsigned
int *rate_max) {
*rate_min = *rate_max = 0; /* both unlimited */
 printf("\n rate supoort rate success\n");
return 0;
}

static void dump(void *obj, snd_output_t *out) {
snd_output_printf(out, "Converter: lib-ratetest\n");
}
#endif

static snd_pcm_rate_ops_t pcm_src_ops = {
.close = pcm_src_close,
.init = pcm_src_init,
.free = pcm_src_free,
.reset = pcm_src_reset,
.adjust_pitch = pcm_src_adjust_pitch,
.convert_s16 = pcm_src_convert_s16,
.input_frames = input_frames,
.output_frames = output_frames,
#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
.version = SND_PCM_RATE_PLUGIN_VERSION,
.get_supported_rates = get_supported_rates,
.dump = dump,
#endif
};

static int pcm_src_open(unsigned int version, snd_pcm_rate_ops_t *ops) {
printf("\n rate  OPEN \n");

#if SND_PCM_RATE_PLUGIN_VERSION < 0x010002
if (version != SND_PCM_RATE_PLUGIN_VERSION) {
fprintf(stderr, "Invalid rate plugin version %x\n", version);
return -EINVAL;
}
#endif

#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
if (version == 0x010001)
memcpy(ops, _src_ops, sizeof(snd_pcm_rate_old_ops_t));
else
#endif
*ops = pcm_src_ops;
printf("\n rate OPEN complete\n");
return 0;
}

int SND_PCM_RATE_PLUGIN_ENTRY(ratehardsp) (unsigned int version, void
**objp, snd_pcm_rate_ops_t *ops) {
printf("\n rate ENTRY \n");
*objp = NULL;
return pcm_src_open(version, ops);
}



So , including all the printf statements, that i have added in my code, the
actual output looks like this:-

rate ENTRY

 rate  OPEN

 rate OPEN complete

 rate supoort rate success
Playing WAVE '/home/Test.wav' : Signed 16 bit Little Endian, Rate 48000 Hz,
Stereo
aplay: set_params:1297: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 48000
PERIOD_TIME: (21333 21334)
PERIOD_SIZE: NONE
PERIOD_BYTES: (4092 4100)
PERIODS: (3 5)
BUFFER_TIME: (85333 85334)
BUFFER_SIZE: 4096
BUFFER_BYTES: 16384
TICK_TIME: ALL

 rate close success
-


>From above i see that call went successful till the ".get_supported_rates =
get_supported_rates", is the definition of function "get_supported_rates()"
is wrong? OR do i need to look at something else. I am using UBUNTU 16.04
for the development purpose.

please help me.
--

Re: [Alsa-user] Help with Mic on Dell M4700

2017-05-07 Thread Paul Menzel


signature.asc
Description: This is a digitally signed message part
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Help with Mic on Dell M4700

2017-05-07 Thread Paul Menzel
Dear Jason,


Am Mittwoch, den 03.05.2017, 15:20 +1000 schrieb Jason Harrop:
> I've got a Dell M4700 running Ubuntu linux 16.04, and the latest ALSA
> driver, but I can't get the internal microphone to work.  I did have a USB
> mic working, but not any more it seems...

[…]

First the obvious, did you make sure, the microphone is not muted?

Have you tried a newer software stack? As you already use Ubuntu, you
could give Ubuntu 17.04 a try. Any other GNU/Linux distribution as
Fedora or Debian also work, and provide live images. You can prepare a
USB storage medium, and boot your system from it, without having to
install it.

If the problem persists, please contact the list alsa-devel, and also
report an issue to the Ubuntu bug tracker [1].


Thanks,

Paul


[1] https://wiki.ubuntu.com/DebuggingSoundProblems

signature.asc
Description: This is a digitally signed message part
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user