* A Minimal Playback Program does't work on my system
@ 2014-08-14 16:42 Carpon frédéric
2014-08-14 16:44 ` Michael Trimarchi
2014-08-14 17:34 ` Clemens Ladisch
0 siblings, 2 replies; 8+ messages in thread
From: Carpon frédéric @ 2014-08-14 16:42 UTC (permalink / raw)
To: alsa-devel@alsa-project.org
Hello,
I am new
System : Raspberry
Linux: ArchLinuxArm
I would like to run this exemple of A Minimal Playback Program from here : Howto use the ALSA API
from the page Tutorials for application developers but there is a bug :
i have done
> pacman -sy
> pacman -s alsa-utils
to install the last alas-utils
done gcc exemple.c -lasound (warning comes)
and ./a.out my_file.wav
and the result is :
"AlSA lib pcm.2239:(and_pcm_open_noupdate) Unknown PCM my_file.wav "
cannot open audio device my_file.wav (No such file or directory)
Can you help me please ?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A Minimal Playback Program does't work on my system
2014-08-14 16:42 A Minimal Playback Program " Carpon frédéric
@ 2014-08-14 16:44 ` Michael Trimarchi
2014-08-14 17:34 ` Clemens Ladisch
1 sibling, 0 replies; 8+ messages in thread
From: Michael Trimarchi @ 2014-08-14 16:44 UTC (permalink / raw)
To: Carpon frédéric; +Cc: alsa-devel@alsa-project.org
Hi
On Thu, Aug 14, 2014 at 6:42 PM, Carpon frédéric
<frederic.carpon@yahoo.fr> wrote:
> Hello,
>
> I am new
>
> System : Raspberry
> Linux: ArchLinuxArm
>
> I would like to run this exemple of A Minimal Playback Program from here : Howto use the ALSA API
> from the page Tutorials for application developers but there is a bug :
> i have done
>> pacman -sy
>> pacman -s alsa-utils
> to install the last alas-utils
> done gcc exemple.c -lasound (warning comes)
> and ./a.out my_file.wav
> and the result is :
> "AlSA lib pcm.2239:(and_pcm_open_noupdate) Unknown PCM my_file.wav "
> cannot open audio device my_file.wav (No such file or directory)
>
I don't see the code, btw. Have you tested on a desktop?
Michael
>
> Can you help me please ?
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A Minimal Playback Program does't work on my system
2014-08-14 16:42 A Minimal Playback Program " Carpon frédéric
2014-08-14 16:44 ` Michael Trimarchi
@ 2014-08-14 17:34 ` Clemens Ladisch
1 sibling, 0 replies; 8+ messages in thread
From: Clemens Ladisch @ 2014-08-14 17:34 UTC (permalink / raw)
To: Carpon frédéric, alsa-devel@alsa-project.org
Carpon frédéric wrote:
> ./a.out my_file.wav
> "AlSA lib pcm.2239:(and_pcm_open_noupdate) Unknown PCM my_file.wav "
The parameter must be a sound device name (like "default").
Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* A minimal playback program does't work on my system
@ 2014-08-15 17:19 Carpon frédéric
2014-08-15 17:31 ` Michael Trimarchi
2014-08-16 0:36 ` Joël Krähemann
0 siblings, 2 replies; 8+ messages in thread
From: Carpon frédéric @ 2014-08-15 17:19 UTC (permalink / raw)
To: alsa-devel@alsa-project.org
Hello,
Yesterday i have written.
I answer to everybody. I am new and I don't know if there is special rule.
Note : It would be good to have a forum to see the messages and answers in a pretty form.
the programme in c comes from
http://equalarea.com/paul/alsa-audio.html
you can download it at
https://mon-partage.fr/f/uvyw39wo/
To answer to Michael i have sound in my HDMI with that :
>speaker-test -c2 -D hw:0,0
so i did that
>gcc -o minimal_playback minimal_playback.c -lasound (warning comes)
and
>./minimal_playback "plughw:0,0"
and i have this result :
>Error of segmentation
Where i can an exemple with the possibility to do something like that :
>./minimal_playback "plughw:0,0" "mywave.wav"
Thank you for your help
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A minimal playback program does't work on my system
2014-08-15 17:19 A minimal playback program does't work on my system Carpon frédéric
@ 2014-08-15 17:31 ` Michael Trimarchi
2014-08-16 11:50 ` Michael Trimarchi
2014-08-16 0:36 ` Joël Krähemann
1 sibling, 1 reply; 8+ messages in thread
From: Michael Trimarchi @ 2014-08-15 17:31 UTC (permalink / raw)
To: Carpon frédéric; +Cc: alsa-devel
Hi
Il 15/ago/2014 19:20 "Carpon frédéric" <frederic.carpon@yahoo.fr> ha
scritto:
>
> Hello,
>
> Yesterday i have written.
> I answer to everybody. I am new and I don't know if there is special
rule.
> Note : It would be good to have a forum to see the messages and answers
in a pretty form.
>
> the programme in c comes from
>
> http://equalarea.com/paul/alsa-audio.html
> you can download it at
> https://mon-partage.fr/f/uvyw39wo/
>
> To answer to Michael i have sound in my HDMI with that :
> >speaker-test -c2 -D hw:0,0
>
> so i did that
> >gcc -o minimal_playback minimal_playback.c -lasound (warning
comes)
> and
> >./minimal_playback "plughw:0,0"
> and i have this result :
> >Error of segmentation
>
> Where i can an exemple with the possibility to do something like that :
> >./minimal_playback "plughw:0,0" "mywave.wav"
>
aplay source code
I ask to test your small program on PC. Now I don't know about segmentation
fault and I'm answering using mobile now. I will check tomorrow
Michael
>
> Thank you for your help
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A minimal playback program does't work on my system
2014-08-15 17:19 A minimal playback program does't work on my system Carpon frédéric
2014-08-15 17:31 ` Michael Trimarchi
@ 2014-08-16 0:36 ` Joël Krähemann
1 sibling, 0 replies; 8+ messages in thread
From: Joël Krähemann @ 2014-08-16 0:36 UTC (permalink / raw)
To: Carpon frédéric; +Cc: alsa-devel@alsa-project.org
On Fri, 2014-08-15 at 18:19 +0100, Carpon frédéric wrote:
> Hello,
>
> Yesterday i have written.
> I answer to everybody. I am new and I don't know if there is special rule.
> Note : It would be good to have a forum to see the messages and answers in a pretty form.
>
> the programme in c comes from
>
> http://equalarea.com/paul/alsa-audio.html
> you can download it at
> https://mon-partage.fr/f/uvyw39wo/
>
> To answer to Michael i have sound in my HDMI with that :
> >speaker-test -c2 -D hw:0,0
>
> so i did that
> >gcc -o minimal_playback minimal_playback.c -lasound (warning comes)
> and
> >./minimal_playback "plughw:0,0"
> and i have this result :
> >Error of segmentation
>
> Where i can an exemple with the possibility to do something like that :
> >./minimal_playback "plughw:0,0" "mywave.wav"
>
>
> Thank you for your help
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Probably you want to use a library that does type and endianes
conversion like:
http://www.mega-nerd.com/libsndfile/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A minimal playback program does't work on my system
2014-08-15 17:31 ` Michael Trimarchi
@ 2014-08-16 11:50 ` Michael Trimarchi
2014-08-16 11:52 ` Michael Trimarchi
0 siblings, 1 reply; 8+ messages in thread
From: Michael Trimarchi @ 2014-08-16 11:50 UTC (permalink / raw)
To: Carpon frédéric; +Cc: alsa-devel@alsa-project.org
Hi
On Fri, Aug 15, 2014 at 7:31 PM, Michael Trimarchi
<michael@amarulasolutions.com> wrote:
> Hi
>
> Il 15/ago/2014 19:20 "Carpon frédéric" <frederic.carpon@yahoo.fr> ha
> scritto:
>
>
>>
>> Hello,
>>
>> Yesterday i have written.
>> I answer to everybody. I am new and I don't know if there is special rule.
>> Note : It would be good to have a forum to see the messages and answers in
>> a pretty form.
>>
>> the programme in c comes from
>>
>> http://equalarea.com/paul/alsa-audio.html
>> you can download it at
>> https://mon-partage.fr/f/uvyw39wo/
>>
>> To answer to Michael i have sound in my HDMI with that :
>> >speaker-test -c2 -D hw:0,0
>>
>> so i did that
>> >gcc -o minimal_playback minimal_playback.c -lasound (warning
>> > comes)
>> and
>> >./minimal_playback "plughw:0,0"
>> and i have this result :
>> >Error of segmentation
>>
if ((err = snd_pcm_hw_params_set_rate_near (playback_handle,
hw_params, 44100, 0)) < 0) {
fprintf (stderr, "cannot set sample rate (%s)\n",
snd_strerror (err));
exit (1);
}
>> Where i can an exemple with the possibility to do something like that :
>> >./minimal_playback "plughw:0,0" "mywave.wav"
>>
>
> aplay source code
>
> I ask to test your small program on PC. Now I don't know about segmentation
> fault and I'm answering using mobile now. I will check tomorrow
>
> Michael
>
>>
>> Thank you for your help
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
--
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO - Founder Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
| [`as] http://www.amarulasolutions.com |
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A minimal playback program does't work on my system
2014-08-16 11:50 ` Michael Trimarchi
@ 2014-08-16 11:52 ` Michael Trimarchi
0 siblings, 0 replies; 8+ messages in thread
From: Michael Trimarchi @ 2014-08-16 11:52 UTC (permalink / raw)
To: Carpon frédéric; +Cc: alsa-devel@alsa-project.org
Hi
hate gmail
On Sat, Aug 16, 2014 at 1:50 PM, Michael Trimarchi
<michael@amarulasolutions.com> wrote:
> Hi
>
> On Fri, Aug 15, 2014 at 7:31 PM, Michael Trimarchi
> <michael@amarulasolutions.com> wrote:
>> Hi
>>
>> Il 15/ago/2014 19:20 "Carpon frédéric" <frederic.carpon@yahoo.fr> ha
>> scritto:
>>
>>
>>>
>>> Hello,
>>>
>>> Yesterday i have written.
>>> I answer to everybody. I am new and I don't know if there is special rule.
>>> Note : It would be good to have a forum to see the messages and answers in
>>> a pretty form.
>>>
>>> the programme in c comes from
>>>
>>> http://equalarea.com/paul/alsa-audio.html
>>> you can download it at
>>> https://mon-partage.fr/f/uvyw39wo/
>>>
>>> To answer to Michael i have sound in my HDMI with that :
>>> >speaker-test -c2 -D hw:0,0
>>>
>>> so i did that
>>> >gcc -o minimal_playback minimal_playback.c -lasound (warning
>>> > comes)
>>> and
>>> >./minimal_playback "plughw:0,0"
>>> and i have this result :
>>> >Error of segmentation
>>>
>
> if ((err = snd_pcm_hw_params_set_rate_near (playback_handle,
> hw_params, 44100, 0)) < 0) {
> fprintf (stderr, "cannot set sample rate (%s)\n",
> snd_strerror (err));
> exit (1);
> }
The error is how this function is called. Just change from
snd_pcm_hw_params_set_rate_near
to
snd_pcm_hw_params_set_rate
let the example compile without warning
gcc playback.c `pkg-config --cflags --libs alsa` -o playback
./playback plughw:0,0
This example take some byte not initialized on the stack so it's not
what you want. If you increase
the loop from 10 to 1024 you have a nice noise
Michael
>
>
>
>
>
>>> Where i can an exemple with the possibility to do something like that :
>>> >./minimal_playback "plughw:0,0" "mywave.wav"
>>>
>>
>> aplay source code
>>
>> I ask to test your small program on PC. Now I don't know about segmentation
>> fault and I'm answering using mobile now. I will check tomorrow
>>
>> Michael
>>
>>>
>>> Thank you for your help
>>> _______________________________________________
>>> Alsa-devel mailing list
>>> Alsa-devel@alsa-project.org
>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>
>
> --
> | Michael Nazzareno Trimarchi Amarula Solutions BV |
> | COO - Founder Cruquiuskade 47 |
> | +31(0)851119172 Amsterdam 1018 AM NL |
> | [`as] http://www.amarulasolutions.com |
--
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO - Founder Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
| [`as] http://www.amarulasolutions.com |
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-08-16 11:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15 17:19 A minimal playback program does't work on my system Carpon frédéric
2014-08-15 17:31 ` Michael Trimarchi
2014-08-16 11:50 ` Michael Trimarchi
2014-08-16 11:52 ` Michael Trimarchi
2014-08-16 0:36 ` Joël Krähemann
-- strict thread matches above, loose matches on Subject: below --
2014-08-14 16:42 A Minimal Playback Program " Carpon frédéric
2014-08-14 16:44 ` Michael Trimarchi
2014-08-14 17:34 ` Clemens Ladisch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.