Close
0%
0%

Car Audio Player

An inexpensive audio player with a simplified interface to make driving safer.

Similar projects worth following
I wanted to make an audio player for my wife's car. The requirements are that it needs to have decent audio (doesn't have to be great), a simple interface that doesn't make driving more dangerous, and a low price point. The original idea was to make it voice controlled, but the lack of accurate speech recognition while music is playing made that impractical. Instead, I added a cheap touchscreen and will make a simple GUI. This project leaves things open enough to allow adding more features some day, like ODBII connection or GPS navigation.

I started with a Raspberry Pi 2B, and a small USB microphone. I tried using the Jasper project to make the unit voice controlled but soon realized that the speech recognition doesn't work very well in a noisy car when the music is playing. I also found out that the on-board audio jack uses PWM so the audio quality is just miserable.

The next version is what I'm working with now. It's a Raspberry Pi 2B with a Plugable USB audio adapter and a Kookye 3.5" touchscreen with a case. The audio adapter isn't audiophile quality, but it meets my price requirements and it's decent enough quality where my wife won't notice the difference in her Dodge Caravan. The touchscreen is pretty low quality. If I do this project again, I would consider spending a little more money on a better touchscreen.

The touchscreen I got doesn't have normal drivers from what I can tell. Instead, they give you a disk image to flash to the Pi. I opted for the Raspbian Jessie image. From what I can tell, the drivers make it so the touchscreen is treated as a mouse instead of a touchscreen. Kind of annoying, but not that big of a deal for me.

  • 1 × Raspberry Pi 2B The brain of the project.
  • 1 × Plugable USB Audio Adapter With 3.5mm headphone and microphone jacks
  • 1 × Kookye 3.5" Touchscreen With transparent case

  • Javascript Fun

    Jeremy10/31/2016 at 18:59 0 comments

    I'm getting there...

    I have a UI that functions, mostly.

    It's one container DIV with 9 smaller DIVs inside. Three rows: Artists, Albums, and Songs. Three columns: Previous, Current, and Next.

    The touchscreen (still crap) is not very sensitive. Here's how the interface will work. When you touch the screen (mousedown) it starts keeping track of your finger movements (mousemove). If you slide in any direction more than the minimum threshold, the UI starts responding by sliding the container DIV. It locks the movement so if you move horizontally beyond the threshold first, then only horizontal movement is allowed. Same for vertical. When you lift your finger (mouseup), it first checks how far you went from your start. If the distance is over a second threshold, it assumes a swipe in that direction and finishes the animation, then calls the associated actions. If the distance is over the movement threshold, but under the second threshold, it animates back to where you started, then does nothing. If your movement wasn't even enough to trigger the initial movement threshold, then it's considered a tap, which means it doesn't animate, but triggers the play/pause action. This lets you do a partial swipe to see what the next song/album/artist is without forcing you to go to the next song/album/artist unless you want to.

    I still need to set up the next/previous actions. I also want to update the UI to show which song is playing, how much time, etc. MPD remembers where you left off if you power down without a proper command. That means you don't have to start over every time you turn it off and back on. Much better user experience.

    I also need to format the info. Right now it's bare bones and looks like crap. Then again, making things pretty has never been my specialty.

    For anyone following this project, I will upload source files once it's ready.

  • Failed Interfaces

    Jeremy10/25/2016 at 19:43 0 comments

    If I haven't said this before, I'll say it now. I'm not the smartest person out there. If a project doesn't have some good documentation, I might not be able to figure it out. MPD has some API/interface projects out there, but most of them are fairly confusing for a simple man like me.

    I tried MPD Web Remote by Thomas Preston. It worked fine, but the interface was too cluttered for a crappy touchscreen. I want the UI to be as easy as the car stereo. On top of that, the touchscreen isn't very accurate so you can easily tap the wrong button if the buttons are small. I could try reusing code, but sometimes it's easier to create than reverse engineer enough to reuse.

    I also tried Mipod, which is a REST API (or websocket if you want) for MPD. It required node.js, which I have never used before. It took a bit to set up. I had to have Mipod listen on a different port so it didn't conflict with Apache. I didn't think the documentation showed how to use the commands well. One of the commands supposedly required a POST method, but I could only get it to work using the GET method.

    Ultimately, I decided against using these APIs for various reasons. The UI I want is basically a swipe-based UI. You start on the Artist level. Swipe left or right to select the artist. Swipe down to see the artist's albums. Swipe left and right to choose an album. Swipe down to see the songs from that album. At any of those levels, if you tap, it will play/pause. None of the APIs organized the data in the artist->album->song hierarchy, probably because MPD doesn't doe this. So I am making a simple PHP script that will handle the logistics. It will probably just execute shell commands and format the output. I'm sure it would be better to figure out how to interface directly with MPD, but as I said, I'm a simple man. And I don't care that much about security. There won't be any sensitive data on the Pi (except my Beastie Boys music) and it will rarely be connected to a network.

    So that's where I'm at right now. Still creating the HTML/Javascript UI and the PHP API.

View all 2 project logs

  • 1
    Step 1

    Burn image and boot up

    Use the image supplied by Kookye so you have their drivers.

  • 2
    Step 2

    SSH into the Pi

    Use Putty or whatever to SSH into the Pi. The Kookye image uses the default Raspbian login.

    User: pi

    Password: raspberry

  • 3
    Step 3

    Run updates

    First run: sudo apt-get update

    Next, you have to lock in the Raspbian kernel so it doesn't update. If it does update, you lose the touchscreen drivers.

    Run: sudo apt-mark hold raspberrypi-kernel

    Then run: sudo apt-get upgrade

View all 8 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates