Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 58
  1. #11
    I tried to look through the active processes for anything that would involve pulseaudio. I tried "ps aux | grep pulse" and "ps aux | grep pa" and found nothing. I also shut down ecasound, the squeezeboxserver, and squeezelite. I can record a .wav file fine with arecord. However, the issue still occurs when I try to use WaveInput. Do you know of any other processes that could interfere with the audio? Do you know if I might have missed a pulseaudio process? My only other thought is to mess with the ALSA mixer. See if the audio is getting mixed somehow at the output. The documentation for how the Wolfson card is modified by the alsamixer seems to be lacking though, so this could be quite a bit of trial and error.

    I need to record the audio at a high bit rate using a lossless format like .wav or .flac, so the .mp3 solution wouldn't work for my purposes. Also, I have had a real headache trying to get pulseaudio working with my Pi's before, so I'd try to avoid that if possible. If the mixer thing doesn't pan out though, I may have to go that route.

    Cheers,

    Michael

  2. #12
    Also, I just want to understand the custom-convent.conf file. Excuse the lack of Linux knowledge coming up here:

    1. Why is there one section each for PCM, mp3, and flac? Do they all need to be there or can I comment some of it out?
    2. The "# R" before the PCM arecord function is just a comment doesn't have a functional role, yes?
    3. Why are there brackets around "arecord" instead of just writing "arecord"?
    4. Is there any section I should need to modify in this file to get make it functional? It's currently unmodified from when I got the plugin.

    Thanks,

    Michael

  3. #13
    Also, is there a way to tell if my client unit is receiving the audio stream even if it's outputting no audio?

    Cheers,

    Michael

  4. #14
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,913
    Quote Originally Posted by mike_b16 View Post
    Also, I just want to understand the custom-convent.conf file. Excuse the lack of Linux knowledge coming up here:

    1. Why is there one section each for PCM, mp3, and flac? Do they all need to be there or can I comment some of it out?
    2. The "# R" before the PCM arecord function is just a comment doesn't have a functional role, yes?
    3. Why are there brackets around "arecord" instead of just writing "arecord"?
    4. Is there any section I should need to modify in this file to get make it functional? It's currently unmodified from when I got the plugin.
    The custom-convert.conf file overrides and augments settings in the main covert.conf file and has the same format of the convert.conf file. If you look at LMS convert.conf file in main LMS top level directory you'll see a full explanation of the file format.

    Answering your questions (but you read the convert,conf file for completeness)

    1. There are 3 sections as they provide conversion rules for LMS to handle all types of player and settings. LMS can then choose the best format for the player according to settings (e.g. if you have a Touch - Flac conversion will be used but if bit rate limiting has been enabled for the player then the MP3 cxonversion will be chose). You can omit sections that you think will nto be used but if you forget this and later change a FileType setting for instance you may be puzzled when no audio is heard.

    2. The "# R" is significant and LMS is very picky about formatting. The R indicates a Remote stream which is what Waveinput plugin is emulating (F would be a File) - see convert,.conf file for full details

    3. Square brackets indicate it is an executable which should be found in the LMS Bin directory and LMS will replace with full path. No brackets and I think LMS will not find the executable and hence not be able to run the conversion.

    4. You should nto need to alter this if you have an arecord command line that works - the significant parameters should be passed through the wavin: URL.

    What is the full "arecord" command line have you found records the audio output ?

  5. #15
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,913
    Quote Originally Posted by mike_b16 View Post
    Also, is there a way to tell if my client unit is receiving the audio stream even if it's outputting no audio?
    Enable logging.

  6. #16
    Thanks for the answers. I'll parse through the LMS convert.conf file right after I answer your question.

    I can record from the command line using a few commands:

    arecord -D hw:0 -c 2 -r 44100 -f S16_LE example_file.wav (rate and format can change without problems)
    arecord -D default -c 2 -r 44100 -f S16_LE example_file.wav
    arecord -d 0 -D default -c 2 -r 44100 -f S16_LE example_file.wav
    arecord -D hw:0 -c 2 -r 44100 -f S16_LE | aplay (if I want to pipe the output to aplay)

    I also tried change the filetype in the pcm portion of custom-convert.conf to a wav (-t wav) with the same results. If you're saying LMS is picky with the formatting I can change it back.

    Thanks,

    Michael

  7. #17
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,913
    Quote Originally Posted by mike_b16 View Post
    I also tried change the filetype in the pcm portion of custom-convert.conf to a wav (-t wav) with the same results. If you're saying LMS is picky with the formatting I can change it back.
    Basically LMS will create a process using the command line created using the "template from the convert.conf file. LMS will then assume the output from the process (i.e. stdout) is either PCM, MP3 or Flac depending on which line has been used. A 44.1/16 WAV audio stream is the same as a LMS PCM except there is a header in WAV at the start. IIRC whether the WAV header is interpreted or played as a PCM sample will depend on the player's audio decoder. Unless you are using a SB1 - I'd advise using the Flac stream as that as LMS expects a Flac header which means audio format of stream is part of the stream.

    In the WAV header there is a length field. A stream is considered to have no length so I'm not sure what "arecord" would put into the length field in the WAV header and so you might get odd problems depending on player (e.g. player stops after approx 3hr20min which is max length of 44.1/16 WAV file)

    The MP3 and Flac line have "-t wav" because the relevant encoder lame/flac reads the WAV header created by "arecord" (which had audio format info) and copies it over to the MP3 or Flac header as appropriate. Since PCM stream has no header the PCM line should have "-t raw"

    The plugin takes the complte "wavin:" URL and removes the "wavin:" part and LMS then uses remainder as the value for $FILE$ in the conf file line. So a wavin:default URL would change a "-D $FILE$" into "-D default"

    For ALSA device specs I suggest always use 2 digits i.e. hw:0,0 and not just hw:0 - as you cannot be sure what ALSA might pick for 2nd param.

  8. #18
    I have been somewhat successful!

    After going with the solution in post 47 of this thread (the snd-aloop method) and overclocking my Pi's, I was able to play the stream with no problems to my clients. I essentially used arecord to grab my line in (with -D hw:0) and then pipe it to the virtual soundcard with the syntax "aplay -D hw:2,0"

    So I'm about halfway to my solution with this. Now, I just need to bring the audio recording/streaming up to 24 bits and 192 kHz sampling. However, if I try to set my format to S24_LE in the command line "arecord", it complains that it is not an acceptable format for aplay. When I change it to S32_LE, it apparently records fine. Then, I record from the looped soundcard and play it back on hw:0 and it plays fine out of my speakers (so I know the audio is recording/playing correctly). However, when I try to use the plugin in LMS, no sound comes out, and it goes from the pause icon back to the play icon after a few seconds. When I change the sample format back to S16_LE, it works fine. Same thing happens when I try to edit the format in the custom-convert.conf file. If I set it at S24_LE or S32_LE, the plugin responds the same way as I described before. I can modify the sample rate though with no issue (I have set it as high as 192 kHz with no problems). Does anyone have any ideas?

    To be explicit, I'll write out the commands I use/procedure I use below:

    1. I type the statement "arecord -d0 -c2 -r44100 -fS16_LE -D hw:0 | aplay -D hw:2,0" into the terminal
    2. I then use the favorite I named "Stream" with the URL "wavin:hw:2,1"
    3. I get playback on my devices
    4. If I change the "-f" field to S24_LE, I get an "aplay: set_params:1081: Sample format non available" error. However, I can definitely record and playback on my hw:0 card with S24_LE
    5. If I change that "-f" field to S32_LE, it doesn't complain anymore
    6. If I then use arecord -d0 -c2 -r44100 -fS32_LE -D hw:2,1 | aplay -D hw:0", I hear the music I'm recording play back out of my speakers fine.
    7. When I use the WaveInput plugin, the button goes back to play a second or two after I push it
    8. Changing settings in the custom-convert.conf file provides the same results

    I tried to check the log, but I see nothing unusual come up when I use the plugin. Just doesn't work.

    Any ideas? Also, thanks for all of the help so far bpa. It's gotten me this far?

    Cheers,

    Michael

  9. #19
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,913
    Quote Originally Posted by mike_b16 View Post
    Any ideas? Also, thanks for all of the help so far bpa. It's gotten me this far?
    You're doing a lot of work generating a PCM stream that is not 44.1kHz/16 but I have a feeling that you need tell LMS the stream format before you start stream audio data so that LMS know whether the player can play it the stream native or whether some processing is needed (e.g. if play is Sb3 and stream is 192kHz - LMS needs to set up resampling). So I think the plugin needs modification for non 44.1khz / 16 bit streams and offhand I do not know what needs to be changed.

  10. #20
    Quote Originally Posted by bpa View Post
    So I think the plugin needs modification for non 44.1khz / 16 bit streams and offhand I do not know what needs to be changed.
    Would you have an idea of where to start looking or a direction you could point me in? Getting 24/192 out of this stream was quite important here, as it was my goal from the beginning.

    Thanks,

    Michael

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •